diff --git a/README.md b/README.md index 4bd7c81..64d2728 100644 --- a/README.md +++ b/README.md @@ -3,18 +3,18 @@ N.B.: This README was automatically generated by https://github.com/YunoHost/app It shall NOT be edited by hand. --> -# Armadietto package for Yunohost - -[![Integration level](https://dash.yunohost.org/integration/armadietto.svg)](https://dash.yunohost.org/appci/app/armadietto) ![](https://ci-apps.yunohost.org/ci/badges/armadietto.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/armadietto.maintain.svg) +# Armadietto for YunoHost +[![Integration level](https://dash.yunohost.org/integration/armadietto.svg)](https://dash.yunohost.org/appci/app/armadietto) ![](https://ci-apps.yunohost.org/ci/badges/armadietto.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/armadietto.maintain.svg) [![Install Armadietto with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=armadietto) *[Lire ce readme en français.](./README_fr.md)* -> *This package allows you to install example quickly and simply on a YunoHost server. +> *This package allows you to install Armadietto quickly and simply on a YunoHost server. If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* -## Armadietto overview +## Overview + [Armadietto](https://github.com/remotestorage/armadietto/) is a [remoteStorage](https://remotestorage.io) server written for Node.js. @@ -29,39 +29,85 @@ Armadietto is maintained by remoteStorage Team [IRC](https://kiwiirc.com/client/ **Shipped version:** 0.1.5 +### Application for remoteStorage + +[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 + + + ## Screenshots - - ![](./doc/screenshots/armadietto.png) - - - +![](./doc/screenshots/armadietto.png) ## Disclaimers / important information -### Important Notes -RemoteStorage requires a dedicated domain, so obtain one and add it using the YunoHost admin panel. **Domains -> Add domain**. As RemoteStorage uses the full domain and is installed on the root, you can create a subdomain such as remote.domain.tld. Don't forget to update your DNS if you manage them manually. +### :warning: WARNING +Armadietto_ynh still in develoment: -RemoteStorage requires browser-approved SSL certificates. If you have certificates not issued by [Let's Encrypt](https://letsencrypt.org/), install them manually as usual. +* Security considerations from [Armadietto](https://github.com/remotestorage/armadietto/) : -### Application for remoteStorage -[Click here](https://remotestorage.io/apps/) to see the list of applications that can be used with RemoteStorage. +>### **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. +> +>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 +> +> - Do not run other applications as root, or as any user that could access files owned by your armadietto user +> +> - Make sure the directory path/to/storage cannot be read, written or executed by anyone but this user: sudo chmod 0700 /path/to/storage && sudo chown armadietto /path/to/storage +> +> - Do not run armadietto as root; if you need to bind to port 80 or 443 use a reverse proxy like nginx, Apache2, caddy, lighttpd or enable bind capability: setcap 'cap_net_bind_service=+ep' `which armadietto` +> +> - Ideally, run your storage inside a container or on a dedicated machine +
+ +### **Important Notes** + +- RemoteStorage requires a dedicated domain, so obtain one and add it using the YunoHost admin panel. **Domains -> Add domain**. +- As RemoteStorage uses the full domain and is installed on the root, you can create a subdomain such as remote.domain.tld. +- Don't forget to update your DNS if you manage them manually. + +- RemoteStorage requires browser-approved SSL certificates. If you have certificates not issued by [Let's Encrypt](https://letsencrypt.org/), install them manually as usual. + +## TODO + +* Any known limitations, constraints or non-functioning elements, such as (but not limited to) : + * Unsupported architectures? + * Single sign-on or LDAP integration not working? + * etc... + +* Other information that people should know, such as. : + * any specific steps to be performed after installation (like manually terminating the installation, specific admin credentials, ...) + * How to configure / administer the application if it is not obvious. + * Specifics, things to know? ## Documentation and resources * Official app website: https://remotestorage.io/ -* Upstream app code repository: https://github.com/remotestorage/armadietto/ -* Report a bug: https://github.com/bencharp/armadietto_ynh/issues +* Upstream app code repository: https://github.com/remotestorage/armadietto +* YunoHost documentation for this app: https://yunohost.org/app_armadietto +* Report a bug: https://github.com/YunoHost-Apps/armadietto_ynh/issues ## Developer info -Please send your pull request to the [testing branch](https://github.com/bencharp/armadietto_ynh/tree/testing). +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/armadietto_ynh/tree/testing). To try the testing branch, please proceed like that. ``` -sudo yunohost app install https://github.com/bencharp/armadietto_ynh/tree/testing --debug +sudo yunohost app install https://github.com/YunoHost-Apps/armadietto_ynh/tree/testing --debug or -sudo yunohost app upgrade armadietto_ynh -u https://github.com/bencharp/armadietto_ynh/tree/testing --debug +sudo yunohost app upgrade armadietto -u https://github.com/YunoHost-Apps/armadietto_ynh/tree/testing --debug ``` + +**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/README_fr.md b/README_fr.md index 38aef6f..2486452 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,22 +1,22 @@ -# Armadietto package pour Yunohost +# Armadietto pour YunoHost -[![Integration level](https://dash.yunohost.org/integration/armadietto.svg)](https://dash.yunohost.org/appci/app/armadietto) ![](https://ci-apps.yunohost.org/ci/badges/armadietto.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/armadietto.maintain.svg) - -[![Install Armadietto with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=armadietto) +[![Niveau d'intégration](https://dash.yunohost.org/integration/armadietto.svg)](https://dash.yunohost.org/appci/app/armadietto) ![](https://ci-apps.yunohost.org/ci/badges/armadietto.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/armadietto.maintain.svg) +[![Installer Armadietto avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=armadietto) *[Read this readme in english.](./README.md)* +*[Lire ce readme en français.](./README_fr.md)* +> *Ce package vous permet d'installer Armadietto rapidement et simplement sur un serveur YunoHost. +Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* -> *Ce paquetage vous permet d'installer Armadietto rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, veuillez consulter [le guide](https://yunohost.org/#/install) pour savoir comment l'installer.* +## Vue d'ensemble -## Aperçu d'Armadietto [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). -> ### :warning : WARNING +> ### :warning: WARNING > Veuillez ne pas considérer `armadietto` comme prêt pour la production, ce projet est toujours > comme expérimental. Comme avec toute technologie de stockage en phase alpha, vous > devez vous attendre à ce qu'elle mange vos données et prendre des précautions contre cela. Vous @@ -25,40 +25,81 @@ Armadietto est maintenu par l'équipe remoteStorage [IRC](https://kiwiirc.com/cl **Version livrée:** 0.1.5 +### Application pour remoteStorage + +[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 + + ## Captures d'écran - - ![](./doc/screenshots/armadietto.png) - - - +![](./doc/screenshots/armadietto.png) ## Avertissements / informations importantes -### Notes importantes -RemoteStorage nécessite un domaine dédié, il faut donc en obtenir un et l'ajouter en utilisant le panneau d'administration de YunoHost. **Domaines -> Ajouter un domaine**. Comme RemoteStorage utilise le domaine complet et est installé à la racine, vous pouvez créer un sous-domaine tel que remote.domain.tld. N'oubliez pas de mettre à jour vos DNS si vous les gérez manuellement. +### :warning: WARNING +Armadietto_ynh still in develoment: -RemoteStorage nécessite des certificats SSL approuvés par le navigateur. Si vous disposez de certificats qui ne sont pas émis par [Let's Encrypt](https://letsencrypt.org/), installez-les manuellement comme d'habitude. +* l'authentification unique ou l'intégration LDAP ne fonctionne pas ? +* Considérations sur la sécurité de [Armadietto](https://github.com/remotestorage/armadietto/) : -### Application pour remoteStorage -[Cliquez ici](https://remotestorage.io/apps/) pour voir la liste des applications qui peuvent être utilisées avec RemoteStorage. +> ### **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. +> +> Vous devez prendre les mesures suivantes pour assurer la sécurité de votre stockage : +> +> - Choisissez un utilisateur Unix unique pour exécuter votre processus serveur ; aucun autre processus sur la machine ne doit être exécuté sous cet utilisateur : sudo useradd armadietto --system --no-create-home +> +> - Ne lancez pas d'autres applications en tant que root, ou en tant qu'utilisateur qui pourrait accéder à des fichiers appartenant à votre utilisateur armadietto. +> +> - Assurez-vous que le répertoire path/to/storage ne peut être lu, écrit ou exécuté par personne d'autre que cet utilisateur : sudo chmod 0700 /path/to/storage && sudo chown armadietto /path/to/storage +> +> - Ne lancez pas armadietto en tant que root ; si vous avez besoin de vous lier au port 80 ou 443, utilisez un reverse proxy comme nginx, Apache2, caddy, lighttpd ou activez la capacité de liaison : setcap 'cap_net_bind_service=+ep' `which armadietto`. +> +> - Idéalement, exécutez votre stockage dans un conteneur ou sur une machine dédiée. + +
+ +### **Notes importantes** + +- RemoteStorage nécessite un domaine dédié, il faut donc en obtenir un et l'ajouter en utilisant le panneau d'administration de YunoHost. **Domaines -> Ajouter un domaine**. +- Comme RemoteStorage utilise le domaine complet et est installé à la racine, vous pouvez créer un sous-domaine tel que remote.domain.tld. +- N'oubliez pas de mettre à jour vos DNS si vous les gérez manuellement. + +- RemoteStorage nécessite des certificats SSL approuvés par le navigateur. Si vous disposez de certificats qui ne sont pas émis par [Let's Encrypt](https://letsencrypt.org/), installez-les manuellement comme d'habitude. +## TODO + +* Toute limitation ou contrainte connue ou tout élément ne fonctionnant pas, tel que (mais non limité à) : + * architectures non prises en charge ? + * L'authentification unique ou l'intégration LDAP ne fonctionnent pas ? + * etc... + +* D'autres informations que les gens devraient connaître, comme.. : + * toute étape spécifique à effectuer après l'installation (comme terminer manuellement l'installation, des identifiants d'administration spécifiques, ...) + * Comment configurer / administrer l'application si ce n'est pas évident. + * Spécificités, les choses à savoir ? ## Documentations et ressources -* Site Web officiel de l'application : https://remotestorage.io/ -* Dépôt de code de l'application en amont : https://github.com/remotestorage/armadietto/ -* Signalez un bogue : https://github.com/bencharp/armadietto_ynh/issues +* Site officiel de l'app : https://remotestorage.io/ +* Dépôt de code officiel de l'app : https://github.com/remotestorage/armadietto +* Documentation YunoHost pour cette app : https://yunohost.org/app_armadietto +* Signaler un bug : https://github.com/YunoHost-Apps/armadietto_ynh/issues ## Informations pour les développeurs -Veuillez envoyer votre demande à la [branche de test] (https://github.com/bencharp/armadietto_ynh/tree/testing). +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/armadietto_ynh/tree/testing). -Pour essayer la branche testing, veuillez procéder comme suit. +Pour essayer la branche testing, procédez comme suit. ``` -sudo yunohost app install https://github.com/bencharp/armadietto_ynh/tree/testing --debug +sudo yunohost app install https://github.com/YunoHost-Apps/armadietto_ynh/tree/testing --debug ou -sudo yunohost app upgrade armadietto_ynh -u https://github.com/bencharp/armadietto_ynh/tree/testing --debug +sudo yunohost app upgrade armadietto -u https://github.com/YunoHost-Apps/armadietto_ynh/tree/testing --debug ``` + +**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/check_process b/check_process index 6bb6c08..9444bd9 100644 --- a/check_process +++ b/check_process @@ -16,20 +16,20 @@ pkg_linter=1 setup_sub_dir=0 setup_root=1 - setup_nourl=1 + setup_nourl=0 setup_private=1 setup_public=1 upgrade=1 - # 0.0.2-beta.10~ynh1 - upgrade=1 from_commit=27894600799b8b04f71e7ec219798e34512e51b0 + # 0.0.2~ynh5 + upgrade=1 from_commit=d185b84698a9f7e83eff6bf6dd5606f35282a536 backup_restore=1 multi_instance=0 - port_already_use=1 + port_already_use=0 change_url=1 ;;; Options Email= Notification=none ;;; Upgrade options - ; commit=27894600799b8b04f71e7ec219798e34512e51b0 - name= Upgrade to version 0.0.2-beta.10~ynh1 + ; 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& diff --git a/conf/config.sample.yml b/conf/config.sample.yml index bf417a5..94a2890 100644 --- a/conf/config.sample.yml +++ b/conf/config.sample.yml @@ -7,4 +7,5 @@ final_path: __FINALPATH__ datadir: __DATADIR__ port: __PORT__ domain: __DOMAIN__ +is_signup: __IS_SIGNUP__ diff --git a/conf/nginx.conf b/conf/nginx.conf index d2b485e..55e8ecd 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -15,6 +15,5 @@ location __PATH__ { # Include SSOWAT user panel. # include conf.d/yunohost_panel.conf.inc; - } \ No newline at end of file diff --git a/conf/server.js b/conf/server.js index 5531073..36a85aa 100644 --- a/conf/server.js +++ b/conf/server.js @@ -19,7 +19,7 @@ server = new Armadietto({ key: '/etc/yunohost/certs/__DOMAIN__/key.pem' }, allow: { - signup: __SIGNUP__ + signup: __IS_SIGNUP__ }, cacheViews: false }); diff --git a/conf/systemd.service b/conf/systemd.service index 4e4f62d..5fc0dcf 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=Armadietto is a remoteStorage server written in nodejs +Description=Armadietto, a remoteStorage server service After=network.target [Service] diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 9084a24..b305f9b 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,6 +1,20 @@ -## TODO -Une description longue de ce que fait l'application +[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) + +> ### :warning: WARNING +> Please do not consider `armadietto` production ready, this project is still +> considered experimental. As with any alpha-stage storage technology, you +> MUST expect that it will eat your data and take precautions against this. You +> SHOULD expect that its APIs and storage schemas will change before it is +> labelled stable. + +**Shipped version:** 0.1.5 + +### Application for remoteStorage + +[Click here](https://remotestorage.io/apps/) to see the list of applications that can be used with RemoteStorage. ### Features diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..7fd6c07 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1,17 @@ + +[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). + +> ### :warning: WARNING +> Veuillez ne pas considérer `armadietto` comme prêt pour la production, ce projet est toujours +> comme expérimental. Comme avec toute technologie de stockage en phase alpha, vous +> devez vous attendre à ce qu'elle mange vos données et prendre des précautions contre cela. Vous +> Vous devez vous attendre à ce que ses API et ses schémas de stockage changent avant qu'il ne soit +> étiqueté comme stable. + +**Version livrée:** 0.1.5 + +### 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 diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 151747f..62f67a7 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,16 +1,43 @@ +### :warning: WARNING +Armadietto_ynh still in develoment: + +* Security considerations from [Armadietto](https://github.com/remotestorage/armadietto/) : + + +>### **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. +> +>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 +> +> - Do not run other applications as root, or as any user that could access files owned by your armadietto user +> +> - Make sure the directory path/to/storage cannot be read, written or executed by anyone but this user: sudo chmod 0700 /path/to/storage && sudo chown armadietto /path/to/storage +> +> - Do not run armadietto as root; if you need to bind to port 80 or 443 use a reverse proxy like nginx, Apache2, caddy, lighttpd or enable bind capability: setcap 'cap_net_bind_service=+ep' `which armadietto` +> +> - Ideally, run your storage inside a container or on a dedicated machine + +
+ +### **Important Notes** + +- RemoteStorage requires a dedicated domain, so obtain one and add it using the YunoHost admin panel. **Domains -> Add domain**. +- As RemoteStorage uses the full domain and is installed on the root, you can create a subdomain such as remote.domain.tld. +- Don't forget to update your DNS if you manage them manually. + +- RemoteStorage requires browser-approved SSL certificates. If you have certificates not issued by [Let's Encrypt](https://letsencrypt.org/), install them manually as usual. + ## TODO -* Toute limitation ou contrainte connue ou tout élément ne fonctionnant pas, tel que (mais non limité à) : - * nécessitant un domaine dédié complet ? - * architectures non prises en charge ? - * L'authentification unique ou l'intégration LDAP ne fonctionnent pas ? - * l'application nécessite une quantité importante de RAM / disque / ... pour s'installer ou fonctionner correctement. +* Any known limitations, constraints or non-functioning elements, such as (but not limited to) : + * Unsupported architectures? + * Single sign-on or LDAP integration not working? * etc... -* D'autres informations que les gens devraient connaître, comme.. : - * toute étape spécifique à effectuer après l'installation (comme terminer manuellement l'installation, des identifiants d'administration spécifiques, ...) - * Comment configurer / administrer l'application si ce n'est pas évident. - * le processus de mise à niveau, les spécificités, les choses à savoir ? - * Considérations de sécurité - -Traduit avec www.DeepL.com/Translator (version gratuite) \ No newline at end of file +* Other information that people should know, such as. : + * any specific steps to be performed after installation (like manually terminating the installation, specific admin credentials, ...) + * How to configure / administer the application if it is not obvious. + * Specifics, things to know? diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md new file mode 100644 index 0000000..0fbb563 --- /dev/null +++ b/doc/DISCLAIMER_fr.md @@ -0,0 +1,45 @@ +### :warning: WARNING +Armadietto_ynh still in develoment: + +* l'authentification unique ou l'intégration LDAP ne fonctionne pas ? +* Considérations sur la sécurité de [Armadietto](https://github.com/remotestorage/armadietto/) : + + +> ### **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. +> +> Vous devez prendre les mesures suivantes pour assurer la sécurité de votre stockage : +> +> - Choisissez un utilisateur Unix unique pour exécuter votre processus serveur ; aucun autre processus sur la machine ne doit être exécuté sous cet utilisateur : sudo useradd armadietto --system --no-create-home +> +> - Ne lancez pas d'autres applications en tant que root, ou en tant qu'utilisateur qui pourrait accéder à des fichiers appartenant à votre utilisateur armadietto. +> +> - Assurez-vous que le répertoire path/to/storage ne peut être lu, écrit ou exécuté par personne d'autre que cet utilisateur : sudo chmod 0700 /path/to/storage && sudo chown armadietto /path/to/storage +> +> - Ne lancez pas armadietto en tant que root ; si vous avez besoin de vous lier au port 80 ou 443, utilisez un reverse proxy comme nginx, Apache2, caddy, lighttpd ou activez la capacité de liaison : setcap 'cap_net_bind_service=+ep' `which armadietto`. +> +> - Idéalement, exécutez votre stockage dans un conteneur ou sur une machine dédiée. + +
+ +### **Notes importantes** + +- RemoteStorage nécessite un domaine dédié, il faut donc en obtenir un et l'ajouter en utilisant le panneau d'administration de YunoHost. **Domaines -> Ajouter un domaine**. +- Comme RemoteStorage utilise le domaine complet et est installé à la racine, vous pouvez créer un sous-domaine tel que remote.domain.tld. +- N'oubliez pas de mettre à jour vos DNS si vous les gérez manuellement. + +- RemoteStorage nécessite des certificats SSL approuvés par le navigateur. Si vous disposez de certificats qui ne sont pas émis par [Let's Encrypt](https://letsencrypt.org/), installez-les manuellement comme d'habitude. + + +## TODO + +* Toute limitation ou contrainte connue ou tout élément ne fonctionnant pas, tel que (mais non limité à) : + * architectures non prises en charge ? + * L'authentification unique ou l'intégration LDAP ne fonctionnent pas ? + * etc... + +* D'autres informations que les gens devraient connaître, comme.. : + * toute étape spécifique à effectuer après l'installation (comme terminer manuellement l'installation, des identifiants d'administration spécifiques, ...) + * Comment configurer / administrer l'application si ce n'est pas évident. + * Spécificités, les choses à savoir ? \ No newline at end of file diff --git a/manifest.json b/manifest.json index 02aaaf8..40fe531 100644 --- a/manifest.json +++ b/manifest.json @@ -3,10 +3,10 @@ "id": "armadietto", "packaging_format": 1, "description": { - "en": "Armadietto is a remoteStorage server written for Node.js.", - "fr": "Armadietto est un serveur remoteStorage écrit pour node.js." + "en": "A remoteStorage server written for Node.js.", + "fr": "Un serveur remoteStorage écrit pour node.js." }, - "version": "0.0.2-beta.10~ynh2", + "version": "0.0.2~ynh6", "url": "https://github.com/remotestorage/armadietto", "upstream": { "license": "MIT", diff --git a/scripts/backup b/scripts/backup index 11f4062..ca43193 100755 --- a/scripts/backup +++ b/scripts/backup @@ -49,6 +49,7 @@ ynh_backup --src_path="$final_path" ynh_backup --src_path="$datadir" +#================================================= # BACKUP THE ARMADIETTO SERVER #================================================= diff --git a/scripts/change_url b/scripts/change_url index e025f6d..5b25c6c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +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) @@ -37,7 +37,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=3 # Backup the current version of the app ynh_backup_before_upgrade @@ -72,7 +72,7 @@ fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 +ynh_script_progression --message="Stopping a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" @@ -138,5 +138,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # END OF SCRIPT #================================================= - ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index f4b26b8..c3ea003 100755 --- a/scripts/install +++ b/scripts/install @@ -37,11 +37,10 @@ datadir="/home/yunohost.app/${app}/storage" #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +ynh_script_progression --message="Validating installation parameters..." --weight=2 -### If the app uses NGINX as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". -### If the app provides an internal web server (or uses another application server such as uWSGI), the final path should be "/opt/yunohost/$app" final_path=/opt/yunohost/$app + test ! -e "$final_path" || ynh_die --message="This path already contains a folder" # Only on / directory @@ -68,24 +67,16 @@ ynh_app_setting_set --app=$app --key=datadir --value=$datadir #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --weight=1 +ynh_script_progression --message="Finding an available port..." --weight=2 # Find an available port port=$(ynh_find_port --port=8008) ynh_app_setting_set --app=$app --key=port --value=$port -# Optional: Expose this port publicly -# (N.B.: you only need to do this if the app actually needs to expose the port publicly. -# If you do this and the app doesn't actually need you are CREATING SECURITY HOLES IN THE SERVER !) - -# Open the port -# ynh_script_progression --message="Configuring firewall..." --weight=1 -# ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port - #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=4 +ynh_script_progression --message="Installing dependencies..." --weight=23 ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_use_nodejs @@ -96,8 +87,6 @@ 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 -# 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" @@ -105,9 +94,7 @@ mkdir -p "$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 - -### `ynh_add_nginx_config` will use the file conf/nginx.conf +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated NGINX config ynh_add_nginx_config @@ -115,15 +102,15 @@ ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 +ynh_script_progression --message="Configuring system user..." --weight=2 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_system_user_create --username=$app #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." +ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path/config.yml" @@ -133,30 +120,33 @@ chown $app:$app "$final_path/config.yml" #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 +ynh_script_progression --message="Configuring a systemd service..." --weight=3 # Create a dedicated systemd config ynh_add_systemd_config #================================================= -# SETUP ARMADIETTO AS A SERVICE +# CREATE DATA DIRECTORY #================================================= -ynh_script_progression --message="Configuring armadietto as a service..." --weight=1 +ynh_script_progression --message="Creating a data directory..." --weight=1 -# Define armadietto module path -modulepath="$node_version_path/$nodejs_version/lib/node_modules/armadietto/lib" +ynh_app_setting_set --app=$app --key=datadir --value=$datadir # Create app data folder -mkdir -p "$datadir" +mkdir -p $datadir -# Using Armadietto as a service in a basic node server -cp -f ../conf/server.js "$final_path/server.js" +#================================================= +# SETUP ARMADIETTO AS A SERVICE +#================================================= +ynh_script_progression --message="Configuring armadietto as a service..." --weight=2 -ynh_replace_string --match_string="__MODULE_PATH__" --replace_string="$modulepath" --target_file="$final_path/server.js" -ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="$final_path/server.js" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/server.js" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/server.js" -ynh_replace_string --match_string="__SIGNUP__" --replace_string="$is_signup" --target_file="$final_path/server.js" +# Define armadietto module path +module_path="$node_version_path/$nodejs_version/lib/node_modules/armadietto/lib" + +ynh_add_config --template="../conf/server.js" --destination="$final_path/server.js" + +chmod 400 "$final_path/server.js" +chown $app:$app "$final_path/server.js" #================================================= # INSTALL ARMADIETTO @@ -167,8 +157,6 @@ pushd $final_path ynh_npm -g i armadietto popd -ynh_script_progression --message="Armadietto installed..." - #================================================= # GENERIC FINALIZATION #================================================= @@ -186,19 +174,20 @@ 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 #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Armadietto run a remotestorage server as service" --log="/var/log/$app/$app.log" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=2 # Make app public if necessary if [ $is_public -eq 1 ] diff --git a/scripts/remove b/scripts/remove index 475bcdf..c9da9b2 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=2 app=$YNH_APP_INSTANCE_NAME @@ -37,7 +37,7 @@ fi #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 +ynh_script_progression --message="Stopping and removing the systemd service..." --weight=2 # Remove the dedicated systemd config ynh_remove_systemd_config @@ -45,7 +45,7 @@ ynh_remove_systemd_config #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing logrotate configuration..." --time --weight=1 +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 # Remove the app-specific logrotate config ynh_remove_logrotate @@ -53,7 +53,7 @@ ynh_remove_logrotate #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=1 +ynh_script_progression --message="Removing app main directory..." --weight=2 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -81,7 +81,7 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 +ynh_script_progression --message="Removing dependencies..." --weight=2 ynh_remove_nodejs --nodejs_version=$NODEJS_VERSION diff --git a/scripts/restore b/scripts/restore index 524f1a7..d825274 100755 --- a/scripts/restore +++ b/scripts/restore @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=2 app=$YNH_APP_INSTANCE_NAME @@ -38,13 +38,12 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +test ! -d "$final_path" || ynh_die --message="There is already a directory: $final_path " #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=4 +ynh_script_progression --message="Reinstalling dependencies..." --weight=21 ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_use_nodejs @@ -64,7 +63,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_system_user_create --username=$app #================================================= # RESTORE THE APP MAIN DIR @@ -76,7 +75,7 @@ ynh_restore_file --origin_path="$final_path" #================================================= # RESTORE SYSTEMD #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +ynh_script_progression --message="Restoring the systemd configuration..." --weight=2 ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet @@ -98,8 +97,6 @@ pushd $final_path ynh_npm -g i armadietto popd -ynh_script_progression --message="Armadietto reinstalled..." - #================================================= # GENERIC FINALIZATION #================================================= @@ -122,9 +119,9 @@ chmod 0700 $datadir && chown $app:$app $datadir #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 +ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Armadietto run a remotestorage server as service" --log="/var/log/$app/$app.log" #================================================= # RELOAD NGINX diff --git a/scripts/upgrade b/scripts/upgrade index bf2f4a7..a406661 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,11 +20,14 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) final_path=$(ynh_app_setting_get --app=$app --key=final_path) datadir=$(ynh_app_setting_get --app=$app --key=datadir) -is_signup=$(ynh_app_setting_get --app=$app --key=signup) +is_signup=$(ynh_app_setting_get --app=$app --key=is_signup) #================================================= # CHECK VERSION #================================================= +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 @@ -32,12 +35,11 @@ is_signup=$(ynh_app_setting_get --app=$app --key=signup) ### - 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. -upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=4 # Backup the current version of the app ynh_backup_before_upgrade @@ -62,18 +64,22 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + +# Remove old log file +ynh_secure_remove --file="/var/log/$app/" + # # N.B. : the followings setting migrations snippets are provided as *EXAMPLES* # of what you may want to do in some cases (e.g. a setting was not defined on # some legacy installs and you therefore want to initiaze stuff during upgrade) # -# If db_name doesn't exist, create it -#if [ -z "$db_name" ]; then -# db_name=$(ynh_sanitize_dbid --db_name=$app) -# ynh_app_setting_set --app=$app --key=db_name --value=$db_name -#fi - # If final_path doesn't exist, create it #if [ -z "$final_path" ]; then # final_path=/var/www/$app @@ -86,7 +92,7 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_system_user_create --username=$app #================================================= # CHECK AND CREATE FINAL_PATH @@ -113,32 +119,37 @@ ynh_use_nodejs #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." +ynh_script_progression --message="Adding a configuration file..." --weight=2 ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path/config.yml" chmod 400 "$final_path/config.yml" chown $app:$app "$final_path/config.yml" +#================================================= +# CREATE DATA DIRECTORY +#================================================= +if [ -z "$datadir" ]; then + ynh_script_progression --message="Creating a data directory..." --weight=1 + + ynh_app_setting_set --app=$app --key=datadir --value=$datadir + + # Create app data folder + mkdir -p $datadir +fi + #================================================= # DEFINE ARMADIETTO OPTIONS & CREATE DATA DIRECTORY #================================================= -ynh_script_progression --message="Configuring armadietto as a service..." --weight=1 +ynh_script_progression --message="Configuring armadietto as a service..." --weight=2 # Define armadietto module path -modulepath="$node_version_path/$nodejs_version/lib/node_modules/armadietto/lib" +module_path="$node_version_path/$nodejs_version/lib/node_modules/armadietto/lib" -# Create app data folder -mkdir -p "$datadir" +ynh_add_config --template="../conf/server.js" --destination="$final_path/server.js" -# Using Armadietto as a service in a basic node server -cp -f ../conf/server.js "$final_path/server.js" - -ynh_replace_string --match_string="__MODULE_PATH__" --replace_string="$modulepath" --target_file="$final_path/server.js" -ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="$final_path/server.js" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/server.js" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/server.js" -ynh_replace_string --match_string="__SIGNUP__" --replace_string="$is_signup" --target_file="$final_path/server.js" +chmod 400 "$final_path/server.js" +chown $app:$app "$final_path/server.js" #================================================= # UPGRADE ARMADIETTO @@ -150,14 +161,17 @@ then pushd $final_path ynh_npm -g i armadietto popd - - ynh_script_progression --message="Armadietto upgraded..." fi #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." --weight=1 +ynh_script_progression --message="Updating a configuration file..." --weight=2 + +ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path/config.yml" + +chmod 400 "$final_path/config.yml" +chown $app:$app "$final_path/config.yml" ### Same as during install ### @@ -182,7 +196,7 @@ ynh_script_progression --message="Updating a configuration file..." --weight=1 #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 +ynh_script_progression --message="Upgrading systemd configuration..." --weight=3 # Create a dedicated systemd config ynh_add_systemd_config @@ -192,7 +206,7 @@ ynh_add_systemd_config #================================================= # SETUP LOGROTATE #================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 +ynh_script_progression --message="Configuring log rotation..." --weight=2 # Use logrotate to manage application logfile(s) ynh_use_logrotate @@ -211,19 +225,12 @@ chmod 0700 $datadir && chown $app:$app $datadir #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="A short description of the app" --log="/var/log/$app/$app.log" - -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +yunohost service add $app --description="Armadietto run a remotestorage server as service" --log="/var/log/$app/$app.log" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=2 ynh_systemd_action --service_name=nginx --action=reload @@ -238,5 +245,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # END OF SCRIPT #================================================= - ynh_script_progression --message="Upgrade of $app completed" --last