diff --git a/.travis.yml b/.travis.yml index 323c170..cd453cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ env: - DOCKER_COMPOSE_VERSION=1.23.2 - TRIVY_VERSION=0.1.1 - GOSS_VERSION=0.3.7 - - COMMANDER_VERSION=1.2.0 + - COMMANDER_VERSION=1.2.1 services: - docker before_install: @@ -40,6 +40,9 @@ install: - make lint # rerun lint to see if output is different with .env in place - echo "docker_repo=$docker_repo" >> .env - echo "DOCKERREADME=yes" >> .env # add DOCKERREADME env var so that make publish also updates readme files on docker hub + - echo "KCCONF_SERVER_SURVEYCLIENT_INTERVAL=0" >> kopano_server.env + - echo "KOPANO_SURVEYCLIENT_ENABLED=false" >> kopano_konnect.env + - echo "KOPANO_SURVEYCLIENT_ENABLED=false" >> kopano_kwmserver.env - travis_retry make build-all script: - make test-ci diff --git a/Makefile b/Makefile index 5eb2c25..550a5e1 100644 --- a/Makefile +++ b/Makefile @@ -381,6 +381,8 @@ test-goss: ## Test configuration of containers with goss GOSS_FILES_PATH=core/goss/monitor dcgoss run kopano_monitor GOSS_FILES_PATH=core/goss/search dcgoss run kopano_search GOSS_FILES_PATH=core/goss/spooler dcgoss run kopano_spooler + GOSS_FILES_PATH=meet dcgoss run kopano_meet + GOSS_FILES_PATH=scheduler dcgoss run kopano_scheduler GOSS_FILES_PATH=webapp dcgoss run kopano_webapp test-commander: ## Test scripts with commander diff --git a/meet/Dockerfile b/meet/Dockerfile index 94c999f..eeb3d2c 100644 --- a/meet/Dockerfile +++ b/meet/Dockerfile @@ -57,4 +57,9 @@ ENV KOPANO_USERSCRIPT_LOCALE="de_DE.UTF-8" ENV LANG=en_US.UTF-8 COPY defaultconfigs/ start-service.sh /kopano/ +COPY goss.yaml /goss/ CMD [ "/kopano/start-service.sh" ] + +HEALTHCHECK --interval=1m --timeout=10s \ + CMD goss -g /goss/goss.yaml validate --format json_oneline + diff --git a/meet/goss.yaml b/meet/goss.yaml new file mode 100644 index 0000000..d4be8e5 --- /dev/null +++ b/meet/goss.yaml @@ -0,0 +1,18 @@ +file: + /usr/share/kopano-kweb/www/config/kopano/meet.json: + exists: true + mode: "0644" + owner: root + group: root + filetype: file + contains: [] +process: + kwebd: + running: true +http: + http://localhost:9080/meet: + status: 200 + allow-insecure: false + no-follow-redirects: false + timeout: 5000 + body: [] diff --git a/php/kweb.cfg b/php/kweb.cfg index a2a4e5f..f7d80bd 100644 --- a/php/kweb.cfg +++ b/php/kweb.cfg @@ -1,6 +1,10 @@ :9080 { + log stdout errors stderr + # healthcheck + status 200 /status + alias /webapp/ /usr/share/kopano-webapp/ fastcgi2 /webapp/ /run/php/php7.0-fpm.sock php { without /webapp/ diff --git a/scheduler/Dockerfile b/scheduler/Dockerfile index 2cc7bfa..bc5110c 100644 --- a/scheduler/Dockerfile +++ b/scheduler/Dockerfile @@ -4,6 +4,7 @@ ARG VCS_REF ENV \ DOCKERIZE_VERSION=v0.6.1 \ + GOSS_VERSION=v0.3.7 \ SUPERCRONIC_VERSION=0.1.9 LABEL maintainer=az@zok.xyz \ @@ -15,16 +16,30 @@ LABEL maintainer=az@zok.xyz \ org.label-schema.version=$SUPERCRONIC_VERSION \ org.label-schema.schema-version="1.0" -RUN apk --no-cache add bash - -RUN wget https://github.com/aptible/supercronic/releases/download/v${SUPERCRONIC_VERSION}/supercronic-linux-amd64 \ - -O /usr/local/bin/supercronic \ - && chmod +x /usr/local/bin/supercronic +RUN apk --no-cache add bash curl ca-certificates RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ && tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ && rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz +RUN wget https://github.com/aelsabbahy/goss/releases/download/$GOSS_VERSION/goss-linux-amd64 -O /usr/local/bin/goss \ + && chmod +x /usr/local/bin/goss \ + && goss --version + +RUN wget https://github.com/aptible/supercronic/releases/download/v${SUPERCRONIC_VERSION}/supercronic-linux-amd64 \ + -O /usr/local/bin/supercronic \ + && chmod +x /usr/local/bin/supercronic + +# Setup timezone +ENV TZ=UTC +RUN ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime +RUN printf '%s\n' "$TZ" > /etc/timezone + COPY start.sh /usr/local/bin/ +COPY goss.yaml /goss/ CMD ["start.sh"] + +# TODO interval does not only define how often the healtcheck is run, but also how long to wait for the first check after startup +HEALTHCHECK --interval=60m --timeout=15s \ + CMD goss -g /goss/goss.yaml validate --format json_oneline \ No newline at end of file diff --git a/scheduler/goss.yaml b/scheduler/goss.yaml new file mode 100644 index 0000000..ce063de --- /dev/null +++ b/scheduler/goss.yaml @@ -0,0 +1,9 @@ +command: + kill -SIGUSR2 $(pidof supercronic): + exit-status: 0 + stdout: [] + stderr: [] + timeout: 10000 +process: + supercronic: + running: true diff --git a/scheduler/goss_wait.yaml b/scheduler/goss_wait.yaml new file mode 100644 index 0000000..bac292b --- /dev/null +++ b/scheduler/goss_wait.yaml @@ -0,0 +1,3 @@ +process: + supercronic: + running: true diff --git a/scheduler/start.sh b/scheduler/start.sh index 5a423df..43e1ca9 100755 --- a/scheduler/start.sh +++ b/scheduler/start.sh @@ -34,4 +34,5 @@ for cronvar in ${!CRON_*}; do $croncommand done +supercronic -test /etc/crontab exec supercronic /etc/crontab diff --git a/webapp/goss.yaml b/webapp/goss.yaml index 9b8f521..0162233 100644 --- a/webapp/goss.yaml +++ b/webapp/goss.yaml @@ -1,9 +1,36 @@ +file: + /run/sessions: + exists: true + mode: "0755" + size: 4096 + owner: www-data + group: www-data + filetype: directory + contains: [] + /usr/lib/php/20151012/mapi.so: + exists: true + mode: "0644" + owner: root + group: root + filetype: file + contains: [] + /var/lib/kopano-webapp/tmp: + exists: true + mode: "0755" + size: 4096 + owner: www-data + group: www-data + filetype: directory + contains: [] process: kwebd: running: true php-fpm7.0: running: true http: - http://localhost:9080/webapp: + http://localhost:9080/status: status: 200 + allow-insecure: false + no-follow-redirects: false timeout: 5000 + body: []