diff --git a/.env b/.env index c17632f..04164ba 100644 --- a/.env +++ b/.env @@ -3,4 +3,4 @@ POSTGRES_PASS=zammad POSTGRES_USER=zammad RESTART=always # don't forget to add the minus before the version -VERSION=-3.6.0-1 +VERSION=-3.6.0-20 diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 771698d..72c7cc1 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -8,23 +8,20 @@ Hi there - thanks for filling an issue. Please ensure the following things befor * The upper textblock will be removed automatically when you submit your issue * --> -### Infos: +# Infos * Docker version: * Docker-compose version: * Operating system (Docker host): - -### Expected behavior: +# Expected behavior * - -### Actual behavior: +# Actual behavior * - -### Steps to reproduce the behavior: +# Steps to reproduce the behavior * diff --git a/.github/lint-scripts.sh b/.github/lint-scripts.sh deleted file mode 100755 index 954a6ae..0000000 --- a/.github/lint-scripts.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# lint bash scripts -# - -set -o errexit - -TMP_FILE="$(mktemp)" - -find . -type f -name "*.sh" > "${TMP_FILE}" - -while read -r FILE; do - echo lint "${FILE}" - shellcheck -x "${FILE}" -done < "${TMP_FILE}" diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml new file mode 100644 index 0000000..5d7892a --- /dev/null +++ b/.github/linters/.markdown-lint.yml @@ -0,0 +1,2 @@ +MD013: + line_length: 500 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3c0f5d4..70030b3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,54 +4,50 @@ on: pull_request: jobs: - lint-bash-scripts: - runs-on: ubuntu-latest + codespell: + name: codespell + runs-on: ubuntu-20.04 steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Lint Bash scripts - uses: docker://koalaman/shellcheck-alpine:v0.7.0 + - name: Checkout Code + uses: actions/checkout@v2 + - name: Codespell + uses: codespell-project/actions-codespell@master with: - args: .github/lint-scripts.sh - - lint-docker-files: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: lint zammad dockerfile - uses: brpaz/hadolint-action@master - with: - dockerfile: containers/zammad/Dockerfile - - name: lint elasticsearch dockerfile - uses: brpaz/hadolint-action@master - with: - dockerfile: containers/zammad-elasticsearch/Dockerfile - - name: lint postgresql dockerfile - uses: brpaz/hadolint-action@master - with: - dockerfile: containers/zammad-postgresql/Dockerfile + skip: .git + check_filenames: true + check_hidden: true lint-docker-compose-file: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v1 - name: lint zammad docker-compose file run: docker-compose config + super-linter: + runs-on: ubuntu-20.04 + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Lint Code Base + uses: github/super-linter@v3 + env: + DEFAULT_BRANCH: master + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + build-and-run-docker-compose: - needs: - - lint-bash-scripts - - lint-docker-files + needs: + - codespell - lint-docker-compose-file + - super-linter timeout-minutes: 20 - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v1 - name: build docker containers - run: .github/docker-image-build.sh + run: .github/docker-image-build.sh - name: use images build by ci run: sed -i -e 's#${IMAGE_REPO}:##g' -e 's#${VERSION}##g' docker-compose.yml - name: run docker-compose up @@ -62,17 +58,17 @@ jobs: run: .github/tests.sh run-remote-image-docker-compose: - needs: - - lint-bash-scripts - - lint-docker-files + needs: + - codespell - lint-docker-compose-file + - super-linter timeout-minutes: 10 - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v1 - name: pull docker-compose images - run: docker-compose pull + run: docker-compose pull - name: run docker-compose up run: docker-compose up --detach - name: add autowizard file diff --git a/README.md b/README.md index 8d26cef..d948951 100644 --- a/README.md +++ b/README.md @@ -6,16 +6,13 @@ twitter, chat and e-mails. It is distributed under the GNU AFFERO General Public License (AGPL). Do you receive many e-mails and want to answer them with a team of agents? You're going to love Zammad! - -## What is zammad-docker-compose repo for? +## Use case for this repo This repo is meant to be the starting point for somebody who likes to use dockerized multi-container Zammad in production. - ## Getting started with zammad-docker-compose -https://docs.zammad.org/en/latest/install-docker-compose.html - + ## CI Status @@ -26,19 +23,20 @@ https://docs.zammad.org/en/latest/install-docker-compose.html In environments with more then one web applications it is necessary to use a reverse proxy to route connections to port 80 and 443 to the right application. To run Zammad behind a revers proxy, we provide `docker-compose.proxy-example.yml` as a starting point. -1. Copy `./.examples/proxy/docker-compose.proxy-example.yml` to your own configuration, e.g. `./docker-compose.prod.yml` +1. Copy `./.examples/proxy/docker-compose.proxy-example.yml` to your own configuration, e.g. `./docker-compose.prod.yml` `cp ./.examples/proxy/docker-compose.proxy-example.yml ./docker-compose.prod.yml` -1. Modify the environment variable `VIRTUAL_HOST` and the name of the external network in `./docker-compose.prod.yml` to fit your environment. -1. Run docker-composer commands with the default and your configuration, e.g. `docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d` +2. Modify the environment variable `VIRTUAL_HOST` and the name of the external network in `./docker-compose.prod.yml` to fit your environment. +3. Run docker-composer commands with the default and your configuration, e.g. `docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d` See `.examples/proxy/docker-compose.yml` for an example proxy project. Like this, you can add your `docker-compose.prod.yml` to a branch of your Git repository and stay up to date by merging changes to your branch. - ## Using Rancher -* RANCHER_URL=http://RANCHER_HOST:8080 rancher-compose --env-file=.env up +```console +RANCHER_URL=http://RANCHER_HOST:8080 rancher-compose --env-file=.env up +``` ## Running without Elasticsearch @@ -50,11 +48,11 @@ Elasticsearch is enabled by default in the example `docker-compose.yml` file. It ### From =< 3.3.0-12 -We've updated the Elasticsearch image from 5.6 to 7.6. -As there is no direct upgrade path we have to delete all Elasticsearch indicies and rebuild them. +We've updated the Elasticsearch image from 5.6 to 7.6. +As there is no direct upgrade path we have to delete all Elasticsearch indices and rebuild them. Do the following to empty the ES docker volume: -``` +```console docker-compose stop set -o pipefail DOCKER_VOLUME="$(docker volume inspect zammaddockercompose_elasticsearch-data | grep Mountpoint | sed -e 's#.*": "##g' -e 's#",##')/*" echo "${DOCKER_VOLUME}" #check this is a valid docker volume path! if not do not proceed or you might lose data! @@ -64,7 +62,7 @@ docker-compose start To workaround the [changes in the PostgreSQL 9.6 container](https://github.com/docker-library/postgres/commit/f1bc8782e7e57cc403d0b32c0e24599535859f76) do the following: -``` +```console docker-compose start docker exec -it zammaddockercompose_zammad-postgresql_1 bash psql --username postgres --dbname zammad_production diff --git a/containers/zammad-postgresql/Dockerfile b/containers/zammad-postgresql/Dockerfile index ce58218..eaf2906 100644 --- a/containers/zammad-postgresql/Dockerfile +++ b/containers/zammad-postgresql/Dockerfile @@ -1,4 +1,4 @@ -FROM postgres:9.6.17-alpine +FROM postgres:9.6.20-alpine ARG BUILD_DATE diff --git a/containers/zammad/docker-entrypoint.sh b/containers/zammad/docker-entrypoint.sh index 355fa76..1c58e16 100755 --- a/containers/zammad/docker-entrypoint.sh +++ b/containers/zammad/docker-entrypoint.sh @@ -103,7 +103,7 @@ if [ "$1" = 'zammad-init' ]; then fi if [ "${ELASTICSEARCH_REINDEX}" == "true" ]; then - if ! curl -s ${SSL_SKIP_VERIFY} ${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_cat/indices | grep -q zammad; then + if ! curl -s "${SSL_SKIP_VERIFY}" "${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_cat/indices" | grep -q zammad; then echo "rebuilding es searchindex..." bundle exec rake searchindex:rebuild fi diff --git a/docker-compose.yml b/docker-compose.yml index 72a76c4..3b5fff6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,7 +34,7 @@ services: - zammad-postgresql environment: - POSTGRESQL_USER=${POSTGRES_USER} - - POSTGRESQL_PASS=${POSTGRES_PASS} + - POSTGRESQL_PASS=${POSTGRES_PASS} image: ${IMAGE_REPO}:zammad${VERSION} links: - zammad-elasticsearch @@ -45,7 +45,7 @@ services: zammad-memcached: command: memcached -m 256M - image: memcached:1.6.7-alpine + image: memcached:1.6.9-alpine restart: ${RESTART} zammad-nginx: