feat: allow owners to set the background image.

This commit allows instance owners to set a background
image for their Pleroma instances. It copies the image from
the ansible controller onto the target host and updates the
Pleroma configuration.

Owners can set the value for pleroma.config.frontend.background
to set the background image. The default image is used if
this value is not set.
This commit is contained in:
Dan Anglin 2019-11-12 23:09:21 +00:00
parent 7a93d7680d
commit cb22739b38
No known key found for this signature in database
GPG key ID: 7AC2B18EC1D09F27
3 changed files with 19 additions and 1 deletions

View file

@ -13,6 +13,8 @@ pleroma_defaults:
healthCheck: "true"
logLevel: info
federating: "true"
frontend:
background: ""
db:
name: pleroma_db
user: pleroma

View file

@ -1,5 +1,4 @@
---
# TODO: Do we need ncurses?
- name: Ensure Pleroma dependencies are installed.
apk:
name: unzip, ncurses
@ -34,6 +33,7 @@
- "{{ pleroma_base_data_dir }}"
- "{{ pleroma_uploads_dir }}"
- "{{ pleroma_static_dir }}"
- "{{ pleroma_static_dir }}/images"
- name: Ensuring that the release build of pleroma is downloaded.
get_url:
@ -75,6 +75,15 @@
find {{ pleroma_user.home }} -mindepth 1 -maxdepth 1 -type d | xargs -I dir chmod 0700 dir
find {{ pleroma_user.home }} -mindepth 1 -maxdepth 1 -type d | xargs -I dir chown -R {{ pleroma_user.name }}:{{ pleroma_user.group }} dir
- name: Uploading the background image to the static directory
copy:
src: "{{ pleroma.config.frontend.background }}"
dest: "{{ pleroma_static_dir }}/images/pleroma-background.png"
owner: "{{ pleroma_user.name }}"
group: "{{ pleroma_user.group }}"
mode: '0400'
when: pleroma.config.frontend.background|length
- name: Setting up the Pleroma service.
copy:
src: "{{ pleroma_user.home }}/installation/init.d/pleroma"

View file

@ -71,3 +71,10 @@ config :web_push_encryption, :vapid_details,
subject: "mailto:{{ pleroma.config.webPushEncryption.email }}",
private_key: "{{ pleroma.config.webPushEncryption.privateKey }}",
public_key: "{{ pleroma.config.webPushEncryption.publicKey }}"
{% if pleroma.config.frontend.background|length %}
config :pleroma, :frontend_configurations,
pleroma_fe: %{
background: "/images/pleroma-background.png"
}
{% endif %}