Skip to content

Commit 219ffb7

Browse files
committed
Port internal CTF uploads fixes
1 parent 377c92a commit 219ffb7

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@ To run just the frontend, first install dependencies with
2121
```bash
2222
npm i
2323
```
24-
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
24+
In `next.config.js`, set `RCTF_BASE` to the public URL of the backend rCTF instance, and `KLODD_URL` to the public URL of
2525
the Klodd instancer frontend:
2626
```js
27+
const RCTF_BASE = 'http://ctf.b01lers.com:9000';
28+
2729
const nextConfig = {
2830
env: {
29-
API_BASE: 'http://ctf.b01lers.com:9000/api/v1',
31+
API_BASE: `${RCTF_BASE}/api/v1`,
3032
KLODD_URL: 'https://klodd.localhost.direct'
31-
}
33+
},
34+
// ...
3235
}
3336
```
3437
Then, run
@@ -47,7 +50,7 @@ RCTF_GIT_REF=master
4750

4851
You can then start both the rCTF backend and production frontend instance simultaneously with
4952
```bash
50-
docker-compose up -d --build
53+
docker compose up -d --build
5154
```
5255

5356
### Configuring

next.config.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
const RCTF_BASE = 'http://ctf.b01lers.com:9002';
2+
13
/** @type {import('next').NextConfig} */
24
const nextConfig = {
35
env: {
4-
API_BASE: 'http://ctf.b01lers.com:9002/api/v1',
6+
API_BASE: `${RCTF_BASE}/api/v1`,
57
KLODD_URL: 'https://instancer.b01lersc.tf'
68
},
79
logging: {
@@ -15,6 +17,10 @@ const nextConfig = {
1517
{
1618
source: '/api/v1/:path*',
1719
destination: `${this.env.API_BASE}/:path*`
20+
},
21+
{
22+
source: '/uploads',
23+
destination: `${RCTF_BASE}/uploads`,
1824
}
1925
]
2026
}

0 commit comments

Comments
 (0)