|
@@ -50,27 +50,15 @@ case "$1" in
|
50
|
50
|
if [ -f "$PROSODY_HOST_CONFIG" ] ; then
|
51
|
51
|
# search for the token auth, if this is not enabled this is the
|
52
|
52
|
# first time we install tokens package and needs a config change
|
53
|
|
- if ! egrep -q '^\s*authentication\s*=\s*"token"' "$PROSODY_HOST_CONFIG"; then
|
|
53
|
+ if ! egrep -q '^\s*authentication\s*=\s*"token" -- do not delete me' "$PROSODY_HOST_CONFIG"; then
|
54
|
54
|
# enable tokens in prosody host config
|
55
|
55
|
sed -i 's/--plugin_paths/plugin_paths/g' $PROSODY_HOST_CONFIG
|
56
|
|
- sed -i 's/authentication = "anonymous"/authentication = "token"/g' $PROSODY_HOST_CONFIG
|
57
|
|
- sed -i 's/ --allow_unencrypted_plain_auth/ allow_unencrypted_plain_auth/g' $PROSODY_HOST_CONFIG
|
|
56
|
+ sed -i 's/authentication = "anonymous" -- do not delete me/authentication = "token" -- do not delete me/g' $PROSODY_HOST_CONFIG
|
58
|
57
|
sed -i "s/ --app_id=\"example_app_id\"/ app_id=\"$APP_ID\"/g" $PROSODY_HOST_CONFIG
|
59
|
58
|
sed -i "s/ --app_secret=\"example_app_secret\"/ app_secret=\"$APP_SECRET\"/g" $PROSODY_HOST_CONFIG
|
60
|
59
|
sed -i 's/ --modules_enabled = { "token_verification" }/ modules_enabled = { "token_verification" }/g' $PROSODY_HOST_CONFIG
|
61
|
60
|
sed -i '/^\s*--\s*"token_verification"/ s/--\s*//' $PROSODY_HOST_CONFIG
|
62
|
61
|
|
63
|
|
- PR10_INSTALL_CHECK="$(dpkg-query -f '${Status}' -W 'prosody-0.10' 2>/dev/null | awk '{print $3}' || true)"
|
64
|
|
- PRTRUNK_INSTALL_CHECK="$(dpkg-query -f '${Status}' -W 'prosody-trunk' 2>/dev/null | awk '{print $3}' || true)"
|
65
|
|
- PR_VER_INSTALLED=$(dpkg-query -f='${Version}\n' --show prosody 2>/dev/null || true)
|
66
|
|
- if [ "$PR10_INSTALL_CHECK" = "installed" ] \
|
67
|
|
- || [ "$PR10_INSTALL_CHECK" = "unpacked" ] \
|
68
|
|
- || [ "$PRTRUNK_INSTALL_CHECK" = "installed" ] \
|
69
|
|
- || [ "$PRTRUNK_INSTALL_CHECK" = "unpacked" ] \
|
70
|
|
- || dpkg --compare-versions "$PR_VER_INSTALLED" lt "0.11" ; then
|
71
|
|
- sed -i 's/module:hook_global(/module:hook(/g' /usr/share/jitsi-meet/prosody-plugins/mod_auth_token.lua
|
72
|
|
- fi
|
73
|
|
-
|
74
|
62
|
if [ -x "/etc/init.d/prosody" ]; then
|
75
|
63
|
invoke-rc.d prosody restart || true
|
76
|
64
|
fi
|