From af037a1064e58f726fb705446b2a94e3e6b9d9fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20G=C3=B3mez=20Zarzosa?= <34076979+jorgegomzar@users.noreply.github.com> Date: Thu, 4 Sep 2025 08:46:24 +0200 Subject: [PATCH] feat: add ntfy (Item requested on issue #145) (#328) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: add meta ntfy * chore: typo * feat: add ntfy --------- Co-authored-by: Jorge Gómez Zarzosa --- README.md | 4 +- blueprints/ntfy/docker-compose.yml | 23 ++ blueprints/ntfy/logo.png | Bin 0 -> 3627 bytes blueprints/ntfy/template.toml | 469 +++++++++++++++++++++++++++++ meta.json | 19 ++ 5 files changed, 513 insertions(+), 2 deletions(-) create mode 100644 blueprints/ntfy/docker-compose.yml create mode 100644 blueprints/ntfy/logo.png create mode 100644 blueprints/ntfy/template.toml diff --git a/README.md b/README.md index 3adb6d5a..e6815e03 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ services: container_name: grafana # ❌ Remove this ``` -- Don't use dokploy-network in your docker compose file, by default all the templates have this flag enabled https://docs.dokploy.com/docs/core/docker-compose/utilities#isolated-deployments, so by default they have a internal network created, so you don't to create a new one or use the dokploy-network name. +- Don't use dokploy-network in your docker compose file, by default all the templates have this flag enabled https://docs.dokploy.com/docs/core/docker-compose/utilities#isolated-deployments, so by default they have a internal network created, so you don't need to create a new one or use the dokploy-network name. ```yaml services: @@ -222,4 +222,4 @@ services: 3. Click on the Template Card, and click the Copy Button in the Base64 Configuration. 4. Go to your instance, create a new Compose Service, go to Advanced Section -> Scroll Down -> Import Section -> Paste the Base64 Value -> Click on the Import Button 5. If everything is correct and set, you should see a modal with all the details (Compose File, Environment Variables, Mounts, Domains, etc) -6. Now you can click on the Deploy Button and wait for the deployment to finish, and try to access to the service, if everything is correct you should access to the service and see the template working. \ No newline at end of file +6. Now you can click on the Deploy Button and wait for the deployment to finish, and try to access to the service, if everything is correct you should access to the service and see the template working. diff --git a/blueprints/ntfy/docker-compose.yml b/blueprints/ntfy/docker-compose.yml new file mode 100644 index 00000000..ac68ff31 --- /dev/null +++ b/blueprints/ntfy/docker-compose.yml @@ -0,0 +1,23 @@ +services: + ntfy: + image: binwiederhier/ntfy + restart: unless-stopped + command: + - serve + ports: + - "${HTTP_PORT}" + volumes: + - ntfy-data:/var/lib/ntfy + - ntfy-cache:/var/cache/ntfy + - ../files/server.yml:/etc/ntfy/server.yml:ro + - ../files/templates:/etc/ntfy/templates:ro + healthcheck: + test: ["CMD-SHELL", "wget -q --tries=1 http://localhost:${HTTP_PORT}/v1/health -O - | grep -Eo '\"healthy\"\\s*:\\s*true' || exit 1"] + interval: 60s + timeout: 10s + retries: 3 + start_period: 40s + +volumes: + ntfy-data: + ntfy-cache: diff --git a/blueprints/ntfy/logo.png b/blueprints/ntfy/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..6b969a846efc6c3dac70510793c72253e04389c9 GIT binary patch literal 3627 zcmV+`4%G39P)XbFClKy8~u8T@K#2U}z9I9j!6Ye%LtbjEg| zb)4yFr&IrS28Ed_2&1i~sNj^^sc0=2#a6zyLqsA(qYy|!LNH;M{k;9LU+28%oV)k# zy$dASXC}G3d+vSDd*0`~?{m-H-Mc^$MHErQxC9$#cE<}0CkML~JVv%fh{V_;$w?4- zB2IpW#uMP_>gu|3-n@AaF~%AhW3%(HHxUquMx)0^M@RovQ&aN~ zWP_hTmJIsm8W;c%0B<-Pej<@b3>ifTNF)-`Xf*m>XJ_X%0Hy*c2jBxx3ZNtvKhtEe zlPL@U8yy|Jsj{+i8-S{OSe-;L!r}0?va+%Vk<6F`fH>6IBfw*^0|tOaqtVAID=Xhb zkq|3jKA-RV@p$~ul`jT> z`ThQ_MM9jRyuAF@UAuO*B3s7Nf-jXZvp_QdYTkJ=ouQo`Dg?H%h1gz|LGSPKO9ZpG9aBCXv!j;th})E0i&5ActqP& zIs)1TwSDVgioc8zGg5N)!h~Q#B1D)5d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 HcmV?d00001 diff --git a/blueprints/ntfy/template.toml b/blueprints/ntfy/template.toml new file mode 100644 index 00000000..df03b04c --- /dev/null +++ b/blueprints/ntfy/template.toml @@ -0,0 +1,469 @@ +[variables] +ntfy_domain = "${domain}" +ntfy_http_port = "80" + +[[config.domains]] +serviceName = "ntfy" +host = "${ntfy_domain}" +port = 80 +path = "/" + +[config.env] +HTTP_PORT = "${ntfy_http_port}" + +# This is an example, you'll need to add manually any templates you want to use +# Should be preserved as we use the ../files/templates solution +[[config.mounts]] +filePath = "/templates/myapp.yml" +content = """ +title: | + {{- if eq .status "firing" }} + {{- if gt .percent 90.0 }}🚨 Critical alert + {{- else }}⚠️ Alert{{- end }} + {{- else if eq .status "resolved" }} + ✅ Alert resolved + {{- end }} +message: | + Status: {{ .status }} + Type: {{ .type | upper }} ({{ .percent }}%) + Server: {{ .server }} +""" + +[[config.mounts]] +filePath = "/server.yml" +content = """ +# ntfy server config file +# +# Please refer to the documentation at https://ntfy.sh/docs/config/ for details. +# All options also support underscores (_) instead of dashes (-) to comply with the YAML spec. + +# Public facing base URL of the service (e.g. https://ntfy.sh or https://ntfy.example.com) +# +# This setting is required for any of the following features: +# - attachments (to return a download URL) +# - e-mail sending (for the topic URL in the email footer) +# - iOS push notifications for self-hosted servers (to calculate the Firebase poll_request topic) +# - Matrix Push Gateway (to validate that the pushkey is correct) +# +base-url: https://${ntfy_domain} + +# Listen address for the HTTP & HTTPS web server. If "listen-https" is set, you must also +# set "key-file" and "cert-file". Format: []:, e.g. "1.2.3.4:8080". +# +# To listen on all interfaces, you may omit the IP address, e.g. ":443". +# To disable HTTP, set "listen-http" to "-". +# +listen-http: ":${ntfy_http_port}" +# listen-https: ":443" + +# Listen on a Unix socket, e.g. /var/lib/ntfy/ntfy.sock +# This can be useful to avoid port issues on local systems, and to simplify permissions. +# +# listen-unix: +# listen-unix-mode: + +# Path to the private key & cert file for the HTTPS web server. Not used if "listen-https" is not set. +# +# key-file: "" +# cert-file: "" + +# If set, also publish messages to a Firebase Cloud Messaging (FCM) topic for your app. +# This is optional and only required to save battery when using the Android app. +# +# firebase-key-file: + +# If "cache-file" is set, messages are cached in a local SQLite database instead of only in-memory. +# This allows for service restarts without losing messages in support of the since= parameter. +# +# The "cache-duration" parameter defines the duration for which messages will be buffered +# before they are deleted. This is required to support the "since=..." and "poll=1" parameter. +# To disable the cache entirely (on-disk/in-memory), set "cache-duration" to 0. +# The cache file is created automatically, provided that the correct permissions are set. +# +# The "cache-startup-queries" parameter allows you to run commands when the database is initialized, +# e.g. to enable WAL mode (see https://phiresky.github.io/blog/2020/sqlite-performance-tuning/)). +# Example: +# cache-startup-queries: | +# pragma journal_mode = WAL; +# pragma synchronous = normal; +# pragma temp_store = memory; +# pragma busy_timeout = 15000; +# vacuum; +# +# The "cache-batch-size" and "cache-batch-timeout" parameter allow enabling async batch writing +# of messages. If set, messages will be queued and written to the database in batches of the given +# size, or after the given timeout. This is only required for high volume servers. +# +# Debian/RPM package users: +# Use /var/cache/ntfy/cache.db as cache file to avoid permission issues. The package +# creates this folder for you. +# +# Check your permissions: +# If you are running ntfy with systemd, make sure this cache file is owned by the +# ntfy user and group by running: chown ntfy.ntfy . +# +cache-file: /var/cache/ntfy/cache.db +cache-duration: "12h" +# cache-startup-queries: +# cache-batch-size: 0 +# cache-batch-timeout: "0ms" + +# If set, access to the ntfy server and API can be controlled on a granular level using +# the 'ntfy user' and 'ntfy access' commands. See the --help pages for details, or check the docs. +# +# - auth-file is the SQLite user/access database; it is created automatically if it doesn't already exist +# - auth-default-access defines the default/fallback access if no access control entry is found; it can be +# set to "read-write" (default), "read-only", "write-only" or "deny-all". +# - auth-startup-queries allows you to run commands when the database is initialized, e.g. to enable +# WAL mode. This is similar to cache-startup-queries. See above for details. +# - auth-users is a list of users that are automatically created when the server starts. +# Each entry is in the format "::", e.g. "phil:$2a$10$YLiO8U21sX1uhZamTLJXHuxgVC0Z/GKISibrKCLohPgtG7yIxSk4C:user" +# Use 'ntfy user hash' to generate the password hash from a password. +# - auth-access is a list of access control entries that are automatically created when the server starts. +# Each entry is in the format "::", e.g. "phil:mytopic:rw" or "phil:phil-*:rw". +# - auth-tokens is a list of access tokens that are automatically created when the server starts. +# Each entry is in the format ":[: