Skip to content

Commit

Permalink
remove the ACL setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Besson committed Dec 26, 2016
1 parent bdfeb02 commit ec40b1f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 31 deletions.
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ 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
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
17 changes: 0 additions & 17 deletions jhi-acl.json

This file was deleted.

12 changes: 1 addition & 11 deletions load-config.sh
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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"
}
Expand Down

0 comments on commit ec40b1f

Please sign in to comment.