feat: add support for uploading custom themes
This commit now allows instance admins to: - upload custom themes from their Ansible controller to the themes directory of their Pleoma instance. - set the default theme for their Pleroma instance. This commit also contains the following changes: - explicitly set the background image if not set by the user. - explicitly set the default theme if not set by the user.
This commit is contained in:
parent
f33b58bc14
commit
aa66391f83
5 changed files with 51 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +1,4 @@
|
|||
inventories/*
|
||||
!inventories/.gitkeep
|
||||
site.yml
|
||||
vapid-private-key.pem
|
||||
|
|
|
@ -16,6 +16,9 @@ pleroma_defaults:
|
|||
federating: "true"
|
||||
frontend:
|
||||
background: ""
|
||||
themes:
|
||||
custom: []
|
||||
default: pleroma-dark
|
||||
db:
|
||||
name: pleroma_db
|
||||
user: pleroma
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
- "{{ pleroma_uploads_dir }}"
|
||||
- "{{ pleroma_static_dir }}"
|
||||
- "{{ pleroma_static_dir }}/images"
|
||||
- "{{ pleroma_static_dir }}/static"
|
||||
- "{{ pleroma_static_dir }}/static/themes"
|
||||
|
||||
- name: Ensuring that the release build of pleroma is downloaded.
|
||||
get_url:
|
||||
|
@ -84,6 +86,23 @@
|
|||
mode: '0400'
|
||||
when: pleroma.config.frontend.background|length
|
||||
|
||||
- name: Ensuring that the custom themes are uploaded.
|
||||
copy:
|
||||
src: "{{ item.path }}"
|
||||
dest: "{{ pleroma_static_dir }}/static/themes/{{ item.name }}.json"
|
||||
owner: "{{ pleroma_user.name }}"
|
||||
group: "{{ pleroma_user.group }}"
|
||||
mode: '0400'
|
||||
loop: "{{ pleroma.config.frontend.themes.custom }}"
|
||||
|
||||
- name: Ensuring the styles.json file is set in the static/static directory.
|
||||
template:
|
||||
src: var_lib_pleroma_static_static_styles.json.j2
|
||||
dest: "{{ pleroma_static_dir }}/static/styles.json"
|
||||
owner: "{{ pleroma_user.name }}"
|
||||
group: "{{ pleroma_user.group }}"
|
||||
mode: '0400'
|
||||
|
||||
- name: Setting up the Pleroma service.
|
||||
copy:
|
||||
src: "{{ pleroma_user.home }}/installation/init.d/pleroma"
|
||||
|
|
|
@ -73,9 +73,12 @@ config :web_push_encryption, :vapid_details,
|
|||
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"
|
||||
}
|
||||
{% if pleroma.config.frontend.background|length %}
|
||||
background: "/images/pleroma-background.png",
|
||||
{% else %}
|
||||
background: "/images/city.jpg",
|
||||
{% endif %}
|
||||
theme: "{{ pleroma.config.frontend.themes.default }}"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"pleroma-dark": [ "Pleroma Dark", "#121a24", "#182230", "#b9b9ba", "#d8a070", "#d31014", "#0fa00f", "#0095ff", "#ffa500" ],
|
||||
"pleroma-light": [ "Pleroma Light", "#f2f4f6", "#dbe0e8", "#304055", "#f86f0f", "#d31014", "#0fa00f", "#0095ff", "#ffa500" ],
|
||||
"pleroma-amoled": [ "Pleroma Dark AMOLED", "#000000", "#111111", "#b0b0b1", "#d8a070", "#aa0000", "#0fa00f", "#0095ff", "#d59500"],
|
||||
"classic-dark": [ "Classic Dark", "#161c20", "#282e32", "#b9b9b9", "#baaa9c", "#d31014", "#0fa00f", "#0095ff", "#ffa500" ],
|
||||
"bird": [ "Bird", "#f8fafd", "#e6ecf0", "#14171a", "#0084b8", "#e0245e", "#17bf63", "#1b95e0", "#fab81e"],
|
||||
"ir-black": [ "Ir Black", "#000000", "#242422", "#b5b3aa", "#ff6c60", "#FF6C60", "#A8FF60", "#96CBFE", "#FFFFB6" ],
|
||||
"monokai": [ "Monokai", "#272822", "#383830", "#f8f8f2", "#f92672", "#F92672", "#a6e22e", "#66d9ef", "#f4bf75" ],
|
||||
|
||||
"redmond-xx": "/static/themes/redmond-xx.json",
|
||||
"redmond-xx-se": "/static/themes/redmond-xx-se.json",
|
||||
"redmond-xxi": "/static/themes/redmond-xxi.json",
|
||||
"breezy-dark": "/static/themes/breezy-dark.json",
|
||||
"breezy-light": "/static/themes/breezy-light.json",
|
||||
"mammal": "/static/themes/mammal.json"
|
||||
|
||||
{% for i in pleroma.config.frontend.themes.custom %}
|
||||
, "{{ i.name }}": "/static/themes/{{ i.name }}.json"
|
||||
{% endfor %}
|
||||
|
||||
}
|
Reference in a new issue