federate two pleroma instances instead

This commit is contained in:
Luna 2022-11-18 13:15:04 -03:00
parent b8eb5119da
commit 330786ea27
6 changed files with 133 additions and 45 deletions

View file

@ -30,43 +30,46 @@ http {
#gzip on;
server {
listen 80;
listen [::]:80;
root /mnt/none;
index index.html index.htm;
#server {
# listen 80;
# listen [::]:80;
# root /mnt/none;
# index index.html index.htm;
server_name mastodon.pubtester.local;
# server_name mastodon.pubtester.local;
absolute_redirect off;
server_name_in_redirect off;
# absolute_redirect off;
# server_name_in_redirect off;
error_page 404 /404.html;
error_page 410 /410.html;
# error_page 404 /404.html;
# error_page 410 /410.html;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
# location / {
# proxy_set_header Host $http_host;
# proxy_set_header X-Forwarded-Proto https;
proxy_pass http://mastodon_web:3000;
}
# proxy_pass http://mastodon_web:3000;
# }
location ^~ /api/v1/streaming {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
# location ^~ /api/v1/streaming {
# proxy_set_header Host $http_host;
# proxy_set_header X-Forwarded-Proto https;
proxy_pass http://mastodon_streaming:4000;
# proxy_pass http://mastodon_streaming:4000;
# proxy_buffering off;
# proxy_redirect off;
# proxy_http_version 1.1;
# tcp_nodelay on;
# }
#}
proxy_buffering off;
proxy_redirect off;
proxy_http_version 1.1;
tcp_nodelay on;
}
}
server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
root /mnt/none;
index index.html index.htm;
@ -74,9 +77,8 @@ http {
absolute_redirect off;
server_name_in_redirect off;
error_page 404 /404.html;
error_page 410 /410.html;
ssl_certificate /etc/nginx/cert.pem;
ssl_certificate_key /etc/nginx/key.pem;
location / {
proxy_set_header Host $http_host;
@ -86,4 +88,30 @@ http {
proxy_pass http://pleroma_web:4000;
}
}
server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
root /mnt/none;
index index.html index.htm;
server_name pleroma2.pubtester.local;
absolute_redirect off;
server_name_in_redirect off;
ssl_certificate /etc/nginx/cert.pem;
ssl_certificate_key /etc/nginx/key.pem;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://pleroma2_web:4000;
}
}
}

View file

@ -1,7 +1,7 @@
import Config
config :pleroma, Pleroma.Web.Endpoint,
url: [host: System.get_env("DOMAIN", "localhost"), scheme: "http", port: 80],
url: [host: System.get_env("DOMAIN", "localhost"), scheme: "https", port: 443],
http: [ip: {0, 0, 0, 0}, port: 4000]
config :pleroma, :instance,
@ -33,6 +33,8 @@ config :pleroma, :database, rum_enabled: false
config :pleroma, :instance, static_dir: "/var/lib/pleroma/static"
config :pleroma, Pleroma.Uploaders.Local, uploads: "/var/lib/pleroma/uploads"
config :tesla, adapter: {Tesla.Adapter.Hackney, [ssl_options: [cacertfile: "/etc/ssl/cert.pem"]]}
# We can't store the secrets in this file, since this is baked into the docker image
if not File.exists?("/var/lib/pleroma/secret.exs") do
secret = :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)