Fix settings read.

This commit is contained in:
John Livingston 2023-04-13 18:41:23 +02:00 committed by John Livingston
parent 801798852c
commit cf0e4d8061

View File

@ -64,6 +64,7 @@ async function getProsodyFilePaths (options: RegisterServerOptions): Promise<Pro
let certsDir: string | undefined = path.resolve(dir, 'certs') let certsDir: string | undefined = path.resolve(dir, 'certs')
let certsDirIsCustom = false let certsDirIsCustom = false
if (settings['prosody-room-allow-s2s']) {
if ((settings['prosody-certificates-dir'] as string ?? '') !== '') { if ((settings['prosody-certificates-dir'] as string ?? '') !== '') {
if (!fs.statSync(settings['prosody-certificates-dir'] as string).isDirectory()) { if (!fs.statSync(settings['prosody-certificates-dir'] as string).isDirectory()) {
// We can throw an exception here... // We can throw an exception here...
@ -75,12 +76,15 @@ async function getProsodyFilePaths (options: RegisterServerOptions): Promise<Pro
certsDir = settings['prosody-certificates-dir'] as string certsDir = settings['prosody-certificates-dir'] as string
} }
certsDirIsCustom = true certsDirIsCustom = true
} else if (settings['prosody-room-allow-s2s']) { } else {
// In this case we are generating and using self signed certificates
// Note: when using prosodyctl to generate self-signed certificates, // Note: when using prosodyctl to generate self-signed certificates,
// there are wrongly generated in the data dir. // there are wrongly generated in the data dir.
// So we will use this dir as the certs dir. // So we will use this dir as the certs dir.
certsDir = path.resolve(dir, 'data') certsDir = path.resolve(dir, 'data')
} }
}
return { return {
dir: dir, dir: dir,