diff --git a/Dockerfile b/Dockerfile index f652301..01e3394 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,8 +33,9 @@ ENV PBR_VERSION=PROD # We are using develop so that the code can be mounted when in DEV. RUN cd /opt/surveil && python setup.py develop -#Set to 'surveil-auth' for surveil-specific auth or set to 'authtoken' for Keystone authentication -ENV SURVEIL_AUTH_BACKEND=surveil-auth +#Set to 'surveil' or 'keystone' +ENV SURVEIL_AUTH_BACKEND=surveil +ENV SURVEIL_KEYSTONE_ENDPOINT=127.0.0.1 CMD cd /opt/surveil && \ ./setup.sh && \ diff --git a/tools/docker/surveil_container/setup.sh b/tools/docker/surveil_container/setup.sh index d82e2de..196a3f7 100755 --- a/tools/docker/surveil_container/setup.sh +++ b/tools/docker/surveil_container/setup.sh @@ -1,13 +1,19 @@ #!/bin/bash function setup_surveil_api { - sed -i "s/pipeline =.*/pipeline = ${SURVEIL_AUTH_BACKEND} api-server/" /etc/surveil/api_paste.ini + if [ $SURVEIL_AUTH_BACKEND = surveil ] ; then + echo -e "=> Setting up Surveil API for surveil authentication..." + sed -i "s/pipeline =.*/pipeline = surveil-auth api-server/" /etc/surveil/api_paste.ini + else + echo -e "=> Setting up Surveil API for keystone authentication..." + sed -i "s/pipeline =.*/pipeline = auth-token api-server/" /etc/surveil/api_paste.ini + sed -i "s/auth_host=.*/auth_host=${SURVEIL_KEYSTONE_ENDPOINT}/" /etc/surveil/api_paste.ini + fi } if [ -f "/.surveil_api_setup" ]; then echo "=> Surveil API was already configured, skipping..." else - echo -e "=> Configuring Surveil API..." setup_surveil_api && touch "/.surveil_api_setup" echo -e "=> Done with API configuration." fi