Embedding Prosody using AppImage:
Thanks to this commit, there is no more need to manually install Prosody on the server. The plugin now build and embed an AppImage of Prosody. In this commit: * building and using a Prosody AppImage. * Adding a launcher in the AppImage: the first command argument tells if we want to run prosody or prosodyctl * prosodyCtl functions now uses the AppImage. * Prosody AppImage: extract once at the startup, then run the squashfs
This commit is contained in:
59
prosody/appimage_x86_64.yml
Normal file
59
prosody/appimage_x86_64.yml
Normal file
@ -0,0 +1,59 @@
|
||||
# This file is meant to be used with appimage-builder: https://appimage-builder.readthedocs.io
|
||||
# See it is use in the build-prosody.sh script.
|
||||
|
||||
version: 1
|
||||
|
||||
script:
|
||||
# Remove any previous build
|
||||
- rm -rf AppDir | true
|
||||
# Make usr dirs
|
||||
- mkdir -p AppDir/usr/bin
|
||||
# Copy the launcher code into the AppDir
|
||||
- cp ./launcher.lua AppDir/usr/bin/
|
||||
|
||||
AppDir:
|
||||
path: ./AppDir
|
||||
|
||||
app_info:
|
||||
id: org.peertube-plugin-livechat.prosody
|
||||
name: prosody
|
||||
icon: utilities-terminal
|
||||
version: 1.0.0
|
||||
exec: usr/bin/lua5.2
|
||||
exec_args: "$APPDIR/usr/bin/launcher.lua $@"
|
||||
|
||||
apt:
|
||||
arch: amd64
|
||||
sources:
|
||||
- sourceline: 'deb [arch=amd64] https://deb.debian.org/debian/ bullseye main contrib'
|
||||
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x648ACFD622F3D138'
|
||||
- sourceline: 'deb [arch=amd64] https://deb.debian.org/debian/ bullseye-backports main contrib'
|
||||
|
||||
include:
|
||||
- lua5.2
|
||||
- prosody
|
||||
|
||||
files:
|
||||
exclude:
|
||||
- usr/share/man
|
||||
- usr/share/doc/*/README.*
|
||||
- usr/share/doc/*/changelog.*
|
||||
- usr/share/doc/*/NEWS.*
|
||||
- usr/share/doc/*/TODO.*
|
||||
- etc/init.d/*
|
||||
- etc/logrotate.d/*
|
||||
|
||||
runtime:
|
||||
# Here we use the path_mappings to rewrite, on runtime, all paths.
|
||||
# Note: this assume that peertube-plugin-livechat is not in a subdir of one of following mappings.
|
||||
# This seems a reasonable assumption.
|
||||
path_mappings:
|
||||
- /etc/:$APPDIR/etc/
|
||||
- /lib/:$APPDIR/lib/
|
||||
- /lib64/:$APPDIR/lib64/
|
||||
- /runtime/:$APPDIR/runtime/
|
||||
- /usr/:$APPDIR/usr/
|
||||
|
||||
AppImage:
|
||||
arch: x86_64
|
||||
file_name: 'livechat-prosody-x86_64.AppImage'
|
13
prosody/launcher.lua
Normal file
13
prosody/launcher.lua
Normal file
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env lua
|
||||
|
||||
-- This file is a launcher, that takes the first argument to choose what to launch.
|
||||
|
||||
local what = table.remove(arg, 1);
|
||||
if what == 'prosody' then
|
||||
dofile('/usr/bin/prosody');
|
||||
elseif what == 'prosodyctl' then
|
||||
dofile('/usr/bin/prosodyctl');
|
||||
else
|
||||
print("Unknown command: "..what);
|
||||
os.exit(1);
|
||||
end
|
Reference in New Issue
Block a user