Compare commits
35
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3ac5de236 | ||
|
|
b84af1e8d4 | ||
|
|
64032582b2
|
||
|
|
7116066b52 | ||
|
|
8f7d69b3e5 | ||
|
|
21f640ccc0 | ||
|
|
1d61954cc7 | ||
|
|
e2a67eaada | ||
|
|
8f1532c80e | ||
|
|
3ae94ea073 | ||
|
|
ffb7b94a08 | ||
|
|
972f93b37a | ||
|
|
18b742727e | ||
|
|
a23f6588e3
|
||
|
|
653a26cca0 | ||
|
|
31901f57ae
|
||
|
|
ec0ad78ef4 | ||
|
|
2d15ee2286
|
||
|
|
ea97fa4d01 | ||
|
|
a8f0b7d0c6
|
||
|
|
b6b52b6e9c
|
||
|
|
d7dbf76a53 | ||
|
|
f80f630304 | ||
|
|
73e9f7bfcc | ||
|
|
3a940d845f | ||
|
|
d7b3c1e18e | ||
|
|
3af308645e | ||
|
|
cb85124b06 | ||
|
|
d68c9ad18c | ||
|
|
38682b8503 | ||
|
|
ce314169cb | ||
|
|
34be0c287e | ||
|
|
aab7e022d0 | ||
|
|
a7e409b337 | ||
|
|
ffe4fa1c54 |
+1
-1
@@ -32,7 +32,7 @@ steps:
|
|||||||
from_secret: drone_abra-bot_token
|
from_secret: drone_abra-bot_token
|
||||||
fork: true
|
fork: true
|
||||||
repositories:
|
repositories:
|
||||||
- coop-cloud/auto-recipes-catalogue-json
|
- toolshed/auto-recipes-catalogue-json
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event: tag
|
event: tag
|
||||||
|
|||||||
+9
-1
@@ -2,11 +2,13 @@ TYPE=zammad
|
|||||||
|
|
||||||
DOMAIN=zammad.example.com
|
DOMAIN=zammad.example.com
|
||||||
TIMEOUT=600
|
TIMEOUT=600
|
||||||
|
ENABLE_BACKUPS=true
|
||||||
|
|
||||||
## Domain aliases
|
## Domain aliases
|
||||||
#EXTRA_DOMAINS=', `www.zammad.example.com`'
|
#EXTRA_DOMAINS=', `www.zammad.example.com`'
|
||||||
|
|
||||||
LETS_ENCRYPT_ENV=production
|
LETS_ENCRYPT_ENV=production
|
||||||
|
COMPOSE_FILE="compose.yml"
|
||||||
|
|
||||||
SECRET_DB_PASSWORD_VERSION=v1
|
SECRET_DB_PASSWORD_VERSION=v1
|
||||||
SECRET_SMTP_PASSWORD_VERSION=v1
|
SECRET_SMTP_PASSWORD_VERSION=v1
|
||||||
@@ -27,4 +29,10 @@ SMTP_PORT=465
|
|||||||
## SAML SSO ##
|
## SAML SSO ##
|
||||||
#SSO_PROVIDER_DOMAIN=authentik.example.com
|
#SSO_PROVIDER_DOMAIN=authentik.example.com
|
||||||
#IDP_SSO_TARGET_URL=https://authentik.example.com/application/saml/zammad/sso/binding/init/
|
#IDP_SSO_TARGET_URL=https://authentik.example.com/application/saml/zammad/sso/binding/init/
|
||||||
#IDP_SLO_SERVICE_URL=https://authentik.example.com/application/saml/zammad/slo/binding/redirect/
|
#IDP_SLO_SERVICE_URL=https://zammad.example.com/auth/saml/slo
|
||||||
|
|
||||||
|
|
||||||
|
## Zammad internal backups
|
||||||
|
# COMPOSE_FILE="$COMPOSE_FILE:compose.backup.yml"
|
||||||
|
# BACKUP_TIME=03:00"
|
||||||
|
# HOLD_DAYS=10
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# Zammad Recipe Maintenance
|
||||||
|
|
||||||
|
All contributions should be made via a pull request. This is to ensure a
|
||||||
|
certain quality and consistency, that others can rely on.
|
||||||
|
|
||||||
|
## Maintainer Responsibilities
|
||||||
|
|
||||||
|
A recipe maintainer has the following responsibilities:
|
||||||
|
|
||||||
|
- Respond to pull requests / issues within two weeks
|
||||||
|
- Make image security updates within a week
|
||||||
|
- Make image major updates every three months
|
||||||
|
|
||||||
|
In order to fullfill these responsibilities a recipe maintainer:
|
||||||
|
|
||||||
|
- Has to watch the repository (to get notifications)
|
||||||
|
- Needs to make sure renovate is configured properly
|
||||||
|
|
||||||
|
## Pull Requests
|
||||||
|
|
||||||
|
A pull request can be merged if it is approved by at least one maintainer. For
|
||||||
|
pull requests opened by a maintainer they need to be approved by another
|
||||||
|
maintainer. Even though it is okay to merge a pull request with one approval, it
|
||||||
|
is always better if all maintainers looked at the pull request and approved it.
|
||||||
|
|
||||||
|
## Become a maintainer
|
||||||
|
|
||||||
|
Everyone can apply to be a recipe maintainer:
|
||||||
|
1. Watch the repository to always get updates
|
||||||
|
2. Simply add your self to the list in the [README.md](./README.md) and open a new pull request with the change.
|
||||||
|
3. Once the pull request gets merged you will be added to the [zammad maintainers team](https://git.coopcloud.tech/org/coop-cloud/teams/zammad-maintainers).
|
||||||
|
4. Join the room [#cc-|-zammad-maintenance:matrix.org](#cc-|-zammad-maintenance:matrix.org) and chat to other maintainers.
|
||||||
@@ -4,8 +4,9 @@ Zammad is a free helpdesk or issue tracking system.
|
|||||||
|
|
||||||
<!-- metadata -->
|
<!-- metadata -->
|
||||||
|
|
||||||
|
* **Maintainer**: Local-IT: [@moritz](https://git.coopcloud.tech/moritz), [@msimon](https://git.coopcloud.tech/simon), [@carla](https://git.coopcloud.tech/carla)
|
||||||
* **Category**: Apps
|
* **Category**: Apps
|
||||||
* **Status**: 0
|
* **Status**: `stable`
|
||||||
* **Image**: [`zammad`](https://hub.docker.com/r/zammad), 4, upstream
|
* **Image**: [`zammad`](https://hub.docker.com/r/zammad), 4, upstream
|
||||||
* **Healthcheck**: Yes
|
* **Healthcheck**: Yes
|
||||||
* **Backups**: No
|
* **Backups**: No
|
||||||
|
|||||||
@@ -1,29 +1,29 @@
|
|||||||
export ENTRYPOINT_VERSION=v2
|
export ENTRYPOINT_VERSION=v3
|
||||||
export AUTO_WIZARD_VERSION=v1
|
export AUTO_WIZARD_VERSION=v2
|
||||||
|
export PG_BACKUP_VERSION=v2
|
||||||
|
|
||||||
get_setting_changes() {
|
get_setting_changes() {
|
||||||
/custom-entrypoint.sh "rails r 'puts JSON.pretty_generate(JSON.parse(Setting.all.select{ |setting| setting.state_current != setting.state_initial }.map { |setting| {name: setting.name, value: setting.state_current[\""value\""]} } .to_json))'"
|
/custom-entrypoint.sh "bundle exec rails r 'puts JSON.pretty_generate(JSON.parse(Setting.all.select{ |setting| setting.state_current != setting.state_initial }.map { |setting| {name: setting.name, value: setting.state_current[\""value\""]} } .to_json))'"
|
||||||
}
|
}
|
||||||
|
|
||||||
console() {
|
console() {
|
||||||
/custom-entrypoint.sh "rails c"
|
/custom-entrypoint.sh "bundle exec rails c"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rails_run() {
|
rails_run() {
|
||||||
COMMAND="rails r \"$@\""
|
COMMAND="bundle exec rails r \"$@\""
|
||||||
/custom-entrypoint.sh "$COMMAND"
|
/custom-entrypoint.sh "$COMMAND"
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
cp -f /opt/zammad/contrib/auto_wizard.json /tmp/auto_wizard.json
|
cp -f /opt/zammad/contrib/auto_wizard.json /tmp/auto_wizard.json
|
||||||
/custom-entrypoint.sh "rails zammad:setup:auto_wizard[/tmp/auto_wizard.json]"
|
/custom-entrypoint.sh "bundle exec rake zammad:setup:auto_wizard[/tmp/auto_wizard.json]"
|
||||||
}
|
}
|
||||||
|
|
||||||
enable_authentik_sso() {
|
enable_authentik_sso() {
|
||||||
ADMIN_UID=$(abra app cmd -T $SSO_PROVIDER_DOMAIN worker get_user_uid akadmin)
|
ADMIN_UID=$(abra app cmd -T $SSO_PROVIDER_DOMAIN worker get_user_uid akadmin)
|
||||||
CERT=$(abra app cmd -T $SSO_PROVIDER_DOMAIN worker get_certificate zammad)
|
CERT=$(abra app cmd -T $SSO_PROVIDER_DOMAIN worker get_certificate zammad)
|
||||||
COMMAND="
|
COMMAND="
|
||||||
(u = User.find_by(login: 'admin')) && (u.login='$ADMIN_UID') && u.save!;
|
(u = User.find_by(login: 'admin')) && (u.login='$ADMIN_UID') && u.save!;
|
||||||
Setting.set('auth_saml', true);
|
Setting.set('auth_saml', true);
|
||||||
Setting.set('auth_third_party_auto_link_at_inital_login', true);
|
Setting.set('auth_third_party_auto_link_at_inital_login', true);
|
||||||
@@ -35,18 +35,26 @@ enable_authentik_sso() {
|
|||||||
'idp_cert_fingerprint'=>'',
|
'idp_cert_fingerprint'=>'',
|
||||||
'name_identifier_format'=>'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress'})
|
'name_identifier_format'=>'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress'})
|
||||||
"
|
"
|
||||||
abra app cmd -T -C support.dev.local-it.cloud zammad-railsserver rails_run "$(printf "%q " $COMMAND )"
|
abra app cmd -T $DOMAIN zammad-railsserver rails_run "$(printf "%q " $COMMAND)"
|
||||||
}
|
}
|
||||||
|
|
||||||
set_logo() {
|
set_logo() {
|
||||||
LOGO_PATH="$1"
|
LOGO_PATH="$1"
|
||||||
abra app cp "$APP_NAME" "$LOGO_PATH" zammad-railsserver:/tmp/
|
abra app cp "$APP_NAME" "$LOGO_PATH" zammad-railsserver:/tmp/
|
||||||
filename="$(basename "$LOGO_PATH")"
|
filename="$(basename "$LOGO_PATH")"
|
||||||
COMMAND="
|
COMMAND="
|
||||||
logo_path = '/tmp/$filename';
|
logo_path = '/tmp/$filename';
|
||||||
logo_content = File.open(logo_path, 'rb') { |file| file.read };
|
logo_content = File.open(logo_path, 'rb') { |file| file.read };
|
||||||
logo_timestamp = Service::SystemAssets::ProductLogo.store(logo_content);
|
logo_timestamp = Service::SystemAssets::ProductLogo.store(logo_content);
|
||||||
Setting.set('product_logo', logo_timestamp);
|
Setting.set('product_logo', logo_timestamp);
|
||||||
"
|
"
|
||||||
abra app cmd -T -C support.dev.local-it.cloud zammad-railsserver rails_run "$(printf "%q " $COMMAND )"
|
abra app cmd -T $DOMAIN zammad-railsserver rails_run "$(printf "%q " $COMMAND)"
|
||||||
|
}
|
||||||
|
|
||||||
|
fix_permissions() {
|
||||||
|
i=0
|
||||||
|
while ! abra app run -t -u 0 $DOMAIN zammad-elasticsearch -- chown elasticsearch -Rv /usr/share/elasticsearch/data && [[ $i -lt 30 ]]; do
|
||||||
|
((i++))
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,10 +46,6 @@
|
|||||||
"name": "organization",
|
"name": "organization",
|
||||||
"value": "{{ env "ORGANIZATION" }}"
|
"value": "{{ env "ORGANIZATION" }}"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "product_logo",
|
|
||||||
"value": "{{ env "LOGO_URL" }}"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "timezone_default",
|
"name": "timezone_default",
|
||||||
"value": "{{ env "TZ" }}"
|
"value": "{{ env "TZ" }}"
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
version: "3.8"
|
||||||
|
services:
|
||||||
|
zammad-backup:
|
||||||
|
image: ghcr.io/zammad/zammad:7.1.2
|
||||||
|
command: ["zammad-backup"]
|
||||||
|
volumes:
|
||||||
|
- zammad-backup:/var/tmp/zammad
|
||||||
|
- zammad-storage:/opt/zammad/storage:ro
|
||||||
|
user: 0:0
|
||||||
|
deploy:
|
||||||
|
labels:
|
||||||
|
backupbot.backup.volumes.zammad-backup: "false"
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
environment:
|
||||||
|
POSTGRESQL_DB: zammad_production
|
||||||
|
POSTGRESQL_HOST: zammad-postgresql
|
||||||
|
POSTGRESQL_USER: zammad
|
||||||
|
POSTGRESQL_PASS_FILE: /run/secrets/db_password
|
||||||
|
POSTGRESQL_PORT: 5432
|
||||||
|
# Backup settings
|
||||||
|
BACKUP_DIR: "/var/tmp/zammad"
|
||||||
|
BACKUP_TIME: "${BACKUP_TIME:-03:00}"
|
||||||
|
#BACKUP_SLEEP: 86400
|
||||||
|
HOLD_DAYS: 10
|
||||||
|
DOMAIN:
|
||||||
|
entrypoint: /custom-entrypoint.sh
|
||||||
|
configs:
|
||||||
|
- source: entrypoint
|
||||||
|
target: /custom-entrypoint.sh
|
||||||
|
mode: 0555
|
||||||
|
secrets:
|
||||||
|
- db_password
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
zammad-backup:
|
||||||
+49
-47
@@ -13,11 +13,6 @@ x-shared:
|
|||||||
POSTGRESQL_OPTIONS: ?pool=50
|
POSTGRESQL_OPTIONS: ?pool=50
|
||||||
POSTGRESQL_DB_CREATE:
|
POSTGRESQL_DB_CREATE:
|
||||||
REDIS_URL: redis://zammad-redis:6379
|
REDIS_URL: redis://zammad-redis:6379
|
||||||
# Backup settings
|
|
||||||
BACKUP_DIR: "/var/tmp/zammad"
|
|
||||||
BACKUP_TIME: "${BACKUP_TIME:-03:00}"
|
|
||||||
#BACKUP_SLEEP: 86400
|
|
||||||
HOLD_DAYS: 10
|
|
||||||
TZ: "${TZ:-Europe/Berlin}"
|
TZ: "${TZ:-Europe/Berlin}"
|
||||||
# Allow passing in these variables via .env:
|
# Allow passing in these variables via .env:
|
||||||
AUTOWIZARD_JSON:
|
AUTOWIZARD_JSON:
|
||||||
@@ -29,6 +24,8 @@ x-shared:
|
|||||||
ELASTICSEARCH_NAMESPACE:
|
ELASTICSEARCH_NAMESPACE:
|
||||||
ELASTICSEARCH_REINDEX:
|
ELASTICSEARCH_REINDEX:
|
||||||
ELASTICSEARCH_SSL_VERIFY:
|
ELASTICSEARCH_SSL_VERIFY:
|
||||||
|
ELASTICSEARCH_USER:
|
||||||
|
ELASTICSEARCH_PASS:
|
||||||
NGINX_PORT:
|
NGINX_PORT:
|
||||||
NGINX_SERVER_NAME:
|
NGINX_SERVER_NAME:
|
||||||
NGINX_SERVER_SCHEME: https
|
NGINX_SERVER_SCHEME: https
|
||||||
@@ -48,65 +45,52 @@ x-shared:
|
|||||||
SSO_PROVIDER_DOMAIN:
|
SSO_PROVIDER_DOMAIN:
|
||||||
IDP_SSO_TARGET_URL:
|
IDP_SSO_TARGET_URL:
|
||||||
IDP_SLO_SERVICE_URL:
|
IDP_SLO_SERVICE_URL:
|
||||||
image: ghcr.io/zammad/zammad:6.3.1-95
|
image: ghcr.io/zammad/zammad:7.1.2
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
volumes:
|
volumes:
|
||||||
- zammad-storage:/opt/zammad/storage
|
- zammad-storage:/opt/zammad/storage
|
||||||
#old: - zammad-data:/opt/zammad
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- zammad-memcached
|
- zammad-memcached
|
||||||
- zammad-postgresql
|
- zammad-postgresql
|
||||||
- zammad-redis
|
- zammad-redis
|
||||||
entrypoint: /custom-entrypoint.sh
|
entrypoint: /custom-entrypoint.sh
|
||||||
configs:
|
configs:
|
||||||
- source: entrypoint
|
- source: entrypoint
|
||||||
target: /custom-entrypoint.sh
|
target: /custom-entrypoint.sh
|
||||||
mode: 0555
|
mode: 0555
|
||||||
- source: auto_wizard
|
- source: auto_wizard
|
||||||
target: /opt/zammad/contrib/auto_wizard.json
|
target: /opt/zammad/contrib/auto_wizard.json
|
||||||
secrets:
|
secrets:
|
||||||
- db_password
|
- db_password
|
||||||
- smtp_password
|
- smtp_password
|
||||||
- admin_password
|
- admin_password
|
||||||
|
|
||||||
services:
|
services:
|
||||||
zammad-backup:
|
|
||||||
<<: *zammad-service
|
|
||||||
command: ["zammad-backup"]
|
|
||||||
volumes:
|
|
||||||
- zammad-backup:/var/tmp/zammad
|
|
||||||
- zammad-storage:/opt/zammad/storage:ro
|
|
||||||
#old: - zammad-data:/opt/zammad
|
|
||||||
user: 0:0
|
|
||||||
deploy:
|
|
||||||
labels:
|
|
||||||
- "backupbot.backup=true"
|
|
||||||
- "backupbot.backup.path=/var/tmp/zammad"
|
|
||||||
|
|
||||||
zammad-elasticsearch:
|
zammad-elasticsearch:
|
||||||
image: bitnami/elasticsearch:8.14.3
|
image: elasticsearch:9.4.4
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
volumes:
|
|
||||||
- elasticsearch-data:/bitnami/elasticsearch/data
|
|
||||||
environment:
|
|
||||||
- discovery.type=single-node
|
|
||||||
healthcheck:
|
|
||||||
test: "/opt/bitnami/scripts/elasticsearch/healthcheck.sh"
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 10
|
|
||||||
start_period: 5m
|
|
||||||
deploy:
|
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
memory: 4G
|
memory: 4G
|
||||||
reservations:
|
reservations:
|
||||||
memory: 2G
|
memory: 2G
|
||||||
|
volumes:
|
||||||
|
- elasticsearch-data:/usr/share/elasticsearch/data
|
||||||
|
environment:
|
||||||
|
discovery.type: single-node
|
||||||
|
xpack.security.enabled: "false"
|
||||||
|
ES_JAVA_OPTS: -Xms1g -Xmx1g
|
||||||
|
healthcheck:
|
||||||
|
#test: TODO
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
start_period: 5m
|
||||||
|
|
||||||
zammad-init:
|
zammad-init:
|
||||||
<<: *zammad-service
|
<<: *zammad-service
|
||||||
command: ["zammad-init"]
|
command: ["zammad-init"]
|
||||||
@@ -116,7 +100,7 @@ services:
|
|||||||
|
|
||||||
zammad-memcached:
|
zammad-memcached:
|
||||||
command: memcached -m 256M
|
command: memcached -m 256M
|
||||||
image: memcached:1.6.29-alpine
|
image: memcached:1.6.45-alpine
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: 'echo "version" | nc -vn -w 1 127.0.0.1 11211'
|
test: 'echo "version" | nc -vn -w 1 127.0.0.1 11211'
|
||||||
interval: 30s
|
interval: 30s
|
||||||
@@ -142,7 +126,7 @@ services:
|
|||||||
deploy:
|
deploy:
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.docker.network=proxy"
|
- "traefik.swarm.network=proxy"
|
||||||
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8080"
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8080"
|
||||||
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
||||||
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
||||||
@@ -150,7 +134,7 @@ services:
|
|||||||
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
||||||
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
|
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
|
||||||
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
||||||
- "coop-cloud.${STACK_NAME}.version=1.0.2+6.3.1-95"
|
- "coop-cloud.${STACK_NAME}.version=4.1.2+7.1.2"
|
||||||
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
|
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:8080"]
|
test: ["CMD", "curl", "-f", "http://localhost:8080"]
|
||||||
@@ -168,10 +152,19 @@ services:
|
|||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
|
labels:
|
||||||
|
backupbot.backup: "${ENABLE_BACKUPS:-true}"
|
||||||
|
backupbot.backup.pre-hook: "/pg_backup.sh backup"
|
||||||
|
backupbot.backup.volumes.postgresql-data.path: "backup.sql"
|
||||||
|
backupbot.restore.post-hook: "/pg_backup.sh restore"
|
||||||
|
backupbot.backup.volumes.elasticsearch-data: "false"
|
||||||
|
backupbot.backup.volumes.redis-data: "false"
|
||||||
volumes:
|
volumes:
|
||||||
- postgresql-data:/var/lib/postgresql/data
|
- postgresql-data:/var/lib/postgresql/data
|
||||||
# Backup Restore
|
configs:
|
||||||
#- zammad-backup:/var/tmp/zammad:ro
|
- source: pg_backup
|
||||||
|
target: /pg_backup.sh
|
||||||
|
mode: 0555
|
||||||
secrets:
|
secrets:
|
||||||
- db_password
|
- db_password
|
||||||
healthcheck:
|
healthcheck:
|
||||||
@@ -190,10 +183,17 @@ services:
|
|||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 10
|
retries: 10
|
||||||
start_period: 5m
|
start_period: 5m
|
||||||
|
deploy:
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 4G
|
||||||
|
reservations:
|
||||||
|
memory: 2G
|
||||||
|
|
||||||
zammad-redis:
|
zammad-redis:
|
||||||
image: redis:7.2.5-alpine
|
image: redis:8.10.0-alpine
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
@@ -210,7 +210,7 @@ services:
|
|||||||
<<: *zammad-service
|
<<: *zammad-service
|
||||||
command: ["zammad-scheduler"]
|
command: ["zammad-scheduler"]
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: 'ps x | grep "[b]ackground-worker.rb"'
|
test: 'grep -a "background-worker.rb" -r /proc/[0-9]*/cmdline'
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 10
|
retries: 10
|
||||||
@@ -230,7 +230,6 @@ volumes:
|
|||||||
elasticsearch-data:
|
elasticsearch-data:
|
||||||
postgresql-data:
|
postgresql-data:
|
||||||
redis-data:
|
redis-data:
|
||||||
zammad-backup:
|
|
||||||
zammad-storage:
|
zammad-storage:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
@@ -246,6 +245,9 @@ configs:
|
|||||||
name: ${STACK_NAME}_auto_wizard_${AUTO_WIZARD_VERSION}
|
name: ${STACK_NAME}_auto_wizard_${AUTO_WIZARD_VERSION}
|
||||||
file: auto_wizard.json.tmpl
|
file: auto_wizard.json.tmpl
|
||||||
template_driver: golang
|
template_driver: golang
|
||||||
|
pg_backup:
|
||||||
|
name: ${STACK_NAME}_pg_backup_${PG_BACKUP_VERSION}
|
||||||
|
file: pg_backup.sh
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
db_password:
|
db_password:
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ file_env() {
|
|||||||
unset "$fileVar"
|
unset "$fileVar"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unset POSTGRESQL_PASS # neutralizes upstream image default
|
||||||
file_env "POSTGRESQL_PASS"
|
file_env "POSTGRESQL_PASS"
|
||||||
|
|
||||||
# https://github.com/zammad/zammad/blob/develop/contrib/docker/docker-entrypoint.sh
|
# https://github.com/zammad/zammad/blob/develop/contrib/docker/docker-entrypoint.sh
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
BACKUP_FILE='/var/lib/postgresql/data/backup.sql'
|
||||||
|
|
||||||
|
function backup {
|
||||||
|
export PGPASSWORD=$(cat /run/secrets/db_password)
|
||||||
|
pg_dump -U ${POSTGRES_USER} ${POSTGRES_DB} > $BACKUP_FILE
|
||||||
|
}
|
||||||
|
|
||||||
|
function restore {
|
||||||
|
cd /var/lib/postgresql/data/
|
||||||
|
restore_config(){
|
||||||
|
# Restore allowed connections
|
||||||
|
cat pg_hba.conf.bak > pg_hba.conf
|
||||||
|
su postgres -c 'pg_ctl reload'
|
||||||
|
}
|
||||||
|
# Don't allow any other connections than local
|
||||||
|
cp pg_hba.conf pg_hba.conf.bak
|
||||||
|
echo "local all all trust" > pg_hba.conf
|
||||||
|
su postgres -c 'pg_ctl reload'
|
||||||
|
trap restore_config EXIT INT TERM
|
||||||
|
|
||||||
|
# Recreate Database
|
||||||
|
psql -U ${POSTGRES_USER} -d postgres -c "DROP DATABASE ${POSTGRES_DB} WITH (FORCE);"
|
||||||
|
createdb -U ${POSTGRES_USER} ${POSTGRES_DB}
|
||||||
|
psql -U ${POSTGRES_USER} -d ${POSTGRES_DB} -1 -f $BACKUP_FILE
|
||||||
|
|
||||||
|
trap - EXIT INT TERM
|
||||||
|
restore_config
|
||||||
|
}
|
||||||
|
|
||||||
|
$@
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Breaking Change. You need to run the following command to change the elasticsearch volume permissions:
|
||||||
|
abra app cmd --local <APPDOMAIN> fix_permission
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Breaking change: Asciifolding and new search features are now available after reindexing via: zammad run rake zammad:searchindex:rebuild. For details, see zammad release notes.
|
||||||
Reference in New Issue
Block a user