p2p https and login fix, removed static domain from ejs files

This commit is contained in:
mrfry 2023-04-07 16:32:22 +02:00
parent ae3bd7c55a
commit e858d7f23e
13 changed files with 210 additions and 79 deletions

View file

@ -24,6 +24,10 @@ import type { Database } from 'better-sqlite3'
import logger from '../utils/logger'
import dbtools from '../utils/dbtools'
import { paths } from '../utils/files'
import utils from '../utils/utils'
const domain = utils.ReadFile(paths.domainFile).trim()
interface Options {
userDB: Database
@ -31,7 +35,7 @@ interface Options {
}
export const testUser: User = {
id: 19,
id: 1,
avaiblePWRequests: 645,
pwRequestCount: 19,
created: new Date().getTime(),
@ -51,7 +55,8 @@ function renderLogin(req: Request, res: Response) {
})
} else {
res.render('login', {
devel: process.env.NS_DEVEL,
useHttp: process.env.NS_NO_HTTPS_FORCE,
domain: domain,
})
}
}