1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01:00

script updates

This commit is contained in:
Kyle Spearrin 2017-08-21 08:49:44 -04:00
parent bfb945ac5f
commit 74415b9955
9 changed files with 50 additions and 90 deletions

View File

@ -71,6 +71,16 @@ You can deploy bitwarden using Docker containers on Windows, macOS, and Linux di
*These dependencies are free to use.*
### Linux & macOS
```
sudo curl -s -o bitwarden.sh https://raw.githubusercontent.com/bitwarden/core/master/scripts/bitwarden.sh && chmod u+x bitwarden.sh
./bitwarden.sh install
./bitwarden.sh updatedb
./bitwarden.sh run
```
### Windows
```
@ -81,26 +91,6 @@ Invoke-RestMethod -OutFile bitwarden.ps1 -Uri https://raw.githubusercontent.com/
.\bitwarden.ps1 -run
```
### macOS
```
curl -s -o bitwarden.sh https://raw.githubusercontent.com/bitwarden/core/master/scripts/bitwarden.sh
./bitwarden.sh install
./bitwarden.sh updatedb
./bitwarden.sh runmac
```
### Linux
```
curl -s -o bitwarden.sh https://raw.githubusercontent.com/bitwarden/core/master/scripts/bitwarden.sh
./bitwarden.sh install
./bitwarden.sh updatedb
./bitwarden.sh run
```
## Contribute
Code contributions are welcome! Visual Studio or VS Code is highly recommended if you are working on this project. Please commit any pull requests against the `master` branch.

View File

@ -1,35 +0,0 @@
version: '3'
services:
mssql:
volumes:
- mssql_data:/var/opt/mssql/data
env_file:
- mssql.env
- c:/bitwarden/docker/mssql.override.env
web:
volumes:
- c:/bitwarden/web:/etc/bitwarden/web
attachments:
volumes:
- c:/bitwarden/core/attachments:/etc/bitwarden/core/attachments
api:
volumes:
- c:/bitwarden/core:/etc/bitwarden/core
env_file:
- global.env
- c:/bitwarden/docker/global.override.env
identity:
volumes:
- c:/bitwarden/identity:/etc/bitwarden/identity
- c:/bitwarden/core:/etc/bitwarden/core
env_file:
- global.env
- c:/bitwarden/docker/global.override.env
nginx:
volumes:
- c:/bitwarden/nginx:/etc/bitwarden/nginx
- c:/bitwarden/letsencrypt:/etc/letsencrypt
- c:/bitwarden/ssl:/etc/ssl
volumes:
mssql_data:

View File

@ -4,11 +4,9 @@ param (
[switch] $restart,
[switch] $update,
[switch] $updatedb,
[string] $output = "c:/bitwarden"
[string] $output = ""
)
$year = (Get-Date).year
Write-Host @'
_ _ _ _
| |__ (_) |___ ____ _ _ __ __| | ___ _ __
@ -19,46 +17,55 @@ Write-Host @'
Write-Host "
Open source password management solutions
Copyright 2015-${year}, 8bit Solutions LLC
Copyright 2015-${(Get-Date).year}, 8bit Solutions LLC
https://bitwarden.com, https://github.com/bitwarden
"
$dir = Split-Path -Parent $MyInvocation.MyCommand.Path
$dockerDir = ".\docker"
if($output -eq "") {
$output="${dir}\bitwarden"
}
if(!(Test-Path -Path $output)) {
New-Item -ItemType directory -Path $output | Out-Null
}
$scriptsDir = "${output}\scripts"
$dockerDir = "${output}\docker"
$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 $scriptsDir\run.ps1 -Uri "${githubBaseUrl}/scripts/run.ps1"
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\docker-compose.macwin.yml ` -Uri "${githubBaseUrl}/docker/docker-compose.macwin.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) {
Invoke-RestMethod -OutFile install.ps1 ` -Uri "${githubBaseUrl}/scripts/install.ps1"
.\install.ps1 -outputDir $output
Invoke-RestMethod -OutFile $scriptsDir\install.ps1 ` -Uri "${githubBaseUrl}/scripts/install.ps1"
$scriptsDir\install.ps1 -outputDir $output
}
elseif($run -Or $restart) {
if(!(Test-Path -Path $dockerDir)){
if(!(Test-Path -Path $dockerDir)) {
New-Item -ItemType directory -Path $dockerDir | Out-Null
Download-Run-Files
}
.\run.ps1 -dockerDir $dockerDir
$scriptsDir\run.ps1 -dockerDir $dockerDir
}
elseif($update) {
if(Test-Path -Path $dockerDir){
if(Test-Path -Path $dockerDir) {
Remove-Item -Recurse -Force $dockerDir | Out-Null
}
New-Item -ItemType directory -Path $dockerDir | Out-Null
Download-Run-Files
.\run.ps1 -dockerDir $dockerDir
$scriptsDir\run.ps1 -dockerDir $dockerDir
}
elseif($updatedb) {
Invoke-RestMethod -OutFile update-db.ps1 -Uri "${githubBaseUrl}/scripts/update-db.ps1"
.\update-db.ps1 -outputDir $output
Invoke-RestMethod -OutFile $scriptsDir\update-db.ps1 -Uri "${githubBaseUrl}/scripts/update-db.ps1"
$scriptsDir\update-db.ps1 -outputDir $output
}
else {
echo "No command found."

View File

@ -17,20 +17,11 @@ https://bitwarden.com, https://github.com/bitwarden
EOF
OS="linux"
if [ $# -eq 2 ]
then
if [ $2 == "mac" -o $2 == "linux" ]
then
OS=$2
fi
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
OUTPUT="$DIR/bitwarden"
if [ $# -eq 3 ]
if [ $# -eq 2 ]
then
OUTPUT=$3
OUTPUT=$2
fi
if [ ! -d "$OUTPUT" ]
@ -38,6 +29,12 @@ then
mkdir $OUTPUT
fi
OS="linux"
if [ "$(uname)" == "Darwin" ]
then
OS="macwin"
fi
SCRIPTS_DIR="$OUTPUT/scripts"
DOCKER_DIR="$OUTPUT/docker"
GITHUB_BASE_URL="https://raw.githubusercontent.com/bitwarden/core/master"
@ -68,7 +65,7 @@ then
mkdir $DOCKER_DIR
downloadRunFiles
fi
$SCRIPTS_DIR/run.sh $DOCKER_DIR $OS
$SCRIPTS_DIR/run.sh $DOCKER_DIR
elif [ "$1" == "update" ]
then
if [ -d "$DOCKER_DIR" ]
@ -78,7 +75,7 @@ then
mkdir $DOCKER_DIR
downloadRunFiles
$SCRIPTS_DIR/run.sh $DOCKER_DIR $OS
$SCRIPTS_DIR/run.sh $DOCKER_DIR
elif [ "$1" == "updatedb" ]
then
curl -s -o $SCRIPTS_DIR/update-db.sh $GITHUB_BASE_URL/scripts/update-db.sh

View File

@ -1,5 +1,5 @@
param (
[string]$outputDir = "c:/bitwarden"
[string]$outputDir = "../."
)
if(!(Test-Path -Path $outputDir )){

View File

@ -10,5 +10,5 @@ if($dockerDir -eq "") {
docker --version
docker-compose --version
docker-compose -f ${dockerDir}\docker-compose.yml -f ${dockerDir}\docker-compose.windows.yml down
docker-compose -f ${dockerDir}\docker-compose.yml -f ${dockerDir}\docker-compose.windows.yml up -d
docker-compose -f ${dockerDir}\docker-compose.yml -f ${dockerDir}\docker-compose.macwin.yml down
docker-compose -f ${dockerDir}\docker-compose.yml -f ${dockerDir}\docker-compose.macwin.yml up -d

View File

@ -3,14 +3,15 @@ set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DOCKER_DIR=$DIR/../docker
OS="linux"
if [ $# -eq 1 ]
then
DOCKER_DIR=$1
fi
if [ $# -eq 2 ]
OS="linux"
if [ "$(uname)" == "Darwin" ]
then
OS=$2
OS="macwin"
fi
docker --version

View File

@ -1,5 +1,5 @@
param (
[string]$outputDir = "c:/bitwarden"
[string]$outputDir = "../."
)
docker run -it --rm --name setup --network container:mssql -v ${outputDir}:/bitwarden bitwarden/setup `