diff --git a/.gitignore b/.gitignore index 08c588b..35eb97f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ inventories/* !inventories/.gitkeep +site.yml +vapid-private-key.pem diff --git a/roles/init/defaults/main.yml b/roles/init/defaults/main.yml index cfdabd2..82efd69 100644 --- a/roles/init/defaults/main.yml +++ b/roles/init/defaults/main.yml @@ -16,6 +16,9 @@ pleroma_defaults: federating: "true" frontend: background: "" + themes: + custom: [] + default: pleroma-dark db: name: pleroma_db user: pleroma diff --git a/roles/pleroma-backend/tasks/main.yml b/roles/pleroma-backend/tasks/main.yml index 5831f35..ac13200 100644 --- a/roles/pleroma-backend/tasks/main.yml +++ b/roles/pleroma-backend/tasks/main.yml @@ -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" diff --git a/roles/pleroma-backend/templates/etc_pleroma_config.exs.j2 b/roles/pleroma-backend/templates/etc_pleroma_config.exs.j2 index d76e7a6..e3728cd 100644 --- a/roles/pleroma-backend/templates/etc_pleroma_config.exs.j2 +++ b/roles/pleroma-backend/templates/etc_pleroma_config.exs.j2 @@ -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 }}" } -{% endif %} diff --git a/roles/pleroma-backend/templates/var_lib_pleroma_static_static_styles.json.j2 b/roles/pleroma-backend/templates/var_lib_pleroma_static_static_styles.json.j2 new file mode 100644 index 0000000..c828dfe --- /dev/null +++ b/roles/pleroma-backend/templates/var_lib_pleroma_static_static_styles.json.j2 @@ -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 %} + +}