1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 08:32:50 -05:00

Rework service user (#299)

* Use user primary group if not root

* Do not run getent on MacOS

* Simplify UID/GID management

* Make uid.env backward compatible in run.sh

* Merge install.sh with run.sh to avoid duplicating code

Especially the UID/GID management one

* Generate correct OS name

* Be sure to keep old behavior for backward compatiblilty

* Get the colors back from install.sh
This commit is contained in:
Mart124
2018-05-31 18:05:26 +02:00
committed by Kyle Spearrin
parent 961c0c6749
commit 92b08e6cf1
12 changed files with 222 additions and 464 deletions

View File

@ -47,15 +47,6 @@ function downloadSelf() {
chmod u+x $SCRIPT_PATH
}
function downloadInstall() {
if [ ! -d "$SCRIPTS_DIR" ]
then
mkdir $SCRIPTS_DIR
fi
curl -s -o $SCRIPTS_DIR/install.sh $GITHUB_BASE_URL/scripts/install.sh
chmod u+x $SCRIPTS_DIR/install.sh
}
function downloadRunFile() {
if [ ! -d "$SCRIPTS_DIR" ]
then
@ -63,6 +54,7 @@ function downloadRunFile() {
fi
curl -s -o $SCRIPTS_DIR/run.sh $GITHUB_BASE_URL/scripts/run.sh
chmod u+x $SCRIPTS_DIR/run.sh
rm -f $SCRIPTS_DIR/install.sh
}
function checkOutputDirExists() {
@ -87,9 +79,8 @@ if [ "$1" == "install" ]
then
checkOutputDirNotExists
mkdir $OUTPUT
downloadInstall
downloadRunFile
$SCRIPTS_DIR/install.sh $OUTPUT $COREVERSION $WEBVERSION
$SCRIPTS_DIR/run.sh install $OUTPUT $COREVERSION $WEBVERSION
elif [ "$1" == "start" -o "$1" == "restart" ]
then
checkOutputDirExists