mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
[PS-2016] Add ability to change UID/GID for Bitwarden unified (#2495)
This commit is contained in:
@ -1,5 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Set up user group
|
||||
GID="${GID:-1000}"
|
||||
addgroup -g $GID bitwarden
|
||||
GROUP_NAME=$(cat /etc/group | grep ":$GID:" | cut -d ':' -f 1)
|
||||
|
||||
# Set up user
|
||||
UID="${UID:-1000}"
|
||||
adduser -s /bin/false -D -u $UID -G $GROUP_NAME bitwarden
|
||||
|
||||
# Translate environment variables for application settings
|
||||
VAULT_SERVICE_URI=https://$BW_DOMAIN
|
||||
MYSQL_CONNECTION_STRING="server=$BW_DB_SERVER;database=$BW_DB_DATABASE;user=$BW_DB_USERNAME;password=$BW_DB_PASSWORD"
|
||||
@ -78,4 +87,14 @@ sed -i "s/autostart=true/autostart=${BW_ENABLE_NOTIFICATIONS}/" /etc/supervisor.
|
||||
sed -i "s/autostart=true/autostart=${BW_ENABLE_SCIM}/" /etc/supervisor.d/scim.ini
|
||||
sed -i "s/autostart=true/autostart=${BW_ENABLE_SSO}/" /etc/supervisor.d/sso.ini
|
||||
|
||||
exec /usr/bin/supervisord
|
||||
chown -R $UID:$GID \
|
||||
/app \
|
||||
/etc/bitwarden \
|
||||
/etc/nginx/http.d \
|
||||
/etc/supervisor \
|
||||
/etc/supervisor.d \
|
||||
/var/lib/nginx \
|
||||
/var/log \
|
||||
/run
|
||||
|
||||
su-exec $UID:$GID /usr/bin/supervisord
|
||||
|
Reference in New Issue
Block a user