From ff896830384cf2db689bcf78dc2fc98722b3dbec Mon Sep 17 00:00:00 2001 From: Phil Date: Thu, 19 Jun 2025 12:46:51 -0600 Subject: [PATCH] feat: add Gotify notification server with iGotify iOS support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add comprehensive push notification infrastructure with: - Gotify server for push notifications with admin password configuration - iGotify Assistant service for iOS notification relay via Apple Push Notifications - Dual subdomain setup (gotify.* and gotify-assistant.*) - Proper service dependencies and container communication via hairpinning - Caddy reverse proxy configuration for both services - DNS A records for both subdomains - Added to monitoring services category - Tested with successful notification delivery Services accessible at: - https://gotify.thesatelliteoflove.com (main server) - https://gotify-assistant.thesatelliteoflove.com (iOS assistant) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- dns.yml | 4 ++ group_vars/all/domains.yml | 2 + group_vars/docker/services.yml | 2 +- roles/docker/files/Caddyfile | 8 ++++ roles/docker/tasks/monitoring/gotify.yml | 19 +++++++++ roles/docker/tasks/monitoring/main.yml | 6 ++- roles/docker/templates/gotify-compose.yml.j2 | 44 ++++++++++++++++++++ 7 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 roles/docker/tasks/monitoring/gotify.yml create mode 100644 roles/docker/templates/gotify-compose.yml.j2 diff --git a/dns.yml b/dns.yml index 803cb16..26803c1 100644 --- a/dns.yml +++ b/dns.yml @@ -45,6 +45,10 @@ ip: "152.53.36.98" - name: bookmarks ip: "152.53.36.98" + - name: gotify + ip: "152.53.36.98" + - name: gotify-assistant + ip: "152.53.36.98" - name: nerder.land dns_records: - name: "forms" diff --git a/group_vars/all/domains.yml b/group_vars/all/domains.yml index 4128484..a5bf881 100644 --- a/group_vars/all/domains.yml +++ b/group_vars/all/domains.yml @@ -29,6 +29,8 @@ subdomains: appriseapi: "appriseapi.{{ primary_domain }}" dockge: "dockge.{{ primary_domain }}" code: "code.{{ primary_domain }}" # Code Server + gotify: "gotify.{{ primary_domain }}" # Gotify notifications + gotify_assistant: "gotify-assistant.{{ primary_domain }}" # iGotify iOS assistant # Email domains for notifications email_domains: diff --git a/group_vars/docker/services.yml b/group_vars/docker/services.yml index 4e04521..562b936 100644 --- a/group_vars/docker/services.yml +++ b/group_vars/docker/services.yml @@ -7,7 +7,7 @@ service_categories: media: ["audiobookshelf", "calibre", "ghost", "pinchflat", "pinry", "hoarder", "manyfold"] productivity: ["paperlessngx", "baikal", "syncthing", "mmdl", "heyform", "dawarich", "pingvin"] communication: ["gotosocial", "postiz"] - monitoring: ["glance", "changedetection", "appriseapi"] + monitoring: ["glance", "changedetection", "appriseapi", "gotify"] # Common service configuration services: diff --git a/roles/docker/files/Caddyfile b/roles/docker/files/Caddyfile index 4fe30d3..41e3600 100644 --- a/roles/docker/files/Caddyfile +++ b/roles/docker/files/Caddyfile @@ -83,6 +83,14 @@ home.thesatelliteoflove.com { reverse_proxy authentik-server-1:9000 } +gotify.thesatelliteoflove.com { + reverse_proxy gotify-gotify-1:80 +} + +gotify-assistant.thesatelliteoflove.com { + reverse_proxy gotify-igotify-assistant-1:8080 +} + repair.nerder.land { root * /srv/repair diff --git a/roles/docker/tasks/monitoring/gotify.yml b/roles/docker/tasks/monitoring/gotify.yml new file mode 100644 index 0000000..cee7b7c --- /dev/null +++ b/roles/docker/tasks/monitoring/gotify.yml @@ -0,0 +1,19 @@ +- name: Create gotify directories + ansible.builtin.file: + path: "{{ item }}" + state: directory + loop: + - /opt/stacks/gotify + +- name: Template out the gotify compose file + ansible.builtin.template: + src: gotify-compose.yml.j2 + dest: /opt/stacks/gotify/compose.yml + owner: root + mode: 644 + +- name: Deploy gotify stack + community.docker.docker_compose_v2: + project_src: /opt/stacks/gotify + files: + - compose.yml \ No newline at end of file diff --git a/roles/docker/tasks/monitoring/main.yml b/roles/docker/tasks/monitoring/main.yml index 99f2229..49e16e5 100644 --- a/roles/docker/tasks/monitoring/main.yml +++ b/roles/docker/tasks/monitoring/main.yml @@ -11,4 +11,8 @@ - name: Install appriseapi import_tasks: appriseapi.yml - tags: appriseapi \ No newline at end of file + tags: appriseapi + +- name: Install gotify + import_tasks: gotify.yml + tags: gotify \ No newline at end of file diff --git a/roles/docker/templates/gotify-compose.yml.j2 b/roles/docker/templates/gotify-compose.yml.j2 new file mode 100644 index 0000000..a382f89 --- /dev/null +++ b/roles/docker/templates/gotify-compose.yml.j2 @@ -0,0 +1,44 @@ +services: + gotify: + image: gotify/server:latest + restart: unless-stopped + volumes: + - gotify_data:/app/data + environment: + - GOTIFY_DEFAULTUSER_PASS={{ vault_gotify.admin_password }} + - TZ=America/Denver + labels: + glance.name: Gotify + glance.icon: si:gotify + glance.url: "https://{{ subdomains.gotify }}/" + glance.description: Push notification server + extra_hosts: + - "{{ subdomains.auth }}:{{ docker.hairpin_ip }}" + - "{{ subdomains.gotify_assistant }}:{{ docker.hairpin_ip }}" + + igotify-assistant: + image: ghcr.io/androidseb25/igotify-notification-assist:latest + restart: unless-stopped + volumes: + - igotify_data:/app/data + environment: + - TZ=America/Denver + depends_on: + - gotify + labels: + glance.name: iGotify Assistant + glance.icon: si:apple + glance.url: "https://{{ subdomains.gotify_assistant }}/" + glance.description: iOS notification assistant + extra_hosts: + - "{{ subdomains.auth }}:{{ docker.hairpin_ip }}" + - "{{ subdomains.gotify }}:{{ docker.hairpin_ip }}" + +volumes: + gotify_data: + igotify_data: + +networks: + default: + external: true + name: "{{ docker.network_name }}" \ No newline at end of file