From 93aa4564d864f02987eebd1798e8d57ed6faa04f Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Mon, 9 May 2022 18:22:10 +0200 Subject: [PATCH] server.toml should always be at the beginning of config.toml --- conf/systemd.service | 3 ++- scripts/install | 6 +++--- scripts/upgrade | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index ff44d3b..e73f58a 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,8 @@ User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ ExecStartPre=-/bin/bash -c 'chown -R __APP__:__APP__ /etc/__APP__/' -ExecStartPre=-/bin/bash -c 'cat /etc/__APP__/config.d/*.toml > /etc/__APP__/config.toml' +ExecStartPre=-/bin/bash -c 'cp /etc/__APP__/config.d/server.toml.head /etc/__APP__/config.toml' +ExecStartPre=-/bin/bash -c 'cat /etc/__APP__/config.d/*.toml >> /etc/__APP__/config.toml' ExecStart=__FINALPATH__/live/__APP__ /etc/__APP__/config.toml StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit diff --git a/scripts/install b/scripts/install index 754991d..6dfd70f 100755 --- a/scripts/install +++ b/scripts/install @@ -118,10 +118,10 @@ chmod 750 "/etc/$app" chmod -R o-rwx "/etc/$app" chown -R "$app":"$app" "/etc/$app" -ynh_add_config --template="../conf/server.toml" --destination="/etc/$app/config.d/server.toml" +ynh_add_config --template="server.toml" --destination="/etc/$app/config.d/server.toml.head" -chmod 400 "/etc/$app/config.d/server.toml" -chown "$app":"$app" "/etc/$app/config.d/server.toml" +chmod 400 "/etc/$app/config.d/server.toml.head" +chown "$app":"$app" "/etc/$app/config.d/server.toml.head" #================================================= # SETUP SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index 503e60f..de647c5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -129,10 +129,10 @@ chmod 750 "/etc/$app" chmod -R o-rwx "/etc/$app" chown -R "$app":"$app" "/etc/$app" -ynh_add_config --template="../conf/server.toml" --destination="/etc/$app/config.d/server.toml" +ynh_add_config --template="server.toml" --destination="/etc/$app/config.d/server.toml.head" -chmod 400 "/etc/$app/config.d/server.toml" -chown "$app":"$app" "/etc/$app/config.d/server.toml" +chmod 400 "/etc/$app/config.d/server.toml.head" +chown "$app":"$app" "/etc/$app/config.d/server.toml.head" #================================================= # SETUP SYSTEMD