Fix Prosody configuration.

This commit is contained in:
John Livingston 2023-04-13 13:01:48 +02:00 committed by John Livingston
parent 772689f9ce
commit f8b83defb5
2 changed files with 11 additions and 5 deletions

View File

@ -27,7 +27,7 @@ async function getProsodyFilePaths (options: RegisterServerOptions): Promise<Pro
logger.debug('Calling getProsodyFilePaths') logger.debug('Calling getProsodyFilePaths')
const dir = await getWorkingDir(options) const dir = await getWorkingDir(options)
const settings = await options.settingsManager.getSettings(['use-system-prosody']) const settings = await options.settingsManager.getSettings(['use-system-prosody', 'prosody-room-allow-s2s'])
let exec let exec
let execArgs: string[] = [] let execArgs: string[] = []
let execCtl let execCtl
@ -60,6 +60,14 @@ async function getProsodyFilePaths (options: RegisterServerOptions): Promise<Pro
} }
} }
let certsDir = path.resolve(dir, 'certs')
if (settings['prosody-room-allow-s2s']) {
// Note: when using prosodyctl to generate self-signed certificates,
// there are wrongly generated in the data dir.
// So we will use this dir as the certs dir.
certsDir = path.resolve(dir, 'data')
}
return { return {
dir: dir, dir: dir,
pid: path.resolve(dir, 'prosody.pid'), pid: path.resolve(dir, 'prosody.pid'),
@ -67,9 +75,7 @@ async function getProsodyFilePaths (options: RegisterServerOptions): Promise<Pro
log: path.resolve(dir, 'prosody.log'), log: path.resolve(dir, 'prosody.log'),
config: path.resolve(dir, 'prosody.cfg.lua'), config: path.resolve(dir, 'prosody.cfg.lua'),
data: path.resolve(dir, 'data'), data: path.resolve(dir, 'data'),
// Certificates dir for Prosody. certs: certsDir,
// Note: not used yet, but we create the directory to avoid errors in prosody logs.
certs: path.resolve(dir, 'certs'),
modules: path.resolve(__dirname, '../../prosody-modules'), modules: path.resolve(__dirname, '../../prosody-modules'),
avatars: path.resolve(__dirname, '../../avatars'), avatars: path.resolve(__dirname, '../../avatars'),
exec, exec,

View File

@ -173,7 +173,7 @@ class ProsodyConfigContent {
this.global.set('consider_bosh_secure', false) this.global.set('consider_bosh_secure', false)
// this.global.set('cross_domain_websocket', false) No more needed with Prosody 0.12 // this.global.set('cross_domain_websocket', false) No more needed with Prosody 0.12
this.global.set('consider_websocket_secure', false) this.global.set('consider_websocket_secure', false)
this.global.set('certificates', this.paths.data) this.global.set('certificates', this.paths.certs)
this.muc.set('muc_room_locking', false) this.muc.set('muc_room_locking', false)
this.muc.set('muc_tombstones', false) this.muc.set('muc_tombstones', false)