Skip to content

Commit

Permalink
Fix file storage path permissions and apply image updates (#439)
Browse files Browse the repository at this point in the history
* Applies fix for zammad/zammad#5412
  • Loading branch information
mgruner authored Nov 18, 2024
1 parent 004a96c commit d1f2406
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
27 changes: 19 additions & 8 deletions .github/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 :)"
Expand All @@ -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: '[email protected]')" | grep '[email protected]'
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: '[email protected]')" | grep '[email protected]'

echo
echo "Check DB for AutoWizard user successfull :)"
Expand All @@ -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
4 changes: 2 additions & 2 deletions .github/updatecli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d1f2406

Please sign in to comment.