diff --git a/src/config.ts b/src/config.ts index 6b7f67b..a7be0a9 100644 --- a/src/config.ts +++ b/src/config.ts @@ -16,7 +16,7 @@ try { config.open("config.conf"); } catch (e) {} -for (const setting of ["relay-domain", "afraid-username", "relay-seed"]) { +for (const setting of ["domain", "afraid-username", "seed"]) { if (!config.get(setting)) { errorExit(`Required config option ${setting} not set`); } diff --git a/src/dht.ts b/src/dht.ts index eee7659..31e214e 100644 --- a/src/dht.ts +++ b/src/dht.ts @@ -23,7 +23,7 @@ let server: { }; async function start() { - const seed = config.str("relay-seed"); + const seed = config.str("seed"); let err = validSeedPhrase(seed); if (err !== null) { diff --git a/src/dns.ts b/src/dns.ts index d64afad..f7fac23 100644 --- a/src/dns.ts +++ b/src/dns.ts @@ -38,7 +38,7 @@ export async function start() { await overwriteRegistryEntry( dht.defaultKeyPair, hashDataKey(REGISTRY_NODE_KEY), - pack(`${config.str("relay-domain")}:${config.uint("relay-port")}`) + pack(`${config.str("domain")}:${config.uint("port")}`) ); console.log( @@ -50,7 +50,7 @@ export async function start() { } async function getDomainInfo() { - const relayDomain = config.str("relay-domain"); + const relayDomain = config.str("domain"); const parser = new Parser(); const url = new URL("https://freedns.afraid.org/api/"); diff --git a/src/relay.ts b/src/relay.ts index 890709e..f5cd996 100644 --- a/src/relay.ts +++ b/src/relay.ts @@ -45,7 +45,7 @@ const FILE_KEY_NAME = "/lumeweb/relay/ssl.key"; type SslData = { crt: IndependentFileSmall; key: IndependentFileSmall }; export async function start() { - const relayPort = config.str("relay-port"); + const relayPort = config.str("port"); app = express(); app.use(function (req, res, next) { router(req, res, next); @@ -109,7 +109,7 @@ async function setupSSl() { dateValid = true; } - if (certInfo?.domains.commonName === config.str("relay-domain")) { + if (certInfo?.domains.commonName === config.str("domain")) { domainValid = true; } } @@ -129,7 +129,7 @@ async function createOrRenewSSl( oldKey?: IndependentFileSmall ) { const [certificateKey, certificateRequest] = await acme.forge.createCsr({ - commonName: config.str("relay-domain"), + commonName: config.str("domain"), }); try { sslParams.cert = await acmeClient.auto({ @@ -218,7 +218,7 @@ async function getSslFile( } function getSeed(): Uint8Array { - let [seed, err] = seedPhraseToSeed(config.str("relay-seed")); + let [seed, err] = seedPhraseToSeed(config.str("seed")); if (err) { console.error(err);