removed host logging, login fix

This commit is contained in:
mrfry 2023-04-02 09:55:31 +02:00
parent e9f5eba8c1
commit 885198d357
4 changed files with 6 additions and 17 deletions

View file

@ -380,6 +380,7 @@ function setup(data: SubmoduleData): Submodule {
let peers: PeerInfo[] = utils.ReadJSON(paths.peersFile) let peers: PeerInfo[] = utils.ReadJSON(paths.peersFile)
let selfInfo: PeerInfo = utils.ReadJSON(paths.selfInfoFile) let selfInfo: PeerInfo = utils.ReadJSON(paths.selfInfoFile)
// TODO: this should be checked by files!
if (!isJsonValidAndLogError(peers, PeersInfoSchema, paths.peersFile)) { if (!isJsonValidAndLogError(peers, PeersInfoSchema, paths.peersFile)) {
throw new Error('Invalid peers file') throw new Error('Invalid peers file')
} }
@ -895,7 +896,10 @@ function setup(data: SubmoduleData): Submodule {
res.json(getSelfInfo(true)) res.json(getSelfInfo(true))
}) })
// TODO: get all user files
app.get('/getnewdatasince', (req: Request, res: Response<SyncDataRes>) => { app.get('/getnewdatasince', (req: Request, res: Response<SyncDataRes>) => {
// TODO: add to third party peers, and recieve self info
// FIXME: hash question db to see if different? // FIXME: hash question db to see if different?
// it could help in determining if it should be checked for new data, but it would only save // it could help in determining if it should be checked for new data, but it would only save
// a getNewDataSince() call per question db // a getNewDataSince() call per question db

View file

@ -122,7 +122,7 @@
button.innerText = '...' button.innerText = '...'
button.classList.add('disabledButton') button.classList.add('disabledButton')
button.disabled = true button.disabled = true
const rawResponse = await fetch('<%= devel? 'http' : 'https' %>://api.frylabs.net/login', { const rawResponse = await fetch('<%= devel ? 'http' : 'https' %>://frylabs.net/api/login', {
method: 'POST', method: 'POST',
credentials: 'include', credentials: 'include',
headers: { headers: {

View file

@ -116,21 +116,6 @@ function LogReq(
return return
} }
let hostname
if (req.hostname) {
hostname = req.hostname.replace('www.', '').split('.')[0]
} else {
hostname = 'NOHOST'
Log(
'req.hostname is undefined! req.hostname: ' + req.hostname,
GetColor('redbg')
)
}
if (!toFile) {
hostname = expandWithSpaces(hostname, 10)
}
logEntry += logHashed(hostname) + dl
if (toFile) { if (toFile) {
logEntry += req.headers['user-agent'] + dl logEntry += req.headers['user-agent'] + dl
logEntry += req.method + dl logEntry += req.method + dl

@ -1 +1 @@
Subproject commit d4553896afa8653c628aa968a37b3601e7f860e7 Subproject commit 5c779a657dc0543cef2abc886057e7828ce711f8