From 244356b8e0b068a0576b8caa9c28d3f080d878b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt?= Date: Sun, 16 Jan 2022 12:57:05 +0100 Subject: [PATCH] add signup config (#11) Co-authored-by: Yunohost-Bot <> @ericgaspar --- README.md | 2 +- README_fr.md | 2 +- config_panel.toml | 12 +++++++----- manifest.json | 15 ++++++++++++++- scripts/upgrade | 8 +++++++- 5 files changed, 30 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index af03fc4..91c4780 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ This option can be enabled in the configuration panel. -**Shipped version:** 0.0.5~ynh1 +**Shipped version:** 0.0.6~ynh1 diff --git a/README_fr.md b/README_fr.md index 43cffee..d397fb1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -34,7 +34,7 @@ Cette option peut être activée via le panneau de configutration. [Cliquez ici](https://remotestorage.io/apps/) pour voir une liste non exhaustive d'applications ayant intégré remoteStorage comme option de stockage/synchronisation. -**Version incluse :** 0.0.5~ynh1 +**Version incluse :** 0.0.6~ynh1 diff --git a/config_panel.toml b/config_panel.toml index 989695b..b13bd5c 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -3,13 +3,15 @@ version = "1.0" [main] name = "Settings" - [main.global_config] - name = "Access options" + [main.is_signup] + name = "Signup configuration" - services = ["nginx", "__APP__"] + services = ["__APP__"] - [main.global_config.is_signup] + [main.is_signup.is_signup] ask = "Allow signups?" type = "boolean" + yes = '1' + no = '' help = "Would you like to allow visitors to register and create an account?" - bind = "signup:__FINALPATH__/server.js" + bind = "signup:/opt/yunohost/__APP__/server.js" \ No newline at end of file diff --git a/manifest.json b/manifest.json index e44b456..ca06a07 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A remoteStorage server running as a nodejs web service with systemd", "fr": "Un serveur remoteStorage excécuté en tant que service web nodejs par systemd" }, - "version": "0.0.5~ynh1", + "version": "0.0.6~ynh1", "url": "https://github.com/remotestorage/armadietto", "upstream": { "license": "MIT", @@ -40,6 +40,19 @@ "en": "Would you like to restrein the access to this web site?", "fr": "Souhaitez-vous limiter l'accès à ce site web ?" } + }, + { + "name": "is_signup", + "type": "boolean", + "ask": { + "en": "Allow signups?", + "fr": "Accepter les inscriptions ?" + }, + "help": { + "en": "Would you like to allow visitors to register and create an account?", + "fr": "Souhaitez-vous autoriser les visiteurs à s'inscrire et créer un compte ?" + }, + "default": false } ] } diff --git a/scripts/upgrade b/scripts/upgrade index 1cc662f..99c18e9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,10 +57,16 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +# If is_signup doesn't exist, create it +if [ -z "$is_signup" ]; then + is_signup="true" + ynh_app_setting_set --app=$app --key=is_signup --value=$is_signup +fi + # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all - ynh_app_setting_delete --app=$app --key=is_public fi