Skip to content

Commit f5cb207

Browse files
committed
fix(server): make migrations use the pgmigrate table
1 parent 42563b5 commit f5cb207

File tree

4 files changed

+26
-19
lines changed

4 files changed

+26
-19
lines changed

.env.example

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
RCTF_NAME=rCTF
22
RCTF_TOKEN_KEY=32_byte_long_base64_encoded_value_for_token
3-
RCTF_ORIGIN=http://127.0.0.1:8000
43
RCTF_DATABASE_PASSWORD=example_postgres_password
5-
RCTF_CTFTIME_CLIENT_ID=0
6-
RCTF_CTFTIME_CLIENT_SECRET=abcd
7-
RCTF_START_TIME=ms_since_epoch
8-
RCTF_END_TIME=ms_since_epoch
4+
5+
# the public URL for RCTF
6+
RCTF_ORIGIN=http://127.0.0.1:8000
7+
8+
# unix timestamps in milliseconds
9+
RCTF_START_TIME=123
10+
RCTF_END_TIME=456
11+
12+
# uncomment these lines to enable CTFtime OAuth
13+
# RCTF_CTFTIME_CLIENT_ID=0
14+
# RCTF_CTFTIME_CLIENT_SECRET=abcd
15+
16+
# uncomment these lines to enable email auth
17+
# RCTF_SMTP_URL=smtp://user:[email protected]
18+

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ RUN yarn install --prod --frozen-lockfile && yarn cache clean
1717

1818
COPY --from=build /app/dist /app/dist
1919

20-
CMD ["node", "--enable-source-maps", "/app/dist/server/index.js"]
20+
CMD ["node", "--enable-source-maps", "--unhandled-rejections=strict", "/app/dist/server/index.js"]

config/client.js.example

+9-13
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,13 @@ module.exports = {
99
imageUrl: 'https://example.com/logo.png'
1010
},
1111
homeContent: 'A description of your CTF. Markdown supported.',
12-
sponsors: [
13-
{
14-
name: 'Big Sponsor',
15-
icon: 'https://example.com/logo.png',
16-
description: 'Brief description. Markdown supported.'
17-
},
18-
{
19-
name: 'Smaller Sponsor',
20-
description: 'Brief description. Markdown supported.',
21-
small: true
22-
}
23-
],
24-
ctftimeClientId: 0
12+
sponsors: [{
13+
name: 'Big Sponsor',
14+
icon: 'https://example.com/logo.png',
15+
description: 'Brief description. Markdown supported.'
16+
}, {
17+
name: 'Smaller Sponsor',
18+
description: 'Brief description. Markdown supported.',
19+
small: true
20+
}]
2521
}

server/database/migrate.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const migrate = async (attempt) => {
1010
databaseUrl: config.database.sql,
1111
dir: path.join(__dirname, '../../migrations'),
1212
direction: 'up',
13+
migrationsTable: 'pgmigrations',
1314
verbose: true
1415
})
1516
} catch (e) {

0 commit comments

Comments
 (0)