From 495dba0f23401a692b8e4f434019dddd0d070b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 8 Oct 2023 14:25:03 +0200 Subject: [PATCH] fix --- conf/coturn-pairdrop.service | 2 +- scripts/restore | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/conf/coturn-pairdrop.service b/conf/coturn-pairdrop.service index 09d9cc4..7774640 100644 --- a/conf/coturn-pairdrop.service +++ b/conf/coturn-pairdrop.service @@ -1,5 +1,5 @@ [Unit] -Description=Coturn STUN/TURN Server +Description=Coturn STUN/TURN Server for __APP__ Documentation=man:coturn(1) man:turnadmin(1) man:turnserver(1) After=syslog.target network.target diff --git a/scripts/restore b/scripts/restore index 1c7a1ba..c865570 100755 --- a/scripts/restore +++ b/scripts/restore @@ -44,7 +44,24 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet +ynh_restore_file --origin_path="/etc/default/coturn-$app" +ynh_restore_file --origin_path="/etc/systemd/system/coturn-$app.service" +systemctl enable coturn-$app.service --quiet + yunohost service add $app --description="Local file sharing in your browser" --log="/var/log/$app/$app.log" +yunohost service add coturn-$app --description="Coturn TURN server" --log="/var/log/$app/turnserver.log" --needs_exposed_ports $turnserver_port + +#================================================= +# RESTORE USER RIGHTS +#================================================= +ynh_script_progression --message="Restoring permissions..." --weight=1 + +chown -R $app:root /var/log/$app +chown -R $app:root /etc/$app +chown turnserver:root /etc/$app/coturn.conf +chmod -R u=rwX,g=rX,o= /etc/$app +setfacl -R -m user:turnserver:rX /etc/$app +setfacl -R -m user:turnserver:rwX /var/log/$app #================================================= # GENERIC FINALIZATION