From cbddd36aadfa17bbe9f024944055a6996bac9790 Mon Sep 17 00:00:00 2001 From: stremovsky Date: Sun, 15 Dec 2019 10:11:25 +0200 Subject: [PATCH] new version of docker integration --- Dockerfile | 3 ++- run.sh | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index a9f9331..c6632a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,12 +17,13 @@ RUN go get -u github.com/evanphx/json-patch RUN go get -u github.com/julienschmidt/httprouter WORKDIR $GOPATH/src/paranoidguy/databunker/src/ COPY . $GOPATH/src/paranoidguy/databunker/ -RUN find $GOPATH/src/paranoidguy/databunker/ # Fetch dependencies. # Using go get. RUN go get -d -v # prepare web to go with packr RUN packr +# debug +RUN find $GOPATH/src/paranoidguy/databunker/ # Build the binary. RUN go build -o /go/bin/databunker # clean packr diff --git a/run.sh b/run.sh index b17b656..3318ced 100755 --- a/run.sh +++ b/run.sh @@ -1,18 +1,20 @@ #!/bin/sh -/bin/busybox find / +/bin/busybox find /databunker -DATABUNKER_MASTERKEY= +DATABUNKER_MASTERKEY="" if [ ! -f /databunker/data/databunker.db ]; then echo "-------------INIT------------" /bin/busybox mkdir -p /tmp - RESULT=`/databunker/bin/databunker -init > /tmp/init.txt` + RESULT=`/databunker/bin/databunker -init -db /databunker/data/databunker.db -conf /databunker/conf/databunker.yaml > /tmp/init.txt` echo $RESULT ROOT_TOKEN=`/bin/busybox awk '/API Root token:/ {print $4}' /tmp/init.txt` - MASTER_KEY=`/bin/busybox awk '/Master key:/ {print $3}' /tmp/init.txt` + DATABUNKER_MASTERKEY=`/bin/busybox awk '/Master key:/ {print $3}' /tmp/init.txt` echo "DATABUNKER_ROOTTOKEN $ROOT_TOKEN" - echo "DATABUNKER_MASTERKEY $MASTER_KEY" + echo "DATABUNKER_MASTERKEY $DATABUNKER_MASTERKEY" /bin/busybox rm -rf /tmp/init.txt fi +echo "-------------FIND------------" +/bin/busybox find /databunker echo "-------------RUN-------------" -#/go/bin/databunker \ No newline at end of file +/databunker/bin/databunker -masterkey $DATABUNKER_MASTERKEY -db /databunker/data/databunker.db -conf /databunker/conf/databunker.yaml \ No newline at end of file