From ce9c1308dd0983faa3145e72ec7025df0d4b069d Mon Sep 17 00:00:00 2001 From: CJ Stevenson Date: Fri, 1 Dec 2023 16:16:25 +0000 Subject: [PATCH 1/4] Add ntfy egg --- README.md | 4 ++++ software/ntfy/README.md | 7 +++++++ software/ntfy/egg-ntfy.json | 31 +++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 software/ntfy/README.md create mode 100644 software/ntfy/egg-ntfy.json diff --git a/README.md b/README.md index 82d5cebc5..7e15ba4fe 100644 --- a/README.md +++ b/README.md @@ -415,6 +415,10 @@ If you are reading this it looks like you are looking to add an egg to your serv * [Meilisearch](/software/meilisearch) +### Ntfy + +* [ntfy](/software/ntfy) + ### Owncast * [owncast](/software/owncast) diff --git a/software/ntfy/README.md b/software/ntfy/README.md new file mode 100644 index 000000000..eb239fa96 --- /dev/null +++ b/software/ntfy/README.md @@ -0,0 +1,7 @@ +# [NTFY](https://ntfy.sh/) + +A simple HTTP-based pub-sub notification service. It allows you to send notifications to your phone or desktop via scripts from any computer, and/or using a REST API. + +## Server Ports + +One port needs to be allocated to run ntfy. diff --git a/software/ntfy/egg-ntfy.json b/software/ntfy/egg-ntfy.json new file mode 100644 index 000000000..47d8de3b6 --- /dev/null +++ b/software/ntfy/egg-ntfy.json @@ -0,0 +1,31 @@ +{ + "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", + "meta": { + "version": "PTDL_v2", + "update_url": null + }, + "exported_at": "2023-12-01T17:09:31+01:00", + "name": "ntfy", + "author": "me@cjstevenson.com", + "description": null, + "features": null, + "docker_images": { + "ghcr.io\/parkervcp\/yolks:debian": "ghcr.io\/parkervcp\/yolks:debian" + }, + "file_denylist": [], + "startup": ".\/ntfy serve --config server\/server.yml", + "config": { + "files": "{\r\n \"server\/server.yml\": {\r\n \"parser\": \"yaml\",\r\n \"find\": {\r\n \"listen-http\": \":{{server.build.default.port}}\",\r\n \"cache-file\": \".\/cache.db\"\r\n }\r\n }\r\n}", + "startup": "{\r\n \"done\": \"INFO Listening on\"\r\n}", + "logs": "{}", + "stop": "^^C" + }, + "scripts": { + "installation": { + "script": "## NTFY Installscript\r\n\r\n## update system\r\napt update\r\napt -y install --no-install-recommends curl tar\r\n\r\n## Variables\r\nARCH=$([[ \"$(uname -m)\" == \"x86_64\" ]] && echo \"amd64\" || echo \"arm64\")\r\n\r\ncd \/mnt\/server\r\n\r\n## install ntfy\r\necho -e \"download url: https:\/\/github.com\/binwiederhier\/ntfy\/releases\/download\/v2.8.0\/ntfy_2.8.0_linux_${ARCH}.tar.gz\"\r\necho -e \"downloading ntfy $VERSION\"\r\ncurl -sSL -o ntfy_2.8.0_linux_${ARCH}.tar.gz https:\/\/github.com\/binwiederhier\/ntfy\/releases\/download\/v2.8.0\/ntfy_2.8.0_linux_${ARCH}.tar.gz\r\n\r\necho -e \"unzipping ntfy exc\"\r\ntar -zxvf .\/ntfy_2.8.0_linux_${ARCH}.tar.gz ntfy\r\n\r\n## clear temp stuff\r\necho -e \"deleting temp files\"\r\nrm .\/ntfy_2.8.0_linux_${ARCH}.tar.gz\r\nrm -r .\/ntfy_2.8.0_linux_${ARCH}\r\n\r\necho -e \"creating cache.db\"\r\ntouch cache.db\r\n\r\necho -e \"-------------------------------------------------\"\r\necho -e \"Installation completed\"\r\necho -e \"-------------------------------------------------\"", + "container": "debian:bullseye-slim", + "entrypoint": "bash" + } + }, + "variables": [] +} From b81a99b063ae6a16cf61a472ad2f0a22674cc67e Mon Sep 17 00:00:00 2001 From: CJ Stevenson Date: Fri, 1 Dec 2023 19:45:08 +0000 Subject: [PATCH 2/4] Update install script and stop config --- software/ntfy/egg-ntfy.json | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/software/ntfy/egg-ntfy.json b/software/ntfy/egg-ntfy.json index 47d8de3b6..2a2f26ff4 100644 --- a/software/ntfy/egg-ntfy.json +++ b/software/ntfy/egg-ntfy.json @@ -4,7 +4,7 @@ "version": "PTDL_v2", "update_url": null }, - "exported_at": "2023-12-01T17:09:31+01:00", + "exported_at": "2023-12-01T20:43:46+01:00", "name": "ntfy", "author": "me@cjstevenson.com", "description": null, @@ -18,14 +18,25 @@ "files": "{\r\n \"server\/server.yml\": {\r\n \"parser\": \"yaml\",\r\n \"find\": {\r\n \"listen-http\": \":{{server.build.default.port}}\",\r\n \"cache-file\": \".\/cache.db\"\r\n }\r\n }\r\n}", "startup": "{\r\n \"done\": \"INFO Listening on\"\r\n}", "logs": "{}", - "stop": "^^C" + "stop": "^C" }, "scripts": { "installation": { - "script": "## NTFY Installscript\r\n\r\n## update system\r\napt update\r\napt -y install --no-install-recommends curl tar\r\n\r\n## Variables\r\nARCH=$([[ \"$(uname -m)\" == \"x86_64\" ]] && echo \"amd64\" || echo \"arm64\")\r\n\r\ncd \/mnt\/server\r\n\r\n## install ntfy\r\necho -e \"download url: https:\/\/github.com\/binwiederhier\/ntfy\/releases\/download\/v2.8.0\/ntfy_2.8.0_linux_${ARCH}.tar.gz\"\r\necho -e \"downloading ntfy $VERSION\"\r\ncurl -sSL -o ntfy_2.8.0_linux_${ARCH}.tar.gz https:\/\/github.com\/binwiederhier\/ntfy\/releases\/download\/v2.8.0\/ntfy_2.8.0_linux_${ARCH}.tar.gz\r\n\r\necho -e \"unzipping ntfy exc\"\r\ntar -zxvf .\/ntfy_2.8.0_linux_${ARCH}.tar.gz ntfy\r\n\r\n## clear temp stuff\r\necho -e \"deleting temp files\"\r\nrm .\/ntfy_2.8.0_linux_${ARCH}.tar.gz\r\nrm -r .\/ntfy_2.8.0_linux_${ARCH}\r\n\r\necho -e \"creating cache.db\"\r\ntouch cache.db\r\n\r\necho -e \"-------------------------------------------------\"\r\necho -e \"Installation completed\"\r\necho -e \"-------------------------------------------------\"", + "script": "## NTFY Installscript\r\n\r\n## update system\r\napt update\r\napt -y install --no-install-recommends curl tar jq ca-certificates\r\n\r\n## Variables\r\nARCH=$([[ \"$(uname -m)\" == \"x86_64\" ]] && echo \"amd64\" || echo \"arm64\")\r\nMATCH=linux_${ARCH}.tar.gz\r\n\r\ncd \/mnt\/server\r\n\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/binwiederhier\/ntfy\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/binwiederhier\/ntfy\/releases\")\r\n\r\nif [ -z \"${VERSION}\" ] || [ \"${VERSION}\" == \"latest\" ]; then\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})\r\nelse\r\n VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"${VERSION}\" == \"${VERSION_CHECK}\" ]; then\r\n DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})\r\n else\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\n## install ntfy\r\necho -e \"download url: $DOWNLOAD_URL\"\r\necho -e \"downloading ntfy $VERSION\"\r\ncurl -sSL -o ntfy_linux_${ARCH}.tar.gz $DOWNLOAD_URL\r\n\r\necho -e \"unzipping ntfy exc\"\r\ntar -zxvf .\/ntfy_linux_${ARCH}.tar.gz \r\n\r\nmv .\/*_linux_${ARCH}\/ntfy .\r\n\r\n## clear temp stuff\r\necho -e \"deleting temp files\"\r\nrm .\/ntfy_linux_${ARCH}.tar.gz\r\nrm -r .\/*_linux_${ARCH}\r\n\r\necho -e \"creating cache.db\"\r\ntouch cache.db\r\n\r\necho -e \"-------------------------------------------------\"\r\necho -e \"Installation completed\"\r\necho -e \"-------------------------------------------------\"", "container": "debian:bullseye-slim", "entrypoint": "bash" } }, - "variables": [] -} + "variables": [ + { + "name": "Version", + "description": "Version for (re)installation such as 2.8.0. Defaults to latest version if no valid version is provided", + "env_variable": "VERSION", + "default_value": "latest", + "user_viewable": true, + "user_editable": true, + "rules": "string|max:20", + "field_type": "text" + } + ] +} \ No newline at end of file From c46afe7f73344dd7065963f5901584d3d5711d13 Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sun, 3 Dec 2023 13:04:27 +0100 Subject: [PATCH 3/4] cleanup --- software/ntfy/egg-ntfy.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/software/ntfy/egg-ntfy.json b/software/ntfy/egg-ntfy.json index 2a2f26ff4..69e190613 100644 --- a/software/ntfy/egg-ntfy.json +++ b/software/ntfy/egg-ntfy.json @@ -4,13 +4,13 @@ "version": "PTDL_v2", "update_url": null }, - "exported_at": "2023-12-01T20:43:46+01:00", + "exported_at": "2023-12-03T13:03:17+01:00", "name": "ntfy", "author": "me@cjstevenson.com", - "description": null, + "description": "Send push notifications to your phone or desktop using PUT\/POST", "features": null, "docker_images": { - "ghcr.io\/parkervcp\/yolks:debian": "ghcr.io\/parkervcp\/yolks:debian" + "Debian": "ghcr.io\/parkervcp\/yolks:debian" }, "file_denylist": [], "startup": ".\/ntfy serve --config server\/server.yml", @@ -22,8 +22,8 @@ }, "scripts": { "installation": { - "script": "## NTFY Installscript\r\n\r\n## update system\r\napt update\r\napt -y install --no-install-recommends curl tar jq ca-certificates\r\n\r\n## Variables\r\nARCH=$([[ \"$(uname -m)\" == \"x86_64\" ]] && echo \"amd64\" || echo \"arm64\")\r\nMATCH=linux_${ARCH}.tar.gz\r\n\r\ncd \/mnt\/server\r\n\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/binwiederhier\/ntfy\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/binwiederhier\/ntfy\/releases\")\r\n\r\nif [ -z \"${VERSION}\" ] || [ \"${VERSION}\" == \"latest\" ]; then\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})\r\nelse\r\n VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"${VERSION}\" == \"${VERSION_CHECK}\" ]; then\r\n DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})\r\n else\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\n## install ntfy\r\necho -e \"download url: $DOWNLOAD_URL\"\r\necho -e \"downloading ntfy $VERSION\"\r\ncurl -sSL -o ntfy_linux_${ARCH}.tar.gz $DOWNLOAD_URL\r\n\r\necho -e \"unzipping ntfy exc\"\r\ntar -zxvf .\/ntfy_linux_${ARCH}.tar.gz \r\n\r\nmv .\/*_linux_${ARCH}\/ntfy .\r\n\r\n## clear temp stuff\r\necho -e \"deleting temp files\"\r\nrm .\/ntfy_linux_${ARCH}.tar.gz\r\nrm -r .\/*_linux_${ARCH}\r\n\r\necho -e \"creating cache.db\"\r\ntouch cache.db\r\n\r\necho -e \"-------------------------------------------------\"\r\necho -e \"Installation completed\"\r\necho -e \"-------------------------------------------------\"", - "container": "debian:bullseye-slim", + "script": "## NTFY Installscript\r\n\r\n\r\n## Variables\r\nARCH=$([[ \"$(uname -m)\" == \"x86_64\" ]] && echo \"amd64\" || echo \"arm64\")\r\nMATCH=linux_${ARCH}.tar.gz\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/binwiederhier\/ntfy\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/binwiederhier\/ntfy\/releases\")\r\n\r\nif [ -z \"${VERSION}\" ] || [ \"${VERSION}\" == \"latest\" ]; then\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})\r\nelse\r\n VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"${VERSION}\" == \"${VERSION_CHECK}\" ]; then\r\n DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})\r\n else\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\n## install ntfy\r\necho -e \"Download url: ${DOWNLOAD_URL}\"\r\necho -e \"Downloading ntfy: ${VERSION}\"\r\ncurl -sSL -o ntfy_linux.tar.gz ${DOWNLOAD_URL}\r\n\r\necho -e \"unzipping ntfy exc\"\r\ntar xvf ntfy_linux.tar.gz --strip-components=1\r\n\r\n## clear temp stuff\r\necho -e \"deleting temp files\"\r\nrm ntfy_linux.tar.gz\r\n\r\nchmod +x ntfy\r\n\r\nFILE=\/mnt\/server\/cache.db\r\nif [ -f \"$FILE\" ]; then\r\n echo \"$FILE exists.\"\r\n echo -e \"skipping creating cache.db\"\r\nelse \r\n echo -e \"creating cache.db\"\r\n touch cache.db\r\nfi\r\n\r\n\r\n\r\necho -e \"-------------------------------------------------\"\r\necho -e \"Installation completed\"\r\necho -e \"-------------------------------------------------\"", + "container": "ghcr.io\/parkervcp\/installers:debian", "entrypoint": "bash" } }, From 2800c2bdbda8815a265d77c60d6afd83c93eedfc Mon Sep 17 00:00:00 2001 From: CJ Stevenson Date: Fri, 8 Dec 2023 17:03:12 +0000 Subject: [PATCH 4/4] Change default config creation method --- software/ntfy/egg-ntfy.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/software/ntfy/egg-ntfy.json b/software/ntfy/egg-ntfy.json index 69e190613..8d54de3a2 100644 --- a/software/ntfy/egg-ntfy.json +++ b/software/ntfy/egg-ntfy.json @@ -4,7 +4,7 @@ "version": "PTDL_v2", "update_url": null }, - "exported_at": "2023-12-03T13:03:17+01:00", + "exported_at": "2023-12-08T18:01:30+01:00", "name": "ntfy", "author": "me@cjstevenson.com", "description": "Send push notifications to your phone or desktop using PUT\/POST", @@ -15,14 +15,14 @@ "file_denylist": [], "startup": ".\/ntfy serve --config server\/server.yml", "config": { - "files": "{\r\n \"server\/server.yml\": {\r\n \"parser\": \"yaml\",\r\n \"find\": {\r\n \"listen-http\": \":{{server.build.default.port}}\",\r\n \"cache-file\": \".\/cache.db\"\r\n }\r\n }\r\n}", + "files": "{}", "startup": "{\r\n \"done\": \"INFO Listening on\"\r\n}", "logs": "{}", "stop": "^C" }, "scripts": { "installation": { - "script": "## NTFY Installscript\r\n\r\n\r\n## Variables\r\nARCH=$([[ \"$(uname -m)\" == \"x86_64\" ]] && echo \"amd64\" || echo \"arm64\")\r\nMATCH=linux_${ARCH}.tar.gz\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/binwiederhier\/ntfy\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/binwiederhier\/ntfy\/releases\")\r\n\r\nif [ -z \"${VERSION}\" ] || [ \"${VERSION}\" == \"latest\" ]; then\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})\r\nelse\r\n VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"${VERSION}\" == \"${VERSION_CHECK}\" ]; then\r\n DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})\r\n else\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\n## install ntfy\r\necho -e \"Download url: ${DOWNLOAD_URL}\"\r\necho -e \"Downloading ntfy: ${VERSION}\"\r\ncurl -sSL -o ntfy_linux.tar.gz ${DOWNLOAD_URL}\r\n\r\necho -e \"unzipping ntfy exc\"\r\ntar xvf ntfy_linux.tar.gz --strip-components=1\r\n\r\n## clear temp stuff\r\necho -e \"deleting temp files\"\r\nrm ntfy_linux.tar.gz\r\n\r\nchmod +x ntfy\r\n\r\nFILE=\/mnt\/server\/cache.db\r\nif [ -f \"$FILE\" ]; then\r\n echo \"$FILE exists.\"\r\n echo -e \"skipping creating cache.db\"\r\nelse \r\n echo -e \"creating cache.db\"\r\n touch cache.db\r\nfi\r\n\r\n\r\n\r\necho -e \"-------------------------------------------------\"\r\necho -e \"Installation completed\"\r\necho -e \"-------------------------------------------------\"", + "script": "## NTFY Installscript\r\n\r\n\r\n## Variables\r\nARCH=$([[ \"$(uname -m)\" == \"x86_64\" ]] && echo \"amd64\" || echo \"arm64\")\r\nMATCH=linux_${ARCH}.tar.gz\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/binwiederhier\/ntfy\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/binwiederhier\/ntfy\/releases\")\r\n\r\nif [ -z \"${VERSION}\" ] || [ \"${VERSION}\" == \"latest\" ]; then\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})\r\nelse\r\n VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"${VERSION}\" == \"${VERSION_CHECK}\" ]; then\r\n DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})\r\n else\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\n## install ntfy\r\necho -e \"Download url: ${DOWNLOAD_URL}\"\r\necho -e \"Downloading ntfy: ${VERSION}\"\r\ncurl -sSL -o ntfy_linux.tar.gz ${DOWNLOAD_URL}\r\n\r\necho -e \"unzipping ntfy exc\"\r\ntar xvf ntfy_linux.tar.gz --strip-components=1\r\n\r\n## clear temp stuff\r\necho -e \"deleting temp files\"\r\nrm ntfy_linux.tar.gz\r\n\r\nchmod +x ntfy\r\n\r\nFILE=\/mnt\/server\/cache.db\r\nif [ -f \"$FILE\" ]; then\r\n echo \"$FILE exists.\"\r\n echo -e \"skipping creating cache.db\"\r\nelse \r\n echo -e \"creating cache.db\"\r\n touch cache.db\r\nfi\r\n\r\nrm -f \/mnt\/server\/server\/server.yml\r\n\r\necho -e '# ntfy server config file\r\n#\r\n# Please refer to the documentation at https:\/\/ntfy.sh\/docs\/config\/ for details.\r\n# All options also support underscores (_) instead of dashes (-) to comply with the YAML spec.\r\n\r\nlisten-http: \":'${SERVER_PORT}'\"\r\ncache-file: \".\/cache.db\"' >> \/mnt\/server\/server\/server.yml\r\n\r\n\r\necho -e \"-------------------------------------------------\"\r\necho -e \"Installation completed\"\r\necho -e \"-------------------------------------------------\"", "container": "ghcr.io\/parkervcp\/installers:debian", "entrypoint": "bash" }