Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

Commit

Permalink
Add option to bypass startup script
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Nov 15, 2022
1 parent 64b5084 commit 4301673
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
#!/bin/sh
if [ ! -z "$MAUTRIX_DIRECT_STARTUP" ]; then
if [ $(id -u) == 0 ]; then
echo "|------------------------------------------|"
echo "| Warning: running bridge unsafely as root |"
echo "|------------------------------------------|"
fi
exec python3 -m mautrix_facebook -c /data/config.yaml
elif [ $(id -u) != 0 ]; then
echo "The startup script must run as root. It will use su-exec to drop permissions before running the bridge."
echo "To bypass the startup script, either set the `MAUTRIX_DIRECT_STARTUP` environment variable,"
echo "or just use `python3 -m mautrix_facebook -c /data/config.yaml` as the run command."
echo "Note that the config and registration will not be auto-generated when bypassing the startup script."
exit 1
fi

# Define functions.
function fixperms {
Expand Down

0 comments on commit 4301673

Please sign in to comment.