Added licence notice to many files, other minor type fixes

This commit is contained in:
mrfry 2022-03-22 11:19:32 +01:00
parent d9175c1fc2
commit 75d93af246
22 changed files with 483 additions and 107 deletions

View file

@ -1,3 +1,23 @@
/* ----------------------------------------------------------------------------
Question Server
GitLab: <https://gitlab.com/MrFry/mrfrys-node-server>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
------------------------------------------------------------------------- */
import fs from 'fs'
import { Response } from 'express'
import { fork, ChildProcess } from 'child_process'
@ -137,7 +157,7 @@ function getDetailedRes(questionDbs: QuestionDb[]) {
})
}
function getMotd(version: any, motd: string) {
function getMotd(version: string, motd: string) {
if (version) {
if (version.startsWith('2.0.')) {
if (utils.FileExists(oldMotdFile)) {
@ -485,7 +505,7 @@ function setup(data: SubmoduleData): Submodule {
app.get('/allqr.txt', function (req: Request, res: Response) {
logger.LogReq(req)
const db: any = req.query.db
const db: string = req.query.db
let stringifiedData = ''
res.setHeader('content-type', 'text/plain; charset=utf-8')
@ -728,7 +748,7 @@ function setup(data: SubmoduleData): Submodule {
utils.WriteFile('[]', registeredScriptsFile)
}
const ua: any = req.headers['user-agent']
const ua: string = req.headers['user-agent']
const registeredScripts: RegisteredUserEntry[] = utils.ReadJSON(
registeredScriptsFile
)
@ -739,7 +759,7 @@ function setup(data: SubmoduleData): Submodule {
})
if (index === -1) {
const x: any = {
const x: RegisteredUserEntry = {
cid: cid,
version: version,
installSource: installSource,
@ -975,7 +995,7 @@ function setup(data: SubmoduleData): Submodule {
// TODO: get status of it cleaning
logger.LogReq(req)
const user: User = req.session.user
const status: any = req.query.status
const status: string = req.query.status
if (status) {
if (!questionCleaner) {