Update to use .env

This commit is contained in:
Wes Lambert
2020-07-16 04:15:03 +00:00
parent 5e853b7dba
commit 62d963d8b2
2 changed files with 6 additions and 4 deletions

View File

@@ -1,12 +1,10 @@
#!/bin/bash
set -e
#VERSION="0.4.5"
BIND_ADDRESS="0.0.0.0"
PUBLIC_PATH="public"
LOG_DIR="."
SERVER_URL="https://VelociraptorServer:8000/"
USER="admin"
PASSWORD="admin"
ROLE="administrator"
DATASTORE_LOCATION="./"
FILESTORE_DIRECTORY="./"
CLIENT_DIR="/velociraptor/clients"
@@ -22,7 +20,7 @@ if [ ! -f server.config.yaml ]; then
./velociraptor config generate > server.config.yaml --merge '{"Frontend":{"public_path":"'$PUBLIC_PATH'"},"API":{"bind_address":"'$BIND_ADDRESS'"},"GUI":{"bind_address":"'$BIND_ADDRESS'"},"Monitoring":{"bind_address":"'$BIND_ADDRESS'"},"Logging":{"output_directory":"'$LOG_DIR'","separate_logs_per_component":true},"Client":{"server_urls":["'$SERVER_URL'"],"use_self_signed_ssl":true}, "Datastore":{"location":"'$DATASTORE_LOCATION'", "filestore_directory":"'$FILESTORE_DIRECTORY'"}}'
sed -i "s#https://localhost:8000/#$SERVER_URL#" server.config.yaml
sed -i 's#/tmp/velociraptor#.#'g server.config.yaml
./velociraptor --config server.config.yaml user add $USER $PASSWORD --role $ROLE
./velociraptor --config server.config.yaml user add $VELOX_USER $VELOX_PASSWORD --role $VELOX_ROLE
fi
# Re-generate client config in case server config changed