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/Akkoma 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). 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 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. 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. You can deploy test instance using `Vagrantfile` attached to the role.
`vagrant up` `vagrant up`

View File

@ -42,6 +42,7 @@ pleroma_signup_open: "true"
pleroma_loglevel: ":debug" pleroma_loglevel: ":debug"
pleroma_conf_from_db: 'true' pleroma_conf_from_db: 'true'
pleroma_allow_relay: 'true' pleroma_allow_relay: 'true'
pleroma_nickname_format: 'false'
pleroma_remote_post_retention: '90' pleroma_remote_post_retention: '90'
pleroma_db_host: "localhost" pleroma_db_host: "localhost"
pleroma_db_superuser: "postgres" pleroma_db_superuser: "postgres"
@ -55,49 +56,30 @@ pleroma_admin: 'true'
pleroma_admin_user: 'admin' pleroma_admin_user: 'admin'
pleroma_admin_email: 'admin@example.lan' pleroma_admin_email: 'admin@example.lan'
pleroma_admin_password: 'changeme' 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_arch: 'amd64'
pleroma_nofile: '500000' pleroma_nofile: '500000'
pleroma_instance_favicons: 'true' pleroma_instance_favicons: 'true'
pleroma_remoteip: 'true' pleroma_remoteip: 'true'
pleroma_proxies: '["192.168.33.15"]' 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: 'true'
pleroma_custom_emoji_list: pleroma_custom_emoji_list:
- name: 'blobbear' - name: 'blobbear'
url: 'https://labo.lacoloc.cafe/june/blobbears/raw/branch/master/manifest.json' url: 'https://labo.lacoloc.cafe/june/blobbears/raw/branch/master/manifest.json'
- name: 'blobcat' - name: 'blobcat'
url: 'https://fedi.absturztau.be/emoji-packs/manifest.json' url: 'https://fedi.absturztau.be/emoji-packs/manifest.json'
#soapbox pleroma_frontends:
pleroma_soapbox_logo: '/images/logo.png' - name: 'mangane'
pleroma_soapbox_brandcolor: '#0482d8' conf: 'primary'
pleroma_soapbox_promopanel: ref: 'dist'
- text: 'Our Site stats' url: 'https://github.com/Cl0v1s/mangane-ui/releases/latest/download/static.zip'
icon: 'area-chart' - name: 'admin-fe'
url: 'https://fediverse.network/example.com' conf: 'admin'
- text: 'Our Site blog' ref: 'develop'
icon: 'comment-o' - name: 'pleroma-fe'
url: 'https://blog.example.com' conf: 'pleroma'
pleroma_soapbox_gif: 'false' ref: 'develop'
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'
#Postgres #Postgres
postgresql_version: 13 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 }}/uploads'
- '{{ pleroma_data_dir }}/static' - '{{ pleroma_data_dir }}/static'
- '{{ pleroma_data_dir }}/static/emoji' - '{{ pleroma_data_dir }}/static/emoji'
- '{{ pleroma_data_dir }}/static/instance'
- name: '[Config] - Install custom emoji packs' - name: '[Config] - Install custom emoji packs'
shell: '{{ pleroma_app_dir }}/release/bin/pleroma_ctl emoji get-packs {{ item.name }} -m {{ item.url }}' 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' - name: '[Frontends] - Make sure pleroma is up and running'
unarchive: systemd:
src: '{{ pleroma_soapbox_download_url }}' name: 'pleroma.service'
dest: '{{ pleroma_tmp_dir }}' state: 'started'
creates: '{{ pleroma_tmp_dir }}/static'
remote_src: yes - 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' - name: '[Frontend] - Install/update custom frontends'
file: command: '{{ pleroma_app_dir }}/release/bin/pleroma_ctl frontend install {{ item.name }} --ref {{ item.ref }} --build-url {{ item.url }}'
path: "{{ pleroma_data_dir }}/static/" become: yes
state: "absent" become_user: '{{ pleroma_user }}'
with_items: '{{ pleroma_frontends }}'
when: 'item.url is defined'
- name: '[Soapbox] - install soapbox' - name: '[Frontend] - Create images dir'
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'
file: file:
path: '{{ pleroma_data_dir }}/static/images' path: '{{ pleroma_data_dir }}/static/images'
state: directory state: directory
- name: '[Soapbox] - Add instance logo' - name: '[Frontend] - Add instance logo'
copy: copy:
src: '{{ pleroma_extra_files_path }}/logo.png' src: '{{ pleroma_extra_files_path }}/logo.svg'
dest: '{{ pleroma_data_dir }}/static/images/logo.png' dest: '{{ pleroma_data_dir }}/static/instance/logo.svg'
owner: '{{ pleroma_user }}' owner: '{{ pleroma_user }}'
group: '{{ pleroma_group }}' group: '{{ pleroma_group }}'
mode: 0775 mode: 0775
- name: '[Soapbox] - Add instance favicon' - name: '[Frontend] - Add instance favicon'
copy: copy:
src: '{{ pleroma_extra_files_path }}/logo.png' src: '{{ pleroma_extra_files_path }}/logo.png'
dest: '{{ pleroma_data_dir }}/static/favicon.png' dest: '{{ pleroma_data_dir }}/static/favicon.png'

View File

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

View File

@ -5,8 +5,19 @@
become: yes become: yes
become_user: '{{ pleroma_user }}' become_user: '{{ pleroma_user }}'
- name: '[Upgrade] - Stop backend'
systemd:
name: pleroma
state: 'stopped'
daemon_reload: 'yes'
- name: '[Upgrade] - Run migrations' - name: '[Upgrade] - Run migrations'
command: '{{ pleroma_app_dir }}/release/bin/pleroma_ctl migrate' command: '{{ pleroma_app_dir }}/release/bin/pleroma_ctl migrate'
become: yes become: yes
become_user: '{{ pleroma_user }}' 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 }}, invites_enabled: {{ pleroma_invites_enabled }},
static_dir: "{{ pleroma_data_dir }}/static/", static_dir: "{{ pleroma_data_dir }}/static/",
allow_relay: {{ pleroma_allow_relay }}, allow_relay: {{ pleroma_allow_relay }},
extended_nickname_format: {{ pleroma_nickname_format }},
remote_post_retention_days: "{{ pleroma_remote_post_retention }}" 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, :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 %}
]
}
}