Skip to content

Commit

Permalink
Port internal CTF uploads fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ky28059 committed Aug 29, 2024
1 parent 377c92a commit 219ffb7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ To run just the frontend, first install dependencies with
```bash
npm i
```
In `next.config.js`, set `env.API_URL` to the public API URL of the rCTF instance, and `KLODD_URL` to the public URL of
In `next.config.js`, set `RCTF_BASE` to the public URL of the backend rCTF instance, and `KLODD_URL` to the public URL of
the Klodd instancer frontend:
```js
const RCTF_BASE = 'http://ctf.b01lers.com:9000';

const nextConfig = {
env: {
API_BASE: 'http://ctf.b01lers.com:9000/api/v1',
API_BASE: `${RCTF_BASE}/api/v1`,
KLODD_URL: 'https://klodd.localhost.direct'
}
},
// ...
}
```
Then, run
Expand All @@ -47,7 +50,7 @@ RCTF_GIT_REF=master

You can then start both the rCTF backend and production frontend instance simultaneously with
```bash
docker-compose up -d --build
docker compose up -d --build
```

### Configuring
Expand Down
8 changes: 7 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const RCTF_BASE = 'http://ctf.b01lers.com:9002';

/** @type {import('next').NextConfig} */
const nextConfig = {
env: {
API_BASE: 'http://ctf.b01lers.com:9002/api/v1',
API_BASE: `${RCTF_BASE}/api/v1`,
KLODD_URL: 'https://instancer.b01lersc.tf'
},
logging: {
Expand All @@ -15,6 +17,10 @@ const nextConfig = {
{
source: '/api/v1/:path*',
destination: `${this.env.API_BASE}/:path*`
},
{
source: '/uploads',
destination: `${RCTF_BASE}/uploads`,
}
]
}
Expand Down

0 comments on commit 219ffb7

Please sign in to comment.