*Remove relay prefix from settings

This commit is contained in:
Derrick Hammer 2022-07-22 19:55:09 -04:00
parent 88dc104102
commit 76a3010ae6
4 changed files with 8 additions and 8 deletions

View File

@ -16,7 +16,7 @@ try {
config.open("config.conf"); config.open("config.conf");
} catch (e) {} } catch (e) {}
for (const setting of ["relay-domain", "afraid-username", "relay-seed"]) { for (const setting of ["domain", "afraid-username", "seed"]) {
if (!config.get(setting)) { if (!config.get(setting)) {
errorExit(`Required config option ${setting} not set`); errorExit(`Required config option ${setting} not set`);
} }

View File

@ -23,7 +23,7 @@ let server: {
}; };
async function start() { async function start() {
const seed = config.str("relay-seed"); const seed = config.str("seed");
let err = validSeedPhrase(seed); let err = validSeedPhrase(seed);
if (err !== null) { if (err !== null) {

View File

@ -38,7 +38,7 @@ export async function start() {
await overwriteRegistryEntry( await overwriteRegistryEntry(
dht.defaultKeyPair, dht.defaultKeyPair,
hashDataKey(REGISTRY_NODE_KEY), hashDataKey(REGISTRY_NODE_KEY),
pack(`${config.str("relay-domain")}:${config.uint("relay-port")}`) pack(`${config.str("domain")}:${config.uint("port")}`)
); );
console.log( console.log(
@ -50,7 +50,7 @@ export async function start() {
} }
async function getDomainInfo() { async function getDomainInfo() {
const relayDomain = config.str("relay-domain"); const relayDomain = config.str("domain");
const parser = new Parser(); const parser = new Parser();
const url = new URL("https://freedns.afraid.org/api/"); const url = new URL("https://freedns.afraid.org/api/");

View File

@ -45,7 +45,7 @@ const FILE_KEY_NAME = "/lumeweb/relay/ssl.key";
type SslData = { crt: IndependentFileSmall; key: IndependentFileSmall }; type SslData = { crt: IndependentFileSmall; key: IndependentFileSmall };
export async function start() { export async function start() {
const relayPort = config.str("relay-port"); const relayPort = config.str("port");
app = express(); app = express();
app.use(function (req, res, next) { app.use(function (req, res, next) {
router(req, res, next); router(req, res, next);
@ -109,7 +109,7 @@ async function setupSSl() {
dateValid = true; dateValid = true;
} }
if (certInfo?.domains.commonName === config.str("relay-domain")) { if (certInfo?.domains.commonName === config.str("domain")) {
domainValid = true; domainValid = true;
} }
} }
@ -129,7 +129,7 @@ async function createOrRenewSSl(
oldKey?: IndependentFileSmall oldKey?: IndependentFileSmall
) { ) {
const [certificateKey, certificateRequest] = await acme.forge.createCsr({ const [certificateKey, certificateRequest] = await acme.forge.createCsr({
commonName: config.str("relay-domain"), commonName: config.str("domain"),
}); });
try { try {
sslParams.cert = await acmeClient.auto({ sslParams.cert = await acmeClient.auto({
@ -218,7 +218,7 @@ async function getSslFile(
} }
function getSeed(): Uint8Array { function getSeed(): Uint8Array {
let [seed, err] = seedPhraseToSeed(config.str("relay-seed")); let [seed, err] = seedPhraseToSeed(config.str("seed"));
if (err) { if (err) {
console.error(err); console.error(err);