Use peertubeHelpers.plugin methods when available:

* getBaseStaticRoute use peertubeHelper when available
* getBaseRouter renamed getBaseRouterRoute and use peertubeHelper when available
* Backward compatibility is maintained.
This commit is contained in:
John Livingston
2021-05-18 18:06:11 +02:00
parent 4cf9ab51aa
commit 2a8df1dc3c
6 changed files with 27 additions and 15 deletions

View File

@ -1,6 +1,6 @@
import * as fs from 'fs'
import * as path from 'path'
import { pluginName, getBaseRouter } from '../helpers'
import { pluginName, getBaseRouterRoute } from '../helpers'
import { ProsodyFilePaths } from './config/paths'
import { ProsodyConfigContent } from './config/content'
import { getProsodyDomain } from './config/domain'
@ -122,7 +122,7 @@ async function getProsodyConfig (options: RegisterServerOptions): Promise<Prosod
const apikey = await getAPIKey(options)
const baseApiUrl = options.peertubeHelpers.config.getWebserverUrl() +
getBaseRouter() +
getBaseRouterRoute(options) +
'api/'
const authApiUrl = baseApiUrl + 'user' // FIXME: should be protected by apikey, but mod_auth_http cant handle params
const roomApiUrl = baseApiUrl + 'room?apikey=' + apikey + '&jid={room.jid|jid_node}'