feat: ensure playbook supports version 2.0.1

- Add proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- Remove proxy_ignore_headers Cache-Control; and proxy_hide_header Cache-Control;
- Replace :pleroma, :instance, dynamic_configuration with :pleroma, :instance, configurable_from_database
- Enhanced/fixed tasks retrieving the versions
- Updated theme configuration file
- Set proxy_pass to localhost IPv4 address

resolves dananglin/pleroma-ansible-playbook#11
This commit is contained in:
Dan Anglin 2020-04-03 05:22:34 +01:00
parent 274056bbed
commit 0a418028ab
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638
5 changed files with 23 additions and 22 deletions

View file

@ -9,7 +9,7 @@ pleroma_defaults:
instanceDescription: "A new single instance of Pleroma"
characterLimit: 5000
registrationsOpen: "false"
dynamicConfiguration: "false"
configurableFromDatabase: "false"
healthCheck: "true"
remotePostRetentionDays: 90
logLevel: info

View file

@ -79,7 +79,7 @@
when: enable_pleroma_download | default(False)
- name: Registering the installed version of Pleroma.
shell: "{{ pleroma_user.home }}/bin/pleroma version | awk '{print $2}'"
shell: "{{ pleroma_user.home }}/bin/pleroma version | awk '{print $2}' | awk -F - '{print $1}'"
register: pleroma_installed_version
when: enable_pleroma_upgrade | default(False)
@ -89,7 +89,7 @@
when: enable_pleroma_upgrade | default(False)
- name: Registering the downloaded version of Pleroma.
shell: /tmp/release/bin/pleroma version | awk '{print $2}'
shell: "/tmp/release/bin/pleroma version | awk '{print $2}' | awk -F - '{print $1}'"
register: pleroma_downloaded_version
when: enable_pleroma_upgrade | default(False)

View file

@ -23,7 +23,7 @@ config :pleroma, :instance,
registrations_open: {{ pleroma.config.registrationsOpen }},
healthcheck: {{ pleroma.config.healthCheck }},
remote_post_retention_days: {{ pleroma.config.remotePostRetentionDays }},
dynamic_configuration: {{ pleroma.config.dynamicConfiguration }},
configurable_from_database: {{ pleroma.config.configurableFromDatabase }},
federating: {{ pleroma.config.federating }},
rewrite_policy: [Pleroma.Web.ActivityPub.MRF.SimplePolicy]

View file

@ -1,6 +1,7 @@
{
"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-dark": "/static/themes/pleroma-dark.json",
"pleroma-light": "/static/themes/pleroma-light.json",
"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"],
@ -12,7 +13,8 @@
"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"
"mammal": "/static/themes/mammal.json",
"paper": "/static/themes/paper.json"
{% for i in pleroma.config.frontend.themes.custom %}
, "{{ i.name }}": "/static/themes/{{ i.name }}.json"

View file

@ -4,7 +4,7 @@ proxy_cache_path /tmp/pleroma-media-cache levels=1:2 keys_zone=pleroma_media_cac
server {
server_name {{ pleroma.config.host }};
root {{ pleroma_nginx_root_dir }};
root {{ pleroma_nginx_root_dir }};
listen 80;
listen [::]:80;
@ -31,7 +31,7 @@ ssl_session_cache shared:ssl_session_cache:10m;
server {
server_name {{ pleroma.config.host }};
root {{ pleroma_nginx_root_dir }};
root {{ pleroma_nginx_root_dir }};
listen 443 ssl http2;
listen [::]:443 ssl http2;
@ -64,28 +64,27 @@ server {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# this is explicitly IPv4 since Pleroma.Web.Endpoint binds on IPv4 only
# and `localhost.` resolves to [::0] on some systems: see issue #930
# this is explicitly IPv4 since Pleroma.Web.Endpoint binds on IPv4 only
# and `localhost.` resolves to [::0] on some systems: see issue #930
proxy_pass http://127.0.0.1:{{ pleroma.config.listeningPort }};
client_max_body_size 16m;
}
location ~ ^/(media|proxy) {
proxy_cache pleroma_media_cache;
slice 1m;
proxy_cache_key $host$uri$is_args$args$slice_range;
proxy_set_header Range $slice_range;
proxy_http_version 1.1;
proxy_cache_valid 200 206 301 304 1h;
proxy_cache_lock on;
proxy_cache pleroma_media_cache;
slice 1m;
proxy_cache_key $host$uri$is_args$args$slice_range;
proxy_set_header Range $slice_range;
proxy_http_version 1.1;
proxy_cache_valid 200 206 301 304 1h;
proxy_cache_lock on;
proxy_ignore_client_abort on;
proxy_buffering on;
proxy_buffering on;
chunked_transfer_encoding on;
proxy_ignore_headers Cache-Control;
proxy_hide_header Cache-Control;
proxy_pass http://localhost:{{ pleroma.config.listeningPort }};
proxy_pass http://127.0.0.1:{{ pleroma.config.listeningPort }};
}
{% if pleroma.keybase.enable == true -%}