From dd8150481a39bac60907f8e0a6cc1ba2574ca6dd Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 26 Jun 2022 07:47:19 +0200 Subject: [PATCH 01/18] 3.4.20 --- conf/app.src | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/app.src b/conf/app.src index df01f47..80810f7 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/timvisee/send/archive/refs/tags/v3.4.18.tar.gz -SOURCE_SUM=6b7cf37a47a49a6b2518af8dec9d426f65fdd8bfdb27e72b11d5219cf198ae2e +SOURCE_URL=https://github.com/timvisee/send/archive/refs/tags/v3.4.20.tar.gz +SOURCE_SUM=d8b485383f5f2fdca98501e1abdacec158b2eb04a7a8a4dabae2a0d4f542c6e4 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 2be226e..3639d2f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "File sharing which allows to send encrypted files", "fr": "Partage de fichiers qui permet d'envoyer des fichiers chiffrés" }, - "version": "3.4.18~ynh1", + "version": "3.4.20~ynh1", "url": "https://github.com/timvisee/send", "upstream": { "license": "MPL-2.0", From f50ec4c3f2b0b8186e742dc692718c02e5219f13 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 26 Jun 2022 05:47:24 +0000 Subject: [PATCH 02/18] Auto-update README --- README.md | 19 ++++++++++--------- README_fr.md | 25 +++++++++++++++---------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index f981532..b688adb 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Send for YunoHost -[![Integration level](https://dash.yunohost.org/integration/send.svg)](https://dash.yunohost.org/appci/app/send) ![](https://ci-apps.yunohost.org/ci/badges/send.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/send.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/send.svg)](https://dash.yunohost.org/appci/app/send) ![Working status](https://ci-apps.yunohost.org/ci/badges/send.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/send.maintain.svg) [![Install Send with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=send) *[Lire ce readme en français.](./README_fr.md)* @@ -19,13 +19,13 @@ A fork of Mozilla's Firefox Send. Mozilla discontinued Send, this fork is a comm Send is a file sharing experiment which allows you to send encrypted files to other users. -**Shipped version:** 3.4.18~ynh1 +**Shipped version:** 3.4.20~ynh1 **Demo:** https://send.vis.ee/ ## Screenshots -![](./doc/screenshots/screenshot.png) +![Screenshot of Send](./doc/screenshots/screenshot.png) ## Disclaimers / important information @@ -36,20 +36,21 @@ You can configure things such as the max file size, max downloads, or max file e ## Documentation and resources -* Official app website: https://send.vis.ee/ -* Upstream app code repository: https://github.com/timvisee/send -* YunoHost documentation for this app: https://yunohost.org/app_send -* Report a bug: https://github.com/YunoHost-Apps/send_ynh/issues +* Official app website: +* 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/send_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/send_ynh/tree/testing --debug or sudo yunohost app upgrade send -u https://github.com/YunoHost-Apps/send_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 08699bc..c35150f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # Send pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/send.svg)](https://dash.yunohost.org/appci/app/send) ![](https://ci-apps.yunohost.org/ci/badges/send.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/send.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/send.svg)](https://dash.yunohost.org/appci/app/send) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/send.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/send.maintain.svg) [![Installer Send avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=send) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer Send 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.* @@ -15,13 +19,13 @@ Un fork du Firefox Send de Mozilla. Mozilla a arrêté Send, et ce fork est un e Send est une expérience de partage de fichiers qui permet d'envoyer des fichiers chiffrés à d'autres utilisateurs. -**Version incluse :** 3.4.18~ynh1 +**Version incluse :** 3.4.20~ynh1 **Démo :** https://send.vis.ee/ ## Captures d'écran -![](./doc/screenshots/screenshot.png) +![Capture d'écran de Send](./doc/screenshots/screenshot.png) ## Avertissements / informations importantes @@ -32,20 +36,21 @@ Vous pouvez configurer des paramètres tels que les taille de fichier, nombre de ## Documentations et ressources -* Site officiel de l'app : https://send.vis.ee/ -* Dépôt de code officiel de l'app : https://github.com/timvisee/send -* Documentation YunoHost pour cette app : https://yunohost.org/app_send -* Signaler un bug : https://github.com/YunoHost-Apps/send_ynh/issues +* Site officiel de l'app : +* 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/send_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/send_ynh/tree/testing --debug ou sudo yunohost app upgrade send -u https://github.com/YunoHost-Apps/send_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 :** From f4d9f40daf319a7046d68ada835881db8dfd5124 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 26 Jun 2022 07:50:56 +0200 Subject: [PATCH 03/18] Cleaning up --- scripts/install | 6 ------ scripts/restore | 3 ++- scripts/upgrade | 35 ++++++++++------------------------- 3 files changed, 12 insertions(+), 32 deletions(-) diff --git a/scripts/install b/scripts/install index f0d7fc4..5074b60 100644 --- a/scripts/install +++ b/scripts/install @@ -123,12 +123,6 @@ chown $app "$final_path/server/config.js" #============================================== ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=20 -#pushd "$final_path" -# ynh_use_nodejs -# ynh_exec_warn_less ynh_npm install -# ynh_exec_warn_less ynh_npm run build -#popd - pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install diff --git a/scripts/restore b/scripts/restore index 557566d..1911c37 100644 --- a/scripts/restore +++ b/scripts/restore @@ -35,7 +35,8 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=2 -test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path \ + || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS diff --git a/scripts/upgrade b/scripts/upgrade index 051eb59..7f114f6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,15 @@ port=$(ynh_app_setting_get --app=$app --key=port) upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# STANDARD UPGRADE STEPS +#================================================= +# STOP SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Stopping a systemd service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -41,15 +50,6 @@ ynh_clean_setup () { # 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..." --weight=1 - -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" - #================================================= # CREATE DEDICATED USER #================================================= @@ -66,23 +66,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=10 - # Create a temporary directory - tmpdir="$(mktemp -d)" - - # Backup the config file in the temp dir - cp -a "$final_path/server/config.js" "$tmpdir/config.js" - - # Remove the app directory securely - ynh_secure_remove --file=$final_path - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir=$final_path - - #Copy the admin saved settings from tmp directory to final path - cp -a "$tmpdir/config.js" "$final_path/server/config.js" - - # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" + ynh_setup_source --dest_dir=$final_path --keep="$final_path/server/config.js" fi chmod 750 "$final_path" From 313bfd5515d5a073e3a95faa6f9a5dc2fcdf2c23 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 26 Jun 2022 08:27:53 +0200 Subject: [PATCH 04/18] Update install --- scripts/install | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 5074b60..c3b2d33 100644 --- a/scripts/install +++ b/scripts/install @@ -125,8 +125,10 @@ ynh_script_progression --message="Building $app... (this will take some time and pushd "$final_path" ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install - ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm run build + #ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install + #ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm run build + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm npm install + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build popd #================================================= From f1b8dd8806dd73cb9e539f7c1bf6dc479c9377f9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 26 Jun 2022 08:30:47 +0200 Subject: [PATCH 05/18] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index c3b2d33..8b1066f 100644 --- a/scripts/install +++ b/scripts/install @@ -127,7 +127,7 @@ pushd "$final_path" ynh_use_nodejs #ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install #ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm run build - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm npm install + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build popd From 3a5034bb0725dd407d9a497387c711143ac6bca8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 26 Jun 2022 08:36:04 +0200 Subject: [PATCH 06/18] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 3dbfaac..0fdf85a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -nodejs_version=16 +nodejs_version=18 #================================================= # PERSONAL HELPERS From 175a285a8dd8ad5af95d7627f5050dae5a6d2985 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 26 Jun 2022 08:36:39 +0200 Subject: [PATCH 07/18] Update install --- scripts/install | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 8b1066f..3b08b34 100644 --- a/scripts/install +++ b/scripts/install @@ -125,10 +125,8 @@ ynh_script_progression --message="Building $app... (this will take some time and pushd "$final_path" ynh_use_nodejs - #ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install - #ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm run build ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH build popd #================================================= From d9c023006c733549c0ef7a2a00e1299bdb37b262 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 26 Jun 2022 08:42:44 +0200 Subject: [PATCH 08/18] Update install --- scripts/install | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 3b08b34..1738a3d 100644 --- a/scripts/install +++ b/scripts/install @@ -125,8 +125,10 @@ ynh_script_progression --message="Building $app... (this will take some time and pushd "$final_path" ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH build + npm install + npm run build + #ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install + #ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build popd #================================================= From 0245ed4acb0c70d322a0bfe186c0db3b1de04107 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 26 Jun 2022 08:50:38 +0200 Subject: [PATCH 09/18] Update install --- scripts/install | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 1738a3d..1592b57 100644 --- a/scripts/install +++ b/scripts/install @@ -125,10 +125,9 @@ ynh_script_progression --message="Building $app... (this will take some time and pushd "$final_path" ynh_use_nodejs - npm install - npm run build - #ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install #ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run clean && webpack popd #================================================= From f28e087a309179ebb51b46fce21e8b80b861ef00 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 26 Jun 2022 08:59:12 +0200 Subject: [PATCH 10/18] Fix --- scripts/install | 3 +-- scripts/upgrade | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 1592b57..8143fd6 100644 --- a/scripts/install +++ b/scripts/install @@ -126,8 +126,7 @@ ynh_script_progression --message="Building $app... (this will take some time and pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install - #ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run clean && webpack + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7f114f6..d65b7d7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -103,8 +103,8 @@ then pushd "$final_path" ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install - ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm run build + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build popd fi From 219301790e7d34cbc4272c6993a5952299c1dd47 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 29 Jun 2022 02:17:46 +0200 Subject: [PATCH 11/18] Apply last example_ynh --- check_process | 9 ++++--- conf/app.src | 2 ++ conf/config.js | 65 +++++++++++++++++++++++++++++++++++++++++++++ doc/.DS_Store | Bin 6148 -> 0 bytes manifest.json | 2 +- scripts/_common.sh | 5 +++- scripts/backup | 3 ++- scripts/change_url | 8 +++--- scripts/install | 61 +++++++++++++++++++++++------------------- scripts/remove | 22 ++++++++------- scripts/restore | 20 +++++++------- scripts/upgrade | 58 ++++++++++++++++++++++------------------ 12 files changed, 172 insertions(+), 83 deletions(-) delete mode 100644 doc/.DS_Store diff --git a/check_process b/check_process index d02340b..b1ea4c6 100644 --- a/check_process +++ b/check_process @@ -10,13 +10,14 @@ setup_private=1 setup_public=1 upgrade=1 + # 3.4.14~ynh1 upgrade=1 from_commit=6e2eba4a9b6b455b35ce9d8e558c454a001bfacf + # 3.4.18~ynh1 + upgrade=1 from_commit=674f8d3211ba98b10f169deea3127a8b378c6c3c backup_restore=1 multi_instance=1 + port_already_use=0 change_url=1 ;;; Options Email= -;;; Upgrade options - ; commit=6e2eba4a9b6b455b35ce9d8e558c454a001bfacf - name=3.4.14 - manifest_arg=domain=DOMAIN&is_public=1& \ No newline at end of file +Notification=none diff --git a/conf/app.src b/conf/app.src index 80810f7..3541b63 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,3 +3,5 @@ SOURCE_SUM=d8b485383f5f2fdca98501e1abdacec158b2eb04a7a8a4dabae2a0d4f542c6e4 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= +SOURCE_EXTRACT=true diff --git a/conf/config.js b/conf/config.js index f1e57bc..805dae7 100644 --- a/conf/config.js +++ b/conf/config.js @@ -1,8 +1,11 @@ const convict = require('convict'); +const convict_format_with_validator = require('convict-format-with-validator'); const { tmpdir } = require('os'); const path = require('path'); const { randomBytes } = require('crypto'); +convict.addFormats(convict_format_with_validator); + convict.addFormat({ name: 'positive-int-array', coerce: ints => { @@ -239,6 +242,68 @@ const conf = convict({ format: String, default: 'https://github.com/timvisee/send', env: 'SEND_FOOTER_SOURCE_URL' + }, + ui_color_primary: { + format: String, + default: '#0a84ff', + env: 'UI_COLOR_PRIMARY' + }, + ui_color_accent: { + format: String, + default: '#003eaa', + env: 'UI_COLOR_ACCENT' + }, + ui_custom_assets: { + android_chrome_192px: { + format: String, + default: '', + env: 'UI_CUSTOM_ASSETS_ANDROID_CHROME_192PX' + }, + android_chrome_512px: { + format: String, + default: '', + env: 'UI_CUSTOM_ASSETS_ANDROID_CHROME_512PX' + }, + apple_touch_icon: { + format: String, + default: '', + env: 'UI_CUSTOM_ASSETS_APPLE_TOUCH_ICON' + }, + favicon_16px: { + format: String, + default: '', + env: 'UI_CUSTOM_ASSETS_FAVICON_16PX' + }, + favicon_32px: { + format: String, + default: '', + env: 'UI_CUSTOM_ASSETS_FAVICON_32PX' + }, + icon: { + format: String, + default: '', + env: 'UI_CUSTOM_ASSETS_ICON' + }, + safari_pinned_tab: { + format: String, + default: '', + env: 'UI_CUSTOM_ASSETS_SAFARI_PINNED_TAB' + }, + facebook: { + format: String, + default: '', + env: 'UI_CUSTOM_ASSETS_FACEBOOK' + }, + twitter: { + format: String, + default: '', + env: 'UI_CUSTOM_ASSETS_TWITTER' + }, + wordmark: { + format: String, + default: '', + env: 'UI_CUSTOM_ASSETS_WORDMARK' + } } }); diff --git a/doc/.DS_Store b/doc/.DS_Store deleted file mode 100644 index 89d6be550c959cabe5cee10f79099a460aff7eae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK-)mGy6h7Z(HM?eQCehX(t?X)O3@S0D7F5vQCQ+hBlqNCj4~)BeC&{fh_lBLD zP4H=@s4qU0QhgP%zDlw7Q43YUr$V7n8tfn7Kj4E;p1CtY($v=?GH03j=FB(e%)K9X zW_E}O{d4|jM1qKNTr_6aaP=Rid0kdm#`b7LnnO}Vil!;1WW{LL;S_KRylV>RwcEyP zwnlZ5{Cl&0Rj3-X)iACSWo}ew!$2i{eT&GnWLK?j&E?m$71kDqjtm_wbeDr#9E}8* zlv)#ETc8LJ=(;^=fa zkqgOEqGeS1jEd{YK$>hqh&d&{mYgeS$U)A?sXFy+CuVgTbxPJ1W0&U{wex>}&@MVU z*RB8XqYb4`cl3U~_dtKS7SGJcC{gEqPB2_i$%$DRN&lR7kH>y68A$)Eb_VK_YkySn zGmnLpstiXj29ZDBFtdzCl^OZx#!Z_){$xv`IL3@z7@H6LWcqYP)nw!c(bRY&P(d}6 zqO}9N^0{>M)@{Y2$cbk;<92T^76imExqQm*+|F#qa=ZJOYY`R8?fIfm6sv@96Ybky zD2S|3c@uf?OJ-M#W0oBlWR^PcDxc4FEq#1lUXN*}51;4VeG7HdUh-&^CVBI|OxNia zJ)np5i2k5OdOp894K5-<1M^tG zWqgY(xQc7|4&UPk+`vuT!fo8akGP9__zCy%Gald}e#LKij3;=C-|-ion`g}M(URJ* zMGN?c8*lk^8zc27jH4+Yu@t>L*m-ZH$+bB(oB~b(r@+4y&|7DTi$>34(_p%*a+P6M z^I47BxUKIJ8cP;Ei%o;fu)%~fno!s)2242jm+UytV$+}rC!{lT9y>Ga4F&1!++RwE z6Fh^ib_zHJmMhR=T%phZLvO$TFAs8_Q@|/dev/null then - ynh_script_progression --message="Removing $app service..." --weight=1 + ynh_script_progression --message="Removing $app service integration..." --weight=1 yunohost service remove $app fi @@ -49,13 +49,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight= # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 - -ynh_remove_nodejs - #================================================= # REMOVE THE REDIS DATABASE #================================================= @@ -76,9 +69,18 @@ ynh_secure_remove --file="$final_path" #================================================= ynh_script_progression --message="Removing NGINX web server configuration..." --weight=5 -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies +ynh_remove_nodejs + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index 1911c37..0658d8a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,6 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -40,13 +41,6 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -74,9 +68,17 @@ chmod +x "$final_path/server/bin/prod.js" #================================================= ynh_script_progression --message="Reinstalling dependencies..." --weight=7 -# Install Nodejs +# Define and install dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +#================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX configuration..." + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # RESTORE SYSTEMD #================================================= @@ -104,7 +106,7 @@ yunohost service add $app --description="Simple, private file sharing" --log="/v #================================================= 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="Started" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index d65b7d7..431fd9b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,9 +24,25 @@ port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # 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)..." --weight=10 + +# 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 #================================================= @@ -36,20 +52,6 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up $app before upgrading (may take a while)..." --weight=10 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - #================================================= # CREATE DEDICATED USER #================================================= @@ -75,6 +77,14 @@ chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" chmod +x "$final_path/server/bin/prod.js" +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=18 + +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + #================================================= # NGINX CONFIGURATION #================================================= @@ -83,19 +93,11 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=18 - -# Install Nodejs -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version - #================================================= # SPECIFIC UPGRADE -#================================================ +#================================================= # INSTALL SEND -#================================================ +#================================================= if [ "$upgrade_type" == "UPGRADE_APP" ] then @@ -105,17 +107,21 @@ then ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm ci --production + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm cache clean --force popd fi #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=2 +ynh_script_progression --message="Upgrading systemd configuration..." --weight=2 # Create a dedicated systemd config ynh_add_systemd_config +#================================================= +# GENERIC FINALIZATION #================================================= # SETUP LOGROTATE #================================================= @@ -136,7 +142,7 @@ yunohost service add $app --description="Simple, private file sharing" --log="/v #================================================= 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="Started" #================================================= # RELOAD NGINX From f5ab837f1380ef4c2cdfc9bbc0722310c69740a7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 29 Jun 2022 02:18:28 +0200 Subject: [PATCH 12/18] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index a07089d..b1d7f08 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "File sharing which allows to send encrypted files", "fr": "Partage de fichiers qui permet d'envoyer des fichiers chiffrés" }, - "version": "3.4.20~ynh1", + "version": "3.4.20~ynh2", "url": "https://github.com/timvisee/send", "upstream": { "license": "MPL-2.0", From 4e3ba75cd7c2353b3c21e312de99897a379fc649 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 29 Jun 2022 00:18:33 +0000 Subject: [PATCH 13/18] 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 b688adb..daf61aa 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ A fork of Mozilla's Firefox Send. Mozilla discontinued Send, this fork is a comm Send is a file sharing experiment which allows you to send encrypted files to other users. -**Shipped version:** 3.4.20~ynh1 +**Shipped version:** 3.4.20~ynh2 **Demo:** https://send.vis.ee/ diff --git a/README_fr.md b/README_fr.md index c35150f..5858fb4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Un fork du Firefox Send de Mozilla. Mozilla a arrêté Send, et ce fork est un e Send est une expérience de partage de fichiers qui permet d'envoyer des fichiers chiffrés à d'autres utilisateurs. -**Version incluse :** 3.4.20~ynh1 +**Version incluse :** 3.4.20~ynh2 **Démo :** https://send.vis.ee/ From aa44a41477f8ddb57eca497c94ab4239b0ea5640 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 1 Jul 2022 01:08:17 +0200 Subject: [PATCH 14/18] Fix upgrade from same version --- scripts/install | 2 -- scripts/upgrade | 2 -- 2 files changed, 4 deletions(-) diff --git a/scripts/install b/scripts/install index c9670b5..c512970 100644 --- a/scripts/install +++ b/scripts/install @@ -117,8 +117,6 @@ pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm ci --production - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm cache clean --force popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 431fd9b..232bc73 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -107,8 +107,6 @@ then ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm install ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm ci --production - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm cache clean --force popd fi From e624704d269f00ce1179570244077372f2b20cdc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 1 Jul 2022 01:13:09 +0200 Subject: [PATCH 15/18] Remove /var/log There is no `/var/log` --- scripts/backup | 6 ------ scripts/change_url | 2 +- scripts/install | 10 +--------- scripts/remove | 8 -------- scripts/restore | 9 +-------- scripts/upgrade | 17 ++++++++--------- 6 files changed, 11 insertions(+), 41 deletions(-) diff --git a/scripts/backup b/scripts/backup index 889bc9c..65e96c1 100644 --- a/scripts/backup +++ b/scripts/backup @@ -47,12 +47,6 @@ ynh_backup --src_path="$final_path" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP LOGROTATE -#================================================= - -ynh_backup --src_path="/etc/logrotate.d/$app" - #================================================= # BACKUP SYSTEMD #================================================= diff --git a/scripts/change_url b/scripts/change_url index 114e437..4048293 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -71,7 +71,7 @@ fi #================================================= 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" #================================================= # MODIFY URL IN NGINX CONF diff --git a/scripts/install b/scripts/install index c512970..78378f3 100644 --- a/scripts/install +++ b/scripts/install @@ -137,20 +137,12 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 - -# Use logrotate to manage application logfile(s) -ynh_use_logrotate - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description="Simple, private file sharing" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Simple, private file sharing" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/remove b/scripts/remove index cbf5a33..c9f2b99 100644 --- a/scripts/remove +++ b/scripts/remove @@ -41,14 +41,6 @@ ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - -# Remove the app-specific logrotate config -ynh_remove_logrotate - #================================================= # REMOVE THE REDIS DATABASE #================================================= diff --git a/scripts/restore b/scripts/restore index 0658d8a..eb12d4b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -87,19 +87,12 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/logrotate.d/$app" - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description="Simple, private file sharing" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Simple, private file sharing" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 232bc73..57b1f50 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -52,6 +52,13 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." + +ynh_remove_logrotate + #================================================= # CREATE DEDICATED USER #================================================= @@ -120,20 +127,12 @@ ynh_add_systemd_config #================================================= # GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 - -# Use logrotate to manage app-specific logfile(s) -ynh_use_logrotate --non-append - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description="Simple, private file sharing" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Simple, private file sharing" #================================================= # START SYSTEMD SERVICE From 109734146c0430441d024065fb5283118d671f25 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 1 Jul 2022 01:13:52 +0200 Subject: [PATCH 16/18] better start --- 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 4048293..08e6228 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -123,7 +123,7 @@ chown $app:$app "$final_path/server/config.js" 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="Started" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index 78378f3..5ccc2cd 100644 --- a/scripts/install +++ b/scripts/install @@ -150,7 +150,7 @@ yunohost service add $app --description="Simple, private file sharing" ynh_script_progression --message="Starting a systemd service..." --weight=2 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index eb12d4b..bcce26f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -99,7 +99,7 @@ yunohost service add $app --description="Simple, private file sharing" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 57b1f50..618bdab 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -139,7 +139,7 @@ yunohost service add $app --description="Simple, private file sharing" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # RELOAD NGINX From a2a077707fe6d7399ee8322cc78bf608a5a27d92 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 1 Jul 2022 21:12:12 +0200 Subject: [PATCH 17/18] Fix upgrade --- scripts/upgrade | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 618bdab..1f489b5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -75,8 +75,23 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=10 + # Create a temporary directory + tmpdir="$(mktemp -d)" + + # Backup the config file in the temp dir + cp -a "$final_path/server/config.js" "$tmpdir/config.js" + + # Remove the app directory securely + ynh_secure_remove --file=$final_path + # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir=$final_path --keep="$final_path/server/config.js" + ynh_setup_source --dest_dir=$final_path + + #Copy the admin saved settings from tmp directory to final path + cp -a "$tmpdir/config.js" "$final_path/server/config.js" + + # Remove the tmp directory securely + ynh_secure_remove --file="$tmpdir" fi chmod 750 "$final_path" @@ -103,12 +118,12 @@ ynh_add_nginx_config #================================================= # SPECIFIC UPGRADE #================================================= -# INSTALL SEND +# BUILD APP #================================================= if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=16 + ynh_script_progression --message="Building app... (this will take some time and resources!)" --weight=16 pushd "$final_path" ynh_use_nodejs From 5657b471cd6fbd1aca69ebf882daca15f7e06491 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Jul 2022 03:55:18 +0200 Subject: [PATCH 18/18] Fix upgrade --- scripts/upgrade | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 1f489b5..29a1208 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,7 @@ 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) port=$(ynh_app_setting_get --app=$app --key=port) +redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) #================================================= # CHECK VERSION @@ -132,6 +133,16 @@ then popd fi +#================================================= +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating a configuration file..." + +ynh_add_config --template="../conf/config.js" --destination="$final_path/server/config.js" + +chmod 400 "$final_path/server/config.js" +chown $app: "$final_path/server/config.js" + #================================================= # SETUP SYSTEMD #=================================================