From ec40b1ff06b00922531f2fb34f6fe27b8e1c8ec9 Mon Sep 17 00:00:00 2001 From: Pierre Besson Date: Mon, 26 Dec 2016 18:36:30 +0100 Subject: [PATCH] remove the ACL setup --- Dockerfile | 3 --- jhi-acl.json | 17 ----------------- load-config.sh | 12 +----------- 3 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 jhi-acl.json diff --git a/Dockerfile b/Dockerfile index ffccbd2..375bee9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,6 @@ RUN apk --update add nodejs git openssh curl bash inotify-tools jq && \ mkdir -p /etc/git2consul.d ADD /load-config.sh / -ADD /jhi-acl.json / VOLUME /config ENV CONFIG_MODE=filesystem @@ -15,7 +14,5 @@ ENV INIT_SLEEP_SECONDS=5 ENV CONSUL_URL=localhost ENV CONSUL_PORT=8500 ENV CONFIG_DIR=/config -ENV MASTER_ACL_TOKEN=to-change-in-production -ENV CLIENT_ACL_TOKEN=to-change-in-production-client CMD /load-config.sh diff --git a/jhi-acl.json b/jhi-acl.json deleted file mode 100644 index 2e35c0e..0000000 --- a/jhi-acl.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "ID" : "to-change-in-production-client", - "Name": "jhipster-client-acl", - "Type": "client", - "Rules": "{ - \"key\" : { - \"\": { - \"policy\": \"read\" - } - }, - \"service\": { - \"\": { - \"policy\": \"write\" - } - } - }" -} diff --git a/load-config.sh b/load-config.sh index b3a26a2..46373bb 100755 --- a/load-config.sh +++ b/load-config.sh @@ -1,19 +1,9 @@ #!/bin/bash -if [ $MASTER_ACL_TOKEN = $CLIENT_ACL_TOKEN ]; then - echo "client and master acl token cannot be equal" - exit 1 -fi - # To use outside of docker, set the following environment variables # export INIT_SLEEP_SECONDS=0;export CONFIG_MODE=filesystem;export CONFIG_DIR=config/;export CONSUL_URL=localhost;export CONSUL_PORT=8500 sleep $INIT_SLEEP_SECONDS -echo "setting ACL settings" -echo "----------------------------------------------------------------------" - -cat jhi-acl.json | sed s/to-change-in-production-client/$CLIENT_ACL_TOKEN/ | curl -sX PUT -d "@-" http://$CONSUL_URL:$CONSUL_PORT/v1/acl/create?token=$MASTER_ACL_TOKEN - echo "---------------------------------------------------------------------- Starting Consul Config Loader in $CONFIG_MODE mode" @@ -22,7 +12,7 @@ function loadPropertiesFilesIntoConsul { do filename=$(basename $file) app=${filename%%.*} - curl -sX PUT --data-binary @$file http://$CONSUL_URL:$CONSUL_PORT/v1/kv/config/$app/data?token=$MASTER_ACL_TOKEN # > /dev/null + curl -sX PUT --data-binary @$file http://$CONSUL_URL:$CONSUL_PORT/v1/kv/config/$app/data # > /dev/null done echo " Consul Config reloaded" }