Prosody Appimage: supports only x86_64:
* stop trying to generated an ARM64 AppImage (as it is buggy) * display a warning in the settings if incompatible CPU detected * documentation for a workaround Implements #120.
This commit is contained in:
@ -35,6 +35,23 @@ export async function diagProsody (test: string, options: RegisterServerOptions)
|
||||
|
||||
result.messages.push(`Prosody will use ${wantedConfig.baseApiUrl} as base uri from api calls`)
|
||||
|
||||
if (!wantedConfig.paths.exec) {
|
||||
result.messages.push({
|
||||
level: 'error',
|
||||
message: 'Error: no Prosody server.'
|
||||
})
|
||||
if (process.arch !== 'x64' && process.arch !== 'x86_64') {
|
||||
result.messages.push({
|
||||
level: 'error',
|
||||
message: 'Error: your CPU is a ' +
|
||||
process.arch + ', ' +
|
||||
'which is not compatible with the plugin. ' +
|
||||
'Please read the plugin installation documentation for a workaround.'
|
||||
})
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
result.messages.push(`Prosody path will be '${wantedConfig.paths.exec}'`)
|
||||
|
||||
if (wantedConfig.paths.appImageToExtract) {
|
||||
|
@ -29,9 +29,9 @@ async function getProsodyFilePaths (options: RegisterServerOptions): Promise<Pro
|
||||
const dir = await getWorkingDir(options)
|
||||
const settings = await options.settingsManager.getSettings(['use-system-prosody'])
|
||||
let exec
|
||||
let execArgs: string[]
|
||||
let execArgs: string[] = []
|
||||
let execCtl
|
||||
let execCtlArgs: string[]
|
||||
let execCtlArgs: string[] = []
|
||||
let appImageToExtract
|
||||
|
||||
// this one is always needed (must create the directory on startup)
|
||||
@ -39,21 +39,25 @@ async function getProsodyFilePaths (options: RegisterServerOptions): Promise<Pro
|
||||
|
||||
if (settings['use-system-prosody']) {
|
||||
exec = 'prosody'
|
||||
execArgs = []
|
||||
execCtl = 'prosodyctl'
|
||||
execCtlArgs = []
|
||||
} else {
|
||||
const arch = process.arch
|
||||
if (arch === 'arm' || arch === 'arm64') {
|
||||
logger.info('Node process.arch is ' + arch + ', we will be using the aarch64 Prosody AppImage')
|
||||
appImageToExtract = path.resolve(__dirname, '../../prosody/livechat-prosody-aarch64.AppImage')
|
||||
// const arch = process.arch
|
||||
// if (arch === 'arm' || arch === 'arm64') {
|
||||
// logger.info('Node process.arch is ' + arch + ', we will be using the aarch64 Prosody AppImage')
|
||||
// appImageToExtract = path.resolve(__dirname, '../../prosody/livechat-prosody-aarch64.AppImage')
|
||||
// } else {
|
||||
// appImageToExtract = path.resolve(__dirname, '../../prosody/livechat-prosody-x86_64.AppImage')
|
||||
// }
|
||||
if (process.arch !== 'x64' && process.arch !== 'x86_64') {
|
||||
logger.info('Node process.arch is ' + process.arch + ', cant use the Prosody AppImage')
|
||||
} else {
|
||||
logger.debug('Node process.arch is ' + process.arch + ', we will be using the x86_64 Prosody AppImage')
|
||||
appImageToExtract = path.resolve(__dirname, '../../prosody/livechat-prosody-x86_64.AppImage')
|
||||
exec = path.resolve(appImageExtractPath, 'squashfs-root/AppRun')
|
||||
execArgs = ['prosody']
|
||||
execCtl = exec
|
||||
execCtlArgs = ['prosodyctl']
|
||||
}
|
||||
exec = path.resolve(appImageExtractPath, 'squashfs-root/AppRun')
|
||||
execArgs = ['prosody']
|
||||
execCtl = exec
|
||||
execCtlArgs = ['prosodyctl']
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -8,9 +8,9 @@ interface ProsodyFilePaths {
|
||||
certs: string
|
||||
modules: string
|
||||
avatars: string
|
||||
exec: string
|
||||
exec?: string
|
||||
execArgs: string[]
|
||||
execCtl: string
|
||||
execCtl?: string
|
||||
execCtlArgs: string[]
|
||||
appImageToExtract?: string
|
||||
appImageExtractPath: string
|
||||
|
@ -100,6 +100,10 @@ async function prosodyCtl (options: RegisterServerOptions, command: string): Pro
|
||||
throw new Error(`Invalid prosodyctl command '${command}'`)
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!filePaths.execCtl) {
|
||||
reject(new Error('Missing prosodyctl command executable'))
|
||||
return
|
||||
}
|
||||
let d: string = ''
|
||||
let e: string = ''
|
||||
let m: string = ''
|
||||
@ -247,6 +251,11 @@ async function ensureProsodyRunning (options: RegisterServerOptions): Promise<vo
|
||||
|
||||
const filePaths = config.paths
|
||||
|
||||
if (!filePaths.exec) {
|
||||
logger.info('No Prosody executable, cant run.')
|
||||
return
|
||||
}
|
||||
|
||||
// launch prosody
|
||||
const execCmd = filePaths.exec + (filePaths.execArgs.length ? ' ' + filePaths.execArgs.join(' ') : '')
|
||||
logger.info('Going to launch prosody (' + execCmd + ')')
|
||||
|
@ -27,6 +27,25 @@ function initSettings (options: RegisterServerOptions): void {
|
||||
(if this button is not opening a new window, please try to refresh the page).`
|
||||
})
|
||||
|
||||
if (process.arch !== 'x64' && process.arch !== 'x86_64') {
|
||||
registerSetting({
|
||||
name: 'prosody-arch-warning',
|
||||
type: 'html',
|
||||
private: true,
|
||||
descriptionHTML: `<span class="peertube-plugin-livechat-warning">
|
||||
It seems that your are using a ${process.arch} CPU,
|
||||
which is not compatible with the plugin.
|
||||
Please read the
|
||||
<a
|
||||
href="https://github.com/JohnXLivingston/peertube-plugin-livechat/blob/main/documentation/installation.md"
|
||||
target="_blank"
|
||||
>
|
||||
installation documentation
|
||||
</a> for a workaround.
|
||||
</span>`
|
||||
})
|
||||
}
|
||||
|
||||
// ********** Chat
|
||||
registerSetting({
|
||||
type: 'html',
|
||||
|
Reference in New Issue
Block a user