mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
added support for DOMAIN env var insted of file
This commit is contained in:
parent
7d1bddd7e2
commit
d310895fcb
9 changed files with 53 additions and 29 deletions
|
@ -96,6 +96,7 @@ interface SyncDataRes {
|
|||
function updateThirdPartyPeers(
|
||||
newVal: Omit<PeerInfo, 'publicKey' | 'name' | 'contact'>[]
|
||||
) {
|
||||
// TODO: check if thirdPartyPeersFile exists!
|
||||
const prevVal = utils.ReadJSON<PeerInfo[]>(paths.thirdPartyPeersFile)
|
||||
const dataToWrite = newVal.reduce((acc, peer) => {
|
||||
const isIncluded = acc.find((x) => {
|
||||
|
@ -963,6 +964,7 @@ function setup(data: SubmoduleData): Submodule {
|
|||
remoteInfo: getSelfInfo(),
|
||||
}
|
||||
|
||||
// TODO: hostname is invalid, should be remote host?
|
||||
let hostToLog = req.hostname
|
||||
if (remoteHost) {
|
||||
const remotePeerInfo = peers.find((peer) => {
|
||||
|
@ -998,6 +1000,7 @@ function setup(data: SubmoduleData): Submodule {
|
|||
)
|
||||
if (remoteHost.includes(':')) {
|
||||
const [host, port] = remoteHost.split(':')
|
||||
// TODO: add public key
|
||||
updateThirdPartyPeers([
|
||||
{
|
||||
host: host,
|
||||
|
|
|
@ -60,7 +60,7 @@ import {
|
|||
SearchResultQuestion,
|
||||
} from '../../../utils/qdbUtils'
|
||||
import { paths } from '../../../utils/files'
|
||||
import constants from '../../../constants.json'
|
||||
import constants from '../../../constants'
|
||||
import {
|
||||
isJsonValidAndLogError,
|
||||
TestUsersSchema,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue