Skip to content

Commit 4e670f7

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 025d7ab + ec9e58e commit 4e670f7

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ To run just the frontend, first install dependencies with
2323
```bash
2424
npm i
2525
```
26-
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
26+
In `next.config.js`, set `RCTF_BASE` to the public URL of the backend rCTF instance, and `KLODD_URL` to the public URL of
2727
the Klodd instancer frontend:
2828
```js
29+
const RCTF_BASE = 'http://ctf.b01lers.com:9000';
30+
2931
const nextConfig = {
3032
env: {
31-
API_BASE: 'http://ctf.b01lers.com:9000/api/v1',
33+
API_BASE: `${RCTF_BASE}/api/v1`,
3234
KLODD_URL: 'https://klodd.localhost.direct'
33-
}
35+
},
36+
// ...
3437
}
3538
```
3639
Then, run
@@ -49,7 +52,7 @@ RCTF_GIT_REF=master
4952

5053
You can then start both the rCTF backend and production frontend instance simultaneously with
5154
```bash
52-
docker-compose up -d --build
55+
docker compose up -d --build
5356
```
5457

5558
### Configuring

util/strings.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export function pluralize(num: number) {
2-
if (num % 10 === 1) return `${num}st`;
3-
if (num % 10 === 2) return `${num}nd`;
4-
if (num % 10 === 3) return `${num}rd`;
2+
if (num % 10 === 1 && num !== 11) return `${num}st`; // 21st, but not 11th
3+
if (num % 10 === 2 && num !== 12) return `${num}nd`; // 32nd, but not 12th
4+
if (num % 10 === 3 && num !== 13) return `${num}rd`; // 63rd, but not 13th
55
return `${num}th`
66
}

0 commit comments

Comments
 (0)