diff --git a/.env b/.env index 609f246..ad3ac31 100644 --- a/.env +++ b/.env @@ -1,6 +1,8 @@ IMAGE_REPO=colpari/zammad-docker-compose +MEMCACHE_SERVERS=zammad-memcached:11211 POSTGRES_PASS=zammad POSTGRES_USER=zammad +REDIS_URL=redis://zammad-redis:6379 RESTART=always # don't forget to add the minus before the version -VERSION=-4.1.0-6c +VERSION=-5.0.1-1 diff --git a/.github/tests.sh b/.github/tests.sh index 1f633f8..96fafc0 100755 --- a/.github/tests.sh +++ b/.github/tests.sh @@ -19,20 +19,20 @@ echo echo "Success - Zammad is up :)" echo -echo +echo echo "Execute autowizard..." echo docker exec zammad-docker-compose_zammad-railsserver_1 rake zammad:setup:auto_wizard -echo +echo echo "Autowizard executed successful :)" -echo +echo -echo +echo echo "Fill DB with some random data" -docker exec zammad-docker-compose_zammad-railsserver_1 rails r "FillDB.load(agents: 1,customers: 1,groups: 1,organizations: 1,overviews: 1,tickets: 1)" +docker exec zammad-docker-compose_zammad-railsserver_1 rails r "FillDb.load(agents: 1,customers: 1,groups: 1,organizations: 1,overviews: 1,tickets: 1)" echo echo "DB fill successful :)" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ff9ea53..a38570f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,6 +38,8 @@ jobs: env: DEFAULT_BRANCH: master GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_JSCPD: false + build-and-run-docker-compose: needs: diff --git a/Dockerfile b/Dockerfile index 6d1a25b..a56a298 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,5 +8,5 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \ org.label-schema.vcs-url="https://github.com/colpari/zammad" \ org.label-schema.vcs-type="Git" \ org.label-schema.vendor="colpari" \ - org.label-schema.schema-version="4.1.0" \ + org.label-schema.schema-version="5.0.1" \ org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up" diff --git a/README.md b/README.md index 2c7542b..6844c51 100644 --- a/README.md +++ b/README.md @@ -75,3 +75,8 @@ ALTER USER zammad WITH SUPERUSER CREATEDB; To be able to run Zammad container with an unprivileged user we had to change the port Nginx uses from 80 to 8080, so Zammad needs to be accessed via instead of now! This change will also affect you, if you use a reverse proxy, like Traefik or Haproxy, in front of Zammad as your reverse proxy configuration needs to be adapted to point to port 8080 now. + +### From =< 4.0.0 to 5.0.0 + +Memchached config changed. If you use the old env vars `MEMCACHED_HOST` & `MEMCACHED_PORT` adapt to `MEMCACHE_SERVERS`. +Redis is a dependency for the Websocket server now. diff --git a/containers/zammad-elasticsearch/Dockerfile b/containers/zammad-elasticsearch/Dockerfile index ad8e891..41eb994 100644 --- a/containers/zammad-elasticsearch/Dockerfile +++ b/containers/zammad-elasticsearch/Dockerfile @@ -9,7 +9,7 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \ org.label-schema.vcs-url="https://github.com/colpari/zammad" \ org.label-schema.vcs-type="Git" \ org.label-schema.vendor="colpari" \ - org.label-schema.schema-version="4.1.0" \ + org.label-schema.schema-version="5.0.1" \ org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up" SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"] diff --git a/containers/zammad-postgresql/Dockerfile b/containers/zammad-postgresql/Dockerfile index b268f14..c3df6be 100644 --- a/containers/zammad-postgresql/Dockerfile +++ b/containers/zammad-postgresql/Dockerfile @@ -10,7 +10,7 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \ org.label-schema.vcs-url="https://github.com/colpari/zammad" \ org.label-schema.vcs-type="Git" \ org.label-schema.vendor="colpari" \ - org.label-schema.schema-version="4.1.0" \ + org.label-schema.schema-version="5.0.1" \ org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up" SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"] diff --git a/containers/zammad/Dockerfile b/containers/zammad/Dockerfile index 4a9b6d4..6f2ebfd 100644 --- a/containers/zammad/Dockerfile +++ b/containers/zammad/Dockerfile @@ -1,6 +1,6 @@ -FROM ruby:2.6.8-slim AS builder # note: zammad is currently incompatible to alpine because of: # https://github.com/docker-library/ruby/issues/113 +FROM ruby:2.7.4-slim AS builder ARG BUILD_DATE ARG DEBIAN_FRONTEND=noninteractive @@ -24,7 +24,7 @@ RUN chmod +x /tmp/setup.sh; \ /tmp/setup.sh builder -FROM ruby:2.6.8-slim +FROM ruby:2.7.4-slim ARG BUILD_DATE ARG DEBIAN_FRONTEND=noninteractive @@ -37,7 +37,7 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \ org.label-schema.vcs-url="https://github.com/colpari/zammad" \ org.label-schema.vcs-type="Git" \ org.label-schema.vendor="colpari" \ - org.label-schema.schema-version="4.1.0" \ + org.label-schema.schema-version="5.0.1" \ org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up" ENV GIT_BRANCH colpari-develop diff --git a/containers/zammad/docker-entrypoint.sh b/containers/zammad/docker-entrypoint.sh index 619cbd1..56736f1 100755 --- a/containers/zammad/docker-entrypoint.sh +++ b/containers/zammad/docker-entrypoint.sh @@ -10,8 +10,6 @@ set -e : "${ELASTICSEARCH_NAMESPACE:=zammad}" : "${ELASTICSEARCH_REINDEX:=true}" : "${ELASTICSEARCH_SSL_VERIFY:=true}" -: "${MEMCACHED_HOST:=zammad-memcached}" -: "${MEMCACHED_PORT:=11211}" : "${NGINX_PORT:=8080}" : "${NGINX_SERVER_NAME:=_}" : "${NGINX_SERVER_SCHEME:=\$scheme}" @@ -58,9 +56,6 @@ if [ "$1" = 'zammad-init' ]; then ESCAPED_POSTGRESQL_PASS=$(echo "$POSTGRESQL_PASS" | sed -e 's/[\/&]/\\&/g') sed -e "s#.*adapter:.*# adapter: postgresql#g" -e "s#.*database:.*# database: ${POSTGRESQL_DB}#g" -e "s#.*username:.*# username: ${POSTGRESQL_USER}#g" -e "s#.*password:.*# password: ${ESCAPED_POSTGRESQL_PASS}\\n host: ${POSTGRESQL_HOST}\\n port: ${POSTGRESQL_PORT}#g" < contrib/packager.io/database.yml.pkgr > config/database.yml - # configure memcache - sed -i -e "s/.*config.cache_store.*file_store.*cache_file_store.*/ config.cache_store = :dalli_store, '${MEMCACHED_HOST}:${MEMCACHED_PORT}'\\n config.session_store = :dalli_store, '${MEMCACHED_HOST}:${MEMCACHED_PORT}'/" config/application.rb - # configure trusted proxies sed -i -e "s#config.action_dispatch.trusted_proxies =.*#config.action_dispatch.trusted_proxies = ${RAILS_TRUSTED_PROXIES}#" config/environments/production.rb @@ -74,10 +69,12 @@ if [ "$1" = 'zammad-init' ]; then bundle exec rake db:seed # create autowizard.json on first install - if [ -n "${AUTOWIZARD_JSON}" ]; then - echo "${AUTOWIZARD_JSON}" | base64 -d > auto_wizard.json + if base64 -d <<< ${AUTOWIZARD_JSON} &>> /dev/null; then + echo "Saving autowizard json payload..." + base64 -d <<< "${AUTOWIZARD_JSON}" > auto_wizard.json fi else + bundle exec rails r "Cache.clear" bundle exec rake db:migrate fi diff --git a/containers/zammad/setup.sh b/containers/zammad/setup.sh index 47160f3..fb41642 100755 --- a/containers/zammad/setup.sh +++ b/containers/zammad/setup.sh @@ -3,7 +3,7 @@ set -e # install dependencies if [ "$1" = 'builder' ]; then - PACKAGES="build-essential curl git libimlib2-dev libpq-dev shared-mime-info" + PACKAGES="build-essential curl git libimlib2-dev libpq-dev nodejs shared-mime-info" elif [ "$1" = 'runner' ]; then PACKAGES="curl libimlib2 libpq5 nginx rsync" fi diff --git a/docker-compose.override-local.yml b/docker-compose.override-local.yml index 26a0ebf..14baddf 100644 --- a/docker-compose.override-local.yml +++ b/docker-compose.override-local.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3' services: diff --git a/docker-compose.override.yml b/docker-compose.override.yml index c685a51..f7888bb 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3' services: zammad-nginx: diff --git a/docker-compose.yml b/docker-compose.yml index 7c3b90d..621c6f9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3' services: @@ -6,6 +6,7 @@ services: command: ["zammad-backup"] depends_on: - zammad-railsserver + - zammad-postgresql entrypoint: /usr/local/bin/backup.sh environment: - BACKUP_SLEEP=86400 @@ -13,8 +14,6 @@ services: - POSTGRESQL_USER=${POSTGRES_USER} - POSTGRESQL_PASSWORD=${POSTGRES_PASS} image: ${IMAGE_REPO}:zammad-postgresql${VERSION} - links: - - zammad-postgresql restart: ${RESTART} volumes: - zammad-backup:/var/tmp/zammad @@ -33,19 +32,18 @@ services: depends_on: - zammad-postgresql environment: + - MEMCACHE_SERVERS=${MEMCACHE_SERVERS} - POSTGRESQL_USER=${POSTGRES_USER} - POSTGRESQL_PASS=${POSTGRES_PASS} + - REDIS_URL=${REDIS_URL} image: ${IMAGE_REPO}:zammad${VERSION} - links: - - zammad-elasticsearch - - zammad-postgresql restart: on-failure volumes: - zammad-data:/opt/zammad zammad-memcached: command: memcached -m 256M - image: memcached:1.6.9-alpine + image: memcached:1.6.10-alpine restart: ${RESTART} zammad-nginx: @@ -55,9 +53,6 @@ services: depends_on: - zammad-railsserver image: ${IMAGE_REPO}:zammad${VERSION} - links: - - zammad-railsserver - - zammad-websocket restart: ${RESTART} volumes: - zammad-data:/opt/zammad @@ -76,25 +71,29 @@ services: depends_on: - zammad-memcached - zammad-postgresql + - zammad-redis + environment: + - MEMCACHE_SERVERS=${MEMCACHE_SERVERS} + - REDIS_URL=${REDIS_URL} image: ${IMAGE_REPO}:zammad${VERSION} - links: - - zammad-elasticsearch - - zammad-memcached - - zammad-postgresql restart: ${RESTART} volumes: - zammad-data:/opt/zammad + zammad-redis: + image: redis:6.2.5-alpine + restart: ${RESTART} + zammad-scheduler: command: ["zammad-scheduler"] depends_on: - zammad-memcached - zammad-railsserver + - zammad-redis + environment: + - MEMCACHE_SERVERS=${MEMCACHE_SERVERS} + - REDIS_URL=${REDIS_URL} image: ${IMAGE_REPO}:zammad${VERSION} - links: - - zammad-elasticsearch - - zammad-memcached - - zammad-postgresql restart: ${RESTART} volumes: - zammad-data:/opt/zammad @@ -104,10 +103,11 @@ services: depends_on: - zammad-memcached - zammad-railsserver + - zammad-redis + environment: + - MEMCACHE_SERVERS=${MEMCACHE_SERVERS} + - REDIS_URL=${REDIS_URL} image: ${IMAGE_REPO}:zammad${VERSION} - links: - - zammad-postgresql - - zammad-memcached restart: ${RESTART} volumes: - zammad-data:/opt/zammad