From 4eb22b0272e042f62a5a9700cba6b0a01c3352c7 Mon Sep 17 00:00:00 2001 From: Dirk Wilden Date: Sun, 21 Feb 2021 11:18:02 +0100 Subject: [PATCH] add gotify data directory and option to run with other user --- docs/applications/gotify.md | 5 +++++ roles/gotify/defaults/main.yml | 7 +++++++ roles/gotify/tasks/main.yml | 12 ++++++++++++ 3 files changed, 24 insertions(+) diff --git a/docs/applications/gotify.md b/docs/applications/gotify.md index 6ebb61c6..8e120b13 100644 --- a/docs/applications/gotify.md +++ b/docs/applications/gotify.md @@ -9,3 +9,8 @@ A simple server for sending and receiving messages in real-time per WebSocket. ( 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. + +Android client: [https://play.google.com/store/apps/details?id=com.github.gotify](https://play.google.com/store/apps/details?id=com.github.gotify) +iOS client: n/a +Chrome extension: n/a +Firefox extension: [https://addons.mozilla.org/en-US/firefox/addon/gotify-for-firefox/](https://addons.mozilla.org/en-US/firefox/addon/gotify-for-firefox/) diff --git a/roles/gotify/defaults/main.yml b/roles/gotify/defaults/main.yml index af4a3b49..e63223a9 100644 --- a/roles/gotify/defaults/main.yml +++ b/roles/gotify/defaults/main.yml @@ -2,9 +2,16 @@ gotify_enabled: false gotify_available_externally: "false" +# data directory +gotify_data_directory: "{{ docker_home }}/gotify" + # docker image to use gotify_docker_image: gotify/server:latest # network gotify_port: "2346" gotify_hostname: "gotify" + +# user to run container with +gotify_user_id: "0" +gotify_group_id: "0" diff --git a/roles/gotify/tasks/main.yml b/roles/gotify/tasks/main.yml index 5e55888e..aa4f1cf2 100644 --- a/roles/gotify/tasks/main.yml +++ b/roles/gotify/tasks/main.yml @@ -1,4 +1,11 @@ --- +- name: Create Gotify Data Directory + file: + path: "{{ item }}" + state: directory + with_items: + - "{{ gotify_data_directory }}" + - name: Gotify Docker Container docker_container: name: gotify @@ -8,6 +15,11 @@ - "{{ gotify_port }}:80" volumes: - "/var/run/docker.sock:/var/run/docker.sock" + - "{{ gotify_data_directory }}:/app/data:rw" + env: + TZ: "{{ ansible_nas_timezone }}" + PUID: "{{ gotify_user_id }}" + PGID: "{{ gotify_group_id }}" restart_policy: unless-stopped memory: 200m labels: