Skip to content

Commit 5be8ff5

Browse files
authored
Merge pull request #17 from trixter-osec/fix/latest-rctf
Support latest rCTF and k8s version
2 parents 9a370d1 + edae0b8 commit 5be8ff5

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16.15.1-bullseye AS build
1+
FROM node:18-bullseye AS build
22

33
WORKDIR /app
44
COPY package.json lerna.json ./
@@ -11,7 +11,7 @@ RUN yarn bootstrap --ci
1111
COPY packages/client packages/client
1212
RUN yarn build
1313

14-
FROM node:16.15.1-bullseye-slim AS run
14+
FROM node:18-bullseye-slim AS run
1515

1616
WORKDIR /app
1717
ENV NODE_ENV=production

docs/content/install-guide/prerequisites.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ There are a number of prerequisites that you must set up before using Klodd.
1010

1111
## rCTF
1212

13-
Klodd integrates with [rCTF](https://rctf.redpwn.net/), redpwn's CTF platform. Because [rCTF does not currently support OAuth](https://img.shields.io/badge/PRs-welcome-brightgreen), you must patch in "pseudo-OAuth" functionality. Consider using the following Cloudflare worker on your rCTF domain `/auth*`, replacing `[KLODD_URL]` with Klodd's public URL.
13+
Klodd integrates with [rCTF](https://rctf.osec.io/), redpwn's CTF platform. Because [rCTF does not currently support OAuth](https://img.shields.io/badge/PRs-welcome-brightgreen), you must patch in "pseudo-OAuth" functionality. Consider using the following Cloudflare worker on your rCTF domain `/auth*`, replacing `[KLODD_URL]` with Klodd's public URL.
1414

1515
```js
1616
const renderAuthPage = uri => `<!doctype html>

packages/server/src/app/rctf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const getTeam = async (token) => {
1313
resolveBodyOnly: true,
1414
throwHttpErrors: false,
1515
})
16-
if (kind !== 'goodUserData') {
16+
if (kind !== 'goodUserData' && kind !== 'goodUserSelfData') { // goodUserData used in redpwn/rctf, goodUserSelfData used in otter-sec/rctf
1717
return null
1818
}
1919
return data

packages/server/src/k8s/resource.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ const subscribeToCluster = async () => {
6666
stopAll(apiObj.metadata.name)
6767
},
6868
(err) => {
69-
if (err) {
69+
// Slightly hacky, but k8s aborts the connection after 5 minutes for some reason. Because of that,
70+
// we should just reconnect as otherwise the entire container gets restarted causing downtime.
71+
if (err && err.code !== 'ECONNRESET') {
7072
throw err
7173
}
7274
subscribeToCluster() // TODO: is this proper usage?

0 commit comments

Comments
 (0)