diff --git a/Workbench/docker-compose.yml b/Workbench/docker-compose.yml index 3ebb492..6fde02a 100644 --- a/Workbench/docker-compose.yml +++ b/Workbench/docker-compose.yml @@ -524,5 +524,3 @@ volumes: generated-config: generated-metadata: mariadb-data: - - diff --git a/Workbench/scripts/refreshListener.php b/Workbench/scripts/refreshListener.php new file mode 100644 index 0000000..3bf9f26 --- /dev/null +++ b/Workbench/scripts/refreshListener.php @@ -0,0 +1,28 @@ +channel(); + +$channel->queue_declare('refreshInstance', false, false, false, false); + +echo " [*] Waiting for messages. To exit press CTRL+C\n"; + +$callback = function ($msg) { + echo ' [x] Received ', $msg->body, "\n"; + if ($msg->body == "REFRESH_THIS_INSTANCE") { + echo "Received REFRESH message!\n"; + shell_exec( "/csp-tap/InCommonTAP-Examples/Workbench/scripts/refresh-this-instance.sh" ); + } +}; + +$channel->basic_consume('refreshInstance', '', false, true, false, false, $callback); + +while ($channel->is_consuming()) { + $channel->wait(); +} + +$channel->close(); +$connection->close(); +?> \ No newline at end of file diff --git a/Workbench/webproxy/Dockerfile b/Workbench/webproxy/Dockerfile index e548133..be0e425 100644 --- a/Workbench/webproxy/Dockerfile +++ b/Workbench/webproxy/Dockerfile @@ -3,9 +3,13 @@ FROM tier/shibboleth_sp:latest ARG CSPHOSTNAME=localhost ENV CSPHOSTNAME=$CSPHOSTNAME -RUN yum -y install cronie +RUN yum -y install cronie php composer php-bcmath +RUN composer require php-amqplib/php-amqplib +RUN composer install +RUN mkdir -p /var/www/html/refresh -#COPY container_files/httpd/httpd.conf /etc/httpd/conf/ + +COPY container_files/httpd/refresh/index.php /var/www/html/refresh/ COPY container_files/httpd/proxy.conf /etc/httpd/conf.d/ COPY container_files/httpd/shib.conf /etc/httpd/conf.d/ COPY container_files/httpd/ssl.conf /etc/httpd/conf.d/ @@ -22,6 +26,8 @@ COPY container_files/shibboleth/ /etc/shibboleth/ COPY container_files/system/setservername.sh /usr/local/bin/ RUN chmod 755 /usr/local/bin/setservername.sh +RUN mkdir -p /signalreload + # fix httpd logging for ssl logs RUN sed -i 's/TransferLog logs\/ssl_access_log/TransferLog \/tmp\/logpipe/g' /etc/httpd/conf.d/ssl.conf \ && sed -i 's/ErrorLog logs\/ssl_error_log/ErrorLog \/tmp\/logpipe/g' /etc/httpd/conf.d/ssl.conf diff --git a/Workbench/webproxy/container_files/httpd/index.html b/Workbench/webproxy/container_files/httpd/index.html index d7862f9..305d221 100644 --- a/Workbench/webproxy/container_files/httpd/index.html +++ b/Workbench/webproxy/container_files/httpd/index.html @@ -40,5 +40,6 @@
