From 6bc341feb3df96b72c95e91a5682c2d955c20b85 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 8 Jan 2022 11:03:36 +0100 Subject: [PATCH 1/9] Fix --- conf/nginx.conf | 4 ---- manifest.json | 10 ++-------- scripts/install | 10 ++-------- scripts/remove | 29 ----------------------------- scripts/restore | 3 ++- scripts/upgrade | 8 +------- 6 files changed, 7 insertions(+), 57 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 55e8ecd..bc145c9 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,9 +1,5 @@ location __PATH__ { - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - proxy_pass http://127.0.0.1:__PORT__; proxy_set_header Host $host; diff --git a/manifest.json b/manifest.json index 40fe531..a0eeeb2 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "armadietto", "packaging_format": 1, "description": { - "en": "A remoteStorage server written for Node.js.", - "fr": "Un serveur remoteStorage écrit pour node.js." + "en": "RemoteStorage server written for node.js", + "fr": "Serveur remoteStorage écrit pour node.js" }, "version": "0.0.2~ynh6", "url": "https://github.com/remotestorage/armadietto", @@ -32,12 +32,6 @@ "name": "domain", "type": "domain" }, - { - "name": "path", - "type": "path", - "example": "/", - "default": "/" - }, { "name": "is_public", "type": "boolean", diff --git a/scripts/install b/scripts/install index c3ea003..ec6491c 100755 --- a/scripts/install +++ b/scripts/install @@ -25,7 +25,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH +path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC is_signup=$YNH_APP_ARG_IS_SIGNUP @@ -43,11 +43,6 @@ final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" -# Only on / directory -if [ "$path_url" != "/" ]; then - ynh_die "Only / is allowed" -fi - # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url @@ -58,7 +53,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url -ynh_app_setting_set --app=$app --key=final_path --value=final_path ynh_app_setting_set --app=$app --key=is_signup --value=$is_signup ynh_app_setting_set --app=$app --key=datadir --value=$datadir @@ -86,7 +80,7 @@ ynh_use_nodejs #================================================= ynh_script_progression --message="Setting up and create final app path..." --weight=1 -ynh_app_setting_set $app final_path $final_path +ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Create final_path mkdir -p "$final_path" diff --git a/scripts/remove b/scripts/remove index c9da9b2..beec3c8 100755 --- a/scripts/remove +++ b/scripts/remove @@ -77,7 +77,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated NGINX config ynh_remove_nginx_config - #================================================= # REMOVE DEPENDENCIES #================================================= @@ -85,34 +84,6 @@ ynh_script_progression --message="Removing dependencies..." --weight=2 ynh_remove_nodejs --nodejs_version=$NODEJS_VERSION -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." --weight=1 - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - -#================================================= -# REMOVE FAIL2BAN CONFIGURATION -#================================================= -# ynh_script_progression --message="Removing Fail2ban configuration..." --weight=1 - -# Remove the dedicated Fail2Ban config -# ynh_remove_fail2ban_config - -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." --weight=1 - -# Remove a cron file -# ynh_secure_remove --file="" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index d825274..3f33626 100755 --- a/scripts/restore +++ b/scripts/restore @@ -114,7 +114,8 @@ ynh_script_progression --message="Secure files and directories" --weight=1 # Set permissions to app files chown -R $app:$app "$final_path" -chmod 0700 $datadir && chown $app:$app $datadir +chmod 0700 $datadir +chown $app:$app $datadir #================================================= # INTEGRATE SERVICE IN YUNOHOST diff --git a/scripts/upgrade b/scripts/upgrade index a406661..cf847ee 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,13 +29,6 @@ ynh_script_progression --message="Checking version..." --weight=1 upgrade_type=$(ynh_check_app_version_changed) -### This helper will compare the version of the currently installed app and the version of the upstream package. -### $upgrade_type can have 2 different values -### - UPGRADE_APP if the upstream app version has changed -### - UPGRADE_PACKAGE if only the YunoHost package has changed -### ynh_check_app_version_changed will stop the upgrade if the app is up to date. -### UPGRADE_APP should be used to upgrade the core app only if there's an upgrade to do. - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -129,6 +122,7 @@ chown $app:$app "$final_path/config.yml" #================================================= # CREATE DATA DIRECTORY #================================================= + if [ -z "$datadir" ]; then ynh_script_progression --message="Creating a data directory..." --weight=1 From 75b669baf73a507c9b22baf3280529cf7c1ee242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt?= Date: Wed, 12 Jan 2022 00:43:42 +0100 Subject: [PATCH 2/9] Update manifest.json --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index a0eeeb2..b8a72c2 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "armadietto", "packaging_format": 1, "description": { - "en": "RemoteStorage server written for node.js", - "fr": "Serveur remoteStorage écrit pour node.js" + "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.2~ynh6", "url": "https://github.com/remotestorage/armadietto", From 5e93a98390dc29baa01c66bc6922f5e65e025bd6 Mon Sep 17 00:00:00 2001 From: bencharp Date: Wed, 12 Jan 2022 01:11:22 +0100 Subject: [PATCH 3/9] report @raucao patch-1 & liitle doc corrections --- doc/DESCRIPTION.md | 5 +---- doc/DESCRIPTION_fr.md | 2 +- doc/DISCLAIMER.md | 11 +++++------ doc/DISCLAIMER_fr.md | 8 +++----- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index b305f9b..2f61dd5 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,7 +1,7 @@ [Armadietto](https://github.com/remotestorage/armadietto/) is a [remoteStorage](https://remotestorage.io) server written for Node.js. -Armadietto is maintained by remoteStorage Team [IRC](https://kiwiirc.com/client/irc.freenode.net/#remotestorage) +Armadietto is maintained by the remoteStorage community, ([IRC](https://web.libera.chat/#remotestorage), [forums](https://community.remotestorage.io/)). > ### :warning: WARNING > Please do not consider `armadietto` production ready, this project is still @@ -16,6 +16,3 @@ Armadietto is maintained by remoteStorage Team [IRC](https://kiwiirc.com/client/ [Click here](https://remotestorage.io/apps/) to see the list of applications that can be used with RemoteStorage. -### Features - -- liste des caractéristiques... diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 7fd6c07..0a88b55 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1,7 +1,7 @@ [Armadietto](https://github.com/remotestorage/armadietto/) est un serveur [remoteStorage](https://remotestorage.io) écrit pour Node.js. -Armadietto est maintenu par l'équipe remoteStorage [IRC](https://kiwiirc.com/client/irc.freenode.net/#remotestorage). +Armadietto est maintenu par la communauté remoteStorage, ([IRC](https://web.libera.chat/#remotestorage), [forums](https://community.remotestorage.io/)). > ### :warning: WARNING > Veuillez ne pas considérer `armadietto` comme prêt pour la production, ce projet est toujours diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 62f67a7..75d177a 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,14 +1,13 @@ ### :warning: WARNING -Armadietto_ynh still in develoment: +The Armadietto_ynh package is still under development, so you should expect some undocumented changes before it is labeled stable. -* Security considerations from [Armadietto](https://github.com/remotestorage/armadietto/) : +### :information_source: Security considerations from [Armadietto](https://github.com/remotestorage/armadietto/) : - ->### **Storage security** +> #### **Storage security** > ->In production, we recommend that you restrict access to the files managed by your armadietto server as much as possible. This is particularly true if you host your storage on a machine with other web applications; you need to protect your files in the event that one of those apps is exploited. +> In production, we recommend that you restrict access to the files managed by your armadietto server as much as possible. This is particularly true if you host your storage on a machine with other web applications; you need to protect your files in the event that one of those apps is exploited. > ->You should take these steps to keep your storage safe: +> You should take these steps to keep your storage safe: > > - Pick a unique Unix user to run your server process; no other process on the box should run as this user: sudo useradd armadietto --system --no-create-home > diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index 0fbb563..26068a0 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/DISCLAIMER_fr.md @@ -1,11 +1,9 @@ ### :warning: WARNING -Armadietto_ynh still in develoment: +Le paquet Armadietto_ynh est toujours en cours de développement, vous devez donc vous attendre à d'éventuels changements non documentés avant qu'il ne soit qualifié de stable. -* l'authentification unique ou l'intégration LDAP ne fonctionne pas ? -* Considérations sur la sécurité de [Armadietto](https://github.com/remotestorage/armadietto/) : +### :information_source: Considérations sur la sécurité de [Armadietto](https://github.com/remotestorage/armadietto/) : - -> ### **Sécurité du stockage** +> #### **Sécurité du stockage** > > En production, nous vous recommandons de restreindre autant que possible l'accès aux fichiers gérés par votre serveur armadietto. Ceci est particulièrement vrai si vous hébergez votre stockage sur une machine avec d'autres applications web ; vous devez protéger vos fichiers dans le cas où l'une de ces applications serait exploitée. > From ffede8044a6d1b040070c9e366bfe3d959f471a7 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Wed, 12 Jan 2022 00:11:41 +0000 Subject: [PATCH 4/9] Auto-update README --- README.md | 16 ++++++---------- README_fr.md | 10 ++++------ 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 64d2728..469b688 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in [Armadietto](https://github.com/remotestorage/armadietto/) is a [remoteStorage](https://remotestorage.io) server written for Node.js. -Armadietto is maintained by remoteStorage Team [IRC](https://kiwiirc.com/client/irc.freenode.net/#remotestorage) +Armadietto is maintained by the remoteStorage community, ([IRC](https://web.libera.chat/#remotestorage), [forums](https://community.remotestorage.io/)). > ### :warning: WARNING > Please do not consider `armadietto` production ready, this project is still @@ -33,9 +33,6 @@ Armadietto is maintained by remoteStorage Team [IRC](https://kiwiirc.com/client/ [Click here](https://remotestorage.io/apps/) to see the list of applications that can be used with RemoteStorage. -### Features - -- liste des caractéristiques... **Shipped version:** 0.0.2~ynh6 @@ -49,16 +46,15 @@ Armadietto is maintained by remoteStorage Team [IRC](https://kiwiirc.com/client/ ## Disclaimers / important information ### :warning: WARNING -Armadietto_ynh still in develoment: +The Armadietto_ynh package is still under development, so you should expect some undocumented changes before it is labeled stable. -* Security considerations from [Armadietto](https://github.com/remotestorage/armadietto/) : +### :information_source: Security considerations from [Armadietto](https://github.com/remotestorage/armadietto/) : - ->### **Storage security** +> #### **Storage security** > ->In production, we recommend that you restrict access to the files managed by your armadietto server as much as possible. This is particularly true if you host your storage on a machine with other web applications; you need to protect your files in the event that one of those apps is exploited. +> In production, we recommend that you restrict access to the files managed by your armadietto server as much as possible. This is particularly true if you host your storage on a machine with other web applications; you need to protect your files in the event that one of those apps is exploited. > ->You should take these steps to keep your storage safe: +> You should take these steps to keep your storage safe: > > - Pick a unique Unix user to run your server process; no other process on the box should run as this user: sudo useradd armadietto --system --no-create-home > diff --git a/README_fr.md b/README_fr.md index 2486452..dc31b55 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour [Armadietto](https://github.com/remotestorage/armadietto/) est un serveur [remoteStorage](https://remotestorage.io) écrit pour Node.js. -Armadietto est maintenu par l'équipe remoteStorage [IRC](https://kiwiirc.com/client/irc.freenode.net/#remotestorage). +Armadietto est maintenu par la communauté remoteStorage, ([IRC](https://web.libera.chat/#remotestorage), [forums](https://community.remotestorage.io/)). > ### :warning: WARNING > Veuillez ne pas considérer `armadietto` comme prêt pour la production, ce projet est toujours @@ -40,13 +40,11 @@ Armadietto est maintenu par l'équipe remoteStorage [IRC](https://kiwiirc.com/cl ## Avertissements / informations importantes ### :warning: WARNING -Armadietto_ynh still in develoment: +Le paquet Armadietto_ynh est toujours en cours de développement, vous devez donc vous attendre à d'éventuels changements non documentés avant qu'il ne soit qualifié de stable. -* l'authentification unique ou l'intégration LDAP ne fonctionne pas ? -* Considérations sur la sécurité de [Armadietto](https://github.com/remotestorage/armadietto/) : +### :information_source: Considérations sur la sécurité de [Armadietto](https://github.com/remotestorage/armadietto/) : - -> ### **Sécurité du stockage** +> #### **Sécurité du stockage** > > En production, nous vous recommandons de restreindre autant que possible l'accès aux fichiers gérés par votre serveur armadietto. Ceci est particulièrement vrai si vous hébergez votre stockage sur une machine avec d'autres applications web ; vous devez protéger vos fichiers dans le cas où l'une de ces applications serait exploitée. > From 288a1005b5fde168de1d5b6903e5d0a827e0e6ed Mon Sep 17 00:00:00 2001 From: bencharp Date: Wed, 12 Jan 2022 01:11:22 +0100 Subject: [PATCH 5/9] update config_panel, manifest, check, doc... --- README.md | 3 +-- README_fr.md | 2 +- actions.toml | 25 +++++++++++++++++++++++++ check_process | 10 +++------- conf/config.sample.yml | 11 ----------- conf/systemd.service | 4 ++-- config_panel.toml | 19 +++++++++---------- doc/DESCRIPTION.md | 7 ++++++- doc/DESCRIPTION_fr.md | 7 ++++++- manifest.json | 15 +-------------- scripts/install | 8 ++++---- scripts/upgrade | 14 ++++++-------- 12 files changed, 64 insertions(+), 61 deletions(-) create mode 100644 actions.toml delete mode 100644 conf/config.sample.yml diff --git a/README.md b/README.md index 469b688..48f76a0 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,7 @@ Armadietto is maintained by the remoteStorage community, ([IRC](https://web.libe [Click here](https://remotestorage.io/apps/) to see the list of applications that can be used with RemoteStorage. - -**Shipped version:** 0.0.2~ynh6 +**Shipped version:** 0.0.3~ynh2 diff --git a/README_fr.md b/README_fr.md index dc31b55..2305bd1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -29,7 +29,7 @@ Armadietto est maintenu par la communauté remoteStorage, ([IRC](https://web.lib [Cliquez ici](https://remotestorage.io/apps/) pour voir la liste des applications qui peuvent être utilisées avec RemoteStorage. -**Version incluse :** 0.0.2~ynh6 +**Version incluse :** 0.0.3~ynh2 diff --git a/actions.toml b/actions.toml new file mode 100644 index 0000000..1a1d7f4 --- /dev/null +++ b/actions.toml @@ -0,0 +1,25 @@ +[is_signup] +name = "Signup activation" +description = "Allow visitors to register and create an account?" +command = "/bin/bash scripts/actions/is_signup" +accepted_return_codes = [0] + + # [is_signup.arguments] + # [is_signup.arguments.is_signup] + # type = "boolean" + # ask.en = "Allow signup?" + # # default = false + + +[public_private] +name = "Private / Public" +description = "TODO" +command = "/bin/bash scripts/actions/public_private" +accepted_return_codes = [0] + + + [public_private.arguments] + [public_private.arguments.is_public] + type = "boolean" + ask.en = "Is it a public app?" + default = true diff --git a/check_process b/check_process index 9444bd9..b6eb2da 100644 --- a/check_process +++ b/check_process @@ -10,26 +10,22 @@ admin="armadietto" language="fr" is_public=1 - is_signup=true + is_signup=0 port="8008" ; Checks pkg_linter=1 - setup_sub_dir=0 setup_root=1 - setup_nourl=0 setup_private=1 setup_public=1 upgrade=1 # 0.0.2~ynh5 upgrade=1 from_commit=d185b84698a9f7e83eff6bf6dd5606f35282a536 backup_restore=1 - multi_instance=0 - port_already_use=0 change_url=1 ;;; Options Email= Notification=none ;;; Upgrade options ; commit=d185b84698a9f7e83eff6bf6dd5606f35282a536 - name= Upgrade to version 0.0.2~ynh6 - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&is_signup=true&port=8008& + name= Upgrade from version 0.0.2~ynh6 + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&is_signup=0&port=8008& diff --git a/conf/config.sample.yml b/conf/config.sample.yml deleted file mode 100644 index 94a2890..0000000 --- a/conf/config.sample.yml +++ /dev/null @@ -1,11 +0,0 @@ -#================================================= -# ARMADIETTO CONFIGURATION -#================================================= - - -final_path: __FINALPATH__ -datadir: __DATADIR__ -port: __PORT__ -domain: __DOMAIN__ -is_signup: __IS_SIGNUP__ - diff --git a/conf/systemd.service b/conf/systemd.service index 5fc0dcf..9ced78c 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,8 +6,8 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__FINALPATH__/ -ExecStart=__YNH_NODE__ __FINALPATH__/server +WorkingDirectory=__FINAL_PATH__/ +ExecStart=__YNH_NODE__ __FINAL_PATH__/server Restart=always Environment=__YNH_NODE_LOAD_PATH__ Environment=NODE_ENV=production diff --git a/config_panel.toml b/config_panel.toml index d703689..989695b 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -1,16 +1,15 @@ version = "1.0" -name= "Armadietto configuration panel" [main] -name = "Armadietto signup configuration" +name = "Settings" - [main.is_signup] - name = "Signup configuration" + [main.global_config] + name = "Access options" - [main.is_signup.signup] - ask.en = "Allow signups?" - ask.fr = "Accepter les inscriptions ?" + services = ["nginx", "__APP__"] + + [main.global_config.is_signup] + ask = "Allow signups?" type = "boolean" - default = true - help.en = "Would you like to allow visitors to register and create an account?" - help.fr = "Souhaitez-vous autoriser les visiteurs à s'inscrire et créer un compte ?" + help = "Would you like to allow visitors to register and create an account?" + bind = "signup:__FINALPATH__/server.js" diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 2f61dd5..d5dea9d 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -12,7 +12,12 @@ Armadietto is maintained by the remoteStorage community, ([IRC](https://web.libe **Shipped version:** 0.1.5 +### Installation option + +User registration is not allowed out of the box. +This option can be enabled in the configuration panel. + ### Application for remoteStorage -[Click here](https://remotestorage.io/apps/) to see the list of applications that can be used with RemoteStorage. +[Here](https://remotestorage.io/apps/) is a non-exhaustive list of apps that have integrated remoteStorage as a storage/sync option. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 0a88b55..a5fc1f9 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -12,6 +12,11 @@ Armadietto est maintenu par la communauté remoteStorage, ([IRC](https://web.lib **Version livrée:** 0.1.5 +### Option d'installation + +L'inscription des utilisateurs n'est pas autorisée par défault. +Cette option peut être activée via le panneau de configutration. + ### Application pour remoteStorage -[Cliquez ici](https://remotestorage.io/apps/) pour voir la liste des applications qui peuvent être utilisées avec RemoteStorage. \ No newline at end of file +[Cliquez ici](https://remotestorage.io/apps/) pour voir une liste non exhaustive d'applications ayant intégré remoteStorage comme option de stockage/synchronisation. \ No newline at end of file diff --git a/manifest.json b/manifest.json index b8a72c2..e44b456 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.2~ynh6", + "version": "0.0.5~ynh1", "url": "https://github.com/remotestorage/armadietto", "upstream": { "license": "MIT", @@ -40,19 +40,6 @@ "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": true } ] } diff --git a/scripts/install b/scripts/install index ec6491c..44c30c5 100755 --- a/scripts/install +++ b/scripts/install @@ -27,7 +27,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC -is_signup=$YNH_APP_ARG_IS_SIGNUP +is_signup="0" app=$YNH_APP_INSTANCE_NAME @@ -106,10 +106,10 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path/config.yml" +# ynh_add_config --template="../conf/config.yml" --destination="$final_path/config.yml" -chmod 400 "$final_path/config.yml" -chown $app:$app "$final_path/config.yml" +# chmod 400 "$final_path/config.yml" +# chown $app:$app "$final_path/config.yml" #================================================= # SETUP SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index cf847ee..1cc662f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -93,8 +93,6 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Setting up and create final app path..." --weight=1 ynh_app_setting_set $app final_path $final_path -# Download, check integrity, uncompress and patch the source from app.src -# ynh_setup_source --dest_dir="$final_path" # Create final_path mkdir -p "$final_path" @@ -114,10 +112,10 @@ ynh_use_nodejs #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=2 -ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path/config.yml" +# ynh_add_config --template="../conf/config.yml" --destination="$final_path/config.yml" -chmod 400 "$final_path/config.yml" -chown $app:$app "$final_path/config.yml" +# chmod 400 "$final_path/config.yml" +# chown $app:$app "$final_path/config.yml" #================================================= # CREATE DATA DIRECTORY @@ -162,10 +160,10 @@ fi #================================================= ynh_script_progression --message="Updating a configuration file..." --weight=2 -ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path/config.yml" +# ynh_add_config --template="../conf/config.yml" --destination="$final_path/config.yml" -chmod 400 "$final_path/config.yml" -chown $app:$app "$final_path/config.yml" +# chmod 400 "$final_path/config.yml" +# chown $app:$app "$final_path/config.yml" ### Same as during install ### From 1e2f7190e329b47dd2f9120f35096f554138f34d Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Thu, 13 Jan 2022 00:05:21 +0000 Subject: [PATCH 6/9] Auto-update README --- README.md | 11 +++++++++-- README_fr.md | 9 +++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 48f76a0..7c382ad 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,19 @@ Armadietto is maintained by the remoteStorage community, ([IRC](https://web.libe **Shipped version:** 0.1.5 +### Installation option + +User registration is not allowed out of the box. +This option can be enabled in the configuration panel. + ### Application for remoteStorage -[Click here](https://remotestorage.io/apps/) to see the list of applications that can be used with RemoteStorage. +[Here](https://remotestorage.io/apps/) is a non-exhaustive list of apps that have integrated remoteStorage as a storage/sync option. -**Shipped version:** 0.0.3~ynh2 + + +**Shipped version:** 0.0.5~ynh1 diff --git a/README_fr.md b/README_fr.md index 2305bd1..43cffee 100644 --- a/README_fr.md +++ b/README_fr.md @@ -25,11 +25,16 @@ Armadietto est maintenu par la communauté remoteStorage, ([IRC](https://web.lib **Version livrée:** 0.1.5 +### Option d'installation + +L'inscription des utilisateurs n'est pas autorisée par défault. +Cette option peut être activée via le panneau de configutration. + ### Application pour remoteStorage -[Cliquez ici](https://remotestorage.io/apps/) pour voir la liste des applications qui peuvent être utilisées avec RemoteStorage. +[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.3~ynh2 +**Version incluse :** 0.0.5~ynh1 From 890f959069ee23b317dc873c82bfe2e3e5b21dc4 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Thu, 13 Jan 2022 00:23:00 +0000 Subject: [PATCH 7/9] Auto-update README --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 7c382ad..af03fc4 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,6 @@ This option can be enabled in the configuration panel. - **Shipped version:** 0.0.5~ynh1 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 8/9] 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 From 7e2b72bcf9ca31ee61e9453e991dfcbb457fc379 Mon Sep 17 00:00:00 2001 From: bencharp Date: Tue, 18 Jan 2022 01:56:42 +0100 Subject: [PATCH 9/9] fix details --- actions.toml | 25 ------------------------- scripts/change_url | 5 ----- scripts/install | 12 +----------- scripts/upgrade | 44 ++------------------------------------------ 4 files changed, 3 insertions(+), 83 deletions(-) delete mode 100644 actions.toml diff --git a/actions.toml b/actions.toml deleted file mode 100644 index 1a1d7f4..0000000 --- a/actions.toml +++ /dev/null @@ -1,25 +0,0 @@ -[is_signup] -name = "Signup activation" -description = "Allow visitors to register and create an account?" -command = "/bin/bash scripts/actions/is_signup" -accepted_return_codes = [0] - - # [is_signup.arguments] - # [is_signup.arguments.is_signup] - # type = "boolean" - # ask.en = "Allow signup?" - # # default = false - - -[public_private] -name = "Private / Public" -description = "TODO" -command = "/bin/bash scripts/actions/public_private" -accepted_return_codes = [0] - - - [public_private.arguments] - [public_private.arguments.is_public] - type = "boolean" - ask.en = "Is it a public app?" - default = true diff --git a/scripts/change_url b/scripts/change_url index 5b25c6c..6645cc7 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,11 +29,6 @@ ynh_script_progression --message="Loading installation settings..." --weight=2 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) -# Add settings here as needed by your application -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name -#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) - #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= diff --git a/scripts/install b/scripts/install index 44c30c5..2cad7d1 100755 --- a/scripts/install +++ b/scripts/install @@ -27,7 +27,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC -is_signup="0" +is_signup=$YNH_APP_ARG_IS_SIGNUP app=$YNH_APP_INSTANCE_NAME @@ -101,16 +101,6 @@ ynh_script_progression --message="Configuring system user..." --weight=2 # Create a system user ynh_system_user_create --username=$app -#================================================= -# ADD A CONFIGURATION -#================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 - -# ynh_add_config --template="../conf/config.yml" --destination="$final_path/config.yml" - -# chmod 400 "$final_path/config.yml" -# chown $app:$app "$final_path/config.yml" - #================================================= # SETUP SYSTEMD #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 99c18e9..0e09d5d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,7 +57,6 @@ 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" @@ -113,16 +112,6 @@ ynh_use_nodejs #================================================= # SPECIFIC UPGRADE -#================================================= -# ADD A CONFIGURATION -#================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=2 - -# ynh_add_config --template="../conf/config.yml" --destination="$final_path/config.yml" - -# chmod 400 "$final_path/config.yml" -# chown $app:$app "$final_path/config.yml" - #================================================= # CREATE DATA DIRECTORY #================================================= @@ -161,36 +150,6 @@ then popd fi -#================================================= -# UPDATE A CONFIG FILE -#================================================= -ynh_script_progression --message="Updating a configuration file..." --weight=2 - -# ynh_add_config --template="../conf/config.yml" --destination="$final_path/config.yml" - -# chmod 400 "$final_path/config.yml" -# chown $app:$app "$final_path/config.yml" - -### Same as during install -### -### The file will automatically be backed-up if it's found to be manually modified (because -### ynh_add_config keeps track of the file's checksum) - -# ynh_add_config --template="some_config_file" --destination="$final_path/some_config_file" - -# FIXME: this should be handled by the core in the future -# You may need to use chmod 600 instead of 400, -# for example if the app is expected to be able to modify its own config -# chmod 400 "$final_path/some_config_file" -# chown $app:$app "$final_path/some_config_file" - -### For more complex cases where you want to replace stuff using regexes, -### you shoud rely on ynh_replace_string (which is basically a wrapper for sed) -### When doing so, you also need to manually call ynh_store_file_checksum -### -### ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/some_config_file" -### ynh_store_file_checksum --file="$final_path/some_config_file" - #================================================= # SETUP SYSTEMD #================================================= @@ -216,7 +175,8 @@ ynh_script_progression --message="Secure files and directories" --weight=1 # Set permissions to app files chown -R $app:$app "$final_path" -chmod 0700 $datadir && chown $app:$app $datadir +chmod 0700 "$datadir" +chown $app:$app "$datadir" #================================================= # INTEGRATE SERVICE IN YUNOHOST