From 88d40e98237eb72ff141132b465a00eb49dedd66 Mon Sep 17 00:00:00 2001 From: Florent Date: Sat, 25 Nov 2023 15:12:24 +0100 Subject: [PATCH] Add ability to customize environment variables --- conf/default.env | 2 ++ conf/systemd.service | 1 + config_panel.toml | 4 ---- manifest.toml | 2 +- scripts/install | 4 ++++ scripts/upgrade | 4 ++++ 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/conf/default.env b/conf/default.env index d7502f2..d87e16c 100644 --- a/conf/default.env +++ b/conf/default.env @@ -1,3 +1,5 @@ +# This file is not meant to be edited. +# Please place your environment variables in __DATA_DIR__/custom.env file APP_HOME_URL=https://__DOMAIN__ GRIST_ORG_IN_PATH=true GRIST_SANDBOX_FLAVOR=pyodide diff --git a/conf/systemd.service b/conf/systemd.service index 1c55900..eaa5ef7 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -11,6 +11,7 @@ ExecStart=__INSTALL_DIR__/sandbox/run.sh StandardOutput=journal StandardError=journal EnvironmentFile=__INSTALL_DIR__/default.env +EnvironmentFile=__DATA_DIR__/custom.env Environment="__YNH_NODE_LOAD_PATH__" # Sandboxing options to harden security diff --git a/config_panel.toml b/config_panel.toml index 39aa3d3..d532538 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -11,10 +11,6 @@ name.fr = "Configuration principale" services = ["__APP__"] - ############################################################################ - #### ABOUT SECTIONS - ############################################################################ - [main.customization] name.fr = "Personnalisation de votre instance Grist" diff --git a/manifest.toml b/manifest.toml index b57dd6d..ad9d71a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Grist" description.en = "Modern relational spreadsheet" description.fr = "Feuille de calcul relationnelle moderne" -version = "1.1.8~ynh1" +version = "1.1.8~ynh2" maintainers = ["fflorent"] diff --git a/scripts/install b/scripts/install index 38b3f5a..3433d51 100755 --- a/scripts/install +++ b/scripts/install @@ -72,10 +72,14 @@ ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db" ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="default.env" --destination="$install_dir/default.env" +ynh_add_config --template="custom.env" --destination="$data_dir/custom.env" chmod 400 "$install_dir/default.env" chown $app:$app "$install_dir/default.env" +chmod 700 "$data_dir/custom.env" +chown $app:$app "$data_dir/custom.env" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 53f0f2a..150a5e6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,10 +83,14 @@ ynh_use_logrotate --non-append ynh_script_progression --message="Updating a configuration file..." --weight=1 ynh_add_config --template="default.env" --destination="$install_dir/default.env" +ynh_add_config --template="custom.env" --destination="$data_dir/custom.env" chmod 400 "$install_dir/default.env" chown $app:$app "$install_dir/default.env" +chmod 700 "$data_dir/custom.env" +chown $app:$app "$data_dir/custom.env" + #================================================= # START SYSTEMD SERVICE #=================================================