added akkoma support; changed the way frontends are installed (following akkoma's docs); switched to mangane; updated config templates

This commit is contained in:
muppeth 2023-01-04 00:21:10 +01:00
parent 31bafb0ce0
commit 75b694f78e
Signed by: muppeth
GPG Key ID: 0EBC7B9848D04031
10 changed files with 60 additions and 117 deletions

View File

@ -1,6 +1,6 @@
# Pleroma role
Pleroma role is was initially based on role by (Luke Hoersten)[https://src.nth.io/ansible-roles/file/2d705e63f6cb/pleroma/otp] with heavy modifications (basically re-written).
This role deploys and updates OTP pleroma instance with soapbox ui. Currently supported distributions are debian based. Role requires disroot's (nginx)[https://git.disroot.org/Disroot-Ansible/nginx] role and (postgresql)[https://github.com/ANXS/postgresql.git]. Other nginx / postgres roles could be used but may require changes in variables.
# Pleroma/Akkoma role
Pleroma/Akkoma role is was initially based on role by (Luke Hoersten)[https://src.nth.io/ansible-roles/file/2d705e63f6cb/pleroma/otp] with heavy modifications (basically re-written).
This role deploys and updates OTP akkoma (default) or pleroma instance. Currently supported distributions are debian based. Role requires disroot's (nginx)[https://git.disroot.org/Disroot-Ansible/nginx] role and (postgresql)[https://github.com/ANXS/postgresql.git]. Other nginx / postgres roles could be used but may require changes in variables.
You can deploy test instance using `Vagrantfile` attached to the role.
`vagrant up`

View File

@ -42,6 +42,7 @@ pleroma_signup_open: "true"
pleroma_loglevel: ":debug"
pleroma_conf_from_db: 'true'
pleroma_allow_relay: 'true'
pleroma_nickname_format: 'false'
pleroma_remote_post_retention: '90'
pleroma_db_host: "localhost"
pleroma_db_superuser: "postgres"
@ -55,49 +56,30 @@ pleroma_admin: 'true'
pleroma_admin_user: 'admin'
pleroma_admin_email: 'admin@example.lan'
pleroma_admin_password: 'changeme'
pleroma_download_url: "https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/stable/download?job={{pleroma_arch}}"
pleroma_download_url: 'https://akkoma-updates.s3-website.fr-par.scw.cloud/stable/akkoma-{{ pleroma_arch }}.zip' #akkoma
#pleroma_download_url: "https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/stable/download?job={{pleroma_arch}}" #pleroma
pleroma_arch: 'amd64'
pleroma_nofile: '500000'
pleroma_instance_favicons: 'true'
pleroma_remoteip: 'true'
pleroma_proxies: '["192.168.33.15"]'
pleroma_soapbox: false
pleroma_soapbox_version: "develop"
pleroma_soapbox_download_url: "https://gitlab.com/soapbox-pub/soapbox/-/jobs/artifacts/{{ pleroma_soapbox_version }}/download?job=build-production"
pleroma_custom_emoji: 'true'
pleroma_custom_emoji_list:
- name: 'blobbear'
url: 'https://labo.lacoloc.cafe/june/blobbears/raw/branch/master/manifest.json'
- name: 'blobcat'
url: 'https://fedi.absturztau.be/emoji-packs/manifest.json'
#soapbox
pleroma_soapbox_logo: '/images/logo.png'
pleroma_soapbox_brandcolor: '#0482d8'
pleroma_soapbox_promopanel:
- text: 'Our Site stats'
icon: 'area-chart'
url: 'https://fediverse.network/example.com'
- text: 'Our Site blog'
icon: 'comment-o'
url: 'https://blog.example.com'
pleroma_soapbox_gif: 'false'
pleroma_soapbox_thememode: 'light'
pleroma_soapbox_copyright: '♡2020. Copying is an act of love. Please copy and share.'
pleroma_soapbox_footer:
- name: 'About'
url: '/about'
- name: 'Terms of Service'
url: '/about/tos'
- name: 'Privacy Policy'
url: '/about/privacy'
- name: 'Source code'
url: '/about#opensource'
pleroma_soapbox_redirects: 'false' #set to true if you want to redirect footer page links to another site
#pleroma_soap_about: 'https://example.com/about'
#pleroma_soap_tos: 'https://example.com/tos'
#pleroma_soap_pp: 'https://example/pp'
pleroma_frontends:
- name: 'mangane'
conf: 'primary'
ref: 'dist'
url: 'https://github.com/Cl0v1s/mangane-ui/releases/latest/download/static.zip'
- name: 'admin-fe'
conf: 'admin'
ref: 'develop'
- name: 'pleroma-fe'
conf: 'pleroma'
ref: 'develop'
#Postgres
postgresql_version: 13

0
files/favicon.png Normal file
View File

0
files/logo.svg Normal file
View File

View File

@ -37,6 +37,7 @@
- '{{ pleroma_data_dir }}/uploads'
- '{{ pleroma_data_dir }}/static'
- '{{ pleroma_data_dir }}/static/emoji'
- '{{ pleroma_data_dir }}/static/instance'
- name: '[Config] - Install custom emoji packs'
shell: '{{ pleroma_app_dir }}/release/bin/pleroma_ctl emoji get-packs {{ item.name }} -m {{ item.url }}'

View File

@ -1,70 +1,38 @@
---
- name: '[Soapbox] - delete tmp pleroma dir'
file:
path: "{{ pleroma_tmp_dir }}"
state: '{{ item }}'
with_items:
- absent
- directory
- name: '[Soapbox] - download and unarchive soapbox'
unarchive:
src: '{{ pleroma_soapbox_download_url }}'
dest: '{{ pleroma_tmp_dir }}'
creates: '{{ pleroma_tmp_dir }}/static'
remote_src: yes
- name: '[Frontends] - Make sure pleroma is up and running'
systemd:
name: 'pleroma.service'
state: 'started'
- name: '[Frontend] - Install/update known frontends'
command: '{{ pleroma_app_dir }}/release/bin/pleroma_ctl frontend install {{ item.name }} --ref {{ item.ref }}'
become: yes
become_user: '{{ pleroma_user }}'
with_items: '{{ pleroma_frontends }}'
when: 'item.url is not defined'
- name: '[Soapbox] - delete old soapbox'
file:
path: "{{ pleroma_data_dir }}/static/"
state: "absent"
- name: '[Frontend] - Install/update custom frontends'
command: '{{ pleroma_app_dir }}/release/bin/pleroma_ctl frontend install {{ item.name }} --ref {{ item.ref }} --build-url {{ item.url }}'
become: yes
become_user: '{{ pleroma_user }}'
with_items: '{{ pleroma_frontends }}'
when: 'item.url is defined'
- name: '[Soapbox] - install soapbox'
copy:
remote_src: true
src: '{{ pleroma_tmp_dir }}/static/'
dest: '{{ pleroma_data_dir }}/static/'
owner: '{{ pleroma_user }}'
group: '{{ pleroma_group }}'
mode: "0755"
- name: '[Soapbox] - install soapbox config'
template:
src: 'soapbox.json.j2'
dest: '{{ pleroma_data_dir }}/static/instance/soapbox.json'
owner: '{{ pleroma_user }}'
group: '{{ pleroma_group }}'
mode: "0755"
- name: '[Soapbox] - Create about dir'
file:
path: '{{ pleroma_data_dir }}/static/instance/about'
state: directory
- name: '[ Soapbox] - Deploy about redirects'
template:
src: 'about/soapbox.{{ item }}.html.j2'
dest: '{{ pleroma_data_dir }}/static/instance/about/{{ item }}.html'
with_items:
- index
- privacy
- tos
when: pleroma_soapbox_redirects is defined and pleroma_soapbox_redirects == 'true'
- name: '[Soapbox] - Create images dir'
- name: '[Frontend] - Create images dir'
file:
path: '{{ pleroma_data_dir }}/static/images'
state: directory
- name: '[Soapbox] - Add instance logo'
- name: '[Frontend] - Add instance logo'
copy:
src: '{{ pleroma_extra_files_path }}/logo.png'
dest: '{{ pleroma_data_dir }}/static/images/logo.png'
src: '{{ pleroma_extra_files_path }}/logo.svg'
dest: '{{ pleroma_data_dir }}/static/instance/logo.svg'
owner: '{{ pleroma_user }}'
group: '{{ pleroma_group }}'
mode: 0775
- name: '[Soapbox] - Add instance favicon'
- name: '[Frontend] - Add instance favicon'
copy:
src: '{{ pleroma_extra_files_path }}/logo.png'
dest: '{{ pleroma_data_dir }}/static/favicon.png'

View File

@ -26,4 +26,3 @@
- include: frontends.yml
tags:
- upgrade
- soapbox

View File

@ -5,8 +5,19 @@
become: yes
become_user: '{{ pleroma_user }}'
- name: '[Upgrade] - Stop backend'
systemd:
name: pleroma
state: 'stopped'
daemon_reload: 'yes'
- name: '[Upgrade] - Run migrations'
command: '{{ pleroma_app_dir }}/release/bin/pleroma_ctl migrate'
become: yes
become_user: '{{ pleroma_user }}'
- name: '[Upgrade] - Start backend'
systemd:
name: pleroma
state: 'started'
daemon_reload: 'yes'

View File

@ -20,6 +20,7 @@ config :pleroma, :instance,
invites_enabled: {{ pleroma_invites_enabled }},
static_dir: "{{ pleroma_data_dir }}/static/",
allow_relay: {{ pleroma_allow_relay }},
extended_nickname_format: {{ pleroma_nickname_format }},
remote_post_retention_days: "{{ pleroma_remote_post_retention }}"
@ -96,3 +97,11 @@ config :pleroma, :ldap,
config :pleroma, :instances_favicons, enabled: {{ pleroma_instance_favicons }}
config :pleroma, :frontends,
{% for item in pleroma_frontends %}
{{ item.conf }}: %{
"name" => "{{ item.name }}",
"ref" => "{{ item.ref }}"
}{% if not loop.last %},
{% endif %}
{% endfor %}

View File

@ -1,27 +0,0 @@
{
"logo": "{{ pleroma_soapbox_logo }}",
"brandColor": "{{ pleroma_soapbox_brandcolor }}",
"promoPanel": {
"items": [
{% for item in pleroma_soapbox_promopanel %}
{
"icon": "{{ item.icon }}",
"text": "{{ item.text }}",
"url": "{{ item.url }}"
}{% if not loop.last %},{% endif %}
{% endfor %}
]
},
"defaultSettings": {
"autoPlayGif": {{ pleroma_soapbox_gif }},
"themeMode": "{{ pleroma_soapbox_thememode }}"
},
"copyright": "{{ pleroma_soapbox_copyright }}",
"navlinks": {
"homeFooter": [
{% for item in pleroma_soapbox_footer %}
{ "title": "{{ item.name }}", "url": "{{ item.url }}" }{% if not loop.last %},{% endif %}
{% endfor %}
]
}
}