2021-08-13 18:53:18 +08:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
configure|upgrade|1|2)
|
|
|
|
|
|
|
|
TARGET=/usr/local/bigbluebutton/bbb-webhooks/config/default.yml
|
|
|
|
|
|
|
|
cp /usr/local/bigbluebutton/bbb-webhooks/config/default.example.yml $TARGET
|
|
|
|
chmod 644 $TARGET
|
|
|
|
chown bigbluebutton:bigbluebutton $TARGET
|
|
|
|
|
2023-09-15 22:19:16 +08:00
|
|
|
BBB_HOST=$(bbb-conf --secret | grep -F URL: | sed 's#^.*://##; s#/.*##')
|
2024-01-09 22:19:04 +08:00
|
|
|
BBB_SECRET=$(bbb-conf --secret | grep -F Secret: | sed 's/.*Secret: //')
|
2021-08-13 18:53:18 +08:00
|
|
|
|
2023-04-28 04:37:26 +08:00
|
|
|
yq e -i ".bbb.sharedSecret = \"$BBB_SECRET\"" $TARGET
|
|
|
|
yq e -i ".bbb.serverDomain = \"$BBB_HOST\"" $TARGET
|
|
|
|
yq e -i '.bbb.auth2_0 = true' $TARGET
|
2024-01-09 22:19:04 +08:00
|
|
|
yq e -i '.modules."../out/webhooks/index.js".config.getRaw = false' $TARGET
|
|
|
|
yq e -i '.log.filename = "/var/log/bbb-webhooks/bbb-webhooks.log"' $TARGET
|
2021-08-13 18:53:18 +08:00
|
|
|
|
|
|
|
mkdir -p /var/log/bbb-webhooks/
|
|
|
|
touch /var/log/bbb-webhooks/bbb-webhooks.log
|
|
|
|
chown -R bigbluebutton:bigbluebutton /usr/local/bigbluebutton/bbb-webhooks /var/log/bbb-webhooks/
|
|
|
|
|
|
|
|
reloadService nginx
|
|
|
|
startService bbb-webhooks || echo "bbb-webhooks could not be registered or started"
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
abort-upgrade|abort-remove|abort-deconfigure)
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "postinst called with unknown argument \`$1'" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|