*Remove relay prefix from settings
This commit is contained in:
parent
88dc104102
commit
76a3010ae6
|
@ -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`);
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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/");
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue