mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2025-10-03 17:59:24 +02:00
Compare commits
21 commits
2024-01-05
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6189601459 | ||
![]() |
569e5ce62d | ||
![]() |
6220cc6bb9 | ||
![]() |
33d9fd732f | ||
![]() |
764f240707 | ||
![]() |
b392ca295a | ||
![]() |
f5fc8e6cd6 | ||
![]() |
9c2048af64 | ||
![]() |
b69271f7df | ||
![]() |
97d2730b20 | ||
![]() |
0346197c23 | ||
![]() |
a7ed01af74 | ||
![]() |
f77d91ff56 | ||
![]() |
2d035da0da | ||
![]() |
2d73cba90e | ||
![]() |
1918c74277 | ||
![]() |
e55d1fd1a9 | ||
![]() |
f10b79a023 | ||
![]() |
2c401288a3 | ||
![]() |
89f3325a18 | ||
![]() |
7aaad00881 |
6 changed files with 1742 additions and 4514 deletions
6205
package-lock.json
generated
6205
package-lock.json
generated
File diff suppressed because it is too large
Load diff
10
package.json
10
package.json
|
@ -38,12 +38,11 @@
|
||||||
"@types/lodash": "^4.14.166",
|
"@types/lodash": "^4.14.166",
|
||||||
"@types/node": "^16.11.59",
|
"@types/node": "^16.11.59",
|
||||||
"@types/nodemailer": "^6.4.4",
|
"@types/nodemailer": "^6.4.4",
|
||||||
"@types/umzug": "^2.3.0",
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
"@typescript-eslint/parser": "^7.18.0",
|
||||||
"@typescript-eslint/parser": "^5.10.0",
|
|
||||||
"eslint": "^8.7.0",
|
"eslint": "^8.7.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"typescript": "^4.4.4",
|
"typescript": "^5.5.4",
|
||||||
"typescript-json-schema": "^0.52.0"
|
"typescript-json-schema": "^0.52.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -63,8 +62,7 @@
|
||||||
"rate-limiter-flexible": "^2.1.15",
|
"rate-limiter-flexible": "^2.1.15",
|
||||||
"sequelize": "^6.25.5",
|
"sequelize": "^6.25.5",
|
||||||
"socket.io": "^4.0.1",
|
"socket.io": "^4.0.1",
|
||||||
"sqlite3": "^4.0.0",
|
"umzug": "^3.8.1"
|
||||||
"umzug": "^2.3.0"
|
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"sqlite3": "^5.0.0"
|
"sqlite3": "^5.0.0"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2023 Jonas Lochmann
|
* Copyright (C) 2019 - 2024 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
@ -58,7 +58,9 @@ const allTypes = [
|
||||||
|
|
||||||
const settings = {
|
const settings = {
|
||||||
required: true,
|
required: true,
|
||||||
noExtraProps: true
|
noExtraProps: true,
|
||||||
|
// otherwise it finds errors in dependencies that we don't care about
|
||||||
|
ignoreErrors: true
|
||||||
};
|
};
|
||||||
|
|
||||||
const compilerOptions = {
|
const compilerOptions = {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2022 Jonas Lochmann
|
* Copyright (C) 2019 - 2024 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
@ -26,7 +26,7 @@ export const config = {
|
||||||
expireTimeRounding: 1000 * 60 * 15
|
expireTimeRounding: 1000 * 60 * 15
|
||||||
}
|
}
|
||||||
|
|
||||||
export function calculateExpireTime(now: bigint): BigInt {
|
export function calculateExpireTime(now: bigint): bigint {
|
||||||
const expireBaseTime = now + BigInt(config.expireDelay)
|
const expireBaseTime = now + BigInt(config.expireDelay)
|
||||||
const expireTime = expireBaseTime - expireBaseTime % BigInt(config.expireTimeRounding) + BigInt(config.expireTimeRounding)
|
const expireTime = expireBaseTime - expireBaseTime % BigInt(config.expireTimeRounding) + BigInt(config.expireTimeRounding)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 Jonas Lochmann
|
* Copyright (C) 2019 - 2024 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
@ -17,18 +17,26 @@
|
||||||
|
|
||||||
import { resolve } from 'path'
|
import { resolve } from 'path'
|
||||||
import { Sequelize } from 'sequelize'
|
import { Sequelize } from 'sequelize'
|
||||||
import * as Umzug from 'umzug'
|
import { Umzug, SequelizeStorage } from 'umzug'
|
||||||
|
|
||||||
export const createUmzug = (sequelize: Sequelize) => (
|
export const createUmzug = (sequelize: Sequelize) => (
|
||||||
new Umzug({
|
new Umzug({
|
||||||
storage: 'sequelize',
|
storage: new SequelizeStorage({ sequelize }),
|
||||||
storageOptions: {
|
|
||||||
sequelize
|
|
||||||
},
|
|
||||||
migrations: {
|
migrations: {
|
||||||
params: [sequelize.getQueryInterface(), sequelize],
|
glob: resolve(__dirname, '../../../build/database/migration/migrations/*.js'),
|
||||||
path: resolve(__dirname, '../../../build/database/migration/migrations'),
|
resolve: ({ name, path }) => {
|
||||||
pattern: /^\d+[\w-]+\.js$/
|
if (!path) throw new Error()
|
||||||
}
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
|
const migration = require(path)
|
||||||
|
|
||||||
|
return {
|
||||||
|
name,
|
||||||
|
up: async () => migration.up(sequelize.getQueryInterface(), sequelize),
|
||||||
|
down: async () => migration.down(sequelize.getQueryInterface(), sequelize),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
logger: console
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
|
@ -11,7 +11,8 @@
|
||||||
"noUnusedParameters": false,
|
"noUnusedParameters": false,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"sourceMap": true
|
"sourceMap": true,
|
||||||
|
"skipLibCheck": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"./src/**/*"
|
"./src/**/*"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue