diff options
-rw-r--r-- | build/test/dummy-apache2.start | 3 | ||||
-rw-r--r-- | build/test/front-test.Dockerfile | 40 | ||||
-rw-r--r-- | build/test/playbook-test.yml | 13 | ||||
-rw-r--r-- | extras/misc/apache2.conf | 43 |
4 files changed, 74 insertions, 25 deletions
diff --git a/build/test/dummy-apache2.start b/build/test/dummy-apache2.start new file mode 100644 index 0000000..fa1b754 --- /dev/null +++ b/build/test/dummy-apache2.start @@ -0,0 +1,3 @@ +#!/bin/bash +apache2ctl start +while true; do sleep 10; done diff --git a/build/test/front-test.Dockerfile b/build/test/front-test.Dockerfile index 4a82491..38b778d 100644 --- a/build/test/front-test.Dockerfile +++ b/build/test/front-test.Dockerfile @@ -1,4 +1,42 @@ FROM debian:jessie RUN apt-get update && apt-get install -y git-core -RUN git clone https://github.com/tech-server/tgnms +RUN apt-get -y install \ + libcapture-tiny-perl \ + libcommon-sense-perl \ + libdata-dumper-simple-perl \ + libdbd-pg-perl \ + libdbi-perl \ + libdigest-perl \ + libgd-perl \ + libgeo-ip-perl \ + libhtml-parser-perl \ + libhtml-template-perl \ + libjson-perl \ + libjson-xs-perl \ + libnetaddr-ip-perl \ + libnet-cidr-perl \ + libnet-ip-perl \ + libnet-oping-perl \ + libnet-rawip-perl \ + libsnmp-perl \ + libsocket6-perl \ + libsocket-perl \ + libswitch-perl \ + libtimedate-perl \ + perl \ + perl-base \ + perl-modules \ + libfreezethaw-perl \ + apache2 +RUN git clone https://github.com/tech-server/tgnms /opt/nms + +RUN a2dissite 000-default +RUN a2enmod cgi +RUN cp /opt/nms/extras/misc/apache2.conf /etc/apache2/sites-enabled/nms.conf +RUN mkdir -p /opt/nms/etc +RUN echo 'demo:$apr1$IKrQYF6x$0zmRciLR7Clc2tEEosyHV.' > /opt/nms/etc/htpasswd-read +RUN echo 'demo:$apr1$IKrQYF6x$0zmRciLR7Clc2tEEosyHV.' > /opt/nms/etc/htpasswd-write +ADD test/dummy-apache2.start / +RUN chmod 0755 /dummy-apache2.start +CMD /dummy-apache2.start diff --git a/build/test/playbook-test.yml b/build/test/playbook-test.yml index 2658e77..0cac807 100644 --- a/build/test/playbook-test.yml +++ b/build/test/playbook-test.yml @@ -11,12 +11,14 @@ path: "src/tgnms/build/" - name: make front-test docker_image: + state: build name: nms-front-test docker_api_version: 1.18 dockerfile: test/front-test.Dockerfile path: "src/tgnms/build/" - name: make collector-test docker_image: + state: build name: nms-collector-test docker_api_version: 1.18 dockerfile: test/collector-test.Dockerfile @@ -29,4 +31,15 @@ state: started net: bridge + - name: start front + docker: + name: nms-front + image: nms-front-test + docker_api_version: 1.18 + state: started + net: bridge + links: + - "nms-db:db" + + diff --git a/extras/misc/apache2.conf b/extras/misc/apache2.conf index 08471e0..572e232 100644 --- a/extras/misc/apache2.conf +++ b/extras/misc/apache2.conf @@ -1,56 +1,51 @@ -<VirtualHost *:8080> - ServerAdmin drift@gathering.org - ServerName nms.tg16.gathering.org - ServerAlias nms.tg16.gathering.org +<VirtualHost *:80> + ServerAdmin lol@example.com + ServerName nms.example.com + ServerAlias nms.example.com - DocumentRoot /srv/tgmanage/web/nms.gathering.org - ScriptAlias /api/write/ /srv/tgmanage/web/nms.gathering.org/api/write/ - ScriptAlias /api/read/ /srv/tgmanage/web/nms.gathering.org/api/read/ - ScriptAlias /api/public/ /srv/tgmanage/web/nms.gathering.org/api/public/ - <Directory "/srv/tgmanage/web/nms.gathering.org/api/write/"> + DocumentRoot /opt/tgnms/web + ScriptAlias /api/write/ /opt/tgnms/web/api/write/ + ScriptAlias /api/read/ /opt/tgnms/web/api/read/ + ScriptAlias /api/public/ /opt/tgnms/web/api/public/ + <Directory "/opt/tgnms/web/api/write/"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch <RequireAny> - AuthUserFile /srv/tgmanage/web/htpasswd-write - AuthName "Tech:Server Secret Volcano Lair" + AuthUserFile /opt/tgnms/etc/htpasswd-write + AuthName "Demo/test of tgnms write" AuthType Basic Require valid-user </RequireAny> </Directory> - <Directory "/srv/tgmanage/web/nms.gathering.org/api/read/"> + <Directory "/opt/tgnms/web/api/read/"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch <RequireAny> - AuthUserFile /srv/tgmanage/web/htpasswd-read - AuthName "The Gathering Network Management System" + AuthUserFile /opt/tgnms/etc/htpasswd-read + AuthName "Demo/test of tgnms read" AuthType Basic Require valid-user </RequireAny> </Directory> - <Directory "/srv/tgmanage/web/nms.gathering.org/api/public/"> + <Directory "/opt/tgnms/web/api/public/"> AllowOverride None Options +ExecCGI -MultiViews +Indexes +SymLinksIfOwnerMatch Require all granted </Directory> - <Directory "/srv/tgmanage/web/nms.gathering.org"> + <Directory "/opt/tgnms/web"> AllowOverride None Options Indexes FollowSymLinks MultiViews AddDefaultCharset UTF-8 - <RequireAny> - AuthUserFile /srv/tgmanage/web/htpasswd-read - AuthName "The Gathering Network Management System" - AuthType Basic - Require valid-user - </RequireAny> + Require all granted </Directory> - ErrorLog /var/log/apache2/error-nms.tg16.gathering.org.log + ErrorLog /var/log/apache2/error-nms.example.com.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn - CustomLog /var/log/apache2/access-nms.tg16.gathering.org.log combined + CustomLog /var/log/apache2/access-nms.example.com.log combined ServerSignature On </VirtualHost> |