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

add signup config (#11)

Co-authored-by: Yunohost-Bot <> @ericgaspar
This commit is contained in:
Benoît 2022-01-16 12:57:05 +01:00 committed by GitHub
parent 57d32e84b0
commit 244356b8e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 9 deletions

View file

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

View file

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

View file

@ -3,13 +3,15 @@ version = "1.0"
[main] [main]
name = "Settings" name = "Settings"
[main.global_config] [main.is_signup]
name = "Access options" name = "Signup configuration"
services = ["nginx", "__APP__"] services = ["__APP__"]
[main.global_config.is_signup] [main.is_signup.is_signup]
ask = "Allow signups?" ask = "Allow signups?"
type = "boolean" type = "boolean"
yes = '1'
no = ''
help = "Would you like to allow visitors to register and create an account?" 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"

View file

@ -6,7 +6,7 @@
"en": "A remoteStorage server running as a nodejs web service with systemd", "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" "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", "url": "https://github.com/remotestorage/armadietto",
"upstream": { "upstream": {
"license": "MIT", "license": "MIT",
@ -40,6 +40,19 @@
"en": "Would you like to restrein the access to this web site?", "en": "Would you like to restrein the access to this web site?",
"fr": "Souhaitez-vous limiter l'accès à ce site web ?" "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
} }
] ]
} }

View file

@ -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 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 # Cleaning legacy permissions
if ynh_legacy_permissions_exists; then if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public ynh_app_setting_delete --app=$app --key=is_public
fi fi