aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--communities/red-right-hand/174bg.net/.env.example1
-rw-r--r--communities/red-right-hand/174bg.net/docker-compose.yaml4
-rw-r--r--communities/red-right-hand/174bg.net/production/.env.example8
-rw-r--r--communities/red-right-hand/174bg.net/production/README.md14
-rw-r--r--communities/red-right-hand/174bg.net/production/docker-compose.yaml17
-rw-r--r--communities/red-right-hand/174bg.net/src/middleware.js13
6 files changed, 10 insertions, 47 deletions
diff --git a/communities/red-right-hand/174bg.net/.env.example b/communities/red-right-hand/174bg.net/.env.example
index 75db2a7..27f7299 100644
--- a/communities/red-right-hand/174bg.net/.env.example
+++ b/communities/red-right-hand/174bg.net/.env.example
@@ -1,5 +1,6 @@
BETTER_AUTH_SECRET=
BETTER_AUTH_URL=
+BETTER_AUTH_URL_INTERNAL=http://localhost:3000
POSTGRES_PASSWORD=
POSTGRES_HOST=
diff --git a/communities/red-right-hand/174bg.net/docker-compose.yaml b/communities/red-right-hand/174bg.net/docker-compose.yaml
index e2dbbef..d441ce7 100644
--- a/communities/red-right-hand/174bg.net/docker-compose.yaml
+++ b/communities/red-right-hand/174bg.net/docker-compose.yaml
@@ -1,12 +1,14 @@
services:
174bg-net:
+ # build: https://github.com/zuedev/unnamed-group.git#master:communities/red-right-hand/174bg.net
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
ports:
- - "3000:3000"
+ - "3000:3000/tcp"
+ - "3000:3000/udp"
restart: unless-stopped
postgres:
diff --git a/communities/red-right-hand/174bg.net/production/.env.example b/communities/red-right-hand/174bg.net/production/.env.example
deleted file mode 100644
index 75db2a7..0000000
--- a/communities/red-right-hand/174bg.net/production/.env.example
+++ /dev/null
@@ -1,8 +0,0 @@
-BETTER_AUTH_SECRET=
-BETTER_AUTH_URL=
-
-POSTGRES_PASSWORD=
-POSTGRES_HOST=
-
-DISCORD_CLIENT_ID=
-DISCORD_CLIENT_SECRET= \ No newline at end of file
diff --git a/communities/red-right-hand/174bg.net/production/README.md b/communities/red-right-hand/174bg.net/production/README.md
deleted file mode 100644
index 500cd7b..0000000
--- a/communities/red-right-hand/174bg.net/production/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# 174bg.net Production Environment
-
-This directory contains the production environment specification for 174bg.net, which is the main website for the Red Right Hand community.
-
-## Deployment
-
-We use [Docker Compose](https://docs.docker.com/compose/) to manage our production environment. The `docker-compose.yml` file defines the services, networks, and volumes needed to run the application in production.
-
-To deploy the application, follow these steps:
-
-1. Ensure you have Docker and Docker Compose installed on your production server.
-2. Copy the `docker-compose.yml` file to your server.
-3. Run the following command to start the application: `docker-compose up -d`.
-4. The application will be accessible at `http://174bg-net:3000`.
diff --git a/communities/red-right-hand/174bg.net/production/docker-compose.yaml b/communities/red-right-hand/174bg.net/production/docker-compose.yaml
deleted file mode 100644
index 7abb3bb..0000000
--- a/communities/red-right-hand/174bg.net/production/docker-compose.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-services:
- 174bg-net:
- build: https://github.com/zuedev/unnamed-group.git#master:communities/red-right-hand/174bg.net
- restart: unless-stopped
- ports:
- - "3000:3000/tcp"
- - "3000:3000/udp"
- env_file: .env
-
- postgres:
- image: postgres:18
- env_file: .env
- ports:
- - "5432:5432"
- volumes:
- - ./postgres:/var/lib/postgresql
- restart: unless-stopped
diff --git a/communities/red-right-hand/174bg.net/src/middleware.js b/communities/red-right-hand/174bg.net/src/middleware.js
index d9b9a6c..59312c6 100644
--- a/communities/red-right-hand/174bg.net/src/middleware.js
+++ b/communities/red-right-hand/174bg.net/src/middleware.js
@@ -4,14 +4,13 @@ export async function middleware(request) {
let session = null;
try {
- const res = await fetch(
- new URL("/api/auth/get-session", request.nextUrl.origin),
- {
- headers: {
- cookie: request.headers.get("cookie") ?? "",
- },
+ const internalUrl =
+ process.env.BETTER_AUTH_URL_INTERNAL || "http://localhost:3000";
+ const res = await fetch(new URL("/api/auth/get-session", internalUrl), {
+ headers: {
+ cookie: request.headers.get("cookie") ?? "",
},
- );
+ });
session = await res.json();
} catch {
// If session check fails, treat as unauthenticated