Builtin Prosody: use Peertube domain instead of localhost.
This commit is contained in:
12
server/lib/prosody/config/domain.ts
Normal file
12
server/lib/prosody/config/domain.ts
Normal file
@ -0,0 +1,12 @@
|
||||
async function getProsodyDomain (options: RegisterServerOptions): Promise<string> {
|
||||
const url = options.peertubeHelpers.config.getWebserverUrl()
|
||||
const matches = url.match(/^https?:\/\/([^:/]*)(:\d+)?(\/|$)/)
|
||||
if (!matches) {
|
||||
throw new Error(`Cant get a domain name from url '${url}'`)
|
||||
}
|
||||
return matches[1]
|
||||
}
|
||||
|
||||
export {
|
||||
getProsodyDomain
|
||||
}
|
Reference in New Issue
Block a user