From 1c18f87c8b4085f49d71b79489de856945720974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 23 May 2023 19:22:17 +0200 Subject: [PATCH] fix --- config_panel.toml.example => config_panel.toml | 0 scripts/install | 16 ++++++++-------- scripts/restore | 7 ++++++- 3 files changed, 14 insertions(+), 9 deletions(-) rename config_panel.toml.example => config_panel.toml (100%) diff --git a/config_panel.toml.example b/config_panel.toml similarity index 100% rename from config_panel.toml.example rename to config_panel.toml diff --git a/scripts/install b/scripts/install index b155a3c..abf1bf2 100755 --- a/scripts/install +++ b/scripts/install @@ -13,8 +13,8 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -#storage_quota="20gb" -#ynh_app_setting_set --app=$app --key=storage_quota --value=$storage_quota +storage_quota="20gb" +ynh_app_setting_set --app=$app --key=storage_quota --value=$storage_quota #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -41,7 +41,7 @@ public_ip4="$(curl -s ip.yunohost.org)" || true ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 pushd "$install_dir" - ./smp-server init --no-password --ip $public_ip4 -y + ./smp-server init --no-password --ip $public_ip4 --store-log -yes ./xftp-server init --ip $public_ip4 --quota '20gb' --store-log --path $data_dir popd @@ -51,7 +51,7 @@ ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint xftp_fingerprint=$(cat /etc/opt/simplex-xftp/fingerprint) ynh_app_setting_set --app=$app --key=xftp_fingerprint --value=$xftp_fingerprint -ynh_replace_string --match_string="port: 443" --replace_string="port: $port_xftp" --target_file="/etc/opt/simplex-xftp/file-server.ini" +#ynh_replace_string --match_string="port: 443" --replace_string="port: $port_xftp" --target_file="/etc/opt/simplex-xftp/file-server.ini" #chown -R $app:$app "/etc/opt/simplex" #chown -R $app:$app "/etc/opt/simplex-xftp" @@ -59,12 +59,12 @@ ynh_replace_string --match_string="port: 443" --replace_string="port: $port_xftp #================================================= # ADD A CONFIGURATION #================================================= -#ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression --message="Adding a configuration file..." --weight=1 -#ynh_add_config --template="../conf/file-server.ini" --destination="/etc/opt/simplex-xftp/file-server.ini" +ynh_add_config --template="../conf/file-server.ini" --destination="/etc/opt/simplex-xftp/file-server.ini" -#chmod 400 "/etc/opt/simplex-xftp/file-server.ini" -#chown $app:$app "/etc/opt/simplex-xftp/file-server.ini" +chmod 400 "/etc/opt/simplex-xftp/file-server.ini" +chown $app:$app "/etc/opt/simplex-xftp/file-server.ini" #================================================= # SYSTEM CONFIGURATION diff --git a/scripts/restore b/scripts/restore index fcc6eb2..a87faaf 100755 --- a/scripts/restore +++ b/scripts/restore @@ -38,7 +38,12 @@ chown -R $app:www-data "$data_dir" ynh_script_progression --message="Restoring system configurations related to $app..." --weight=4 ynh_restore_file --origin_path="/etc/opt/simplex" -chown -R $app:$app "/etc/opt/simplex" +ynh_restore_file --origin_path="/etc/opt/simplex-xftp" + +ynh_restore_file --origin_path="/var/opt/simplex" +ynh_restore_file --origin_path="/var/opt/simplex-xftp" + +chown -R $app:$app /var/opt/simplex-xftp /var/opt/simplex /etc/opt/simplex-xftp /etc/opt/simplex ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet