Skip to content

Commit

Permalink
Customizable portal setting.json with install script
Browse files Browse the repository at this point in the history
Signed-off-by: lorenzo farnararo <[email protected]>
  • Loading branch information
baldarn committed Aug 13, 2024
1 parent 907709f commit b743a52
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ services:
- type: bind
source: ./common/config/portal/nginx.conf
target: /etc/nginx/nginx.conf
- type: bind
source: ./common/config/portal/setting.json
target: /usr/share/nginx/html/setting.json
{%if internal_tls.enabled %}
- type: bind
source: {{internal_tls.portal_crt_path}}
Expand Down
13 changes: 13 additions & 0 deletions make/photon/prepare/templates/portal/config.json.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"headerBgColor": {
"darkMode": "",
"lightMode": ""
},
"loginBgImg": "",
"loginTitle": "",
"product": {
"name": "",
"logo": "",
"introduction": ""
}
}
10 changes: 9 additions & 1 deletion make/photon/prepare/utils/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
portal_config_dir = config_dir.joinpath("portal")
portal_conf_template_path = templates_dir.joinpath("portal", "nginx.conf.jinja")
portal_conf = config_dir.joinpath("portal", "nginx.conf")
portal_conf_setting_template_path = templates_dir.joinpath("portal", "setting.json.jinja")
portal_conf_setting = config_dir.joinpath("portal", "setting.json")

def prepare_portal(config_dict):
prepare_dir(portal_config_dir, uid=DEFAULT_UID, gid=DEFAULT_GID)

# Render Jobservice config
# Render Portal nginx config
render_jinja(
str(portal_conf_template_path),
portal_conf,
Expand All @@ -19,3 +21,9 @@ def prepare_portal(config_dict):
gid=DEFAULT_GID,
strong_ssl_ciphers=config_dict['strong_ssl_ciphers']
)

# Render Portal setting config
render_jinja(
str(portal_conf_setting_template_path),
portal_conf_setting
)

0 comments on commit b743a52

Please sign in to comment.