1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-06 13:38:13 -05:00

main sh script

This commit is contained in:
Kyle Spearrin 2017-08-19 17:59:04 -04:00
parent 8bbaa40307
commit b095a3b6fd
3 changed files with 65 additions and 4 deletions

View File

@ -29,10 +29,10 @@ $githubBaseUrl = "https://raw.githubusercontent.com/bitwarden/core/master"
function Download-Run-Files {
Invoke-RestMethod -OutFile run.ps1 -Uri "${githubBaseUrl}/scripts/run.ps1"
Invoke-RestMethod -OutFile docker\docker-compose.yml -Uri "${githubBaseUrl}/docker/docker-compose.yml"
Invoke-RestMethod -OutFile docker\docker-compose.windows.yml ` -Uri "${githubBaseUrl}/docker/docker-compose.windows.yml"
Invoke-RestMethod -OutFile docker\global.env -Uri "${githubBaseUrl}/docker/global.env"
Invoke-RestMethod -OutFile docker\mssql.env -Uri "${githubBaseUrl}/docker/mssql.env"
Invoke-RestMethod -OutFile $dockerDir\docker-compose.yml -Uri "${githubBaseUrl}/docker/docker-compose.yml"
Invoke-RestMethod -OutFile $dockerDir\docker-compose.windows.yml ` -Uri "${githubBaseUrl}/docker/docker-compose.windows.yml"
Invoke-RestMethod -OutFile $dockerDir\global.env -Uri "${githubBaseUrl}/docker/global.env"
Invoke-RestMethod -OutFile $dockerDir\mssql.env -Uri "${githubBaseUrl}/docker/mssql.env"
}
if($install) {

57
scripts/bitwarden.sh Normal file
View File

@ -0,0 +1,57 @@
#!/usr/bin/env bash
set -e
YEAR=$(date +'%Y')
cat << "EOF"
_ _ _ _
| |__ (_) |___ ____ _ _ __ __| | ___ _ __
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \
| |_) | | |_ \ V V / (_| | | | (_| | __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_| \__,_|\___|_| |_|
EOF
cat << EOF
Open source password management solutions
Copyright 2015-$YEAR, 8bit Solutions LLC
https://bitwarden.com, https://github.com/bitwarden
EOF
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DOCKER_DIR="./docker"
GITHUB_BASE_URL="https://raw.githubusercontent.com/bitwarden/core/master"
OUTPUT=~/bitwarden
if [ $# -eq 2 ]
then
OUTPUT=$2
fi
function dowloadRunFiles {
curl -s -o run.sh $GITHUB_BASE_URL/scripts/run.ps1
curl -s -o $DOCKER_DIR/docker-compose.yml $GITHUB_BASE_URL/docker/docker-compose.yml
curl -s -o $DOCKER_DIR/docker-compose.linux.yml $GITHUB_BASE_URL/docker/docker-compose.linux.yml
curl -s -o $DOCKER_DIR/global.env $GITHUB_BASE_URL/docker/global.env
curl -s -o $DOCKER_DIR/mssql.env $GITHUB_BASE_URL/docker/mssql.env
}
if [ $1 == 'install' ]
then
curl -s -o install.sh $GITHUB_BASE_URL/scripts/install.sh
chmod u+x install.sh
./install.sh $OUTPUT
elif [ $1 == 'run' -o $1 == 'restart' ]
then
#
elif [ $1 == 'update' ]
then
#
elif [ $1 == 'updatedb' ]
then
curl -s -o update-db.sh $GITHUB_BASE_URL/scripts/update-db.sh
chmod u+x update-db.sh
./update-db.sh $OUTPUT
else
echo "No command found."
fi

View File

@ -2,6 +2,10 @@
set -e
OUTPUT_DIR=~/bitwarden
if [ $# -eq 1 ]
then
OUTPUT_DIR=$1
fi
docker run -it --rm --name setup --network container:mssql -v $OUTPUT_DIR:/bitwarden bitwarden/setup \
dotnet Setup.dll -update 1 -db 1