diff --git a/data/Dockerfiles/policyd/Dockerfile b/data/Dockerfiles/policyd/Dockerfile deleted file mode 100644 index 3990f9f2..00000000 --- a/data/Dockerfiles/policyd/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM docker.io/1and1internet/ubuntu-16-apache-php-7.1:latest -ARG DEBIAN_FRONTEND=noninteractive -COPY files / -RUN \ - groupadd cbpolicyd && \ - useradd -g cbpolicyd cbpolicyd && \ - apt-get update && \ - apt-get -o Dpkg::Options::=--force-confdef -y install gettext-base postfix-cluebringer postfix-cluebringer-mysql postfix-cluebringer-webui -y && \ - apt-get -y clean && \ - rm -rf /var/lib/apt/lists/* /etc/cluebringer && \ - mkdir --mode=0775 /etc/cluebringer && \ - cp /usr/share/doc/postfix-cluebringer/database/policyd-db.mysql.gz /tmp/ && \ - cp -r /usr/share/postfix-cluebringer-webui/webui/* /var/www/html/ && \ - gunzip /tmp/policyd-db.mysql.gz && \ - sed -i -e 's/TYPE=InnoDB/ENGINE=InnoDB/g' /tmp/policyd-db.mysql && \ - chmod -R 0755 /hooks && \ - chmod -R 0777 /var/www/html && \ - chmod 0666 /var/log/cbpolicyd.log -EXPOSE 10031 8080 8443 diff --git a/data/Dockerfiles/policyd/files/etc/supervisor/conf.d/apache-2.4.conf b/data/Dockerfiles/policyd/files/etc/supervisor/conf.d/apache-2.4.conf deleted file mode 100644 index d5409158..00000000 --- a/data/Dockerfiles/policyd/files/etc/supervisor/conf.d/apache-2.4.conf +++ /dev/null @@ -1,12 +0,0 @@ -[program:apache-2.4] -command=/bin/bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND" -autostart=true -autorestart=true -startretries=3 - -# Redirect output so we can see it using "docker logs" -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - diff --git a/data/Dockerfiles/policyd/files/etc/supervisor/conf.d/cbpolicyd.conf b/data/Dockerfiles/policyd/files/etc/supervisor/conf.d/cbpolicyd.conf deleted file mode 100644 index 53f78cf7..00000000 --- a/data/Dockerfiles/policyd/files/etc/supervisor/conf.d/cbpolicyd.conf +++ /dev/null @@ -1,12 +0,0 @@ -[program:cbpolicyd] -command=/usr/sbin/cbpolicyd --fg --config=/etc/cluebringer/cluebringer.conf -autostart=true -autorestart=true -startretries=3 - -# Redirect output so we can see it using "docker logs" -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - diff --git a/data/Dockerfiles/policyd/files/hooks/supervisord-pre.d/50_install_cluebringer_db b/data/Dockerfiles/policyd/files/hooks/supervisord-pre.d/50_install_cluebringer_db deleted file mode 100644 index 4c53f15b..00000000 --- a/data/Dockerfiles/policyd/files/hooks/supervisord-pre.d/50_install_cluebringer_db +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -set -eo pipefail - -# Password protect webui -echo Creating webui user -echo $WEBUI_PASSWORD | htpasswd -ci /var/www/html/.htpasswd webui - -# Checking for DB liveness before continuing with DB set up. -count=0 -while [ $count -lt 4 ]; do - if [[ $(mysql -h$CLUEBRINGER_DB_HOST -uroot -p$MYSQL_ROOT_PASSWORD -e "select 1" &>/dev/null ; echo $?) -ne 0 ]]; then - echo "Waiting for DB to be ready." - sleep 15 - let count+=1 - else - echo "DB appears to be ready." - break - fi -done -# Die if DB doesn't come up in time. -if [ $count -eq 4 ]; then - echo "!!!WARNING!!! DB didn't come up in time." - exit 0 -fi - -# Set up DB if it's empty. -if [[ $(mysql -N -h$CLUEBRINGER_DB_HOST -uroot -p$MYSQL_ROOT_PASSWORD -e "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '$MYSQL_DATABASE';") == 0 ]]; then - echo "Setting up cluebringer DB." - - # Set up DB and User - if [[ $(mysql -N -h$CLUEBRINGER_DB_HOST -uroot -p$MYSQL_ROOT_PASSWORD -e "create database $MYSQL_DATABASE;use $MYSQL_DATABASE;CREATE USER '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD';GRANT ALL PRIVILEGES ON $MYSQL_DATABASE.* TO '$MYSQL_USER'@'%';") -ne 0 ]]; then - echo "Can't create DB and Policyd DB user!" - exit 0 - fi - - # Add our policys from sql if they exist. - if [[ -e /tmpl/cluebringer/import/policy.sql ]]; then - echo "Importing our configuration." - mysql -h$CLUEBRINGER_DB_HOST -u$MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE < /tmpl/cluebringer/import/policy.sql - echo "Done." - else - echo "Additional sql configuration no found importing standart configuration." - mysql -h$CLUEBRINGER_DB_HOST -u$MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE < /tmp/policyd-db.mysql - fi -else - echo "Cluebringer DB not empty, exiting." - exit 0 -fi diff --git a/data/Dockerfiles/policyd/files/hooks/supervisord-pre.d/51_configure_policyd b/data/Dockerfiles/policyd/files/hooks/supervisord-pre.d/51_configure_policyd deleted file mode 100644 index 1983b4a5..00000000 --- a/data/Dockerfiles/policyd/files/hooks/supervisord-pre.d/51_configure_policyd +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -eu - -export DOLLAR=$ -export MYSQL_DATABASE=${MYSQL_DATABASE} -export MYSQL_USER=${MYSQL_USER} -export MYSQL_PASSWORD=${MYSQL_PASSWORD} -export CLUEBRINGER_DB_BACKEND=${CLUEBRINGER_DB_BACKEND} -export CLUEBRINGER_DB_PORT=${CLUEBRINGER_DB_PORT} -export CLUEBRINGER_DB_HOST=${CLUEBRINGER_DB_HOST} - -envsubst < /tmpl/cluebringer/cluebringer.conf > /etc/cluebringer/cluebringer.conf -envsubst < /tmpl/cluebringer/cluebringer-webui.conf > /etc/cluebringer/cluebringer-webui.conf diff --git a/data/Dockerfiles/policyd/files/tmpl/cluebringer/cluebringer-webui.conf b/data/Dockerfiles/policyd/files/tmpl/cluebringer/cluebringer-webui.conf deleted file mode 100644 index a68f5a61..00000000 --- a/data/Dockerfiles/policyd/files/tmpl/cluebringer/cluebringer-webui.conf +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/data/Dockerfiles/policyd/files/tmpl/cluebringer/cluebringer.conf b/data/Dockerfiles/policyd/files/tmpl/cluebringer/cluebringer.conf deleted file mode 100644 index 4686f1e2..00000000 --- a/data/Dockerfiles/policyd/files/tmpl/cluebringer/cluebringer.conf +++ /dev/null @@ -1,192 +0,0 @@ -# -# Server configuration -# -[server] - -# Protocols to load -protocols=<