]> Untitled Git - lemmy.git/commitdiff
Get image uploads working for federation-test
authorFelix <me@nutomic.com>
Sat, 28 Mar 2020 16:30:59 +0000 (17:30 +0100)
committerFelix <me@nutomic.com>
Sat, 28 Mar 2020 16:30:59 +0000 (17:30 +0100)
docker/federation-test/docker-compose.yml
docker/federation-test/nginx.conf [new file with mode: 0644]

index de539237b17dfd5e74e17a7b84704c8ae2919bec..91f167c46a440e0840044b1f6cf4629b7545180f 100644 (file)
@@ -1,17 +1,30 @@
 version: '3.3'
 
 services:
+  nginx:
+    image: nginx:1.17-alpine
+    ports:
+      - "8540:8540"
+      - "8550:8550"
+    volumes:
+      - ./nginx.conf:/etc/nginx/nginx.conf
+    depends_on:
+      - lemmy_alpha
+      - pictshare_alpha
+      - lemmy_beta
+      - pictshare_beta
+      - iframely
+    restart: "always"
+
   lemmy_alpha:
     image: lemmy-federation-test:latest
-    ports:
-      - "127.0.0.1:8540:8540"
     environment:
       - LEMMY_HOSTNAME=lemmy_alpha:8540
       - 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__FOLLOWED_INSTANCES=lemmy_beta:8541
+      - LEMMY_FEDERATION__FOLLOWED_INSTANCES=lemmy_beta:8550
       - LEMMY_FEDERATION__TLS_ENABLED=false
       - LEMMY_PORT=8540
       - RUST_BACKTRACE=1
@@ -27,20 +40,23 @@ services:
     volumes:
       - ./volumes/postgres_alpha:/var/lib/postgresql/data
     restart: always
+  pictshare_alpha:
+    image: shtripok/pictshare:latest
+    volumes:
+      - ./volumes/pictshare_alpha:/usr/share/nginx/html/data
+    restart: always
 
   lemmy_beta:
     image: lemmy-federation-test:latest
-    ports:
-      - "127.0.0.1:8541:8541"
     environment:
-      - LEMMY_HOSTNAME=lemmy_beta:8541
+      - LEMMY_HOSTNAME=lemmy_beta:8550
       - 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__FOLLOWED_INSTANCES=lemmy_alpha:8540
       - LEMMY_FEDERATION__TLS_ENABLED=false
-      - LEMMY_PORT=8541
+      - LEMMY_PORT=8550
       - RUST_BACKTRACE=1
     restart: always
     depends_on:
@@ -54,11 +70,14 @@ services:
     volumes:
       - ./volumes/postgres_beta:/var/lib/postgresql/data
     restart: always
+  pictshare_beta:
+    image: shtripok/pictshare:latest
+    volumes:
+      - ./volumes/pictshare_beta:/usr/share/nginx/html/data
+    restart: always
 
   iframely:
     image: dogbin/iframely:latest
-    ports:
-      - "127.0.0.1:8061:80"
     volumes:
       - ../iframely.config.local.js:/iframely/config.local.js:ro
     restart: always
diff --git a/docker/federation-test/nginx.conf b/docker/federation-test/nginx.conf
new file mode 100644 (file)
index 0000000..96fbf99
--- /dev/null
@@ -0,0 +1,73 @@
+events {
+    worker_connections 1024;
+}
+
+http {
+    server {
+        listen 8540;
+        server_name 127.0.0.1;
+
+        # Upload limit for pictshare
+        client_max_body_size 50M;
+
+        location / {
+            proxy_pass http://lemmy_alpha:8540;
+            proxy_set_header X-Real-IP $remote_addr;
+            proxy_set_header Host $host;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+
+            # WebSocket support
+            proxy_http_version 1.1;
+            proxy_set_header Upgrade $http_upgrade;
+            proxy_set_header Connection "upgrade";
+        }
+
+        location /pictshare/ {
+          proxy_pass http://pictshare_alpha:80/;
+          proxy_set_header X-Real-IP $remote_addr;
+          proxy_set_header Host $host;
+          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        }
+
+        location /iframely/ {
+          proxy_pass http://iframely:80/;
+          proxy_set_header X-Real-IP $remote_addr;
+          proxy_set_header Host $host;
+          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        }
+    }
+
+    server {
+         listen 8550;
+         server_name 127.0.0.1;
+
+         # Upload limit for pictshare
+         client_max_body_size 50M;
+
+         location / {
+             proxy_pass http://lemmy_beta:8540;
+             proxy_set_header X-Real-IP $remote_addr;
+             proxy_set_header Host $host;
+             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+
+             # WebSocket support
+             proxy_http_version 1.1;
+             proxy_set_header Upgrade $http_upgrade;
+             proxy_set_header Connection "upgrade";
+         }
+
+         location /pictshare/ {
+           proxy_pass http://pictshare_beta:80/;
+           proxy_set_header X-Real-IP $remote_addr;
+           proxy_set_header Host $host;
+           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+         }
+
+         location /iframely/ {
+           proxy_pass http://iframely:80/;
+           proxy_set_header X-Real-IP $remote_addr;
+           proxy_set_header Host $host;
+           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+         }
+     }
+}