From 62d963d8b2e91e111c1828639ed1f363037466aa Mon Sep 17 00:00:00 2001 From: Wes Lambert Date: Thu, 16 Jul 2020 04:15:03 +0000 Subject: [PATCH] Update to use .env --- docker-compose.yaml | 4 ++++ entrypoint | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 7807091..05bd1fc 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,6 +8,10 @@ services: dockerfile: Dockerfile volumes: - ./velociraptor:/velociraptor/:rw + environment: + - VELOX_USER=${VELOX_USER} + - VELOX_PASSWORD=${VELOX_PASSWORD} + - VELOX_ROLE=${VELOX_ROLE} ports: - "8000:8000" - "8001:8001" diff --git a/entrypoint b/entrypoint index 0b65141..e24af07 100755 --- a/entrypoint +++ b/entrypoint @@ -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