From b6a81cde7e8c8e2f7527d004f957357ee800efca Mon Sep 17 00:00:00 2001 From: polyfloyd Date: Wed, 21 Dec 2022 21:03:16 +0100 Subject: [PATCH] services/mastodon_spacestate: Alter picture --- roles/services/tasks/mastodon_spacestate.yaml | 12 ++++++++++++ .../services/templates/mastodon-spacestate-config.py | 4 ++++ roles/services/templates/mastodon-spacestate.service | 1 + 3 files changed, 17 insertions(+) diff --git a/roles/services/tasks/mastodon_spacestate.yaml b/roles/services/tasks/mastodon_spacestate.yaml index b9883dd..72791b9 100644 --- a/roles/services/tasks/mastodon_spacestate.yaml +++ b/roles/services/tasks/mastodon_spacestate.yaml @@ -22,6 +22,18 @@ mode: 0655 notify: restart mastodon-spacestate +- name: Copy profile picture files + copy: + src: "files/{{ item }}" + dest: /var/lib/mastodon-spacestate/{{ item }} + owner: root + group: root + mode: 0655 + with_items: + - closed.png + - open.png + notify: restart mastodon-spacestate + - name: Install service file template: src: mastodon-spacestate.service diff --git a/roles/services/templates/mastodon-spacestate-config.py b/roles/services/templates/mastodon-spacestate-config.py index fe30c15..bf8ff3c 100644 --- a/roles/services/templates/mastodon-spacestate-config.py +++ b/roles/services/templates/mastodon-spacestate-config.py @@ -12,3 +12,7 @@ closed_profile_field = 'Closed @ {}' profile_fields = [('Website', 'https://bitlair.nl/')] access_token = '{{ mastodon_spacestate_access_token }}' homeserver = 'https://hsnl.social' + +update_profilepic_on_spacestate_change = True +spacestate_open_profilepic = './open.png' +spacestate_closed_profilepic = './closed.png' diff --git a/roles/services/templates/mastodon-spacestate.service b/roles/services/templates/mastodon-spacestate.service index 4e7e458..918c789 100644 --- a/roles/services/templates/mastodon-spacestate.service +++ b/roles/services/templates/mastodon-spacestate.service @@ -8,6 +8,7 @@ After=network.target Type=simple Restart=on-failure RestartSec=10s +WorkingDirectory=/var/lib/mastodon-spacestate ExecStart=/var/lib/mastodon-spacestate/mastodon-spacestate.py DynamicUser=true