From d1f24062f7d86683fcbfe132746b88fce3520768 Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Mon, 18 Nov 2024 11:55:53 +0100 Subject: [PATCH] Fix file storage path permissions and apply image updates (#439) * Applies fix for https://github.com/zammad/zammad/issues/5412 --- .env.dist | 6 +++--- .github/tests.sh | 27 +++++++++++++++++++-------- .github/updatecli.yaml | 4 ++-- docker-compose.yml | 6 +++--- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.env.dist b/.env.dist index 5ca3cc5..8543566 100644 --- a/.env.dist +++ b/.env.dist @@ -1,4 +1,4 @@ -# ELASTICSEARCH_VERSION=8.15.3 +# ELASTICSEARCH_VERSION=8.16.0 # IMAGE_REPO=ghcr.io/zammad/zammad # MEMCACHE_SERVERS=zammad-memcached:11211 # MEMCACHE_VERSION=1.6.32-alpine @@ -9,13 +9,13 @@ # POSTGRES_USER=zammad # POSTGRES_HOST=zammad-postgresql # POSTGRES_PORT=5432 -# POSTGRES_VERSION=17.0-alpine +# POSTGRES_VERSION=17.1-alpine # POSTGRESQL_OPTIONS=?pool=50 # REDIS_URL=redis://zammad-redis:6379 # REDIS_VERSION=7.4.1-alpine # RESTART=always # Use a fixed version. You are responsible to update this to newer patch level versions yourself. -# VERSION=6.4.0 +# VERSION=6.4.0-17 # You can also use floating versions that will give you automatic updates: # VERSION=6.2 # all patchlevel updates # VERSION=6 # including minor updates diff --git a/.github/tests.sh b/.github/tests.sh index 0aa8f1c..00e61f7 100755 --- a/.github/tests.sh +++ b/.github/tests.sh @@ -8,10 +8,12 @@ set -o pipefail docker compose logs --timestamps --follow & -until (curl -I --silent --fail localhost:8080 | grep -iq "HTTP/1.1 200 OK"); do - echo "wait for zammad to be ready..." - sleep 5 -done +echo +echo "wait for zammad to be ready..." +echo + +docker compose wait zammad-init +curl --retry 30 --retry-delay 1 --retry-connrefused http://localhost:8080 | grep "Zammad" echo echo "Success - Zammad is up :)" @@ -21,18 +23,17 @@ echo echo "Execute autowizard..." echo -docker exec --env=AUTOWIZARD_RELATIVE_PATH=tmp/auto_wizard.json --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-docker-compose-zammad-railsserver-1 bundle exec rake zammad:setup:auto_wizard +docker compose exec --env=AUTOWIZARD_RELATIVE_PATH=tmp/auto_wizard.json --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-railsserver bundle exec rake zammad:setup:auto_wizard echo echo "Autowizard executed successful :)" echo - echo echo "Check DB for AutoWizard user" echo -docker exec --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-docker-compose-zammad-railsserver-1 bundle exec rails r "p User.find_by(email: 'info@zammad.org')" | grep 'info@zammad.org' +docker compose exec --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-railsserver bundle exec rails r "p User.find_by(email: 'info@zammad.org')" | grep 'info@zammad.org' echo echo "Check DB for AutoWizard user successfull :)" @@ -42,8 +43,18 @@ echo echo "Fill DB with some random data" echo -docker exec --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-docker-compose-zammad-railsserver-1 bundle exec rails r "FillDb.load(agents: 1,customers: 1,groups: 1,organizations: 1,overviews: 1,tickets: 1)" +docker compose exec --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-railsserver bundle exec rails r "FillDb.load(agents: 1,customers: 1,groups: 1,organizations: 1,overviews: 1,tickets: 1)" echo echo "DB fill successful :)" echo + +echo +echo "Check if the Zammad user can write to FS storage" +echo + +docker compose exec zammad-railsserver touch storage/test.txt + +echo +echo "Storage write successful :)" +echo diff --git a/.github/updatecli.yaml b/.github/updatecli.yaml index 2ec9686..7fde32a 100644 --- a/.github/updatecli.yaml +++ b/.github/updatecli.yaml @@ -6,9 +6,9 @@ sources: spec: image: "zammad/zammad-docker-compose" architecture: "linux/amd64" - tagfilter: "^6\\.4\\.0$" + # tagfilter: "^6\\.4\\.0$" # tagfilter: "^6\\.4\\.0-\\d{1}" - # tagfilter: "^6\\.4\\.0-\\d{2}" + tagfilter: "^6\\.4\\.0-\\d{2}" # tagfilter: "^6\\.4\\.0-\\d{3}" elasticsearch: kind: dockerimage diff --git a/docker-compose.yml b/docker-compose.yml index bbd9a0d..848cab3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,7 +36,7 @@ x-shared: ZAMMAD_SESSION_JOBS: ZAMMAD_PROCESS_SCHEDULED: ZAMMAD_PROCESS_DELAYED_JOBS_WORKERS: - image: ${IMAGE_REPO:-ghcr.io/zammad/zammad}:${VERSION:-6.4.0} + image: ${IMAGE_REPO:-ghcr.io/zammad/zammad}:${VERSION:-6.4.0-17} restart: ${RESTART:-always} volumes: - zammad-storage:/opt/zammad/storage @@ -56,7 +56,7 @@ services: user: 0:0 zammad-elasticsearch: - image: bitnami/elasticsearch:${ELASTICSEARCH_VERSION:-8.15.3} + image: bitnami/elasticsearch:${ELASTICSEARCH_VERSION:-8.16.0} restart: ${RESTART:-always} volumes: - elasticsearch-data:/bitnami/elasticsearch/data @@ -89,7 +89,7 @@ services: POSTGRES_DB: ${POSTGRES_DB:-zammad_production} POSTGRES_USER: ${POSTGRES_USER:-zammad} POSTGRES_PASSWORD: ${POSTGRES_PASS:-zammad} - image: postgres:${POSTGRES_VERSION:-17.0-alpine} + image: postgres:${POSTGRES_VERSION:-17.1-alpine} restart: ${RESTART:-always} volumes: - postgresql-data:/var/lib/postgresql/data