From 91de139c73bde7f9123492f855d1d1f009246306 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Tue, 15 Sep 2020 14:46:20 +0200 Subject: [PATCH] Update local federation test setup --- docker/federation/docker-compose.yml | 75 ++++++++++++++++++++-------- docker/federation/nginx.conf | 40 +++++++-------- 2 files changed, 75 insertions(+), 40 deletions(-) diff --git a/docker/federation/docker-compose.yml b/docker/federation/docker-compose.yml index 49c4ae857..449f0c664 100644 --- a/docker/federation/docker-compose.yml +++ b/docker/federation/docker-compose.yml @@ -15,11 +15,11 @@ services: depends_on: - pictrs - iframely - - lemmy-alpha - - lemmy-beta - - lemmy-gamma - - lemmy-delta - - lemmy-epsilon + - lemmy-alpha-ui + - lemmy-beta-ui + - lemmy-gamma-ui + - lemmy-delta-ui + - lemmy-epsilon-ui pictrs: restart: always @@ -28,17 +28,24 @@ services: volumes: - ./volumes/pictrs_alpha:/mnt + lemmy-alpha-ui: + image: dessalines/lemmy-isomorphic-ui:v0.0.7 + environment: + - LEMMY_INTERNAL_HOST=lemmy-alpha:8541 + - LEMMY_EXTERNAL_HOST=localhost:8541 + - LEMMY_HTTPS=false + depends_on: + - lemmy-alpha lemmy-alpha: image: lemmy-federation:latest environment: - - LEMMY_HOSTNAME=lemmy-alpha:8540 + - LEMMY_HOSTNAME=lemmy-alpha:8541 - LEMMY_DATABASE_URL=postgres://lemmy:password@postgres_alpha:5432/lemmy - LEMMY_JWT_SECRET=changeme - - LEMMY_FRONT_END_DIR=/app/dist - LEMMY_FEDERATION__ENABLED=true - LEMMY_FEDERATION__TLS_ENABLED=false - LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-beta,lemmy-gamma,lemmy-delta,lemmy-epsilon - - LEMMY_PORT=8540 + - LEMMY_PORT=8541 - LEMMY_SETUP__ADMIN_USERNAME=lemmy_alpha - LEMMY_SETUP__ADMIN_PASSWORD=lemmy - LEMMY_SETUP__SITE_NAME=lemmy-alpha @@ -58,17 +65,24 @@ services: volumes: - ./volumes/postgres_alpha:/var/lib/postgresql/data + lemmy-beta-ui: + image: dessalines/lemmy-isomorphic-ui:v0.0.7 + environment: + - LEMMY_INTERNAL_HOST=lemmy-beta:8551 + - LEMMY_EXTERNAL_HOST=localhost:8551 + - LEMMY_HTTPS=false + depends_on: + - lemmy-beta lemmy-beta: image: lemmy-federation:latest environment: - - LEMMY_HOSTNAME=lemmy-beta:8550 + - LEMMY_HOSTNAME=lemmy-beta:8551 - LEMMY_DATABASE_URL=postgres://lemmy:password@postgres_beta:5432/lemmy - LEMMY_JWT_SECRET=changeme - - LEMMY_FRONT_END_DIR=/app/dist - LEMMY_FEDERATION__ENABLED=true - LEMMY_FEDERATION__TLS_ENABLED=false - LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-alpha,lemmy-gamma,lemmy-delta,lemmy-epsilon - - LEMMY_PORT=8550 + - LEMMY_PORT=8551 - LEMMY_SETUP__ADMIN_USERNAME=lemmy_beta - LEMMY_SETUP__ADMIN_PASSWORD=lemmy - LEMMY_SETUP__SITE_NAME=lemmy-beta @@ -88,17 +102,24 @@ services: volumes: - ./volumes/postgres_beta:/var/lib/postgresql/data + lemmy-gamma-ui: + image: dessalines/lemmy-isomorphic-ui:v0.0.7 + environment: + - LEMMY_INTERNAL_HOST=lemmy-gamma:8561 + - LEMMY_EXTERNAL_HOST=localhost:8561 + - LEMMY_HTTPS=false + depends_on: + - lemmy-gamma lemmy-gamma: image: lemmy-federation:latest environment: - - LEMMY_HOSTNAME=lemmy-gamma:8560 + - LEMMY_HOSTNAME=lemmy-gamma:8561 - LEMMY_DATABASE_URL=postgres://lemmy:password@postgres_gamma:5432/lemmy - LEMMY_JWT_SECRET=changeme - - LEMMY_FRONT_END_DIR=/app/dist - LEMMY_FEDERATION__ENABLED=true - LEMMY_FEDERATION__TLS_ENABLED=false - LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-alpha,lemmy-beta,lemmy-delta,lemmy-epsilon - - LEMMY_PORT=8560 + - LEMMY_PORT=8561 - LEMMY_SETUP__ADMIN_USERNAME=lemmy_gamma - LEMMY_SETUP__ADMIN_PASSWORD=lemmy - LEMMY_SETUP__SITE_NAME=lemmy-gamma @@ -119,17 +140,24 @@ services: - ./volumes/postgres_gamma:/var/lib/postgresql/data # An instance with only an allowlist for beta + lemmy-delta-ui: + image: dessalines/lemmy-isomorphic-ui:v0.0.7 + environment: + - LEMMY_INTERNAL_HOST=lemmy-delta:8571 + - LEMMY_EXTERNAL_HOST=localhost:8571 + - LEMMY_HTTPS=false + depends_on: + - lemmy-delta lemmy-delta: image: lemmy-federation:latest environment: - - LEMMY_HOSTNAME=lemmy-delta:8570 + - LEMMY_HOSTNAME=lemmy-delta:8571 - LEMMY_DATABASE_URL=postgres://lemmy:password@postgres_delta:5432/lemmy - LEMMY_JWT_SECRET=changeme - - LEMMY_FRONT_END_DIR=/app/dist - LEMMY_FEDERATION__ENABLED=true - LEMMY_FEDERATION__TLS_ENABLED=false - LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-beta - - LEMMY_PORT=8570 + - LEMMY_PORT=8571 - LEMMY_SETUP__ADMIN_USERNAME=lemmy_delta - LEMMY_SETUP__ADMIN_PASSWORD=lemmy - LEMMY_SETUP__SITE_NAME=lemmy-delta @@ -150,17 +178,24 @@ services: - ./volumes/postgres_delta:/var/lib/postgresql/data # An instance who has a blocklist, with lemmy-alpha blocked + lemmy-epsilon-ui: + image: dessalines/lemmy-isomorphic-ui:v0.0.7 + environment: + - LEMMY_INTERNAL_HOST=lemmy-epsilon:8581 + - LEMMY_EXTERNAL_HOST=localhost:8581 + - LEMMY_HTTPS=false + depends_on: + - lemmy-epsilon lemmy-epsilon: image: lemmy-federation:latest environment: - - LEMMY_HOSTNAME=lemmy-epsilon:8580 + - LEMMY_HOSTNAME=lemmy-epsilon:8581 - LEMMY_DATABASE_URL=postgres://lemmy:password@postgres_epsilon:5432/lemmy - LEMMY_JWT_SECRET=changeme - - LEMMY_FRONT_END_DIR=/app/dist - LEMMY_FEDERATION__ENABLED=true - LEMMY_FEDERATION__TLS_ENABLED=false - LEMMY_FEDERATION__BLOCKED_INSTANCES=lemmy-alpha - - LEMMY_PORT=8580 + - LEMMY_PORT=8581 - LEMMY_SETUP__ADMIN_USERNAME=lemmy_epsilon - LEMMY_SETUP__ADMIN_PASSWORD=lemmy - LEMMY_SETUP__SITE_NAME=lemmy-epsilon diff --git a/docker/federation/nginx.conf b/docker/federation/nginx.conf index 6d062f70b..ed008c844 100644 --- a/docker/federation/nginx.conf +++ b/docker/federation/nginx.conf @@ -12,20 +12,20 @@ http { client_max_body_size 50M; location / { - proxy_pass http://lemmy-alpha:8540; + proxy_pass http://lemmy-alpha-ui:1234/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Cuts off the trailing slash on URLs to make them valid rewrite ^(.+)/+$ $1 permanent; - - # WebSocket support + } + location /api/v1/ws { + proxy_pass http://lemmy-alpha:8541; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } - location /iframely/ { proxy_pass http://iframely:80/; proxy_set_header X-Real-IP $remote_addr; @@ -43,20 +43,20 @@ http { client_max_body_size 50M; location / { - proxy_pass http://lemmy-beta:8550; + proxy_pass http://lemmy-beta-ui:1234; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Cuts off the trailing slash on URLs to make them valid rewrite ^(.+)/+$ $1 permanent; - - # WebSocket support + } + location /api/v1/ws { + proxy_pass http://lemmy-beta:8551; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } - location /iframely/ { proxy_pass http://iframely:80/; proxy_set_header X-Real-IP $remote_addr; @@ -74,20 +74,20 @@ http { client_max_body_size 50M; location / { - proxy_pass http://lemmy-gamma:8560; + proxy_pass http://lemmy-gamma-ui:1234; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Cuts off the trailing slash on URLs to make them valid rewrite ^(.+)/+$ $1 permanent; - - # WebSocket support + } + location /api/v1/ws { + proxy_pass http://lemmy-gamma:8561; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } - location /iframely/ { proxy_pass http://iframely:80/; proxy_set_header X-Real-IP $remote_addr; @@ -105,20 +105,20 @@ http { client_max_body_size 50M; location / { - proxy_pass http://lemmy-delta:8570; + proxy_pass http://lemmy-delta-ui:1234; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Cuts off the trailing slash on URLs to make them valid rewrite ^(.+)/+$ $1 permanent; - - # WebSocket support + } + location /api/v1/ws { + proxy_pass http://lemmy-delta:8571; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } - location /iframely/ { proxy_pass http://iframely:80/; proxy_set_header X-Real-IP $remote_addr; @@ -136,20 +136,20 @@ http { client_max_body_size 50M; location / { - proxy_pass http://lemmy-epsilon:8580; + proxy_pass http://lemmy-epsilon-ui:1234; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Cuts off the trailing slash on URLs to make them valid rewrite ^(.+)/+$ $1 permanent; - - # WebSocket support + } + location /api/v1/ws { + proxy_pass http://lemmy-epsilon:8581; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } - location /iframely/ { proxy_pass http://iframely:80/; proxy_set_header X-Real-IP $remote_addr;