From ee49730da2e03443041fe8dccb8e22bd6f1d70cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20W=C3=BChr?= Date: Mon, 20 Feb 2023 13:33:39 +0100 Subject: [PATCH 1/4] Add a basic wrapper script for admin --- README.md | 2 +- README_fr.md | 2 +- check_process | 1 + conf/ntfy.sh | 3 +++ manifest.json | 2 +- scripts/install | 8 ++++++++ scripts/upgrade | 8 ++++++++ 7 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 conf/ntfy.sh diff --git a/README.md b/README.md index 2f0abcb..e805034 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 ntfy (pronounce: *notify*) is a simple HTTP-based pub-sub notification service. It allows you to send notifications to your phone or desktop via scripts from any computer, entirely without signup, cost or setup. It's also open source if you want to run your own. -**Shipped version:** 2.0.0~ynh1 +**Shipped version:** 2.0.0~ynh2 **Demo:** https://ntfy.sh/app ## Disclaimers / important information diff --git a/README_fr.md b/README_fr.md index 64dcde9..2194474 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ntfy (pronounce: *notify*) is a simple HTTP-based pub-sub notification service. It allows you to send notifications to your phone or desktop via scripts from any computer, entirely without signup, cost or setup. It's also open source if you want to run your own. -**Version incluse :** 2.0.0~ynh1 +**Version incluse :** 2.0.0~ynh2 **Démo :** https://ntfy.sh/app ## Avertissements / informations importantes diff --git a/check_process b/check_process index b8246de..89c34e9 100644 --- a/check_process +++ b/check_process @@ -6,6 +6,7 @@ setup_nourl=0 setup_private=0 upgrade=1 + upgrade=1 from_commit=2.0.0-ynh1 upgrade=1 from_commit=1.31.0-ynh1 # 1.30.1~ynh1 upgrade=1 from_commit=6d7d7082971be2626d082a117cdd613a21716f61 diff --git a/conf/ntfy.sh b/conf/ntfy.sh new file mode 100644 index 0000000..835ff70 --- /dev/null +++ b/conf/ntfy.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +sudo -u __APP__ NTFY_CONFIG_FILE="__FINALPATH__/server.yml" __FINALPATH__/ntfy $@ diff --git a/manifest.json b/manifest.json index 73ab09d..602e679 100644 --- a/manifest.json +++ b/manifest.json @@ -15,7 +15,7 @@ "code": "https://github.com/binwiederhier/ntfy" }, "url": "https://ntfy.sh/", - "version": "2.0.0~ynh1", + "version": "2.0.0~ynh2", "license": "GPL-2.0-only", "maintainer": { "name": "Alexander Wühr", diff --git a/scripts/install b/scripts/install index 032e7ef..f716e63 100755 --- a/scripts/install +++ b/scripts/install @@ -104,6 +104,14 @@ ynh_add_config --template="server.yml" --destination="$final_path/server.yml" chmod 400 "$final_path/server.yml" chown $app:$app "$final_path/server.yml" +#================================================= +# ADD A SIMPLE WRAPPER SCRIPT +#================================================= +ynh_script_progression --message="Adding a command wrapper..." --weight=1 + +ynh_add_config --template="ntfy.sh" --destination="$final_path/ntfy.sh" +chmod +x "$final_path/ntfy.sh" + #================================================= # SETUP SYSTEMD #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2ef09dd..d6cd389 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -103,6 +103,14 @@ ynh_add_config --template="server.yml" --destination="$final_path/server.yml" chmod 400 "$final_path/server.yml" chown $app:$app "$final_path/server.yml" +#================================================= +# UPDATE A SIMPLE WRAPPER SCRIPT +#================================================= +ynh_script_progression --message="Updating a command wrapper..." --weight=1 + +ynh_add_config --template="ntfy.sh" --destination="$final_path/ntfy.sh" +chmod +x "$final_path/ntfy.sh" + #================================================= # SETUP SYSTEMD #================================================= From 1626230009e677535e9d25cbd7f794ab68df22f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20W=C3=BChr?= Date: Mon, 20 Feb 2023 13:38:47 +0100 Subject: [PATCH 2/4] Remove sudo stuff from ntfy.sh --- conf/ntfy.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/ntfy.sh b/conf/ntfy.sh index 835ff70..585d5df 100644 --- a/conf/ntfy.sh +++ b/conf/ntfy.sh @@ -1,3 +1,5 @@ #!/bin/sh -sudo -u __APP__ NTFY_CONFIG_FILE="__FINALPATH__/server.yml" __FINALPATH__/ntfy $@ +HOME=__FINALPATH__ + +NTFY_CONFIG_FILE="$HOME/server.yml" $HOME/ntfy $@ From 0edda6aed9377b614880e7f8589ad4f02e261316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20W=C3=BChr?= Date: Mon, 20 Feb 2023 15:31:36 +0100 Subject: [PATCH 3/4] Update upstream app to v2.0.1 --- README.md | 2 +- README_fr.md | 2 +- conf/amd64.src | 6 +++--- conf/arm64.src | 6 +++--- conf/armhf.src | 6 +++--- manifest.json | 2 +- tools/update_src.sh | 20 ++++++++++++++++++++ 7 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 tools/update_src.sh diff --git a/README.md b/README.md index e805034..4ab122c 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 ntfy (pronounce: *notify*) is a simple HTTP-based pub-sub notification service. It allows you to send notifications to your phone or desktop via scripts from any computer, entirely without signup, cost or setup. It's also open source if you want to run your own. -**Shipped version:** 2.0.0~ynh2 +**Shipped version:** 2.0.1~ynh1 **Demo:** https://ntfy.sh/app ## Disclaimers / important information diff --git a/README_fr.md b/README_fr.md index 2194474..e7c36f8 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ntfy (pronounce: *notify*) is a simple HTTP-based pub-sub notification service. It allows you to send notifications to your phone or desktop via scripts from any computer, entirely without signup, cost or setup. It's also open source if you want to run your own. -**Version incluse :** 2.0.0~ynh2 +**Version incluse :** 2.0.1~ynh1 **Démo :** https://ntfy.sh/app ## Avertissements / informations importantes diff --git a/conf/amd64.src b/conf/amd64.src index ec038e5..533f71e 100644 --- a/conf/amd64.src +++ b/conf/amd64.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://github.com/binwiederhier/ntfy/releases/download/v2.0.0/ntfy_2.0.0_linux_x86_64.tar.gz -SOURCE_SUM=3603e08929fc5e7980f7e0d198e5f5545d23957bb60c8daf6ab9bc0165549285 +SOURCE_URL=https://github.com/binwiederhier/ntfy/releases/download/v2.0.1/ntfy_2.0.1_linux_x86_64.tar.gz +SOURCE_SUM=e3da79a6772e3561e7cc6927f918dbfc3a985f56bc53688ec1a4ca0dfe164fff SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=ntfy_2.0.0_linux_x86_64 +SOURCE_FILENAME=ntfy_2.0.1_linux_x86_64 diff --git a/conf/arm64.src b/conf/arm64.src index 338e170..f17db68 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://github.com/binwiederhier/ntfy/releases/download/v2.0.0/ntfy_2.0.0_linux_arm64.tar.gz -SOURCE_SUM=fb5f6df4da0d4e625fa15ef1a006e63912cdcd65c3c2bbc78018bf9ea9964498 +SOURCE_URL=https://github.com/binwiederhier/ntfy/releases/download/v2.0.1/ntfy_2.0.1_linux_arm64.tar.gz +SOURCE_SUM=af00579d814537b848a424b20361e948a3ef6a014b831c20ce374b6c71d6b4f6 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=ntfy_2.0.0_linux_arm64 +SOURCE_FILENAME=ntfy_2.0.1_linux_arm64 diff --git a/conf/armhf.src b/conf/armhf.src index 1628e47..c684601 100644 --- a/conf/armhf.src +++ b/conf/armhf.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://github.com/binwiederhier/ntfy/releases/download/v2.0.0/ntfy_2.0.0_linux_armv7.tar.gz -SOURCE_SUM=5a864d8fcc0f9faad5989463558bcee3b70b8c6ec15f0a95c348d864d8b3cf68 +SOURCE_URL=https://github.com/binwiederhier/ntfy/releases/download/v2.0.1/ntfy_2.0.1_linux_armv7.tar.gz +SOURCE_SUM=2f6c8a8ca99593d41e75ca35cbc78673647d76c5e20c08c6d7fb3d535c77e50f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=ntfy_2.0.0_linux_armv7 +SOURCE_FILENAME=ntfy_2.0.1_linux_armv7 diff --git a/manifest.json b/manifest.json index 602e679..166a63b 100644 --- a/manifest.json +++ b/manifest.json @@ -15,7 +15,7 @@ "code": "https://github.com/binwiederhier/ntfy" }, "url": "https://ntfy.sh/", - "version": "2.0.0~ynh2", + "version": "2.0.1~ynh1", "license": "GPL-2.0-only", "maintainer": { "name": "Alexander Wühr", diff --git a/tools/update_src.sh b/tools/update_src.sh new file mode 100644 index 0000000..dad7c1b --- /dev/null +++ b/tools/update_src.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +VERSION=$1 + +CHECKSUMS=`wget https://github.com/binwiederhier/ntfy/releases/download/v$VERSION/checksums.txt -q -O -` + +src() { + cat << SH > conf/$1.src +SOURCE_URL=https://github.com/binwiederhier/ntfy/releases/download/v${VERSION}/ntfy_${VERSION}_linux_${2}.tar.gz +SOURCE_SUM=`echo "$CHECKSUMS" | grep ${VERSION}_linux_${2}.tar.gz | cut -d " " -f 1` +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME=ntfy_${VERSION}_linux_${2} +SH +} + +src amd64 x86_64 +src arm64 arm64 +src armhf armv7 From b0f30c05cf0158529798c7523180b37716e17dc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20W=C3=BChr?= Date: Mon, 20 Feb 2023 16:35:48 +0100 Subject: [PATCH 4/4] Enable login by default --- conf/server.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/server.yml b/conf/server.yml index c283fc3..45a0012 100644 --- a/conf/server.yml +++ b/conf/server.yml @@ -13,6 +13,7 @@ cache-startup-queries: | auth-file: __FINALPATH__/data/user.db auth-default-access: "deny-all" +enable-login: true attachment-cache-dir: __FINALPATH__/data/attachments