mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-20 21:01:29 +01:00
Merge branch 'master' of github.com:bitwarden/web
This commit is contained in:
commit
48a36649fa
@ -5,52 +5,27 @@
|
|||||||
GROUPNAME="bitwarden"
|
GROUPNAME="bitwarden"
|
||||||
USERNAME="bitwarden"
|
USERNAME="bitwarden"
|
||||||
|
|
||||||
CURRENTGID=`getent group $GROUPNAME | cut -d: -f3`
|
LUID=${LOCAL_UID:-0}
|
||||||
LGID=${LOCAL_GID:-999}
|
LGID=${LOCAL_GID:-0}
|
||||||
|
|
||||||
NOUSER=`id -u $USERNAME > /dev/null 2>&1; echo $?`
|
# Step down from host root to well-known nobody/nogroup user
|
||||||
LUID=${LOCAL_UID:-999}
|
|
||||||
|
|
||||||
# Step down from host root
|
if [ $LUID -eq 0 ]
|
||||||
|
|
||||||
if [ $LGID == 0 ]
|
|
||||||
then
|
then
|
||||||
LGID=999
|
LUID=65534
|
||||||
|
fi
|
||||||
|
if [ $LGID -eq 0 ]
|
||||||
|
then
|
||||||
|
LGID=65534
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $LUID == 0 ]
|
# Create user and group
|
||||||
then
|
|
||||||
LUID=999
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create group
|
groupadd -o -g $LGID $GROUPNAME >/dev/null 2>&1 ||
|
||||||
|
groupmod -o -g $LGID $GROUPNAME >/dev/null 2>&1
|
||||||
if [ $CURRENTGID ]
|
useradd -o -u $LUID -g $GROUPNAME -s /bin/false $USERNAME >/dev/null 2>&1 ||
|
||||||
then
|
usermod -o -u $LUID -g $GROUPNAME -s /bin/false $USERNAME >/dev/null 2>&1
|
||||||
if [ "$CURRENTGID" != "$LGID" ]
|
mkhomedir_helper $USERNAME
|
||||||
then
|
|
||||||
groupmod -g $LGID $GROUPNAME
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
groupadd -g $LGID $GROUPNAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create user and assign group
|
|
||||||
|
|
||||||
if [ $NOUSER == 0 ] && [ `id -u $USERNAME` != $LUID ]
|
|
||||||
then
|
|
||||||
usermod -u $LUID $USERNAME
|
|
||||||
elif [ $NOUSER == 1 ]
|
|
||||||
then
|
|
||||||
useradd -r -u $LUID -g $GROUPNAME $USERNAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make home directory for user
|
|
||||||
|
|
||||||
if [ ! -d "/home/$USERNAME" ]
|
|
||||||
then
|
|
||||||
mkhomedir_helper $USERNAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
# The rest...
|
# The rest...
|
||||||
|
|
||||||
@ -60,5 +35,5 @@ cp /etc/bitwarden/web/app-id.json /app/app-id.json
|
|||||||
chown -R $USERNAME:$GROUPNAME /app
|
chown -R $USERNAME:$GROUPNAME /app
|
||||||
chown -R $USERNAME:$GROUPNAME /bitwarden_server
|
chown -R $USERNAME:$GROUPNAME /bitwarden_server
|
||||||
|
|
||||||
gosu $USERNAME:$GROUPNAME dotnet /bitwarden_server/Server.dll \
|
exec gosu $USERNAME:$GROUPNAME dotnet /bitwarden_server/Server.dll \
|
||||||
/contentRoot=/app /webRoot=. /serveUnknown=false
|
/contentRoot=/app /webRoot=. /serveUnknown=false
|
||||||
|
Loading…
Reference in New Issue
Block a user