Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
ky28059 committed Aug 30, 2024
2 parents 025d7ab + ec9e58e commit 4e670f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,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 @@ -49,7 +52,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
6 changes: 3 additions & 3 deletions util/strings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function pluralize(num: number) {
if (num % 10 === 1) return `${num}st`;
if (num % 10 === 2) return `${num}nd`;
if (num % 10 === 3) return `${num}rd`;
if (num % 10 === 1 && num !== 11) return `${num}st`; // 21st, but not 11th
if (num % 10 === 2 && num !== 12) return `${num}nd`; // 32nd, but not 12th
if (num % 10 === 3 && num !== 13) return `${num}rd`; // 63rd, but not 13th
return `${num}th`
}

0 comments on commit 4e670f7

Please sign in to comment.