1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gemserv_ynh.git synced 2024-09-03 18:36:27 +02:00

Merge pull request #15 from YunoHost-Apps/testing

server.toml should always be at the beginning of config.toml
This commit is contained in:
yalh76 2022-05-10 19:40:44 +02:00 committed by GitHub
commit f9e059a5ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 10 deletions

View file

@ -28,7 +28,7 @@ A gemini server written in rust.
- Reload config on SIGHUP
**Shipped version:** 0.6.6~ynh1
**Shipped version:** 0.6.6~ynh2

View file

@ -24,7 +24,7 @@ A gemini server written in rust.
- Reload config on SIGHUP
**Version incluse :** 0.6.6~ynh1
**Version incluse :** 0.6.6~ynh2

View file

@ -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

View file

@ -5,7 +5,7 @@
"description": {
"en": "A gemini server written in rust."
},
"version": "0.6.6~ynh1",
"version": "0.6.6~ynh2",
"url": "https://git.sr.ht/~int80h/gemserv/",
"upstream": {
"license": "MIT",

View file

@ -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

View file

@ -53,6 +53,14 @@ ynh_systemd_action --service_name="$app" --action="stop" --line_match="Stopped"
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
# Change to head file
if [ -f "/etc/$app/config.d/server.toml" ]
then
ynh_delete_file_checksum --file="/etc/$app/config.d/server.toml"
mv "/etc/$app/config.d/server.toml" "/etc/$app/config.d/server.toml.head"
ynh_store_file_checksum --file="/etc/$app/config.d/server.toml.head"
fi
#=================================================
# CREATE DEDICATED USER
#=================================================
@ -129,10 +137,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