From 7663ae305be0c8d8a24b7e59807be4bb7f9f935c Mon Sep 17 00:00:00 2001 From: Dirk Wilden Date: Sat, 20 Feb 2021 20:04:12 +0100 Subject: [PATCH] add gotify application --- .gitignore | 3 +++ README.md | 1 + docs/applications/gotify.md | 11 +++++++++++ docs/configuration/application_ports.md | 3 ++- nas.yml | 5 +++++ roles/gotify/defaults/main.yml | 10 ++++++++++ roles/gotify/tasks/main.yml | 19 +++++++++++++++++++ 7 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 docs/applications/gotify.md create mode 100644 roles/gotify/defaults/main.yml create mode 100644 roles/gotify/tasks/main.yml diff --git a/.gitignore b/.gitignore index 6d5441ff..9d5e5797 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ inventories # Session Session.vim + +# IntelliJ +/.idea/ diff --git a/README.md b/README.md index ac6a82dd..d8555834 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ Ansible config and a bunch of Docker containers. * [Gitea](https://gitea.io/en-us/) - Simple self-hosted GitHub clone * [GitLab](https://about.gitlab.com/features/) - Self-hosted GitHub clone of the highest order * [Glances](https://nicolargo.github.io/glances/) - for seeing the state of your system via a web browser +* [Gotify](https://gotify.net/) Self-hosted server for sending push notifications * [Grafana](https://github.com/grafana/grafana) - Dashboarding tool * [Guacamole](https://guacamole.apache.org/) - Web based remote desktop gateway, supports VNC, RDP and SSH * [Heimdall](https://heimdall.site/) - Home server dashboard diff --git a/docs/applications/gotify.md b/docs/applications/gotify.md new file mode 100644 index 00000000..6ebb61c6 --- /dev/null +++ b/docs/applications/gotify.md @@ -0,0 +1,11 @@ +# Gotify + +Homepage: [https://gotify.net/](https://gotify.net/) + +A simple server for sending and receiving messages in real-time per WebSocket. (Includes a sleek web-ui) + +## Usage + +Set `gotify_enabled: true` in your `inventories//nas.yml` file. + +The Gotify web interface can be found at http://ansible_nas_host_or_ip:2346. diff --git a/docs/configuration/application_ports.md b/docs/configuration/application_ports.md index 871adca0..5de329ec 100644 --- a/docs/configuration/application_ports.md +++ b/docs/configuration/application_ports.md @@ -23,6 +23,7 @@ By default, applications can be found on the ports listed below. | GitLab | 4443 | Bridge | HTTPS | | GitLab | 422 | Bridge | SSH | | Glances | 61208 | Bridge | HTTP | +| Gotify | 2346 | Bridge | HTTP | | Grafana | 3000 | Bridge | HTTP | | Guacamole | 8090 | Bridge | HTTP | | Heimdall | 10080 | Bridge | HTTP | @@ -75,4 +76,4 @@ By default, applications can be found on the ports listed below. | uTorrent | 6881 | Bridge | UDP | | Wallabag | 7780 | Bridge | HTTP | | YouTubeDL-Mater | 8998 | Bridge | HTTP | -| ZNC | 6677 | Bridge | | \ No newline at end of file +| ZNC | 6677 | Bridge | | diff --git a/nas.yml b/nas.yml index 317044db..02c88d44 100644 --- a/nas.yml +++ b/nas.yml @@ -103,6 +103,11 @@ - get_iplayer when: (get_iplayer_enabled | default(False)) + - role: gotify + tags: + - gotify + when: (gotify_enabled | default(False)) + - role: heimdall tags: - heimdall diff --git a/roles/gotify/defaults/main.yml b/roles/gotify/defaults/main.yml new file mode 100644 index 00000000..af4a3b49 --- /dev/null +++ b/roles/gotify/defaults/main.yml @@ -0,0 +1,10 @@ +--- +gotify_enabled: false +gotify_available_externally: "false" + +# docker image to use +gotify_docker_image: gotify/server:latest + +# network +gotify_port: "2346" +gotify_hostname: "gotify" diff --git a/roles/gotify/tasks/main.yml b/roles/gotify/tasks/main.yml new file mode 100644 index 00000000..5e55888e --- /dev/null +++ b/roles/gotify/tasks/main.yml @@ -0,0 +1,19 @@ +--- +- name: Gotify Docker Container + docker_container: + name: gotify + image: "{{ gotify_docker_image }}" + pull: true + ports: + - "{{ gotify_port }}:80" + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" + restart_policy: unless-stopped + memory: 200m + labels: + traefik.enable: "{{ gotify_available_externally }}" + traefik.http.routers.gotify.rule: "Host(`{{ gotify_hostname }}.{{ ansible_nas_domain }}`)" + traefik.http.routers.gotify.tls.certresolver: "letsencrypt" + traefik.http.routers.gotify.tls.domains[0].main: "{{ ansible_nas_domain }}" + traefik.http.routers.gotify.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" + traefik.http.services.gotify.loadbalancer.server.port: "80"