From 0db2a83105657dd6e03f596600d28fcdd86e2355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 12 Jun 2023 18:58:03 +0200 Subject: [PATCH 01/62] Manifestv2 initial commit --- .gitattributes | 2 + .gitignore | 2 + README.md | 25 +++--- README_fr.md | 40 +++++----- check_process | 21 ------ conf/app.src | 7 -- conf/nginx.conf | 2 - conf/systemd.service | 8 +- doc/DESCRIPTION.md | 1 + doc/DESCRIPTION_fr.md | 2 + doc/DISCLAIMER.md | 0 manifest.json | 47 ------------ manifest.toml | 83 ++++++++++++++++++++ scripts/_common.sh | 3 - scripts/backup | 43 +++++------ scripts/change_url | 47 ++++++++++++ scripts/config | 102 +++++++++++++++++++++++++ scripts/install | 171 +++++++----------------------------------- scripts/remove | 93 +++-------------------- scripts/restore | 107 ++++++-------------------- scripts/upgrade | 135 ++++++++++++--------------------- tests.toml | 10 +++ 22 files changed, 412 insertions(+), 539 deletions(-) create mode 100644 .gitattributes create mode 100644 .gitignore delete mode 100644 check_process delete mode 100644 conf/app.src create mode 100644 doc/DESCRIPTION_fr.md delete mode 100644 doc/DISCLAIMER.md delete mode 100644 manifest.json create mode 100644 manifest.toml mode change 100644 => 100755 scripts/backup create mode 100644 scripts/change_url create mode 100644 scripts/config mode change 100644 => 100755 scripts/install mode change 100644 => 100755 scripts/remove mode change 100644 => 100755 scripts/restore mode change 100644 => 100755 scripts/upgrade create mode 100644 tests.toml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6f9a98b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +tests.toml.example linguist-language=toml +config_panel.toml.example linguist-language=toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..783a4ae --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +*.sw[op] diff --git a/README.md b/README.md index 2a1e091..3fbff60 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Pydio for YunoHost -[![Integration level](https://dash.yunohost.org/integration/pydio.svg)](https://dash.yunohost.org/appci/app/pydio) ![](https://ci-apps.yunohost.org/ci/badges/pydio.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/pydio.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/pydio.svg)](https://dash.yunohost.org/appci/app/pydio) ![Working status](https://ci-apps.yunohost.org/ci/badges/pydio.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/pydio.maintain.svg) + [![Install Pydio with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pydio) *[Lire ce readme en français.](./README_fr.md)* @@ -15,33 +16,33 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -File sharing platform - -**Shipped version:** 3.0.4~ynh1 +Cells V4 now provides secure, cloud-native, scalable, self-hosted, open-core document sharing and collaboration without putting your data at risk. +**Shipped version:** 4.2.1~ynh1 ## Screenshots -![](./doc/screenshots/screenshot01.png) +![Screenshot of Pydio](./doc/screenshots/screenshot01.png) ## Documentation and resources -* Official app website: https://pydio.com -* Official admin documentation: https://pydio.com/en/docs/ -* Upstream app code repository: https://github.com/pydio/cells -* YunoHost documentation for this app: https://yunohost.org/app_pydio -* Report a bug: https://github.com/YunoHost-Apps/pydio_ynh/issues +* Official app website: +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/pydio_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/pydio_ynh/tree/testing --debug or sudo yunohost app upgrade pydio -u https://github.com/YunoHost-Apps/pydio_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index da0c775..94d83ae 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,43 +1,49 @@ + + # Pydio pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/pydio.svg)](https://dash.yunohost.org/appci/app/pydio) ![](https://ci-apps.yunohost.org/ci/badges/pydio.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/pydio.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/pydio.svg)](https://dash.yunohost.org/appci/app/pydio) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/pydio.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/pydio.maintain.svg) + [![Installer Pydio avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pydio) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* -> *Ce package vous permet d'installer Pydio 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 package vous permet d’installer Pydio 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.* -## Vue d'ensemble +## Vue d’ensemble -Plateforme de partage de fichiers - -**Version incluse :** 3.0.4~ynh1 +Favorisez la collaboration entre les équipes sans mettre vos données en danger. +Pydio Cells est un logiciel de partage de documents opencore, auto-hébergé, avec la sécurité pour ADN. +**Version incluse :** 4.2.1~ynh1 -## Captures d'écran +## Captures d’écran -![](./doc/screenshots/screenshot01.png) +![Capture d’écran de Pydio](./doc/screenshots/screenshot01.png) ## Documentations et ressources -* Site officiel de l'app : https://pydio.com -* Documentation officielle de l'admin : https://pydio.com/en/docs/ -* Dépôt de code officiel de l'app : https://github.com/pydio/cells -* Documentation YunoHost pour cette app : https://yunohost.org/app_pydio -* Signaler un bug : https://github.com/YunoHost-Apps/pydio_ynh/issues +* Site officiel de l’app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/pydio_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/pydio_ynh/tree/testing --debug ou sudo yunohost app upgrade pydio -u https://github.com/YunoHost-Apps/pydio_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file diff --git a/check_process b/check_process deleted file mode 100644 index 0b52ab7..0000000 --- a/check_process +++ /dev/null @@ -1,21 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - admin="john" - password="1Strong-Password" - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=0 - setup_public=1 - upgrade=1 - #upgrade=1 from_commit=CommitHash - backup_restore=1 - multi_instance=1 - port_already_use=0 - change_url=0 -;;; Options -Email= -Notification=none diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index d04ac1d..0000000 --- a/conf/app.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://download.pydio.com/pub/cells/release/3.0.4/linux-amd64/pydio-cells-3.0.4-linux-amd64.zip -SOURCE_SUM=97e6bb779fed596b6fe11ed2aff8db0789d2f2f2b8bf8cd11e240dc3b76bf4b2 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME= -SOURCE_EXTRACT=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 484efd1..ed70286 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,12 +1,10 @@ location / { - proxy_pass https://localhost:__PORT__; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } - location /ws/ { proxy_pass https://localhost:__PORT__; proxy_http_version 1.1; diff --git a/conf/systemd.service b/conf/systemd.service index 461e17f..fe735c5 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -3,16 +3,16 @@ Description=Pydio Cells Documentation=https://pydio.com Wants=network-online.target After=network-online.target -AssertFileIsExecutable=__FINALPATH__/cells +AssertFileIsExecutable=__INSTALL_DIR__/cells [Service] User=__APP__ Group=__APP__ -WorkingDirectory=__DATADIR__/ +WorkingDirectory=__INSTALL_DIR__/ PermissionsStartOnly=true AmbientCapabilities=CAP_NET_BIND_SERVICE -ExecStart=__FINALPATH__/cells start +ExecStart=__INSTALL_DIR__/cells start Restart=on-failure StandardOutput=journal StandardError=inherit @@ -24,7 +24,7 @@ SuccessExitStatus=0 # Add environment variables Environment=CELLS_ENABLE_METRICS=false -# Environment=CELLS_WORKING_DIR=__FINALPATH__ +# Environment=CELLS_WORKING_DIR=__INSTALL_DIR__ # Environment=CELLS_DATA_DIR=__DATADIR__ [Install] diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index e69de29..0a8bbb2 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -0,0 +1 @@ +Cells V4 now provides secure, cloud-native, scalable, self-hosted, open-core document sharing and collaboration without putting your data at risk. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..fbec72c --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1,2 @@ +Favorisez la collaboration entre les équipes sans mettre vos données en danger. +Pydio Cells est un logiciel de partage de documents opencore, auto-hébergé, avec la sécurité pour ADN. diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index e69de29..0000000 diff --git a/manifest.json b/manifest.json deleted file mode 100644 index f8ff71b..0000000 --- a/manifest.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "Pydio", - "id": "pydio", - "packaging_format": 1, - "description": { - "en": "File sharing platform", - "fr": "Plateforme de partage de fichiers" - }, - "version": "3.0.4~ynh1", - "url": "https://pydio.com", - "upstream": { - "license": "AGPL-3.0-or-later", - "website": "https://pydio.com", - "admindoc": "https://pydio.com/en/docs/", - "code": "https://github.com/pydio/cells" - }, - "license": "AGPL-3.0-or-later", - "maintainer": { - "name": "julienmalik", - "email": "julien.malik@paraiso.me", - "url": "https://github.com/julienmalik" - }, - "requirements": { - "yunohost": ">= 4.3.0" - }, - "multi_instance": true, - "services": [ - "nginx", - "mysql" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "admin", - "type": "user" - }, - { - "name": "password", - "type": "password" - } - ] - } -} diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..813602e --- /dev/null +++ b/manifest.toml @@ -0,0 +1,83 @@ +packaging_format = 2 + +id = "pydio" +name = "Pydio" +description.en = "A file sharing platform" +description.fr = "Une plateforme de partage de fichiers" + +version = "4.2.1~ynh1" + +maintainers = ["salamandar"] + +[upstream] +# NB: Only the "license" key is mandatory. Remove entries for which there's no relevant data +license = "AGPL-3.0" +website = "https://pydio.com" +# demo = "https://demo.example.com" +admindoc = "https://pydio.com/en/docs" +# userdoc = "https://yunohost.org/apps" +code = "https://github.com/pydio/cells" +cpe = "cpe:2.3:a:pydio:cells" +fund = "https://pydio.com/en/pricing" + +[integration] +yunohost = ">= 11.1.14" +architectures = ["amd64", "armhf", "arm64"] +multi_instance = true +ldap = false +sso = false +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" + +[install] + [install.domain] + type = "domain" + + [install.init_main_permission] + # this is a generic question - ask strings are automatically handled by YunoHost's core + # This won't be saved as setting and will instead be used to initialize the SSOwat permission + type = "group" + default = "visitors" + + [install.admin] + type = "user" + + [install.password] + type = "password" + +[resources] + # See the packaging documentation for the full set + # of explanation regarding the behavior and properties for each of those + + [resources.sources] + + [resources.sources.main] + in_subdir = false + amd64.url = "https://download.pydio.com/pub/cells/release/4.2.1/linux-amd64/pydio-cells-4.2.1-linux-amd64.zip" + amd64.sha256 = "76caea1aca6c408fb43be49dc5e2193ccf5db9add449476a188bc725c5989849" + + armhf.url = "https://download.pydio.com/pub/cells/release/4.2.1/linux-arm/pydio-cells-4.2.1-linux-arm.zip" + armhf.sha256 = "153ffd514911a164dad82e23007b2db2ebcc2c6d55d7727675e2312186eb6123" + + arm64.url = "https://download.pydio.com/pub/cells/release/4.2.1/linux-arm64/pydio-cells-4.2.1-linux-arm64.zip" + arm64.sha256 = "0f348ff4e48db5c9231873c75bc6493c66ba790876ec7acf0b71d64a9bbb2f4a" + + [resources.system_user] + + [resources.install_dir] + + # [resources.data_dir] + # This will create/remove the data dir as /home/yunohost.app/$app + # and store the corresponding setting $data_dir + + [resources.permissions] + main.url = "/" + + [resources.ports] + + [resources.apt] + packages = "mariadb-server" + + [resources.database] + type = "mysql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 82e3b11..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#pkg_dependencies="acl" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup old mode 100644 new mode 100755 index 44e4951..503270b --- a/scripts/backup +++ b/scripts/backup @@ -10,28 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_print_info --message="Loading installation settings..." - -app=$YNH_APP_INSTANCE_NAME - -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= @@ -41,13 +19,14 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP THE DATA DIR #================================================= -ynh_backup --src_path="$datadir" --is_big +# Only relevant if there is a "data_dir" resource for this app +ynh_backup --src_path="$data_dir" --is_big #================================================= # BACKUP THE NGINX CONFIGURATION @@ -55,8 +34,21 @@ ynh_backup --src_path="$datadir" --is_big ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# BACKUP FAIL2BAN CONFIGURATION +#================================================= + +# ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" +# ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" + #================================================= # SPECIFIC BACKUP +#================================================= +# BACKUP LOGROTATE +#================================================= + +# ynh_backup --src_path="/etc/logrotate.d/$app" + #================================================= # BACKUP SYSTEMD #================================================= @@ -68,6 +60,9 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= ynh_print_info --message="Backing up the MySQL database..." +### (However, things like MySQL dumps *do* take some time to run, though the +### copy of the generated dump to the archive still happens later) + ynh_mysql_dump_db --database="$db_name" > db.sql #================================================= diff --git a/scripts/change_url b/scripts/change_url new file mode 100644 index 0000000..f0964a6 --- /dev/null +++ b/scripts/change_url @@ -0,0 +1,47 @@ +#!/bin/bash + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# STANDARD MODIFICATIONS +#================================================= +# STOP SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Stopping a systemd service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" + +#================================================= +# MODIFY URL IN NGINX CONF +#================================================= +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 + +ynh_change_url_nginx_config + +#================================================= +# SPECIFIC MODIFICATIONS +#================================================= +# ... +#================================================= + +#================================================= +# GENERIC FINALISATION +#================================================= +# 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" + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/config b/scripts/config new file mode 100644 index 0000000..dca69fb --- /dev/null +++ b/scripts/config @@ -0,0 +1,102 @@ +#!/bin/bash +# In simple cases, you don't need a config script. + +# With a simple config_panel.toml, you can write in the app settings, in the +# upstream config file or replace complete files (logo ...) and restart services. + +# The config scripts allows you to go further, to handle specific cases +# (validation of several interdependent fields, specific getter/setter for a value, +# display dynamic informations or choices, pre-loading of config type .cube... ). + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source /usr/share/yunohost/helpers + +ynh_abort_if_errors + +#================================================= +# RETRIEVE ARGUMENTS +#================================================= + +install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) + +#================================================= +# SPECIFIC GETTERS FOR TOML SHORT KEY +#================================================= + +get__amount() { + # Here we can imagine to have an API call to stripe to know the amount of donation during a month + local amount = 200 + + # It's possible to change some properties of the question by overriding it: + if [ $amount -gt 100 ] + then + cat << EOF +style: success +value: $amount +ask: + en: A lot of donation this month: **$amount €** +EOF + else + cat << EOF +style: danger +value: $amount +ask: + en: Not so much donation this month: $amount € +EOF + fi +} + +get__prices() { + local prices = "$(grep "DONATION\['" "$install_dir/settings.py" | sed -r "s@^DONATION\['([^']*)'\]\['([^']*)'\] = '([^']*)'@\1/\2/\3@g" | sed -z 's/\n/,/g;s/,$/\n/')" + if [ "$prices" == "," ]; + then + # Return YNH_NULL if you prefer to not return a value at all. + echo YNH_NULL + else + echo $prices + fi +} + + +#================================================= +# SPECIFIC VALIDATORS FOR TOML SHORT KEYS +#================================================= +validate__publishable_key() { + + # We can imagine here we test if the key is really a publisheable key + (is_secret_key $publishable_key) && + echo 'This key seems to be a secret key' +} + +#================================================= +# SPECIFIC SETTERS FOR TOML SHORT KEYS +#================================================= +set__prices() { + + #--------------------------------------------- + # IMPORTANT: setter are trigger only if a change is detected + #--------------------------------------------- + for price in $(echo $prices | sed "s/,/ /"); do + frequency=$(echo $price | cut -d/ -f1) + currency=$(echo $price | cut -d/ -f2) + price_id=$(echo $price | cut -d/ -f3) + sed "d/DONATION\['$frequency'\]\['$currency'\]" "$install_dir/settings.py" + + echo "DONATION['$frequency']['$currency'] = '$price_id'" >> "$install_dir/settings.py" + done + + #--------------------------------------------- + # IMPORTANT: to be able to upgrade properly, you have to saved the value in settings too + #--------------------------------------------- + ynh_app_setting_set $app prices $prices +} + +#================================================= +# GENERIC FINALIZATION +#================================================= +ynh_app_config_run $1 diff --git a/scripts/install b/scripts/install old mode 100644 new mode 100755 index df4551c..d92e899 --- a/scripts/install +++ b/scripts/install @@ -10,177 +10,58 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -domain=$YNH_APP_ARG_DOMAIN -path_url="/" -admin=$YNH_APP_ARG_ADMIN -password=$YNH_APP_ARG_PASSWORD - -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -ynh_script_progression --message="Validating installation parameters..." - -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -ynh_script_progression --message="Storing installation settings..." - -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=admin --value=$admin - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -ynh_script_progression --message="Finding an available port..." - -# Find an available port -port=$(ynh_find_port --port=8080) -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..." -# ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port - -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." - -# Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" - -#================================================= -# CREATE A MYSQL DATABASE -#================================================= -ynh_script_progression --message="Creating a MySQL database..." - -db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$db_name -ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name - +# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." +ynh_script_progression --message="Setting up source files..." --weight=1 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path -# Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" +ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chown -R "$app:www-data" "$install_dir" #================================================= -# NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 -# Create a dedicated NGINX config ynh_add_nginx_config +ynh_add_systemd_config + +yunohost service add "$app" --description="Pydio - A file sharing platform" --log="/var/log/$app/$app.log" + +# ynh_use_logrotate + +# Create a dedicated Fail2Ban config +# ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" + #================================================= -# SPECIFIC SETUP -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." - -datadir=/home/yunohost.app/$app -ynh_app_setting_set --app=$app --key=datadir --value=$datadir - -mkdir -p $datadir - -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - +# APP INITIAL CONFIGURATION #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." +ynh_script_progression --message="Configuring Pydio..." --weight=1 -ynh_add_config --template="../conf/install-conf.yml" --destination="$final_path/install-conf.yml" -ynh_delete_file_checksum --file="$final_path/install-conf.yml" +ynh_add_config --template="install-conf.yml" --destination="$install_dir/install-conf.yml" -pushd "$final_path" - ynh_exec_as $app ./cells configure --cli --yaml "$final_path/install-conf.yml" -popd +pushd "$install_dir" || ynh_die + ynh_exec_as "$app" ./cells configure --cli --yaml "$install_dir/install-conf.yml" +popd || ynh_die -ynh_secure_remove --file="$final_path/install-conf.yml" - -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." - -# Create a dedicated systemd config -ynh_add_systemd_config +ynh_secure_remove --file="$install_dir/install-conf.yml" +ynh_delete_file_checksum --file="$install_dir/install-conf.yml" #================================================= # GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - -yunohost service add $app - #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." --weight=1 -# Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Restart done" - -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Configuring permissions..." - -# Everyone can access the app. -# The "main" permission is automatically created before the install script. -ynh_permission_update --permission="main" --add="visitors" - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." - -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT #================================================= - -ynh_script_progression --message="Installation of $app completed" +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/remove b/scripts/remove old mode 100644 new mode 100755 index 909874e..8686684 --- a/scripts/remove +++ b/scripts/remove @@ -10,102 +10,27 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# LOAD SETTINGS +# REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Loading installation settings..." - -app=$YNH_APP_INSTANCE_NAME - -domain=$(ynh_app_setting_get --app=$app --key=domain) -port=$(ynh_app_setting_get --app=$app --key=port) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) - -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEMD SERVICE #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 -# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null -then - ynh_script_progression --message="Removing $app service integration..." - yunohost service remove $app +if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then + ynh_script_progression --message="Removing $app service integration..." --weight=1 + yunohost service remove "$app" fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." - -# Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Removing the MySQL database..." - -# Remove a database if it exists, along with the associated user -ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -ynh_script_progression --message="Removing app main directory..." - -# Remove the app directory securely -ynh_secure_remove --file="$final_path" - -#================================================= -# REMOVE DATA DIR -#================================================= - -# Remove the data directory if --purge option is used -if [ "${YNH_APP_PURGE:-0}" -eq 1 ] -then - ynh_script_progression --message="Removing app data directory..." - ynh_secure_remove --file="$datadir" -fi - -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." - -# Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." +# ynh_remove_logrotate -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." - -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -ynh_script_progression --message="Removing the dedicated system user..." - -# Delete a system user -ynh_system_user_delete --username=$app +# ynh_remove_fail2ban_config #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore old mode 100644 new mode 100755 index 39b0fde..105e37c --- a/scripts/restore +++ b/scripts/restore @@ -10,123 +10,62 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." - -app=$YNH_APP_INSTANCE_NAME - -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -datadir=$(ynh_app_setting_get --app=$app --key=datadir) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -ynh_script_progression --message="Validating restoration parameters..." - -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" - #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring the app main directory..." --weight=1 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chown -R "$app:www-data" "$install_dir" #================================================= # RESTORE THE DATA DIRECTORY #================================================= -ynh_script_progression --message="Restoring the data directory..." +ynh_script_progression --message="Restoring the data directory..." --weight=1 -ynh_restore_file --origin_path="$datadir" --not_mandatory +ynh_restore_file --origin_path="$data_dir" --not_mandatory -mkdir -p $datadir +# (Same as for install dir) +chown -R "$app:www-data" "$data_dir" -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - -#================================================= -# SPECIFIC RESTORATION #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the MySQL database..." +ynh_script_progression --message="Restoring the MySQL database..." --weight=1 -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql +ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql #================================================= -# RESTORE SYSTEMD +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service --quiet +systemctl enable "$app.service" --quiet -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +yunohost service add "$app" --description="Pydio - A file sharing platform" --log="/var/log/$app/$app.log" -yunohost service add $app +# ynh_restore_file --origin_path="/etc/logrotate.d/$app" -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." - -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Restart done" +# ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" +# ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" +# ynh_systemd_action --action=restart --service_name=fail2ban #================================================= # GENERIC FINALIZATION #================================================= -# RELOAD NGINX +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade old mode 100644 new mode 100755 index 370f361..9663ef9 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,131 +9,88 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." - -app=$YNH_APP_INSTANCE_NAME - -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -admin=$(ynh_app_setting_get --app=$app --key=admin) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -port=$(ynh_app_setting_get --app=$app --key=port) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) - -#================================================= -# CHECK VERSION -#================================================= -ynh_script_progression --message="Checking version..." - 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)..." - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - ynh_clean_check_starting - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS -#================================================= -# STOP SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Stopping a systemd service..." - -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." - -# Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 #================================================= -# CREATE DEDICATED USER +# STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." +ynh_script_progression --message="Stopping a systemd service..." --weight=1 -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log" +#================================================= +# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." +if [ "$upgrade_type" == "UPGRADE_APP" ]; then + ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$install_dir" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chown -R "$app:www-data" "$install_dir" #================================================= -# NGINX CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 -# Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC UPGRADE -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." - -# Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +yunohost service add "$app" --description="Pydio - A file sharing platform" --log="/var/log/$app/$app.log" -yunohost service add $app +# ynh_use_logrotate --non-append + +# ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" + +#================================================= +# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) +#================================================= +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating a configuration file..." --weight=1 + +### 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="$install_dir/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 "$install_dir/some_config_file" +chown $app:$app "$install_dir/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="$install_dir/some_config_file" +### ynh_store_file_checksum --file="$install_dir/some_config_file" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Restart done" - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." - -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" +ynh_script_progression --message="Upgrade of $app completed" --last diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..d9de67f --- /dev/null +++ b/tests.toml @@ -0,0 +1,10 @@ +test_format = 1.0 + +[default] + + # The test IDs to be used in only/exclude statements are: install.root, install.subdir, + # install.nourl, install.multi, backup_restore, upgrade, upgrade.someCommitId change_url + exclude = ["install.subdir", "install.nourl", "change_url"] + + # test_upgrade_from.00a1a6e7.name = "Upgrade from 5.4" + # test_upgrade_from.00a1a6e7.args.foo = "bar" From e16737767bdd681d798142010c3ca804111182c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 12 Jun 2023 20:04:44 +0200 Subject: [PATCH 02/62] Add data dir --- conf/install-conf.yml | 2 +- conf/systemd.service | 2 +- manifest.toml | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/conf/install-conf.yml b/conf/install-conf.yml index c353510..8c030ab 100644 --- a/conf/install-conf.yml +++ b/conf/install-conf.yml @@ -19,4 +19,4 @@ dbtcpname: __DB_NAME__ dbtcpuser: __DB_USER__ dbtcppassword: __DB_PWD__ -dsfolder: __DATADIR__ \ No newline at end of file +dsfolder: __DATA_DIR__ diff --git a/conf/systemd.service b/conf/systemd.service index fe735c5..36716ab 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -25,7 +25,7 @@ SuccessExitStatus=0 # Add environment variables Environment=CELLS_ENABLE_METRICS=false # Environment=CELLS_WORKING_DIR=__INSTALL_DIR__ -# Environment=CELLS_DATA_DIR=__DATADIR__ +# Environment=CELLS_DATA_DIR=__DATA_DIR__ [Install] WantedBy=multi-user.target diff --git a/manifest.toml b/manifest.toml index 813602e..13a132c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -67,9 +67,8 @@ ram.runtime = "50M" [resources.install_dir] - # [resources.data_dir] - # This will create/remove the data dir as /home/yunohost.app/$app - # and store the corresponding setting $data_dir + [resources.data_dir] + group = "www-data:rwx" [resources.permissions] main.url = "/" From b9692e5c9a496ec81592ac2e6d3cad8eb25d6f1c Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 17 Jul 2023 12:22:01 +0000 Subject: [PATCH 03/62] Auto-update README --- README_fr.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 4bacd74..94d83ae 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,6 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Favorisez la collaboration entre les équipes sans mettre vos données en danger. Pydio Cells est un logiciel de partage de documents opencore, auto-hébergé, avec la sécurité pour ADN. -Plateforme de partage de fichiers **Version incluse :** 4.2.1~ynh1 From 8de59f2d844c0a699d5b714c8b4e1048a5bf9de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 17 Jul 2023 14:25:23 +0200 Subject: [PATCH 04/62] cleaning --- manifest.toml | 13 +++---------- scripts/backup | 3 --- scripts/change_url | 6 ------ scripts/upgrade | 23 ++++------------------- 4 files changed, 7 insertions(+), 38 deletions(-) diff --git a/manifest.toml b/manifest.toml index 13a132c..4f49cf5 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,26 +2,23 @@ packaging_format = 2 id = "pydio" name = "Pydio" -description.en = "A file sharing platform" -description.fr = "Une plateforme de partage de fichiers" +description.en = "File sharing platform" +description.fr = "Plateforme de partage de fichiers" version = "4.2.1~ynh1" maintainers = ["salamandar"] [upstream] -# NB: Only the "license" key is mandatory. Remove entries for which there's no relevant data license = "AGPL-3.0" website = "https://pydio.com" -# demo = "https://demo.example.com" admindoc = "https://pydio.com/en/docs" -# userdoc = "https://yunohost.org/apps" code = "https://github.com/pydio/cells" cpe = "cpe:2.3:a:pydio:cells" fund = "https://pydio.com/en/pricing" [integration] -yunohost = ">= 11.1.14" +yunohost = ">= 11.1.21" architectures = ["amd64", "armhf", "arm64"] multi_instance = true ldap = false @@ -35,8 +32,6 @@ ram.runtime = "50M" type = "domain" [install.init_main_permission] - # this is a generic question - ask strings are automatically handled by YunoHost's core - # This won't be saved as setting and will instead be used to initialize the SSOwat permission type = "group" default = "visitors" @@ -47,8 +42,6 @@ ram.runtime = "50M" type = "password" [resources] - # See the packaging documentation for the full set - # of explanation regarding the behavior and properties for each of those [resources.sources] diff --git a/scripts/backup b/scripts/backup index 503270b..ebf2cf1 100755 --- a/scripts/backup +++ b/scripts/backup @@ -60,9 +60,6 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= ynh_print_info --message="Backing up the MySQL database..." -### (However, things like MySQL dumps *do* take some time to run, though the -### copy of the generated dump to the archive still happens later) - ynh_mysql_dump_db --database="$db_name" > db.sql #================================================= diff --git a/scripts/change_url b/scripts/change_url index f0964a6..ae914ad 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -25,12 +25,6 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- ynh_change_url_nginx_config -#================================================= -# SPECIFIC MODIFICATIONS -#================================================= -# ... -#================================================= - #================================================= # GENERIC FINALISATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 9663ef9..ccf013c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -60,27 +60,12 @@ yunohost service add "$app" --description="Pydio - A file sharing platform" --lo #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." --weight=1 +#ynh_script_progression --message="Updating a configuration file..." --weight=1 -### 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="$install_dir/some_config_file" -ynh_add_config --template="some_config_file" --destination="$install_dir/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 "$install_dir/some_config_file" -chown $app:$app "$install_dir/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="$install_dir/some_config_file" -### ynh_store_file_checksum --file="$install_dir/some_config_file" +#chmod 400 "$install_dir/some_config_file" +#chown $app:$app "$install_dir/some_config_file" #================================================= # START SYSTEMD SERVICE From 11ea791a0b630f96f345ebb82d675d885c471e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 17 Jul 2023 14:29:05 +0200 Subject: [PATCH 05/62] Update manifest.toml --- manifest.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/manifest.toml b/manifest.toml index 4f49cf5..57cbc53 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Pydio" description.en = "File sharing platform" description.fr = "Plateforme de partage de fichiers" -version = "4.2.1~ynh1" +version = "4.2.5~ynh1" maintainers = ["salamandar"] @@ -47,14 +47,14 @@ ram.runtime = "50M" [resources.sources.main] in_subdir = false - amd64.url = "https://download.pydio.com/pub/cells/release/4.2.1/linux-amd64/pydio-cells-4.2.1-linux-amd64.zip" - amd64.sha256 = "76caea1aca6c408fb43be49dc5e2193ccf5db9add449476a188bc725c5989849" + amd64.url = "https://download.pydio.com/pub/cells/release/4.2.5/linux-amd64/pydio-cells-4.2.5-linux-amd64.zip" + amd64.sha256 = "75467de7b763ed163f3b1956a9b32bcaece52a056979763dcfe315bd2c7273db" - armhf.url = "https://download.pydio.com/pub/cells/release/4.2.1/linux-arm/pydio-cells-4.2.1-linux-arm.zip" - armhf.sha256 = "153ffd514911a164dad82e23007b2db2ebcc2c6d55d7727675e2312186eb6123" + armhf.url = "https://download.pydio.com/pub/cells/release/4.2.5/linux-arm/pydio-cells-4.2.5-linux-arm.zip" + armhf.sha256 = "b81ea76619b3d6593147014094e80fa5d659b64cc197d826236daea5d8da7baa" - arm64.url = "https://download.pydio.com/pub/cells/release/4.2.1/linux-arm64/pydio-cells-4.2.1-linux-arm64.zip" - arm64.sha256 = "0f348ff4e48db5c9231873c75bc6493c66ba790876ec7acf0b71d64a9bbb2f4a" + arm64.url = "https://download.pydio.com/pub/cells/release/4.2.5/linux-arm64/pydio-cells-4.2.5-linux-arm64.zip" + arm64.sha256 = "068d3d7a32f3d9fd87f6ccede4b4721b9e4530234269f9a638fc630da17150ba" [resources.system_user] From 73d8f90fad1a94a014403510c644890a2a502d69 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 17 Jul 2023 12:29:10 +0000 Subject: [PATCH 06/62] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3fbff60..a11120c 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Cells V4 now provides secure, cloud-native, scalable, self-hosted, open-core document sharing and collaboration without putting your data at risk. -**Shipped version:** 4.2.1~ynh1 +**Shipped version:** 4.2.5~ynh1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 94d83ae..ad62273 100644 --- a/README_fr.md +++ b/README_fr.md @@ -20,7 +20,7 @@ Favorisez la collaboration entre les équipes sans mettre vos données en danger Pydio Cells est un logiciel de partage de documents opencore, auto-hébergé, avec la sécurité pour ADN. -**Version incluse :** 4.2.1~ynh1 +**Version incluse :** 4.2.5~ynh1 ## Captures d’écran From 60dd2ff3ba5ce1597371a7ec91fcab51a348642a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 17 Jul 2023 14:48:26 +0200 Subject: [PATCH 07/62] Update manifest.toml --- manifest.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifest.toml b/manifest.toml index 57cbc53..87e6daa 100644 --- a/manifest.toml +++ b/manifest.toml @@ -65,6 +65,10 @@ ram.runtime = "50M" [resources.permissions] main.url = "/" + api.url = "/api" + api.allowed = "visitors" + api.show_tile = false + api.protected = true [resources.ports] From dc38caa9959d9beaa8f4af6b794fcddcf9f3fcf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 17 Jul 2023 15:08:34 +0200 Subject: [PATCH 08/62] Create POST_INSTALL.md --- doc/POST_INSTALL.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/POST_INSTALL.md diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md new file mode 100644 index 0000000..8bd0945 --- /dev/null +++ b/doc/POST_INSTALL.md @@ -0,0 +1,3 @@ +__DB_NAME__ +__DB_USER__ +__DB_PWD__ From 4129b1c33bd8f5d7bac1cde65e4dc87fd7428452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 17 Jul 2023 15:23:50 +0200 Subject: [PATCH 09/62] fix --- conf/install-conf.yml | 2 +- conf/nginx.conf | 4 ++-- conf/systemd.service | 6 +++--- manifest.toml | 3 +++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/conf/install-conf.yml b/conf/install-conf.yml index 8c030ab..fc3d830 100644 --- a/conf/install-conf.yml +++ b/conf/install-conf.yml @@ -1,7 +1,7 @@ # Basic no-TLS config for the embedded gateway proxyconfig: binds: - - localhost:__PORT__ + - 127.0.0.1:__PORT__ reverseproxyurl: https://__DOMAIN__ tlsconfig: selfsigned: diff --git a/conf/nginx.conf b/conf/nginx.conf index ed70286..1589b56 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,12 +1,12 @@ location / { - proxy_pass https://localhost:__PORT__; + proxy_pass https://127.0.0.1:__PORT__; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } location /ws/ { - proxy_pass https://localhost:__PORT__; + proxy_pass https://127.0.0.1:__PORT__; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; diff --git a/conf/systemd.service b/conf/systemd.service index 36716ab..f66a0da 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -12,7 +12,7 @@ WorkingDirectory=__INSTALL_DIR__/ PermissionsStartOnly=true AmbientCapabilities=CAP_NET_BIND_SERVICE -ExecStart=__INSTALL_DIR__/cells start +ExecStart=__INSTALL_DIR__/cells start --grpc_discovery_port __PORT_DISCOVERY_GRPC__ --grpc_port __PORT_GRPC__ Restart=on-failure StandardOutput=journal StandardError=inherit @@ -24,8 +24,8 @@ SuccessExitStatus=0 # Add environment variables Environment=CELLS_ENABLE_METRICS=false -# Environment=CELLS_WORKING_DIR=__INSTALL_DIR__ -# Environment=CELLS_DATA_DIR=__DATA_DIR__ +Environment=CELLS_WORKING_DIR=__INSTALL_DIR__ +Environment=CELLS_DATA_DIR=__DATA_DIR__ [Install] WantedBy=multi-user.target diff --git a/manifest.toml b/manifest.toml index 87e6daa..2ebbca4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -71,6 +71,9 @@ ram.runtime = "50M" api.protected = true [resources.ports] + main.default = 8080 + discovery_grpc.default = 50051 + grpc.default = 50052 [resources.apt] packages = "mariadb-server" From e58382729c6ed934205c55c3d9e9bd2d3d2667cb Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 29 Sep 2023 14:33:56 +0000 Subject: [PATCH 10/62] Auto-update README --- README.md | 1 - README_fr.md | 1 - 2 files changed, 2 deletions(-) diff --git a/README.md b/README.md index a11120c..4d925f1 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,6 @@ Cells V4 now provides secure, cloud-native, scalable, self-hosted, open-core doc * Official app website: * Official admin documentation: * Upstream app code repository: -* YunoHost documentation for this app: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index ad62273..c5751a9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -31,7 +31,6 @@ Pydio Cells est un logiciel de partage de documents opencore, auto-hébergé, av * Site officiel de l’app : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : -* Documentation YunoHost pour cette app : * Signaler un bug : ## Informations pour les développeurs From 3d09a54ac352464b37243150e6a264f22473664d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 29 Sep 2023 16:36:47 +0200 Subject: [PATCH 11/62] cleaning --- manifest.toml | 2 +- scripts/backup | 15 --------------- scripts/change_url | 4 ++-- scripts/install | 15 +++++---------- scripts/remove | 4 ---- scripts/restore | 10 ++-------- scripts/upgrade | 22 +++------------------- 7 files changed, 13 insertions(+), 59 deletions(-) diff --git a/manifest.toml b/manifest.toml index 2ebbca4..156b3c6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -18,7 +18,7 @@ cpe = "cpe:2.3:a:pydio:cells" fund = "https://pydio.com/en/pricing" [integration] -yunohost = ">= 11.1.21" +yunohost = ">= 11.2" architectures = ["amd64", "armhf", "arm64"] multi_instance = true ldap = false diff --git a/scripts/backup b/scripts/backup index ebf2cf1..4606e12 100755 --- a/scripts/backup +++ b/scripts/backup @@ -34,21 +34,6 @@ ynh_backup --src_path="$data_dir" --is_big ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP FAIL2BAN CONFIGURATION -#================================================= - -# ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" -# ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" - -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= - -# ynh_backup --src_path="/etc/logrotate.d/$app" - #================================================= # BACKUP SYSTEMD #================================================= diff --git a/scripts/change_url b/scripts/change_url index ae914ad..3a9b28d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF @@ -32,7 +32,7 @@ ynh_change_url_nginx_config #================================================= 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" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index d92e899..8c94655 100755 --- a/scripts/install +++ b/scripts/install @@ -29,25 +29,20 @@ ynh_add_nginx_config ynh_add_systemd_config -yunohost service add "$app" --description="Pydio - A file sharing platform" --log="/var/log/$app/$app.log" - -# ynh_use_logrotate - -# Create a dedicated Fail2Ban config -# ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" +yunohost service add "$app" --description="File sharing platform" --log="/var/log/$app/$app.log" #================================================= # APP INITIAL CONFIGURATION #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Configuring Pydio..." --weight=1 +ynh_script_progression --message="Configuring $app..." --weight=1 ynh_add_config --template="install-conf.yml" --destination="$install_dir/install-conf.yml" -pushd "$install_dir" || ynh_die +pushd "$install_dir" ynh_exec_as "$app" ./cells configure --cli --yaml "$install_dir/install-conf.yml" -popd || ynh_die +popd ynh_secure_remove --file="$install_dir/install-conf.yml" ynh_delete_file_checksum --file="$install_dir/install-conf.yml" @@ -59,7 +54,7 @@ ynh_delete_file_checksum --file="$install_dir/install-conf.yml" #================================================= 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" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 8686684..46cdd26 100755 --- a/scripts/remove +++ b/scripts/remove @@ -25,10 +25,6 @@ ynh_remove_systemd_config ynh_remove_nginx_config -# ynh_remove_logrotate - -# ynh_remove_fail2ban_config - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 105e37c..f3625de 100755 --- a/scripts/restore +++ b/scripts/restore @@ -46,13 +46,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable "$app.service" --quiet -yunohost service add "$app" --description="Pydio - A file sharing platform" --log="/var/log/$app/$app.log" - -# ynh_restore_file --origin_path="/etc/logrotate.d/$app" - -# ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" -# ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" -# ynh_systemd_action --action=restart --service_name=fail2ban +yunohost service add "$app" --description="File sharing platform" --log="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION @@ -61,7 +55,7 @@ yunohost service add "$app" --description="Pydio - A file sharing platform" --lo #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ccf013c..a809b5c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,7 +23,7 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" #================================================= # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) @@ -49,30 +49,14 @@ ynh_add_nginx_config ynh_add_systemd_config -yunohost service add "$app" --description="Pydio - A file sharing platform" --log="/var/log/$app/$app.log" - -# ynh_use_logrotate --non-append - -# ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" - -#================================================= -# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) -#================================================= -# UPDATE A CONFIG FILE -#================================================= -#ynh_script_progression --message="Updating a configuration file..." --weight=1 - -#ynh_add_config --template="some_config_file" --destination="$install_dir/some_config_file" - -#chmod 400 "$install_dir/some_config_file" -#chown $app:$app "$install_dir/some_config_file" +yunohost service add "$app" --description="File sharing platform" --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" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # END OF SCRIPT From d1384268c3fe6aa5d714308f65b122cc9e8807f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 29 Sep 2023 16:57:13 +0200 Subject: [PATCH 12/62] Update install --- scripts/install | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 8c94655..c09f0f0 100755 --- a/scripts/install +++ b/scripts/install @@ -38,14 +38,14 @@ yunohost service add "$app" --description="File sharing platform" --log="/var/lo #================================================= ynh_script_progression --message="Configuring $app..." --weight=1 -ynh_add_config --template="install-conf.yml" --destination="$install_dir/install-conf.yml" +ynh_add_config --template="install-conf.yaml" --destination="$install_dir/install-conf.yaml" pushd "$install_dir" - ynh_exec_as "$app" ./cells configure --cli --yaml "$install_dir/install-conf.yml" + ynh_exec_as "$app" ./cells configure --cli --yaml "$install_dir/install-conf.yaml" popd -ynh_secure_remove --file="$install_dir/install-conf.yml" -ynh_delete_file_checksum --file="$install_dir/install-conf.yml" +ynh_secure_remove --file="$install_dir/install-conf.yaml" +ynh_delete_file_checksum --file="$install_dir/install-conf.yaml" #================================================= # GENERIC FINALIZATION From d98aff61977af37be9adaf1e75286a9aa03c0cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 29 Sep 2023 16:57:32 +0200 Subject: [PATCH 13/62] Update upgrade --- scripts/upgrade | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index a809b5c..fc2cf85 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -11,13 +11,6 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# STANDARD UPGRADE STEPS -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - #================================================= # STOP SYSTEMD SERVICE #================================================= From 31d40c5d879501a5f243e3fdc53907a6661336e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 23 Nov 2023 17:38:26 +0100 Subject: [PATCH 14/62] fix --- manifest.toml | 3 +++ scripts/install | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index 156b3c6..765552d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -21,8 +21,11 @@ fund = "https://pydio.com/en/pricing" yunohost = ">= 11.2" architectures = ["amd64", "armhf", "arm64"] multi_instance = true + ldap = false + sso = false + disk = "50M" ram.build = "50M" ram.runtime = "50M" diff --git a/scripts/install b/scripts/install index c09f0f0..8c94655 100755 --- a/scripts/install +++ b/scripts/install @@ -38,14 +38,14 @@ yunohost service add "$app" --description="File sharing platform" --log="/var/lo #================================================= ynh_script_progression --message="Configuring $app..." --weight=1 -ynh_add_config --template="install-conf.yaml" --destination="$install_dir/install-conf.yaml" +ynh_add_config --template="install-conf.yml" --destination="$install_dir/install-conf.yml" pushd "$install_dir" - ynh_exec_as "$app" ./cells configure --cli --yaml "$install_dir/install-conf.yaml" + ynh_exec_as "$app" ./cells configure --cli --yaml "$install_dir/install-conf.yml" popd -ynh_secure_remove --file="$install_dir/install-conf.yaml" -ynh_delete_file_checksum --file="$install_dir/install-conf.yaml" +ynh_secure_remove --file="$install_dir/install-conf.yml" +ynh_delete_file_checksum --file="$install_dir/install-conf.yml" #================================================= # GENERIC FINALIZATION From 7ffd1b002c653d4039738f015a6ad566694f8cef Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 23 Nov 2023 16:38:30 +0000 Subject: [PATCH 15/62] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 4d925f1..08d9ef1 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ Cells V4 now provides secure, cloud-native, scalable, self-hosted, open-core doc * Official app website: * Official admin documentation: * Upstream app code repository: +* YunoHost Store: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index c5751a9..58412d0 100644 --- a/README_fr.md +++ b/README_fr.md @@ -31,6 +31,7 @@ Pydio Cells est un logiciel de partage de documents opencore, auto-hébergé, av * Site officiel de l’app : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : +* YunoHost Store: * Signaler un bug : ## Informations pour les développeurs From 6c05f8a8c142bdfb0ed51ddb7341cc89985742ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 23 Nov 2023 17:42:37 +0100 Subject: [PATCH 16/62] Update manifest.toml --- manifest.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifest.toml b/manifest.toml index 765552d..47787a0 100644 --- a/manifest.toml +++ b/manifest.toml @@ -50,14 +50,14 @@ ram.runtime = "50M" [resources.sources.main] in_subdir = false - amd64.url = "https://download.pydio.com/pub/cells/release/4.2.5/linux-amd64/pydio-cells-4.2.5-linux-amd64.zip" - amd64.sha256 = "75467de7b763ed163f3b1956a9b32bcaece52a056979763dcfe315bd2c7273db" + amd64.url = "https://download.pydio.com/pub/cells/release/4.3.1/linux-amd64/pydio-cells-4.3.1-linux-amd64.zip" + amd64.sha256 = "966337451cf007ff9294f15db830cda128162604bb44ccd91510fae292c790ee" - armhf.url = "https://download.pydio.com/pub/cells/release/4.2.5/linux-arm/pydio-cells-4.2.5-linux-arm.zip" - armhf.sha256 = "b81ea76619b3d6593147014094e80fa5d659b64cc197d826236daea5d8da7baa" + armhf.url = "https://download.pydio.com/pub/cells/release/4.3.1/linux-arm/pydio-cells-4.3.1-linux-arm.zip" + armhf.sha256 = "af200d58f3efd917bf8add2a0e8bfb3bc832780cca470070530afa6bb1caefd0" - arm64.url = "https://download.pydio.com/pub/cells/release/4.2.5/linux-arm64/pydio-cells-4.2.5-linux-arm64.zip" - arm64.sha256 = "068d3d7a32f3d9fd87f6ccede4b4721b9e4530234269f9a638fc630da17150ba" + arm64.url = "https://download.pydio.com/pub/cells/release/4.3.1/linux-arm64/pydio-cells-4.3.1-linux-arm64.zip" + arm64.sha256 = "840d9a85e15892b52dd549152bef240015584b82feace9137e8b5b1660e80c43" [resources.system_user] From f13c0bc3b7770dbd128069df7f5efe7ae66d492a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 23 Nov 2023 17:42:51 +0100 Subject: [PATCH 17/62] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 47787a0..a2c0283 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Pydio" description.en = "File sharing platform" description.fr = "Plateforme de partage de fichiers" -version = "4.2.5~ynh1" +version = "4.3.1~ynh1" maintainers = ["salamandar"] From 2879f6a11d4fd317f41bbae58ef11a2771146ca8 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 23 Nov 2023 16:43:01 +0000 Subject: [PATCH 18/62] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 08d9ef1..1a85473 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Cells V4 now provides secure, cloud-native, scalable, self-hosted, open-core document sharing and collaboration without putting your data at risk. -**Shipped version:** 4.2.5~ynh1 +**Shipped version:** 4.3.1~ynh1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 58412d0..e234207 100644 --- a/README_fr.md +++ b/README_fr.md @@ -20,7 +20,7 @@ Favorisez la collaboration entre les équipes sans mettre vos données en danger Pydio Cells est un logiciel de partage de documents opencore, auto-hébergé, avec la sécurité pour ADN. -**Version incluse :** 4.2.5~ynh1 +**Version incluse :** 4.3.1~ynh1 ## Captures d’écran From ca2e4af7cf967a6c48b93e44dc90b7357e8eb9e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 23 Nov 2023 17:45:04 +0100 Subject: [PATCH 19/62] Update POST_INSTALL.md --- doc/POST_INSTALL.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index 8bd0945..8d475a2 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -1,3 +1,4 @@ -__DB_NAME__ -__DB_USER__ -__DB_PWD__ +Database credentials +Database name: __DB_NAME__ +Database user: __DB_USER__ +Database password: __DB_PWD__ From 185d744f1e93481870a1805bc7fc122d86250911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 23 Nov 2023 17:54:01 +0100 Subject: [PATCH 20/62] fix --- manifest.toml | 3 --- scripts/restore | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index a2c0283..f4f115f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -49,13 +49,10 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - in_subdir = false amd64.url = "https://download.pydio.com/pub/cells/release/4.3.1/linux-amd64/pydio-cells-4.3.1-linux-amd64.zip" amd64.sha256 = "966337451cf007ff9294f15db830cda128162604bb44ccd91510fae292c790ee" - armhf.url = "https://download.pydio.com/pub/cells/release/4.3.1/linux-arm/pydio-cells-4.3.1-linux-arm.zip" armhf.sha256 = "af200d58f3efd917bf8add2a0e8bfb3bc832780cca470070530afa6bb1caefd0" - arm64.url = "https://download.pydio.com/pub/cells/release/4.3.1/linux-arm64/pydio-cells-4.3.1-linux-arm64.zip" arm64.sha256 = "840d9a85e15892b52dd549152bef240015584b82feace9137e8b5b1660e80c43" diff --git a/scripts/restore b/scripts/restore index f3625de..e705210 100755 --- a/scripts/restore +++ b/scripts/restore @@ -28,6 +28,7 @@ ynh_restore_file --origin_path="$data_dir" --not_mandatory # (Same as for install dir) chown -R "$app:www-data" "$data_dir" +chmod +x "install_dir/cells" #================================================= # RESTORE THE MYSQL DATABASE From fa57afac01d7fd5ba98a8c9c1962d41639ea59cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 23 Nov 2023 17:54:30 +0100 Subject: [PATCH 21/62] Update install --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 8c94655..56c08f8 100755 --- a/scripts/install +++ b/scripts/install @@ -19,6 +19,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" chown -R "$app:www-data" "$install_dir" +chmod +x "install_dir/cells" #================================================= # SYSTEM CONFIGURATION From c7a13a5260994e1f878cf722af143c9b19db8e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 23 Nov 2023 17:55:35 +0100 Subject: [PATCH 22/62] Update upgrade --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index fc2cf85..61646ec 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,6 +32,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]; then fi chown -R "$app:www-data" "$install_dir" +chmod +x "install_dir/cells" #================================================= # REAPPLY SYSTEM CONFIGURATIONS From 0b91eaee8533b9a69987c0111065ca7c04822178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 23 Nov 2023 17:56:53 +0100 Subject: [PATCH 23/62] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 56c08f8..99e6e23 100755 --- a/scripts/install +++ b/scripts/install @@ -42,7 +42,7 @@ ynh_script_progression --message="Configuring $app..." --weight=1 ynh_add_config --template="install-conf.yml" --destination="$install_dir/install-conf.yml" pushd "$install_dir" - ynh_exec_as "$app" ./cells configure --cli --yaml "$install_dir/install-conf.yml" + ynh_exec_as $app ./cells configure --cli --yaml "$install_dir/install-conf.yml" popd ynh_secure_remove --file="$install_dir/install-conf.yml" From 17ab15235bec1439ee0b35a27732cc7782238ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 23 Nov 2023 17:57:59 +0100 Subject: [PATCH 24/62] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 99e6e23..6224e9b 100755 --- a/scripts/install +++ b/scripts/install @@ -19,7 +19,7 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_setup_source --dest_dir="$install_dir" chown -R "$app:www-data" "$install_dir" -chmod +x "install_dir/cells" +chmod +x "$install_dir/cells" #================================================= # SYSTEM CONFIGURATION From 68fccaa2bd10e057ad85faac5cdc35c0a2bb3456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 23 Nov 2023 17:58:21 +0100 Subject: [PATCH 25/62] fix --- scripts/restore | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index e705210..054c519 100755 --- a/scripts/restore +++ b/scripts/restore @@ -28,7 +28,7 @@ ynh_restore_file --origin_path="$data_dir" --not_mandatory # (Same as for install dir) chown -R "$app:www-data" "$data_dir" -chmod +x "install_dir/cells" +chmod +x "$install_dir/cells" #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index 61646ec..b8b166f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,7 +32,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]; then fi chown -R "$app:www-data" "$install_dir" -chmod +x "install_dir/cells" +chmod +x "$install_dir/cells" #================================================= # REAPPLY SYSTEM CONFIGURATIONS From 6786e779be8059870ea33df1003f76fd3e369033 Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 3 Dec 2023 08:16:07 +0100 Subject: [PATCH 26/62] Update doc/POST_INSTALL.md Co-authored-by: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> --- doc/POST_INSTALL.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index 8d475a2..2cee078 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -1,4 +1,5 @@ -Database credentials -Database name: __DB_NAME__ -Database user: __DB_USER__ -Database password: __DB_PWD__ +### Database credentials + +- Database name: __DB_NAME__ +- Database user: __DB_USER__ +- Database password: __DB_PWD__ From 14324d2824138c227207c3226c9552504a075553 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 3 Dec 2023 08:17:43 +0100 Subject: [PATCH 27/62] Update DESCRIPTION_fr.md --- doc/DESCRIPTION_fr.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index fbec72c..f94852d 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1,2 +1 @@ -Favorisez la collaboration entre les équipes sans mettre vos données en danger. -Pydio Cells est un logiciel de partage de documents opencore, auto-hébergé, avec la sécurité pour ADN. +Cells V4 offre désormais un partage et une collaboration de documents sécurisés, cloud natifs, évolutifs, auto-hébergés et open-core sans mettre vos données en danger. From 47f02ea9ca4acdfcc4f2fe528f5771c60190649f Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 3 Dec 2023 07:17:46 +0000 Subject: [PATCH 28/62] Auto-update README --- README_fr.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README_fr.md b/README_fr.md index e234207..836f3df 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,8 +16,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -Favorisez la collaboration entre les équipes sans mettre vos données en danger. -Pydio Cells est un logiciel de partage de documents opencore, auto-hébergé, avec la sécurité pour ADN. +Cells V4 offre désormais un partage et une collaboration de documents sécurisés, cloud natifs, évolutifs, auto-hébergés et open-core sans mettre vos données en danger. **Version incluse :** 4.3.1~ynh1 From ff80741eca349e257da0bea9c1356c56245fb3cd Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 3 Dec 2023 08:20:30 +0100 Subject: [PATCH 29/62] cleaning --- scripts/config | 102 ------------------------------------------------- tests.toml | 4 -- 2 files changed, 106 deletions(-) delete mode 100644 scripts/config diff --git a/scripts/config b/scripts/config deleted file mode 100644 index dca69fb..0000000 --- a/scripts/config +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash -# In simple cases, you don't need a config script. - -# With a simple config_panel.toml, you can write in the app settings, in the -# upstream config file or replace complete files (logo ...) and restart services. - -# The config scripts allows you to go further, to handle specific cases -# (validation of several interdependent fields, specific getter/setter for a value, -# display dynamic informations or choices, pre-loading of config type .cube... ). - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source /usr/share/yunohost/helpers - -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - -#================================================= -# SPECIFIC GETTERS FOR TOML SHORT KEY -#================================================= - -get__amount() { - # Here we can imagine to have an API call to stripe to know the amount of donation during a month - local amount = 200 - - # It's possible to change some properties of the question by overriding it: - if [ $amount -gt 100 ] - then - cat << EOF -style: success -value: $amount -ask: - en: A lot of donation this month: **$amount €** -EOF - else - cat << EOF -style: danger -value: $amount -ask: - en: Not so much donation this month: $amount € -EOF - fi -} - -get__prices() { - local prices = "$(grep "DONATION\['" "$install_dir/settings.py" | sed -r "s@^DONATION\['([^']*)'\]\['([^']*)'\] = '([^']*)'@\1/\2/\3@g" | sed -z 's/\n/,/g;s/,$/\n/')" - if [ "$prices" == "," ]; - then - # Return YNH_NULL if you prefer to not return a value at all. - echo YNH_NULL - else - echo $prices - fi -} - - -#================================================= -# SPECIFIC VALIDATORS FOR TOML SHORT KEYS -#================================================= -validate__publishable_key() { - - # We can imagine here we test if the key is really a publisheable key - (is_secret_key $publishable_key) && - echo 'This key seems to be a secret key' -} - -#================================================= -# SPECIFIC SETTERS FOR TOML SHORT KEYS -#================================================= -set__prices() { - - #--------------------------------------------- - # IMPORTANT: setter are trigger only if a change is detected - #--------------------------------------------- - for price in $(echo $prices | sed "s/,/ /"); do - frequency=$(echo $price | cut -d/ -f1) - currency=$(echo $price | cut -d/ -f2) - price_id=$(echo $price | cut -d/ -f3) - sed "d/DONATION\['$frequency'\]\['$currency'\]" "$install_dir/settings.py" - - echo "DONATION['$frequency']['$currency'] = '$price_id'" >> "$install_dir/settings.py" - done - - #--------------------------------------------- - # IMPORTANT: to be able to upgrade properly, you have to saved the value in settings too - #--------------------------------------------- - ynh_app_setting_set $app prices $prices -} - -#================================================= -# GENERIC FINALIZATION -#================================================= -ynh_app_config_run $1 diff --git a/tests.toml b/tests.toml index d9de67f..1869a65 100644 --- a/tests.toml +++ b/tests.toml @@ -2,9 +2,5 @@ test_format = 1.0 [default] - # The test IDs to be used in only/exclude statements are: install.root, install.subdir, - # install.nourl, install.multi, backup_restore, upgrade, upgrade.someCommitId change_url - exclude = ["install.subdir", "install.nourl", "change_url"] - # test_upgrade_from.00a1a6e7.name = "Upgrade from 5.4" # test_upgrade_from.00a1a6e7.args.foo = "bar" From 608af510580019e8db298a5529e146fda65522fa Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 3 Dec 2023 08:21:49 +0100 Subject: [PATCH 30/62] Update restore --- scripts/restore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index 054c519..4a92bc2 100755 --- a/scripts/restore +++ b/scripts/restore @@ -18,6 +18,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" chown -R "$app:www-data" "$install_dir" +chmod +x "$install_dir/cells" #================================================= # RESTORE THE DATA DIRECTORY @@ -26,9 +27,7 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_restore_file --origin_path="$data_dir" --not_mandatory -# (Same as for install dir) chown -R "$app:www-data" "$data_dir" -chmod +x "$install_dir/cells" #================================================= # RESTORE THE MYSQL DATABASE From e955344e864636f1b308b23ba55854f2da7d4777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 15:56:05 +0100 Subject: [PATCH 31/62] Add subdir=false to resources --- manifest.toml | 19 ++++++++++--------- tests.toml | 2 ++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/manifest.toml b/manifest.toml index f4f115f..d29cd83 100644 --- a/manifest.toml +++ b/manifest.toml @@ -1,3 +1,5 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json + packaging_format = 2 id = "pydio" @@ -23,7 +25,6 @@ architectures = ["amd64", "armhf", "arm64"] multi_instance = true ldap = false - sso = false disk = "50M" @@ -47,14 +48,14 @@ ram.runtime = "50M" [resources] [resources.sources] - - [resources.sources.main] - amd64.url = "https://download.pydio.com/pub/cells/release/4.3.1/linux-amd64/pydio-cells-4.3.1-linux-amd64.zip" - amd64.sha256 = "966337451cf007ff9294f15db830cda128162604bb44ccd91510fae292c790ee" - armhf.url = "https://download.pydio.com/pub/cells/release/4.3.1/linux-arm/pydio-cells-4.3.1-linux-arm.zip" - armhf.sha256 = "af200d58f3efd917bf8add2a0e8bfb3bc832780cca470070530afa6bb1caefd0" - arm64.url = "https://download.pydio.com/pub/cells/release/4.3.1/linux-arm64/pydio-cells-4.3.1-linux-arm64.zip" - arm64.sha256 = "840d9a85e15892b52dd549152bef240015584b82feace9137e8b5b1660e80c43" + [resources.sources.main] + amd64.url = "https://download.pydio.com/pub/cells/release/4.3.1/linux-amd64/pydio-cells-4.3.1-linux-amd64.zip" + amd64.sha256 = "966337451cf007ff9294f15db830cda128162604bb44ccd91510fae292c790ee" + arm64.url = "https://download.pydio.com/pub/cells/release/4.3.1/linux-arm64/pydio-cells-4.3.1-linux-arm64.zip" + arm64.sha256 = "840d9a85e15892b52dd549152bef240015584b82feace9137e8b5b1660e80c43" + armhf.url = "https://download.pydio.com/pub/cells/release/4.3.1/linux-arm/pydio-cells-4.3.1-linux-arm.zip" + armhf.sha256 = "af200d58f3efd917bf8add2a0e8bfb3bc832780cca470070530afa6bb1caefd0" + in_subdir = false [resources.system_user] diff --git a/tests.toml b/tests.toml index 1869a65..3081978 100644 --- a/tests.toml +++ b/tests.toml @@ -1,3 +1,5 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json + test_format = 1.0 [default] From bd2ba7b32272108b4d32d565ece68617ba342828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 16:18:08 +0100 Subject: [PATCH 32/62] manifestv2 bis --- check_process | 21 ------ conf/app.src | 6 -- conf/install-conf.yml | 2 +- conf/systemd.service | 10 +-- manifest.json | 47 ------------- manifest.toml | 77 ++++++++++++++++++++ scripts/_common.sh | 3 - scripts/backup | 20 +++--- scripts/install | 158 +++++------------------------------------- scripts/remove | 34 ++++----- scripts/restore | 54 +++++++-------- scripts/upgrade | 50 ++++++------- tests.toml | 7 ++ 13 files changed, 186 insertions(+), 303 deletions(-) delete mode 100644 check_process delete mode 100644 conf/app.src delete mode 100644 manifest.json create mode 100644 manifest.toml create mode 100644 tests.toml diff --git a/check_process b/check_process deleted file mode 100644 index 0b52ab7..0000000 --- a/check_process +++ /dev/null @@ -1,21 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - admin="john" - password="1Strong-Password" - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=0 - setup_public=1 - upgrade=1 - #upgrade=1 from_commit=CommitHash - backup_restore=1 - multi_instance=1 - port_already_use=0 - change_url=0 -;;; Options -Email= -Notification=none diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index d6af588..0000000 --- a/conf/app.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://download.pydio.com/pub/cells/release/3.0.9/linux-amd64/cells -SOURCE_SUM=4272ca1e10f2ca08d08d7d08d440d4b6e3d09ba37235f54bdbac1ac7c29b2aaa -SOURCE_SUM_PRG=sha256sum -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=cells -SOURCE_EXTRACT=false diff --git a/conf/install-conf.yml b/conf/install-conf.yml index c353510..76f0403 100644 --- a/conf/install-conf.yml +++ b/conf/install-conf.yml @@ -19,4 +19,4 @@ dbtcpname: __DB_NAME__ dbtcpuser: __DB_USER__ dbtcppassword: __DB_PWD__ -dsfolder: __DATADIR__ \ No newline at end of file +dsfolder: __DATA_DIR__ \ No newline at end of file diff --git a/conf/systemd.service b/conf/systemd.service index 461e17f..00786ca 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -3,16 +3,16 @@ Description=Pydio Cells Documentation=https://pydio.com Wants=network-online.target After=network-online.target -AssertFileIsExecutable=__FINALPATH__/cells +AssertFileIsExecutable=__INSTALL_DIR__/cells [Service] User=__APP__ Group=__APP__ -WorkingDirectory=__DATADIR__/ +WorkingDirectory=__DATA_DIR__/ PermissionsStartOnly=true AmbientCapabilities=CAP_NET_BIND_SERVICE -ExecStart=__FINALPATH__/cells start +ExecStart=__INSTALL_DIR__/cells start Restart=on-failure StandardOutput=journal StandardError=inherit @@ -24,8 +24,8 @@ SuccessExitStatus=0 # Add environment variables Environment=CELLS_ENABLE_METRICS=false -# Environment=CELLS_WORKING_DIR=__FINALPATH__ -# Environment=CELLS_DATA_DIR=__DATADIR__ +# Environment=CELLS_WORKING_DIR=__INSTALL_DIR__ +# Environment=CELLS_DATA_DIR=__DATA_DIR__ [Install] WantedBy=multi-user.target diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 2e56cc3..0000000 --- a/manifest.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "Pydio", - "id": "pydio", - "packaging_format": 1, - "description": { - "en": "File sharing platform", - "fr": "Plateforme de partage de fichiers" - }, - "version": "3.0.9~ynh1", - "url": "https://pydio.com", - "upstream": { - "license": "AGPL-3.0-or-later", - "website": "https://pydio.com", - "admindoc": "https://pydio.com/en/docs/", - "code": "https://github.com/pydio/cells" - }, - "license": "AGPL-3.0-or-later", - "maintainer": { - "name": "julienmalik", - "email": "julien.malik@paraiso.me", - "url": "https://github.com/julienmalik" - }, - "requirements": { - "yunohost": ">= 11.1.21" - }, - "multi_instance": true, - "services": [ - "nginx", - "mysql" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "admin", - "type": "user" - }, - { - "name": "password", - "type": "password" - } - ] - } -} diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..99c6f3e --- /dev/null +++ b/manifest.toml @@ -0,0 +1,77 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json + +packaging_format = 2 + +id = "pydio" +name = "Pydio" +description.en = "File sharing platform" +description.fr = "Plateforme de partage de fichiers" + +version = "3.0.9~ynh2" + +maintainers = ["julienmalik"] + +[upstream] +license = "AGPL-3.0-or-later" +website = "https://pydio.com" +admindoc = "https://pydio.com/en/docs/" +code = "https://github.com/pydio/cells" +cpe = "cpe:2.3:a:pydio:cells" +fund = "https://pydio.com/en/pricing" + +[integration] +yunohost = ">= 11.1.21" +architectures = ["amd64"] +multi_instance = true +ldap = false +sso = false + +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + [install.domain] + type = "domain" + + [install.init_main_permission] + type = "group" + default = "visitors" + + [install.admin] + type = "user" + + [install.password] + type = "password" + +[resources] + [resources.sources.main] + url = "https://download.pydio.com/pub/cells/release/3.0.9/linux-amd64/cells" + sha256 = "4272ca1e10f2ca08d08d7d08d440d4b6e3d09ba37235f54bdbac1ac7c29b2aaa" + in_subdir = false + + [resources.system_user] + + [resources.install_dir] + + [resources.data_dir] + group = "www-data:rwx" + + [resources.permissions] + main.url = "/" + api.url = "/api" + api.allowed = "visitors" + api.show_tile = false + api.protected = true + + [resources.ports] + main.default = 8080 + + [resources.apt] + packages = [ + "acl", + "mariadb-server", + ] + + [resources.database] + type = "mysql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 82e3b11..944a65e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#pkg_dependencies="acl" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 44e4951..772d3ef 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,23 +14,23 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -41,13 +41,13 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP THE DATA DIR #================================================= -ynh_backup --src_path="$datadir" --is_big +ynh_backup --src_path="$data_dir" --is_big #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/install b/scripts/install index 986f1ee..e919f6c 100644 --- a/scripts/install +++ b/scripts/install @@ -9,152 +9,44 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -domain=$YNH_APP_ARG_DOMAIN -path_url="/" -admin=$YNH_APP_ARG_ADMIN -password=$YNH_APP_ARG_PASSWORD - -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -ynh_script_progression --message="Validating installation parameters..." - -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -ynh_script_progression --message="Storing installation settings..." - -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=admin --value=$admin - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -ynh_script_progression --message="Finding an available port..." - -# Find an available port -port=$(ynh_find_port --port=8080) -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..." -# ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port - -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." - -# Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" - -#================================================= -# CREATE A MYSQL DATABASE -#================================================= -ynh_script_progression --message="Creating a MySQL database..." - -db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$db_name -ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." -ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" +ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" -chmod +x "$final_path/cells" +chmod +x "$install_dir/cells" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." - -# Create a dedicated NGINX config -ynh_add_nginx_config - -#================================================= -# SPECIFIC SETUP -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." - -datadir=/home/yunohost.app/$app -ynh_app_setting_set --app=$app --key=datadir --value=$datadir - -mkdir -p $datadir - -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # ADD A CONFIGURATION #================================================= ynh_script_progression --message="Adding a configuration file..." -ynh_add_config --template="../conf/install-conf.yml" --destination="$final_path/install-conf.yml" -ynh_delete_file_checksum --file="$final_path/install-conf.yml" +ynh_add_config --template="../conf/install-conf.yml" --destination="$install_dir/install-conf.yml" +ynh_delete_file_checksum --file="$install_dir/install-conf.yml" -pushd "$final_path" - ynh_exec_as $app ./cells configure --cli --yaml "$final_path/install-conf.yml" +pushd "$install_dir" + ynh_exec_as "$app" ./cells configure --cli --yaml "./install-conf.yml" popd - -ynh_secure_remove --file="$final_path/install-conf.yml" +ynh_secure_remove --file="$install_dir/install-conf.yml" #================================================= -# SETUP SYSTEMD +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring a systemd service..." +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 + +# Create a dedicated NGINX config +ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config - -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - -yunohost service add $app +yunohost service add "$app" --description="File sharing platform" #================================================= # START SYSTEMD SERVICE @@ -162,23 +54,7 @@ yunohost service add $app ynh_script_progression --message="Starting a systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Restart done" - -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Configuring permissions..." - -# Everyone can access the app. -# The "main" permission is automatically created before the install script. -ynh_permission_update --permission="main" --add="visitors" - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." - -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Restart done" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 909874e..de5d7e0 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,16 +12,16 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -port=$(ynh_app_setting_get --app=$app --key=port) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # STANDARD REMOVE @@ -47,18 +47,18 @@ ynh_remove_systemd_config #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Removing the MySQL database..." +#REMOVEME? ynh_script_progression --message="Removing the MySQL database..." # Remove a database if it exists, along with the associated user -ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +#REMOVEME? ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." +#REMOVEME? ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE DATA DIR @@ -68,7 +68,7 @@ ynh_secure_remove --file="$final_path" if [ "${YNH_APP_PURGE:-0}" -eq 1 ] then ynh_script_progression --message="Removing app data directory..." - ynh_secure_remove --file="$datadir" +#REMOVEME? ynh_secure_remove --file="$data_dir" fi #================================================= @@ -82,10 +82,10 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." +#REMOVEME? ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies -ynh_remove_app_dependencies +#REMOVEME? ynh_remove_app_dependencies #================================================= # SPECIFIC REMOVE @@ -99,10 +99,10 @@ ynh_script_progression --message="Removing various files..." #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 39b0fde..1c0b405 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,33 +14,33 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # STANDARD RESTORATION STEPS @@ -54,44 +54,44 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." +#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # RESTORE THE DATA DIRECTORY #================================================= ynh_script_progression --message="Restoring the data directory..." -ynh_restore_file --origin_path="$datadir" --not_mandatory +ynh_restore_file --origin_path="$data_dir" --not_mandatory -mkdir -p $datadir +mkdir -p $data_dir -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:www-data "$data_dir" #================================================= # SPECIFIC RESTORATION #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the MySQL database..." +#REMOVEME? ynh_script_progression --message="Restoring the MySQL database..." -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index bed3926..8fb54f5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,17 +12,17 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +#REMOVEME? ynh_script_progression --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -admin=$(ynh_app_setting_get --app=$app --key=admin) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -port=$(ynh_app_setting_get --app=$app --key=port) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # CHECK VERSION @@ -33,17 +33,17 @@ 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)..." +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { ynh_clean_check_starting # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS @@ -60,8 +60,8 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app ynh_script_progression --message="Ensuring downward compatibility..." # Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all +#REMOVEME? if ynh_legacy_permissions_exists; then +#REMOVEME? ynh_legacy_permissions_delete_all ynh_app_setting_delete --app=$app --key=is_public fi @@ -69,10 +69,10 @@ fi #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." +#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -83,13 +83,13 @@ then ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$install_dir" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" -chmod +x "$final_path/cells" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" +chmod +x "$install_dir/cells" #================================================= # NGINX CONFIGURATION @@ -128,9 +128,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..2f34722 --- /dev/null +++ b/tests.toml @@ -0,0 +1,7 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json + +test_format = 1.0 + +[default] + + test_upgrade_from.5725c85c09f1d3b76d12a4dc4d367ec911cd0019.name = "Last packaging v2 version" From ad1b541617f59a4945d25bd515948c48578f420a Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 28 Jan 2024 15:18:13 +0000 Subject: [PATCH 33/62] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1b3ccbc..b067987 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 File sharing platform -**Shipped version:** 3.0.9~ynh1 +**Shipped version:** 3.0.9~ynh2 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 03207eb..bb77681 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Plateforme de partage de fichiers -**Version incluse :** 3.0.9~ynh1 +**Version incluse :** 3.0.9~ynh2 ## Captures d’écran From 8905a403df517c569667420b48bd4998d2159dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 16:21:46 +0100 Subject: [PATCH 34/62] fix url --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 99c6f3e..d0eb03f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -46,8 +46,8 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources] [resources.sources.main] - url = "https://download.pydio.com/pub/cells/release/3.0.9/linux-amd64/cells" - sha256 = "4272ca1e10f2ca08d08d7d08d440d4b6e3d09ba37235f54bdbac1ac7c29b2aaa" + url = "https://download.pydio.com/pub/cells/release/3.0.9/linux-amd64/pydio-cells-3.0.9-linux-amd64.zip" + sha256 = "54b1f92dcaa0204f0b2e6ebb1daff0d4911d0b1c60d68acacfeb6290170dd4a8" in_subdir = false [resources.system_user] From d031a21e4c565bd342423a6c3351a59f092e59ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 16:26:50 +0100 Subject: [PATCH 35/62] finalize manifestv2 --- scripts/backup | 22 ------------ scripts/remove | 82 +++--------------------------------------- scripts/restore | 92 +++++++---------------------------------------- scripts/upgrade | 96 ++++++------------------------------------------- 4 files changed, 29 insertions(+), 263 deletions(-) diff --git a/scripts/backup b/scripts/backup index 772d3ef..6c13dbb 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,28 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/remove b/scripts/remove index de5d7e0..969710b 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,99 +10,27 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEM CONFIGURATIONS #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null -then - ynh_script_progression --message="Removing $app service integration..." - yunohost service remove $app +if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then + yunohost service remove "$app" fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE THE MYSQL DATABASE -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the MySQL database..." - -# Remove a database if it exists, along with the associated user -#REMOVEME? ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - -#================================================= -# REMOVE DATA DIR -#================================================= - -# Remove the data directory if --purge option is used -if [ "${YNH_APP_PURGE:-0}" -eq 1 ] -then - ynh_script_progression --message="Removing app data directory..." -#REMOVEME? ynh_secure_remove --file="$data_dir" -fi - -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." - # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." - -# Remove metapackage and its dependencies -#REMOVEME? ynh_remove_app_dependencies - #================================================= # SPECIFIC REMOVE #================================================= # REMOVE VARIOUS FILES #================================================= -ynh_script_progression --message="Removing various files..." - -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." - -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app +# ynh_script_progression --message="Removing various files..." #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 1c0b405..b2ca40e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,55 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." - -# Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -66,8 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= @@ -77,51 +26,36 @@ ynh_script_progression --message="Restoring the data directory..." ynh_restore_file --origin_path="$data_dir" --not_mandatory -mkdir -p $data_dir - chmod 750 "$data_dir" chmod -R o-rwx "$data_dir" -chown -R $app:www-data "$data_dir" +chown -R "$app:www-data" "$data_dir" -#================================================= -# SPECIFIC RESTORATION #================================================= # RESTORE THE MYSQL DATABASE #================================================= -#REMOVEME? ynh_script_progression --message="Restoring the MySQL database..." +ynh_script_progression --message="Restoring the MySQL database..." --weight=1 -#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql +ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql #================================================= -# RESTORE SYSTEMD +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service --quiet - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - -yunohost service add $app - -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." - -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Restart done" +systemctl enable "$app.service" --quiet +yunohost service add "$app" #================================================= # GENERIC FINALIZATION #================================================= -# RELOAD NGINX +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 + +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Restart done" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 8fb54f5..f2ae69f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,42 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - ynh_clean_check_starting - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -59,78 +23,40 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= ynh_script_progression --message="Ensuring downward compatibility..." -# Cleaning legacy permissions -#REMOVEME? if ynh_legacy_permissions_exists; then -#REMOVEME? ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." +ynh_exec_warn ls -lah "$install_dir" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" -fi +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$install_dir" --full_replace=1 + +chmod +x "$install_dir/cells" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" -chmod +x "$install_dir/cells" +chown -R "$app:www-data" "$install_dir" #================================================= -# NGINX CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC UPGRADE -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." - # Create a dedicated systemd config ynh_add_systemd_config - -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." - -yunohost service add $app +yunohost service add "$app" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Restart done" - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Restart done" #================================================= # END OF SCRIPT From cb5dbba9619fb1c33490ee8649e121a19e3c3974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 16:47:10 +0100 Subject: [PATCH 36/62] Keep on upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index f2ae69f..c1dc40d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -31,7 +31,7 @@ ynh_script_progression --message="Upgrading source files..." ynh_exec_warn ls -lah "$install_dir" # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" --full_replace=1 +ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".config .minio" chmod +x "$install_dir/cells" From 6126805b62ca27512ced7efc652953a86ef50500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 17:08:37 +0100 Subject: [PATCH 37/62] Remove fixmes --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index d0eb03f..19a0390 100644 --- a/manifest.toml +++ b/manifest.toml @@ -26,9 +26,9 @@ multi_instance = true ldap = false sso = false -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +disk = "50M" +ram.build = "500M" +ram.runtime = "500M" [install] [install.domain] From 02fa26390a82f787cf7a52cd49c8feed98e3cb26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 17:10:55 +0100 Subject: [PATCH 38/62] Remove debug --- scripts/upgrade | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index c1dc40d..4150871 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -28,8 +28,6 @@ ynh_script_progression --message="Ensuring downward compatibility..." #================================================= ynh_script_progression --message="Upgrading source files..." -ynh_exec_warn ls -lah "$install_dir" - # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".config .minio" From 325b814b8451adc61e113f9c7f64576e33bf59ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 17:12:48 +0100 Subject: [PATCH 39/62] Disable change_url --- tests.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests.toml b/tests.toml index 2f34722..b2d03a7 100644 --- a/tests.toml +++ b/tests.toml @@ -4,4 +4,6 @@ test_format = 1.0 [default] + exclude = ["change_url"] + test_upgrade_from.5725c85c09f1d3b76d12a4dc4d367ec911cd0019.name = "Last packaging v2 version" From 4248ab2f6ad47991e1d20fd560962ba3e5542170 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 28 Jan 2024 16:22:29 +0000 Subject: [PATCH 40/62] Auto-update README --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 1cb13de..836f3df 100644 --- a/README_fr.md +++ b/README_fr.md @@ -45,4 +45,4 @@ ou sudo yunohost app upgrade pydio -u https://github.com/YunoHost-Apps/pydio_ynh/tree/testing --debug ``` -**Plus d’infos sur le packaging d’applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file From 03332d241c63475f9a932c92074a14ffcd545548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 17:22:58 +0100 Subject: [PATCH 41/62] Remove useless gitattributes --- .gitattributes | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 6f9a98b..0000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -tests.toml.example linguist-language=toml -config_panel.toml.example linguist-language=toml From c5abf15d87b17e9289ac521902c4c5c1b890cfbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 17:25:21 +0100 Subject: [PATCH 42/62] Cleanup --- README.md | 2 +- README_fr.md | 2 +- conf/install-conf.yml | 2 +- manifest.toml | 2 +- scripts/backup | 8 +------- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b067987..4c9336e 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ File sharing platform ## Documentation and resources * Official app website: -* Official admin documentation: +* Official admin documentation: * Upstream app code repository: * YunoHost Store: * Report a bug: diff --git a/README_fr.md b/README_fr.md index bb77681..84fcf4d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,7 +27,7 @@ Plateforme de partage de fichiers ## Documentations et ressources * Site officiel de l’app : -* Documentation officielle de l’admin : +* Documentation officielle de l’admin : * Dépôt de code officiel de l’app : * YunoHost Store: * Signaler un bug : diff --git a/conf/install-conf.yml b/conf/install-conf.yml index 76f0403..8c030ab 100644 --- a/conf/install-conf.yml +++ b/conf/install-conf.yml @@ -19,4 +19,4 @@ dbtcpname: __DB_NAME__ dbtcpuser: __DB_USER__ dbtcppassword: __DB_PWD__ -dsfolder: __DATA_DIR__ \ No newline at end of file +dsfolder: __DATA_DIR__ diff --git a/manifest.toml b/manifest.toml index 19a0390..60b77de 100644 --- a/manifest.toml +++ b/manifest.toml @@ -14,7 +14,7 @@ maintainers = ["julienmalik"] [upstream] license = "AGPL-3.0-or-later" website = "https://pydio.com" -admindoc = "https://pydio.com/en/docs/" +admindoc = "https://pydio.com/en/docs" code = "https://github.com/pydio/cells" cpe = "cpe:2.3:a:pydio:cells" fund = "https://pydio.com/en/pricing" diff --git a/scripts/backup b/scripts/backup index 6c13dbb..ea3891d 100644 --- a/scripts/backup +++ b/scripts/backup @@ -28,17 +28,11 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="$data_dir" --is_big #================================================= -# BACKUP THE NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= From 9e64ef64d474aa6215a0c278e878c22b28bb0d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 17:29:31 +0100 Subject: [PATCH 43/62] Add missing --weight --- scripts/install | 8 ++++---- scripts/remove | 2 +- scripts/restore | 6 +++--- scripts/upgrade | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/install b/scripts/install index e919f6c..45f15f9 100644 --- a/scripts/install +++ b/scripts/install @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." +ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" @@ -26,7 +26,7 @@ chown -R "$app:www-data" "$install_dir" #================================================= # 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/install-conf.yml" --destination="$install_dir/install-conf.yml" ynh_delete_file_checksum --file="$install_dir/install-conf.yml" @@ -51,7 +51,7 @@ yunohost service add "$app" --description="File sharing platform" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Restart done" @@ -60,4 +60,4 @@ ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" - # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/remove b/scripts/remove index 969710b..e2a26db 100644 --- a/scripts/remove +++ b/scripts/remove @@ -36,4 +36,4 @@ ynh_remove_nginx_config # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index b2ca40e..1eeae3e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring the app main directory..." --weight=1 ynh_restore_file --origin_path="$install_dir" @@ -22,7 +22,7 @@ chown -R $app:www-data "$install_dir" #================================================= # RESTORE THE DATA DIRECTORY #================================================= -ynh_script_progression --message="Restoring the data directory..." +ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_restore_file --origin_path="$data_dir" --not_mandatory @@ -63,4 +63,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index 4150871..a71c2ee 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -14,19 +14,19 @@ source /usr/share/yunohost/helpers #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." +ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Upgrading source files..." +ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".config .minio" @@ -52,7 +52,7 @@ yunohost service add "$app" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Restart done" @@ -60,4 +60,4 @@ ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" - # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" +ynh_script_progression --message="Upgrade of $app completed" --last From db13e648d2acd3a38cb42b50d25fee60703c31f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 17:31:41 +0100 Subject: [PATCH 44/62] Fix execution perms --- scripts/backup | 0 scripts/install | 0 scripts/remove | 0 scripts/restore | 0 scripts/upgrade | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/backup mode change 100644 => 100755 scripts/install mode change 100644 => 100755 scripts/remove mode change 100644 => 100755 scripts/restore mode change 100644 => 100755 scripts/upgrade diff --git a/scripts/backup b/scripts/backup old mode 100644 new mode 100755 diff --git a/scripts/install b/scripts/install old mode 100644 new mode 100755 diff --git a/scripts/remove b/scripts/remove old mode 100644 new mode 100755 diff --git a/scripts/restore b/scripts/restore old mode 100644 new mode 100755 diff --git a/scripts/upgrade b/scripts/upgrade old mode 100644 new mode 100755 From 50bc03d1d1d6b87464608565412e37f62dd03abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 17:43:51 +0100 Subject: [PATCH 45/62] Fix: set cells_worging_dir --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 568478a..f5c640d 100755 --- a/scripts/install +++ b/scripts/install @@ -32,7 +32,7 @@ ynh_add_config --template="../conf/install-conf.yml" --destination="$install_dir ynh_delete_file_checksum --file="$install_dir/install-conf.yml" pushd "$install_dir" - ynh_exec_as "$app" ./cells configure --cli --yaml "./install-conf.yml" + ynh_exec_as "$app" env CELLS_WORKING_DIR="$install_dir" ./cells configure --cli --yaml "./install-conf.yml" popd ynh_secure_remove --file="$install_dir/install-conf.yml" From 8ab857ba7738b4ccb06b1938921e6f13b0a8067f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 17:52:59 +0100 Subject: [PATCH 46/62] Fix yunohost service add calls --- scripts/restore | 2 +- scripts/upgrade | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/restore b/scripts/restore index 1eeae3e..3b8a18b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -46,7 +46,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable "$app.service" --quiet -yunohost service add "$app" +yunohost service add "$app" --description="File sharing platform" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index a71c2ee..76f35aa 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -47,7 +47,7 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config -yunohost service add "$app" +yunohost service add "$app" --description="File sharing platform" #================================================= # START SYSTEMD SERVICE From a402005fb64752b1af04b8eb268beca16e5a4a40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 18:10:49 +0100 Subject: [PATCH 47/62] Cleanup --- scripts/change_url | 4 ++-- scripts/install | 2 +- scripts/upgrade | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 3a9b28d..546471e 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF @@ -32,7 +32,7 @@ ynh_change_url_nginx_config #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index f5c640d..469ea6f 100755 --- a/scripts/install +++ b/scripts/install @@ -46,7 +46,7 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config -yunohost service add "$app" --description="File sharing platform" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="File sharing platform" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 098b05f..d331288 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -42,6 +42,7 @@ chown -R "$app:www-data" "$install_dir" #================================================= ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 +# Create a dedicated NGINX config ynh_add_nginx_config # Create a dedicated systemd config From 7bd1ae57da0587157badd75c70454baac378fe1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 18:11:34 +0100 Subject: [PATCH 48/62] Fix working directory envvar --- conf/systemd.service | 2 +- scripts/install | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index f66a0da..47d883d 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -24,7 +24,7 @@ SuccessExitStatus=0 # Add environment variables Environment=CELLS_ENABLE_METRICS=false -Environment=CELLS_WORKING_DIR=__INSTALL_DIR__ +# Environment=CELLS_WORKING_DIR=__INSTALL_DIR__ Environment=CELLS_DATA_DIR=__DATA_DIR__ [Install] diff --git a/scripts/install b/scripts/install index 469ea6f..8af695d 100755 --- a/scripts/install +++ b/scripts/install @@ -32,7 +32,10 @@ ynh_add_config --template="../conf/install-conf.yml" --destination="$install_dir ynh_delete_file_checksum --file="$install_dir/install-conf.yml" pushd "$install_dir" - ynh_exec_as "$app" env CELLS_WORKING_DIR="$install_dir" ./cells configure --cli --yaml "./install-conf.yml" + # See https://pydio.com/fr/docs/cells/v4/working-directories + ynh_exec_as "$app" env \ + CELLS_DATA_DIR="$data_dir" \ + ./cells configure --cli --yaml "./install-conf.yml" popd ynh_secure_remove --file="$install_dir/install-conf.yml" From d7971a753be2e2ee62badd52e871512496b15f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 18:19:57 +0100 Subject: [PATCH 49/62] Remove post install doc --- doc/POST_INSTALL.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 doc/POST_INSTALL.md diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md deleted file mode 100644 index 2cee078..0000000 --- a/doc/POST_INSTALL.md +++ /dev/null @@ -1,5 +0,0 @@ -### Database credentials - -- Database name: __DB_NAME__ -- Database user: __DB_USER__ -- Database password: __DB_PWD__ From 5a44d3c8b19cea09d3c78b025b9f8a8ccb7bf0a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 18:20:51 +0100 Subject: [PATCH 50/62] Remove line match on systemd start --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 8af695d..c78cfe9 100755 --- a/scripts/install +++ b/scripts/install @@ -57,7 +57,7 @@ yunohost service add "$app" --description="File sharing platform" ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Restart done" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 243a498..ec770e5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -53,7 +53,7 @@ yunohost service add "$app" --description="File sharing platform" #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Restart done" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d331288..ca0ccb8 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,7 +54,7 @@ yunohost service add "$app" --description="File sharing platform" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Restart done" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" #================================================= # END OF SCRIPT From 0a9e64314d11eb250f16dc9d2b6cd37a2614251c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 18:25:38 +0100 Subject: [PATCH 51/62] Bump ram usage to 700M --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index cd95fc1..2cf76bf 100644 --- a/manifest.toml +++ b/manifest.toml @@ -28,8 +28,8 @@ ldap = false sso = false disk = "50M" -ram.build = "500M" -ram.runtime = "500M" +ram.build = "700M" +ram.runtime = "700M" [install] [install.domain] From 56e4482e57e9c45974aeb77fcdd51d0bcbdbfbc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 19:03:57 +0100 Subject: [PATCH 52/62] Add --line_match='Index connected' to systemctl start pydio --- scripts/change_url | 2 +- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 546471e..4f5d2e5 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -32,7 +32,7 @@ ynh_change_url_nginx_config #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Index connected" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index c78cfe9..b3ea073 100755 --- a/scripts/install +++ b/scripts/install @@ -57,7 +57,7 @@ yunohost service add "$app" --description="File sharing platform" ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Index connected" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index ec770e5..4d386d9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -53,7 +53,7 @@ yunohost service add "$app" --description="File sharing platform" #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Index connected" ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ca0ccb8..b8a6ab1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,7 +54,7 @@ yunohost service add "$app" --description="File sharing platform" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Index connected" #================================================= # END OF SCRIPT From a1218cc4984596ac4094e45e172fc5dc629368b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 19:35:04 +0100 Subject: [PATCH 53/62] Fix line_match --- scripts/change_url | 2 +- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 4f5d2e5..a18765d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -32,7 +32,7 @@ ynh_change_url_nginx_config #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Index connected" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="pydio.gateway.websocket ready" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index b3ea073..42f53fd 100755 --- a/scripts/install +++ b/scripts/install @@ -57,7 +57,7 @@ yunohost service add "$app" --description="File sharing platform" ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Index connected" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="pydio.gateway.websocket ready" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 4d386d9..9fcfea9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -53,7 +53,7 @@ yunohost service add "$app" --description="File sharing platform" #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Index connected" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="pydio.gateway.websocket ready" ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b8a6ab1..9f8d5c2 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,7 +54,7 @@ yunohost service add "$app" --description="File sharing platform" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Index connected" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="pydio.gateway.websocket ready" #================================================= # END OF SCRIPT From dbd647b84ce3bcbefd3fbe57a9c22fc2ffa8b870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 19:52:00 +0100 Subject: [PATCH 54/62] fix line_match --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 42f53fd..2491901 100755 --- a/scripts/install +++ b/scripts/install @@ -57,7 +57,7 @@ yunohost service add "$app" --description="File sharing platform" ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="pydio.gateway.websocket ready" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="pydio.grpc.oauth ready" #================================================= # END OF SCRIPT From 58b91388f0c26cd15b995197d1de99e2566ae850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 20:02:24 +0100 Subject: [PATCH 55/62] Add sleep 10 --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 2491901..35341ea 100755 --- a/scripts/install +++ b/scripts/install @@ -58,6 +58,7 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="pydio.grpc.oauth ready" +sleep 10 #================================================= # END OF SCRIPT From ae93389c26bf7d3ef74c970a04f66e1486e2104e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 21:02:08 +0100 Subject: [PATCH 56/62] reword tests.toml --- tests.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index b2d03a7..302b5d0 100644 --- a/tests.toml +++ b/tests.toml @@ -6,4 +6,4 @@ test_format = 1.0 exclude = ["change_url"] - test_upgrade_from.5725c85c09f1d3b76d12a4dc4d367ec911cd0019.name = "Last packaging v2 version" + test_upgrade_from.5725c85c09f1d3b76d12a4dc4d367ec911cd0019.name = "Last packaging v1 version" From 6ea96018213cb755752ea48c7ae47d0954e4a66f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 21:04:42 +0100 Subject: [PATCH 57/62] 60s sleep for debug --- scripts/install | 4 +++- scripts/upgrade | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 35341ea..66d504b 100755 --- a/scripts/install +++ b/scripts/install @@ -58,7 +58,9 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="pydio.grpc.oauth ready" -sleep 10 +sleep 60 + +ynh_exec_warn journalctl -xu "$app.service" #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index 9f8d5c2..0855f96 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,7 +54,10 @@ yunohost service add "$app" --description="File sharing platform" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="pydio.gateway.websocket ready" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="pydio.grpc.oauth ready" +sleep 60 + +ynh_exec_warn journalctl -xu "$app.service" #================================================= # END OF SCRIPT From cf19fb9466ca0d6cf9ed44e2652d6927ef90f562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 22:49:01 +0100 Subject: [PATCH 58/62] Cleanup debuggings --- scripts/change_url | 2 +- scripts/install | 5 +---- scripts/restore | 2 +- scripts/upgrade | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index a18765d..546471e 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -32,7 +32,7 @@ ynh_change_url_nginx_config #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="pydio.gateway.websocket ready" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 66d504b..c78cfe9 100755 --- a/scripts/install +++ b/scripts/install @@ -57,10 +57,7 @@ yunohost service add "$app" --description="File sharing platform" ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="pydio.grpc.oauth ready" -sleep 60 - -ynh_exec_warn journalctl -xu "$app.service" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 9fcfea9..ec770e5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -53,7 +53,7 @@ yunohost service add "$app" --description="File sharing platform" #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="pydio.gateway.websocket ready" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 0855f96..80ceea3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,8 +54,7 @@ yunohost service add "$app" --description="File sharing platform" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="pydio.grpc.oauth ready" -sleep 60 +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" ynh_exec_warn journalctl -xu "$app.service" From ccf13c79ec1a8ebbdb595a272ce7b4a3c3de886e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 22:49:15 +0100 Subject: [PATCH 59/62] Fix upgrade from version listening on ipv6 --- scripts/upgrade | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 80ceea3..6946a9a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,6 +23,13 @@ ynh_systemd_action --service_name="$app" --action="stop" #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +# Previous installs might have been listening on local ipv6 +if ynh_compare_current_package_version --comparison lt "4.3.1~ynh1"; then + jq ".defaults.sites[0].Binds[0] = \"127.0.0.1:$port\"" "$install_dir/.config/pydio/cells/pydio.json" \ + > "$install_dir/_pydio.json" + mv "$install_dir/_pydio.json" "$install_dir/.config/pydio/cells/pydio.json" +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= From 53025382b0c6ca8b8c2d82c17599e6f5bbd60554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 28 Jan 2024 23:43:25 +0100 Subject: [PATCH 60/62] For testing purposes, change the port numbers --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 2cf76bf..23438e4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -74,7 +74,7 @@ ram.runtime = "700M" [resources.ports] main.default = 8080 discovery_grpc.default = 50051 - grpc.default = 50052 + grpc.default = 50053 [resources.apt] packages = [ From cc34234704f36477d882df7e53193eacf4c0504a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 29 Jan 2024 11:07:48 +0100 Subject: [PATCH 61/62] Fix compare_current_package_version --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6946a9a..90b3db1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,7 +24,7 @@ ynh_systemd_action --service_name="$app" --action="stop" ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # Previous installs might have been listening on local ipv6 -if ynh_compare_current_package_version --comparison lt "4.3.1~ynh1"; then +if ynh_compare_current_package_version --comparison lt --version "4.3.1~ynh1"; then jq ".defaults.sites[0].Binds[0] = \"127.0.0.1:$port\"" "$install_dir/.config/pydio/cells/pydio.json" \ > "$install_dir/_pydio.json" mv "$install_dir/_pydio.json" "$install_dir/.config/pydio/cells/pydio.json" From 61ee3fd8e9a93cc7566630e82fa99a34f7ee5e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 29 Jan 2024 12:20:59 +0100 Subject: [PATCH 62/62] Remove debug --- scripts/upgrade | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 90b3db1..9265a63 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -63,8 +63,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" -ynh_exec_warn journalctl -xu "$app.service" - #================================================= # END OF SCRIPT #=================================================