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:
parent
7a93d7680d
commit
cb22739b38
3 changed files with 19 additions and 1 deletions
|
@ -13,6 +13,8 @@ pleroma_defaults:
|
|||
healthCheck: "true"
|
||||
logLevel: info
|
||||
federating: "true"
|
||||
frontend:
|
||||
background: ""
|
||||
db:
|
||||
name: pleroma_db
|
||||
user: pleroma
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Reference in a new issue