From 4eb1b38e3737ac6ab1ebcca8fda784e861240edc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 30 Jan 2022 08:56:48 +0100 Subject: [PATCH 01/21] 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 265a7e9..122943f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -version_commit=ded221c985ee6eabb4f1bbd6eb5a1ec0dacfc215 +version_commit=7fef3ed059a15e4cffdb5460f41de60b427b962c nodejs_version=16 From 4bf975a1abd0fa3f2cf4e4c26198bf025c2799d9 Mon Sep 17 00:00:00 2001 From: Florent Date: Mon, 31 Jan 2022 21:31:05 +0100 Subject: [PATCH 02/21] Install node app in production mode --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 17f21ed..e507f06 100755 --- a/scripts/install +++ b/scripts/install @@ -111,7 +111,7 @@ ynh_script_progression --message="Building Sutom... (this will take some time an pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less npm i -g npm - ynh_exec_warn_less npm install + ynh_exec_warn_less npm install --production popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2a96a23..7b754e7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -114,7 +114,7 @@ ynh_script_progression --message="Building Sutom... (this will take some time an pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less npm i -g npm - ynh_exec_warn_less npm install + ynh_exec_warn_less npm install --production popd #================================================= From 5de6cb27839a93e0146a24dcbbae7979f0adcc24 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 31 Jan 2022 23:05:25 +0100 Subject: [PATCH 03/21] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 7c97672..365872d 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Wordle-based online word game", "fr": "Jeu de lettres en ligne basé sur Wordle" }, - "version": "1.0.0~ynh1", + "version": "1.0.0~ynh2", "url": "https://sutom.nocle.fr/", "upstream": { "license": "MIT", From 86100c6ddbc657555f369c3d7b328c32b3c0b6a0 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 31 Jan 2022 22:05:48 +0000 Subject: [PATCH 04/21] 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 b183780..9b2e103 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 Jeu de lettres en ligne (et en français) basé sur Wordle. Le jeu se trouve à l'adresse https://sutom.nocle.fr -**Shipped version:** 1.0.0~ynh1 +**Shipped version:** 1.0.0~ynh2 **Demo:** https://sutom.nocle.fr/ diff --git a/README_fr.md b/README_fr.md index fc78ff3..c1a4de6 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Jeu de lettres en ligne (et en français) basé sur Wordle. Le jeu se trouve à l'adresse https://sutom.nocle.fr -**Version incluse :** 1.0.0~ynh1 +**Version incluse :** 1.0.0~ynh2 **Démo :** https://sutom.nocle.fr/ From 7c96edd53d61e1a7b8eff2c40e5b7be5ddae49a6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 31 Jan 2022 23:07:31 +0100 Subject: [PATCH 05/21] 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 122943f..41d7ceb 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -version_commit=7fef3ed059a15e4cffdb5460f41de60b427b962c +version_commit=335b42256fbbe5080d7756fc0ca085433c9d14f5 nodejs_version=16 From 6b3912893afc2ce5a528d09e2d8f0c913125b083 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 31 Jan 2022 23:15:11 +0100 Subject: [PATCH 06/21] Update install --- scripts/install | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index e507f06..46c6d80 100755 --- a/scripts/install +++ b/scripts/install @@ -83,7 +83,6 @@ 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" git clone https://framagit.org/JonathanMM/sutom "$final_path" --quiet @@ -111,7 +110,7 @@ ynh_script_progression --message="Building Sutom... (this will take some time an pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less npm i -g npm - ynh_exec_warn_less npm install --production + ynh_exec_warn_less npm install #--production popd #================================================= From d3a49780bd0441657ee53167157d5d1da0cd6e0d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 31 Jan 2022 23:46:40 +0100 Subject: [PATCH 07/21] 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 41d7ceb..5a76321 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -version_commit=335b42256fbbe5080d7756fc0ca085433c9d14f5 +version_commit=1d48c6de990de0cecef4296d6e041921cad150f9 nodejs_version=16 From 1abe0bc0372f1209ca78548df2f815430d6be5b7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 1 Feb 2022 12:20:44 +0100 Subject: [PATCH 08/21] Update --- scripts/_common.sh | 2 +- scripts/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 5a76321..41d7ceb 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -version_commit=1d48c6de990de0cecef4296d6e041921cad150f9 +version_commit=335b42256fbbe5080d7756fc0ca085433c9d14f5 nodejs_version=16 diff --git a/scripts/install b/scripts/install index 46c6d80..b2d77c4 100755 --- a/scripts/install +++ b/scripts/install @@ -110,7 +110,7 @@ ynh_script_progression --message="Building Sutom... (this will take some time an pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less npm i -g npm - ynh_exec_warn_less npm install #--production + ynh_exec_warn_less npm install --production popd #================================================= From b0f9d654893ce96516bca25f03d01124277d31e7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 1 Feb 2022 12:45:07 +0100 Subject: [PATCH 09/21] Fix --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index b2d77c4..900076e 100755 --- a/scripts/install +++ b/scripts/install @@ -110,7 +110,7 @@ ynh_script_progression --message="Building Sutom... (this will take some time an pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less npm i -g npm - ynh_exec_warn_less npm install --production + ynh_exec_warn_less npm install popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7b754e7..2a96a23 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -114,7 +114,7 @@ ynh_script_progression --message="Building Sutom... (this will take some time an pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less npm i -g npm - ynh_exec_warn_less npm install --production + ynh_exec_warn_less npm install popd #================================================= From 881932d4db6a39f287432b22d9cc31151c532fad Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 5 Feb 2022 19:09:10 +0100 Subject: [PATCH 10/21] Fix --- scripts/_common.sh | 2 +- scripts/install | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 41d7ceb..3dd6aec 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -version_commit=335b42256fbbe5080d7756fc0ca085433c9d14f5 +version_commit=2e7fbfecf9cbdc369229a0f234ef180f03dd6035 nodejs_version=16 diff --git a/scripts/install b/scripts/install index 900076e..b2d77c4 100755 --- a/scripts/install +++ b/scripts/install @@ -110,7 +110,7 @@ ynh_script_progression --message="Building Sutom... (this will take some time an pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less npm i -g npm - ynh_exec_warn_less npm install + ynh_exec_warn_less npm install --production popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2a96a23..7b754e7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -114,7 +114,7 @@ ynh_script_progression --message="Building Sutom... (this will take some time an pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less npm i -g npm - ynh_exec_warn_less npm install + ynh_exec_warn_less npm install --production popd #================================================= From 2d3a5af84c7cc34805e8fb66d79dc39c7a2ca25e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 6 Feb 2022 22:00:02 +0100 Subject: [PATCH 11/21] 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 3dd6aec..fdd4fe3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -version_commit=2e7fbfecf9cbdc369229a0f234ef180f03dd6035 +version_commit=00b8c682a2ef45e5f2399588a355d845c0d0016b nodejs_version=16 From c5470f815d09677fca7eb08c6666f0c553c9470f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 23 Feb 2022 22:58:34 +0100 Subject: [PATCH 12/21] 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 fdd4fe3..f8ba605 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -version_commit=00b8c682a2ef45e5f2399588a355d845c0d0016b +version_commit=bab13f2fdce33833c21f1ca788ab9ae4415b005b nodejs_version=16 From 594661b90ff1ddea875442b2c2cbdaf774df395b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 5 Mar 2022 10:00:46 +0100 Subject: [PATCH 13/21] 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 f8ba605..34b253d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -version_commit=bab13f2fdce33833c21f1ca788ab9ae4415b005b +version_commit=2149d9dbe3c452019d50e14fbd8542cc713ef551 nodejs_version=16 From af9028c7fea5d47256ef640f112e59a177c56f00 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 6 Mar 2022 15:35:52 +0100 Subject: [PATCH 14/21] 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 34b253d..0d56fe8 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -version_commit=2149d9dbe3c452019d50e14fbd8542cc713ef551 +version_commit=fecbb8a196e7bbe77cc861f194b3bbaee959c375 nodejs_version=16 From 11fabe11dd970800e4db962bce19834a4dfb1498 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 7 Apr 2022 23:01:32 +0200 Subject: [PATCH 15/21] 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 0d56fe8..ad72bca 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -version_commit=fecbb8a196e7bbe77cc861f194b3bbaee959c375 +version_commit=d76c32fd8c47d471e6a7449ecbeb5ad0b01d7444 nodejs_version=16 From 01aebb56aa4aa4133566b2b5cfe4271e891f93f8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 6 May 2022 09:27:55 +0200 Subject: [PATCH 16/21] 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 ad72bca..2e3ba04 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -version_commit=d76c32fd8c47d471e6a7449ecbeb5ad0b01d7444 +version_commit=05e6dfe28c1ebfebff4f22d99f68b2bbb2127569 nodejs_version=16 From b0f41f47d64089bd8c67a7295c49901552483aa2 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 30 May 2022 13:46:25 +0200 Subject: [PATCH 17/21] Apply example_ynh --- .github/ISSUE_TEMPLATE.md | 55 ++++++++++++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 16 +++++++++ check_process | 5 +-- conf/app.src | 5 +-- conf/nginx.conf | 4 +-- conf/systemd.service | 7 ++-- manifest.json | 10 ++---- scripts/_common.sh | 2 -- scripts/backup | 1 - scripts/change_url | 3 ++ scripts/install | 23 ++++++------- scripts/remove | 14 ++++---- scripts/restore | 10 +++--- scripts/upgrade | 16 ++++----- sources/extra_files/app/.gitignore | 2 -- sources/patches/.gitignore | 2 -- 16 files changed, 117 insertions(+), 58 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 sources/extra_files/app/.gitignore delete mode 100644 sources/patches/.gitignore diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..2729a6b --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,55 @@ +--- +name: Bug report +about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. + +--- + +**How to post a meaningful bug report** +1. *Read this whole template first.* +2. *Determine if you are on the right place:* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* + - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* + - *When in doubt, post here and we will figure it out together.* +3. *Delete the italic comments as you write over them below, and remove this guide.* +--- + +### Describe the bug + +*A clear and concise description of what the bug is.* + +### Context + +- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* +- YunoHost version: x.x.x +- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* + - If yes, please explain: +- Using, or trying to install package version/branch: +- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* + +### Steps to reproduce + +- *If you performed a command from the CLI, the command itself is enough. For example:* + ```sh + sudo yunohost app install the_app + ``` +- *If you used the webadmin, please perform the equivalent command from the CLI first.* +- *If the error occurs in your browser, explain what you did:* + 1. *Go to '...'* + 2. *Click on '...'* + 3. *Scroll down to '...'* + 4. *See error* + +### Expected behavior + +*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* + +### Logs + +*When an operation fails, YunoHost provides a simple way to share the logs.* +- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* +- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* + +*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* + +*If applicable and useful, add screenshots to help explain your problem.* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ef70e18 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Problem + +- *Description of why you made this PR* + +## Solution + +- *And how do you fix that problem* + +## PR Status + +- [ ] Code finished and ready to be reviewed/tested +- [ ] The fix/enhancement were manually tested (if applicable) + +## Automatic tests + +Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) diff --git a/check_process b/check_process index 4b16641..108685a 100644 --- a/check_process +++ b/check_process @@ -11,9 +11,10 @@ setup_private=1 setup_public=1 upgrade=1 - #upgrade=1 from_commit=CommitHash + # 1.0.0~ynh1 + upgrade=1 from_commit=3203df977e8ab92fb24968adcabbcd901ab84785 backup_restore=1 - multi_instance=0 + multi_instance=1 change_url=1 ;;; Options Email= diff --git a/conf/app.src b/conf/app.src index 000fb2b..2731410 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,7 @@ -SOURCE_URL=url of app's source -SOURCE_SUM=sha256 checksum +SOURCE_URL=https://framagit.org/JonathanMM/sutom/-/archive/05e6dfe28c1ebfebff4f22d99f68b2bbb2127569/sutom-05e6dfe28c1ebfebff4f22d99f68b2bbb2127569.tar.gz +SOURCE_SUM=7428b08b0ca8c20c75b804e555ac77815d399c73f154b62f4a4d098f3bc53916 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= SOURCE_EXTRACT=true diff --git a/conf/nginx.conf b/conf/nginx.conf index dd08124..37be152 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,5 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location ^~ __PATH__/ { +location __PATH__/ { proxy_pass http://127.0.0.1:__PORT__/; proxy_redirect off; @@ -12,8 +12,8 @@ location ^~ __PATH__/ { proxy_http_version 1.1; proxy_set_header Connection "upgrade"; proxy_set_header Upgrade $http_upgrade; + more_clear_input_headers 'Accept-Encoding'; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; - more_clear_input_headers 'Accept-Encoding'; } diff --git a/conf/systemd.service b/conf/systemd.service index 6e0b5c8..7dab18b 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,10 +6,11 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__FINALPATH__ -Environment="PATH=__ENV_PATH__" +WorkingDirectory=__FINALPATH__/ +Environment="__YNH_NODE_LOAD_PATH__" +Environment="SUTOM_PORT=__PORT__" Environment="NODE_ENV=production" -ExecStart=__YNH_NPM__ start +ExecStart=__YNH_NPM__ run start:prod Restart=always # Sandboxing options to harden security diff --git a/manifest.json b/manifest.json index 365872d..0da77b7 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Wordle-based online word game", "fr": "Jeu de lettres en ligne basé sur Wordle" }, - "version": "1.0.0~ynh2", + "version": "1.0.0~ynh3", "url": "https://sutom.nocle.fr/", "upstream": { "license": "MIT", @@ -22,12 +22,12 @@ "requirements": { "yunohost": ">= 4.3.0" }, - "multi_instance": false, + "multi_instance": true, "services": [ "nginx" ], "arguments": { - "install" : [ + "install": [ { "name": "domain", "type": "domain" @@ -41,10 +41,6 @@ { "name": "is_public", "type": "boolean", - "help": { - "en": "If enabled, Sutom will be accessible by people who do not have an account. This can be changed later via the webadmin.", - "fr": "Si cette case est cochée, Sutom sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." - }, "default": true } ] diff --git a/scripts/_common.sh b/scripts/_common.sh index 2e3ba04..b818f0f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,8 +4,6 @@ # COMMON VARIABLES #================================================= -version_commit=05e6dfe28c1ebfebff4f22d99f68b2bbb2127569 - nodejs_version=16 #================================================= diff --git a/scripts/backup b/scripts/backup index fb3c925..65e96c1 100755 --- a/scripts/backup +++ b/scripts/backup @@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script diff --git a/scripts/change_url b/scripts/change_url index 234969d..034d1af 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,6 +28,8 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) + +# Add settings here as needed by your application port=$(ynh_app_setting_get --app=$app --key=port) #================================================= @@ -38,6 +40,7 @@ ynh_script_progression --message="Backing up the app before changing its URL (ma # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + ynh_clean_check_starting # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" diff --git a/scripts/install b/scripts/install index b2d77c4..5ba6570 100755 --- a/scripts/install +++ b/scripts/install @@ -14,8 +14,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -57,7 +56,7 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port -port=$(ynh_find_port --port=4000) +port=$(ynh_find_port --port=8095) ynh_app_setting_set --app=$app --key=port --value=$port #================================================= @@ -83,12 +82,7 @@ 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 - -git clone https://framagit.org/JonathanMM/sutom "$final_path" --quiet - -pushd "$final_path" - git reset --hard --quiet $version_commit -popd +ynh_setup_source --dest_dir="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" @@ -109,8 +103,9 @@ ynh_script_progression --message="Building Sutom... (this will take some time an pushd "$final_path" ynh_use_nodejs - ynh_exec_warn_less npm i -g npm - ynh_exec_warn_less npm install --production + ynh_exec_warn_less ynh_exec_as $app NODE_ENV=production $ynh_node_load_PATH $ynh_npm install --production + ynh_exec_warn_less ynh_exec_as $app NODE_ENV=production $ynh_node_load_PATH ./node_modules/.bin/tsc + ln -s $final_path/public/js/mots/listeMotsProposables.js $final_path/public/js/mots/listeMotsProposables.9.D.js popd #================================================= @@ -118,11 +113,11 @@ popd #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 -env_path="$PATH" - # Create a dedicated systemd config ynh_add_systemd_config +#================================================= +# GENERIC FINALIZATION #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= @@ -146,6 +141,8 @@ ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary if [ $is_public -eq 1 ] then + # Everyone can access the app. + # The "main" permission is automatically created before the install script. ynh_permission_update --permission="main" --add="visitors" fi diff --git a/scripts/remove b/scripts/remove index 4bc3575..42707a2 100755 --- a/scripts/remove +++ b/scripts/remove @@ -41,13 +41,6 @@ ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 - -ynh_remove_nodejs - #================================================= # REMOVE APP MAIN DIR #================================================= @@ -64,6 +57,13 @@ 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..." --weight=1 + +ynh_remove_nodejs + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index ea78772..2dac620 100755 --- a/scripts/restore +++ b/scripts/restore @@ -15,8 +15,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - #### Remove this function if there's nothing to clean before calling the remove script. - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -37,14 +36,15 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path \ + || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -72,7 +72,7 @@ chown -R $app:www-data "$final_path" #================================================= ynh_script_progression --message="Reinstalling dependencies..." --weight=6 -# Install Nodejs +# Define and install dependencies ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7b754e7..b046a37 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,6 +35,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # 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 } @@ -79,11 +80,7 @@ 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" - pushd $final_path - git fetch - #git checkout master - git reset --hard --quiet $version_commit + ynh_setup_source --dest_dir="$final_path" fi chmod 750 "$final_path" @@ -103,9 +100,10 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading dependencies..." --weight=10 -# Install Nodejs ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +#================================================= +# SPECIFIC UPGRADE #============================================== # INSTALL SUTOM #============================================== @@ -113,8 +111,8 @@ ynh_script_progression --message="Building Sutom... (this will take some time an pushd "$final_path" ynh_use_nodejs - ynh_exec_warn_less npm i -g npm - ynh_exec_warn_less npm install --production + ynh_exec_warn_less ynh_exec_as $app NODE_ENV=production $ynh_node_load_PATH $ynh_npm install --production + ynh_exec_warn_less ynh_exec_as $app NODE_ENV=production $ynh_node_load_PATH ./node_modules/.bin/tsc popd #================================================= @@ -122,8 +120,6 @@ popd #================================================= ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 -env_path="$PATH" - # Create a dedicated systemd config ynh_add_systemd_config diff --git a/sources/extra_files/app/.gitignore b/sources/extra_files/app/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/extra_files/app/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op] diff --git a/sources/patches/.gitignore b/sources/patches/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/patches/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op] From 76a163fef10d5a87a601525316702593d0ef5f40 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 30 May 2022 11:46:30 +0000 Subject: [PATCH 18/21] 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 9b2e103..5e04b90 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Sutom for YunoHost -[![Integration level](https://dash.yunohost.org/integration/sutom.svg)](https://dash.yunohost.org/appci/app/sutom) ![](https://ci-apps.yunohost.org/ci/badges/sutom.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/sutom.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/sutom.svg)](https://dash.yunohost.org/appci/app/sutom) ![Working status](https://ci-apps.yunohost.org/ci/badges/sutom.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/sutom.maintain.svg) [![Install Sutom with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=sutom) *[Lire ce readme en français.](./README_fr.md)* @@ -18,30 +18,31 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Jeu de lettres en ligne (et en français) basé sur Wordle. Le jeu se trouve à l'adresse https://sutom.nocle.fr -**Shipped version:** 1.0.0~ynh2 +**Shipped version:** 1.0.0~ynh3 **Demo:** https://sutom.nocle.fr/ ## Screenshots -![](./doc/screenshots/screenshot.png) +![Screenshot of Sutom](./doc/screenshots/screenshot.png) ## Documentation and resources -* Official app website: https://sutom.nocle.fr/ -* Upstream app code repository: https://framagit.org/JonathanMM/sutom -* YunoHost documentation for this app: https://yunohost.org/app_sutom -* Report a bug: https://github.com/YunoHost-Apps/sutom_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/sutom_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/sutom_ynh/tree/testing --debug or sudo yunohost app upgrade sutom -u https://github.com/YunoHost-Apps/sutom_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 c1a4de6..f63b3b2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # Sutom pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/sutom.svg)](https://dash.yunohost.org/appci/app/sutom) ![](https://ci-apps.yunohost.org/ci/badges/sutom.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/sutom.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/sutom.svg)](https://dash.yunohost.org/appci/app/sutom) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/sutom.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/sutom.maintain.svg) [![Installer Sutom avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=sutom) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer Sutom 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.* @@ -14,30 +18,31 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Jeu de lettres en ligne (et en français) basé sur Wordle. Le jeu se trouve à l'adresse https://sutom.nocle.fr -**Version incluse :** 1.0.0~ynh2 +**Version incluse :** 1.0.0~ynh3 **Démo :** https://sutom.nocle.fr/ ## Captures d'écran -![](./doc/screenshots/screenshot.png) +![Capture d'écran de Sutom](./doc/screenshots/screenshot.png) ## Documentations et ressources -* Site officiel de l'app : https://sutom.nocle.fr/ -* Dépôt de code officiel de l'app : https://framagit.org/JonathanMM/sutom -* Documentation YunoHost pour cette app : https://yunohost.org/app_sutom -* Signaler un bug : https://github.com/YunoHost-Apps/sutom_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/sutom_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/sutom_ynh/tree/testing --debug ou sudo yunohost app upgrade sutom -u https://github.com/YunoHost-Apps/sutom_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 ff1d2038c974fef1c15a8a0ee8458d237afd5ddd Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 30 May 2022 14:33:02 +0200 Subject: [PATCH 19/21] Update upgrade --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index b046a37..ffdba45 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -113,6 +113,7 @@ pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app NODE_ENV=production $ynh_node_load_PATH $ynh_npm install --production ynh_exec_warn_less ynh_exec_as $app NODE_ENV=production $ynh_node_load_PATH ./node_modules/.bin/tsc + ln -sf $final_path/public/js/mots/listeMotsProposables.js $final_path/public/js/mots/listeMotsProposables.9.D.js popd #================================================= From 7ede486783c29409966d36d86e2b6bdf91c57d2c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 30 May 2022 14:33:05 +0200 Subject: [PATCH 20/21] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 5ba6570..e5da697 100755 --- a/scripts/install +++ b/scripts/install @@ -105,7 +105,7 @@ pushd "$final_path" ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app NODE_ENV=production $ynh_node_load_PATH $ynh_npm install --production ynh_exec_warn_less ynh_exec_as $app NODE_ENV=production $ynh_node_load_PATH ./node_modules/.bin/tsc - ln -s $final_path/public/js/mots/listeMotsProposables.js $final_path/public/js/mots/listeMotsProposables.9.D.js + ln -sf $final_path/public/js/mots/listeMotsProposables.js $final_path/public/js/mots/listeMotsProposables.9.D.js popd #================================================= From 2c19aa9a262fc51acc126ad719cb2b6fb102489d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 4 Jun 2022 16:11:34 +0200 Subject: [PATCH 21/21] Fix upgrade from previous version --- scripts/upgrade | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index ffdba45..acf7b35 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,14 +74,10 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=1 -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" -fi +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path"