matrix-ntfy: persist cache on disk

This commit is contained in:
Julian Foad 2022-07-02 17:35:53 +01:00
parent 763586e878
commit 3866fff5a8
4 changed files with 14 additions and 1 deletions

View file

@ -1,4 +1,3 @@
# TODO
- Mount the ntfy database to disk so subscriptions persist across restarts.
- Authentication?

View file

@ -2,6 +2,7 @@
matrix_ntfy_enabled: true
matrix_ntfy_base_path: "{{ matrix_base_data_path }}/ntfy"
matrix_ntfy_data_path: "{{ matrix_ntfy_base_path }}/data"
matrix_ntfy_version: v1.27.2
matrix_ntfy_docker_image: "{{ matrix_container_global_registry_prefix }}binwiederhier/ntfy:{{ matrix_ntfy_version }}"

View file

@ -15,6 +15,17 @@
delay: "{{ matrix_container_retries_delay }}"
until: result is not failed
- name: Ensure matrix-ntfy paths exists
file:
path: "{{ item }}"
state: directory
mode: 0750
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}"
with_items:
- "{{ matrix_ntfy_base_path }}"
- "{{ matrix_ntfy_data_path }}"
- name: Ensure matrix-ntfy.service installed
template:
src: "{{ role_path }}/templates/systemd/matrix-ntfy.service.j2"

View file

@ -23,6 +23,8 @@ ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-ntfy \
{% if matrix_ntfy_container_http_host_bind_port %}
-p {{ matrix_ntfy_container_http_host_bind_port }}:80 \
{% endif %}
--mount type=bind,src={{ matrix_ntfy_data_path }},dst=/data \
--env NTFY_CACHE_FILE=/data/cache.db \
--env NTFY_BASE_URL=https://{{ matrix_server_fqn_ntfy }} \
{{ matrix_ntfy_docker_image }} \
serve --behind-proxy