Compare commits

...

169 Commits

Author SHA1 Message Date
André Bauer
799edd7863
Update zammad to 6.0.0-66 (#363) 2023-07-18 18:47:20 +02:00
André Bauer
6606e8e2ca
update zammad to 6.0.0-32 (#353) 2023-06-22 20:16:10 +02:00
André Bauer
662aa8f512
update dockerhub pulls badge (#352) 2023-06-21 16:27:42 +02:00
Martin Gruner
ffa1268a2a
Update to Zammad 6.0. (#347)
* Update to Zammad 6.0.

* adjust compose and env / change docker registry

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

---------

Signed-off-by: André Bauer <andre.bauer@staffbase.com>
Co-authored-by: André Bauer <andre.bauer@staffbase.com>
2023-06-21 16:05:23 +02:00
André Bauer
3338cbeb22
sort vars (#351) 2023-06-14 13:27:25 +02:00
Jan Kiesewetter
9a547c67a9
Define database name (#343)
Set the database name to the default of the Zammad image to avoid an unused database with the name of the POSTGRES_USER var.

See default database name:
163377fc65/contrib/docker/docker-entrypoint.sh (L20)

See PostgreSQL image documentation:
https://hub.docker.com/_/postgres

POSTGRES_DB
This optional environment variable can be used to define a different name for the default database
that is created when the image is first started. If it is not specified, then the value of POSTGRES_USER will be used.
2023-06-14 11:36:01 +02:00
André Bauer
1c52589095
update zammad to 5.4.1-29 (#340) 2023-05-14 13:23:10 +02:00
Jensa
281b5f317f
timed backup script with backup time (#339)
* Update backup.sh

- new zammad-timed-backup which uses fixed backup time $BACKUP_TIME

* Update docker-compose.yml

- $BACKUP_TIME added
- timed backup as command

* merge request and linting fixes

* arithmetic linting fix

* not related to merge request but fixes linting in check_railsserver_available
2023-05-12 20:51:57 +02:00
dependabot[bot]
ef8830e636
Bump github/super-linter from 4 to 5 (#333)
Bumps [github/super-linter](https://github.com/github/super-linter) from 4 to 5.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](https://github.com/github/super-linter/compare/v4...v5)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-10 13:14:45 +02:00
Martin Gruner
a8911b1359 Maintenance: Update README. 2023-04-20 13:41:51 +02:00
Marcel Herrguth
1f32908c23
Merge pull request #332 from sdm216/master
Update to Zammad 5.4.1
2023-04-12 16:53:42 +02:00
sdm216
360324353f
Update .env 2023-04-12 10:41:14 -04:00
Martin Gruner
e5b0fedfe6
Maintenance: Switch to Zammad 5.4.0. (#328) 2023-03-14 11:50:16 +01:00
Jan Kiesewetter
d588f2ff65
Define PostgreSQL version in .env (#322)
Resolves: #321
2022-12-23 21:21:40 +01:00
Fonata
01fe85d74c
Fix small spelling and typography mistakes in README (#317) 2022-12-23 21:20:50 +01:00
André Bauer
abd9cd631d
update zammad to 5.3.1-6 (#323) 2022-12-23 21:17:24 +01:00
André Bauer
d397322bae
update docker image to 5.3.0-9 (#316) 2022-12-03 14:18:22 +01:00
André Bauer
ae716aed3d
update config 2022-11-23 00:39:57 +01:00
André Bauer
ad516bdfd6
update docker image to 5.3.0-2 (#314) 2022-11-23 00:32:55 +01:00
André Bauer
87e8b49794
update zammad to 5.3.0 (#313)
* update zammad to 5.3.0

* update dependencies

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

Signed-off-by: André Bauer <andre.bauer@staffbase.com>
2022-11-22 18:59:50 +01:00
André Bauer
a0aa5324dc
adjust readme and docker image path (#310)
Signed-off-by: André Bauer <andre.bauer@staffbase.com>

Signed-off-by: André Bauer <andre.bauer@staffbase.com>
2022-11-08 16:08:16 +01:00
André Bauer
731f83da2b
add release drafter, remove container & rework ci (#309)
Signed-off-by: André Bauer <andre.bauer@staffbase.com>

Signed-off-by: André Bauer <andre.bauer@staffbase.com>
2022-11-08 12:49:04 +01:00
André Bauer
c5c1db541a
update zammad & components (#307)
Signed-off-by: André Bauer <andre.bauer@staffbase.com>

Signed-off-by: André Bauer <andre.bauer@staffbase.com>
2022-11-04 19:30:32 +01:00
André Bauer
0af24d791f
update postgres image to 15.0 2022-11-04 01:09:50 +01:00
Marcel Herrguth
cd424e9868
Merge pull request #303 from waja/5.2.3
Update to Zammad 5.2.3
2022-10-18 15:46:58 +02:00
Jan Wagner
daa1c71e00 Update to Zammad 5.2.3 2022-10-18 15:24:46 +02:00
Marcel Herrguth
52bced15fe
Merge pull request #302 from waja/5.2.2
Update to latest zammad tag
2022-09-29 14:01:47 +02:00
Jan Wagner
225ee21d5f Update to latest zammad tag 2022-09-29 05:27:03 +02:00
Marcel Herrguth
f57418a2a5
Merge pull request #299 from yogo1212/readme_typo
README: fix typo
2022-09-21 11:34:11 +02:00
Leon M. George
130f22766c README: fix typo 2022-09-21 11:00:15 +02:00
André Bauer
b4779f1be0
Update dependabot.yml 2022-08-05 11:00:17 +02:00
André Bauer
10fa5096c7
Update dependabot.yml 2022-08-05 10:59:33 +02:00
André Bauer
5a65ce28cf
add dependabot 2022-08-05 10:47:00 +02:00
Marcel Herrguth
d3e27a5828
Merge pull request #288 from soymgomez/patch-1
Update .env to 5.2.1-7
2022-07-10 01:33:05 +02:00
Martín Gómez
bf95bf7fa4
Update .env to 5.2.1-7
Update version to 5.2.1-7
2022-07-06 17:22:23 +02:00
Marcel Herrguth
d1a0e023c7
Merge pull request #287 from zammad/mh/5-2-1
Closes #286 - Raise Dockerfile to 5.2.1
2022-07-06 14:11:48 +02:00
Marcel Herrguth
44ae0bfd18 Closes #286 - Raise Dockerfile to 5.2.1
PR for @waja
2022-07-05 19:05:39 +02:00
André Bauer
893fd870d5
update zammad to 5.2.0-9 (#283)
* update zammad to 5.2.0-5

* Update .env
2022-06-29 10:50:56 +02:00
Marcel Herrguth
834ede5ffe
Merge pull request #282 from zammad/mh/switch-to-background-services
Maintenance: Switch from scheduler.rb to background-services.rb
2022-06-28 10:53:43 +02:00
Marcel Herrguth
fe5481e89a Remove obsolete line 2022-06-21 14:39:29 +02:00
Marcel Herrguth
d3308a6e77 Fix wrong script name 🤡 2022-06-21 14:13:21 +02:00
Marcel Herrguth
c43b89fcb4 Maintenance: Switch from scheduler.rb to background-services.rb 2022-06-21 14:05:32 +02:00
Marcel Herrguth
b308627f3d
Maintenance: Raise Dockerfile versions to 5.2 (#281)
Currently only the Zammad container was raised, but Elasticsearch and PGSQL should be as well.
2022-06-21 13:56:14 +02:00
Martin Gruner
cc6207c354
Maintenance: Changes for Zammad 5.2. (#274)
* Maintenance: Changes for Zammad 5.2.

* Maintenance: Switch to Ruby 3.0.4.

* Update Zammad version label.

* Maintenance: Use the renamed zammad:searchindex:* commands of Zammad 5.2.
2022-06-21 12:28:31 +02:00
Martin Gruner
4799b327d2
Switch to Node.js 16 from Nodesource as that will be a dependency of Zammad 5.2 soon. (#279)
* Switch to Node.js 16 from Nodesource as that will be a dependency of Zammad 5.2 soon.

* Fixed indentation.
2022-05-04 17:39:02 +02:00
André Bauer
8d24441c85
added docker pulls badge 2022-04-27 16:08:47 +02:00
André Bauer
b5b1d7bb9e
update to 5.1.1-11 (#277) 2022-04-27 16:03:50 +02:00
André Bauer
5bcd41057a
update docker images & ci (#276)
* update images

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* remove unneeded dummey dockerfile

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* fix superlinter

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* fix stale.yml

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* update version

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* remove codespell

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* add fetcfh depth

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* fix codepsell removal

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* enable VALIDATE_ALL_CODEBASE

Signed-off-by: André Bauer <andre.bauer@staffbase.com>
2022-04-25 23:13:34 +02:00
Marcel Herrguth
c6be2e5326
Merge pull request #273 from zammad/mh/raise-env-to-5_1
Raise env VERSION to latest available 5.1 version
2022-03-18 11:16:14 +01:00
Marcel Herrguth
a3c0a7e39c Raise env VERSION to latest available 5.1 version 2022-03-18 00:01:21 +01:00
Marcel Herrguth
5ee8fb4a0c
Merge pull request #272 from zammad/mg/update-5.1
Maintenance: Update version to 5.1.
2022-03-14 14:25:52 +01:00
Martin Gruner
1cfaaef188 Revert change to .env file again. 2022-03-14 14:04:07 +01:00
Martin Gruner
8761f57cf7 Maintenance: Update version to 5.1. 2022-03-14 13:57:30 +01:00
Marcel Herrguth
66bd5725a0
Merge pull request #255 from zammad/develop/changes-for-zammad-5.1
Changes for Zammad 5.1
2022-03-14 13:54:28 +01:00
Marcel Herrguth
0b1d50f532
Merge branch 'master' into develop/changes-for-zammad-5.1 2022-03-14 13:26:51 +01:00
Marcel Herrguth
3e465c6ce7
Merge pull request #267 from pebosi/patch-1
update to 7.16.3
2022-01-28 22:51:42 +01:00
pebosi
6ae09345ad update to 7.16.3
including latest log4j release
2022-01-28 22:19:45 +01:00
Marcel Herrguth
09e1e6b2d7
Raise .env version to 5.0.3-14 to include ES 7.16.2 (#266)
* Raise .env version to 5.0.3-14 to include ES 7.16.2

* Maintenance: Test raised linter version from 3 to 4

* Maintenance: Adjust readme according to linters complaints

* Maintenance: Fix typos
2022-01-28 21:44:56 +01:00
André Bauer
60a6fc202f
Merge branch 'master' into develop/changes-for-zammad-5.1 2022-01-27 01:27:16 +01:00
Marcel Herrguth
acf378a8f7
Merge pull request #265 from TuringTux/use-es-7.16.2
Use latest elasticsearch version 7.16.2
2021-12-20 16:58:54 +01:00
TuringTux
7a0ba8ce35 Use latest elasticsearch version 2021-12-20 12:36:56 +01:00
Marcel Herrguth
e697dcd493
Bump compose-Version (#263)
* Maintenance: Raise schema version from 5.0.1 to 5.0.3

* Closes #262 - Raise default tag version to 5.0.3-7

Contains ES 7.16.1
2021-12-14 11:29:26 +01:00
Marcel Herrguth
17c5d209bd
Maintenance: Raise Elasticsearch version to 7.16.1 to mitgitate log4j (#262) 2021-12-14 10:24:59 +01:00
Martin Gruner
efbe666429
Maintenance: Update image to the new 5.0.3 release. (#259) 2021-12-07 12:39:46 +01:00
André Bauer
9842a689e4
Update .env (#257) 2021-11-27 01:55:12 +01:00
Martin Gruner
bf534fbd5d Maintenance: Remove obsolete fetch_locales call. 2021-11-15 18:38:17 +01:00
André Bauer
0d262239b8
update to 5.0.2-1 (#254) 2021-10-31 23:16:00 +01:00
André Bauer
a703b63cb1
remove without from bundle command (#250)
* remove without from bundle command

* fix quote
2021-10-20 13:35:09 +02:00
Martin Gruner
01daa74920
Maintenance: Clean-up unneeded test files during the build process. (#249) 2021-10-19 11:53:10 +02:00
André Bauer
c5a6f5afec
update elasticsearch to 7.15.1 (non oss) (#248)
* Update Dockerfile

* Update Dockerfile
2021-10-18 23:45:56 +02:00
André Bauer
4b22c2e442
update to version 5.0.1-5 (#245) 2021-10-13 15:55:25 +02:00
Steffen Zieger
7458686643
set same version in all docker-compose files (#242)
Co-authored-by: André Bauer <monotek@users.noreply.github.com>
2021-10-08 12:35:55 +02:00
Thorsten
cda3c41c7a
Release Update 5.0.1. (#243)
* Release Update 5.0.1.

* Update .env

Co-authored-by: Thorsten Eckel <{ID}+{username}@users.noreply.github.com>
Co-authored-by: André Bauer <monotek@users.noreply.github.com>
2021-10-08 12:35:34 +02:00
André Bauer
defd3fbdcf
fix in memory db usage (#241)
* fix in memeory db

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* fix linter

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* disable jscpd

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* added env to init container too

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* remove whitespaces

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* fix typo

Signed-off-by: André Bauer <andre.bauer@staffbase.com>
2021-10-06 14:16:13 +02:00
André Bauer
701627f9c6
update zammad labels to 5.0.0 (#239)
* FillDB was renamed to FillDb for Zammad 5.

* Changed Ruby dependency to 2.7.3.

* Update containers/zammad/Dockerfile

* added redis / changed memcached

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* update memcached

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* fix image

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* remove nginx duplicate

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* added nodejs

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* added cache clear and removed links

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* fix typo

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* update zammmad version label to 5.0.0

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

Co-authored-by: Martin Gruner <mg@zammad.com>
Co-authored-by: Martin Gruner <mg.pub@gmx.net>
2021-10-05 22:20:00 +02:00
Arnaud Veron
b531521da8
Fix error "base64: invalid input" causing init container crash (#232)
* Fix error "base64: invalid input" causing init container crash

Fixes zammad/zammad-docker-compose#231

* Update containers/zammad/docker-entrypoint.sh

* Update containers/zammad/docker-entrypoint.sh

Co-authored-by: André Bauer <monotek@users.noreply.github.com>
2021-10-05 21:59:47 +02:00
Thorsten
11db944a4d
Applied workaround required for Rails update Cache issue (#238)
https://github.com/zammad/zammad/issues/3786 / https://github.com/zammad/zammad/issues/3759

Co-authored-by: André Bauer <monotek@users.noreply.github.com>
2021-10-05 21:41:40 +02:00
Martin Gruner
9aad202b60
Changes for Zammad 5 (#219)
* FillDB was renamed to FillDb for Zammad 5.

* Changed Ruby dependency to 2.7.3.

* Update containers/zammad/Dockerfile

* added redis / changed memcached

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* update memcached

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* fix image

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* remove nginx duplicate

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* added nodejs

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* added cache clear and removed links

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* fix typo

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

Co-authored-by: André Bauer <monotek@users.noreply.github.com>
Co-authored-by: André Bauer <andre.bauer@staffbase.com>
2021-10-05 21:25:26 +02:00
Martin Gruner
db7ca4b92d
Fixes: 224 - Escape special characters in 'sed' replace pattern to support passwords with special characters. (#226) 2021-08-16 19:00:59 +02:00
Martin Gruner
be6cce84f0
Maintenance: Provide a safer way to force a rebuild of the Elasticsearch volume data on upgrades. (#225)
Co-authored-by: André Bauer <monotek@users.noreply.github.com>
2021-08-13 16:00:05 +02:00
Mantas Masalskis
a5ab85d651
Maintenance: Ruby updated to 2.6.8 (#227) 2021-08-11 14:52:57 +02:00
Marcel Herrguth
3866262aa5
Maintenance: Provide performance tuning options for docker-compose (#217)
* Maintenance: Provide performance tuning options for docker-compose

* Maintenance: Ensure PUMA_OPTS being available anytime

* Maintenance: Move PUMA_OPTS position

* Maintenance: Adjust puma startup command to allow cluster workers

* Maintenance: Solve SC2086

* Maintenance: Ensure puma knows it's config

* Fix Typo to load config file

* Maintenance: Tell puma what its correct config is...

* fix bind

Signed-off-by: André Bauer <monotek23@gmail.com>

* change concurency to 0 by default

Signed-off-by: André Bauer <monotek23@gmail.com>

Co-authored-by: André Bauer <monotek23@gmail.com>
2021-06-23 18:04:19 +02:00
André Bauer
fb9a9b2085
update to 4.1.0-6 2021-06-14 21:42:41 +02:00
André Bauer
0c4c6b8b59
Update .env (#215) 2021-06-09 17:30:30 +02:00
André Bauer
ab745072cd
update zammad to 4.1.0 (#214)
* update to 4.1.0

Signed-off-by: André Bauer <monotek23@gmail.com>
2021-06-08 17:08:48 +02:00
André Bauer
3552f447ba
update to 4.0.0-25 2021-04-26 16:39:53 +02:00
olafbuitelaar
a77de6a442
Update backup.sh (#204)
i suppose this change should be reflected here as well; 3d86eb8543

Co-authored-by: André Bauer <monotek@users.noreply.github.com>
2021-04-24 19:50:55 +02:00
Marcel
ccb9ca3226
Fixes #205 - Automatically remove IPv6 listen directive (#207)
* Fixes #205 - Automatically remove IPv6 listen directive

* Update docker-entrypoint.sh

Co-authored-by: André Bauer <monotek@users.noreply.github.com>
2021-04-24 15:20:03 +02:00
André Bauer
8eadbd39a1
Update .env (#201) 2021-04-08 20:24:49 +02:00
André Bauer
9dbd862451
Update to 4.0.0-13 (#199)
* Update .env

* Update .env
2021-04-01 18:55:35 +02:00
André Bauer
fda5b3075c
update to 4.0.0 (#198)
Signed-off-by: André Bauer <monotek23@gmail.com>
2021-03-28 13:09:25 +02:00
André Bauer
55a8183190
add RAILS_LOG_TO_STDOUT to zammad container (#197)
Signed-off-by: André Bauer <monotek23@gmail.com>
2021-03-26 22:58:00 +01:00
Thorsten
6ddc9262ed
Added mimemagic gem version 0.3.7 dependency. (#195) 2021-03-26 11:00:32 +01:00
André Bauer
b39454dc36
update to 3.6.0-67 (#194)
* update to 3.6.0-67

Signed-off-by: André Bauer <monotek23@gmail.com>

* fix ci name

Signed-off-by: André Bauer <monotek23@gmail.com>

* fix typo

Signed-off-by: André Bauer <monotek23@gmail.com>
2021-03-19 15:04:38 +01:00
André Bauer
73a4fbd453 split ci
Signed-off-by: André Bauer <monotek23@gmail.com>
2021-03-19 13:13:10 +01:00
André Bauer
9eda319ed3
use port 8080 for nginx (#193)
* use port 8080 for nginx

Signed-off-by: André Bauer <monotek23@gmail.com>

* fix test

Signed-off-by: André Bauer <monotek23@gmail.com>

* fix port in override file

Signed-off-by: André Bauer <monotek23@gmail.com>

* fix logging

Signed-off-by: André Bauer <monotek23@gmail.com>

* fix compose cmd

Signed-off-by: André Bauer <monotek23@gmail.com>

* fix ci timeout

Signed-off-by: André Bauer <monotek23@gmail.com>
2021-03-18 21:53:46 +01:00
André Bauer
b1ce16963a
Update .env (#191) 2021-03-05 03:01:22 +01:00
André Bauer
538f19d0b2
move nginx static config to build (#190)
move nginx static config to build...
2021-03-03 20:53:51 +01:00
André Bauer
288b91a0cd
remove gosu and run nginx as zammad user (#189)
remove gosu and run nginx as zammad user
2021-03-03 20:28:03 +01:00
Thorsten
7ef7084e48
Migrate to elasticsearch OSS (#186) 2021-02-05 18:35:04 +01:00
André Bauer
c76180b7d9
update elasticsearch to 7.10.1 (#185) 2021-01-04 13:39:59 +01:00
André Bauer
04e6220993
added codespell & superlinter / updated versions (#183)
* added codespell linter
* added superlinter
* raised env version to 3.6.0-20
* updated memcache container
* updated postgres container
* some readme fixes
* use fixed ubuntu 20.04 version for all github action steps
2020-12-07 13:41:12 +01:00
André Bauer
2f9d7b32ed
Update Dockerfile 2020-11-19 00:01:17 +01:00
Thorsten
99cd79a748
Release Update 3.6. (#181)
* Release Update 3.6.

* Added VERSION ENV.
2020-11-18 19:02:40 +01:00
Ross Crawford-d'Heureuse
30d25a9151
update image to 3.5.0-20 (#179)
* bumped to 3.6.0-82

* Update .env

Co-authored-by: Ross Crawford-d'Heureuse <ross.crawford@mindcurv.com>
Co-authored-by: André Bauer <monotek@users.noreply.github.com>
2020-11-11 16:41:37 +01:00
André Bauer
7d15c4909a
update zammad version & made es reindex optional (#175)
Signed-off-by: André Bauer <monotek23@gmail.com>
2020-09-25 14:35:49 +02:00
André Bauer
297c3f8004
updated memcached image 2020-09-24 18:23:02 +02:00
Thorsten Eckel
9f79620f9e Maintenance: Updated ruby dependency from 2.6.5 to 2.6.6. 2020-09-22 13:56:31 +02:00
Jensa
d2e5fbb4a5
Fix as recommended here: https://github.com/zammad/zammad-docker-compose/issues/168#issuecomment-659505704 (#172) 2020-09-19 00:17:46 +02:00
Jakub Gocławski
cf3fd9c090
Allow starting without Elasticsearch. (#171)
* Allow starting without Elasticsearch.

* Document running without Elasticsearch in the README.md.
2020-09-14 16:11:41 +02:00
André Bauer
83438a63a4
update es (#170)
Signed-off-by: André Bauer <monotek23@gmail.com>
2020-09-04 15:27:06 +02:00
André Bauer
6c6fe76d11
Update image version to 3.4.0-4 2020-07-01 01:06:27 +02:00
André Bauer
675e573b54
added stale bot config (#167)
Signed-off-by: André Bauer <monotek23@gmail.com>
2020-06-30 17:04:19 +02:00
André Bauer
9071b2d406
made nginx X-Forwarded-Proto scheme & rails trusted proxies configurable (#166)
* made nginx X-Forwarded-Proto scheme & rails trusted proxies configurable

* disable schellcheck

* removed quotes

* changed sed command

* removed shellcheck disable

* changed scheme var
2020-06-30 15:43:41 +02:00
André Bauer
8aeb72e215
updated zammad image to 3.4.0-2 2020-06-17 09:52:49 +02:00
Thorsten
ff20084ce2
Required changes for 3.4 release. (#162)
* Required changes for 3.4 release.

* Required for first build.
2020-06-16 19:11:18 +02:00
Thiago Alves Cavalcante
05e56fde67
Update rsync command (#150)
* Update rsync command

Adds --no-perms --no-owner params to rsync command for maintain compatibility with NFS volumes, else rsync change owner and perms of files synced causing error.

* Change params on rsync to a generic variable

* Add params as string on generic var

* remove duplicated generic var

* Remove double quotes on rsync command

* Add a coment to ignore spellcheck
2020-05-22 00:10:23 +02:00
André Bauer
0ff9b46136
added missing rm command again 2020-04-14 16:36:29 +02:00
André Bauer
8423028cc5
fixed typo 2020-04-14 16:35:14 +02:00
André Bauer
cdbb3dce14
added check of DOCKER_VOLUME variable 2020-04-14 16:32:36 +02:00
André Bauer
c5751c06f7
added es namespace setting 2020-03-27 13:31:22 +01:00
André Bauer
f48fca238e
fixed postgres varname 2020-03-26 16:56:31 +01:00
André Bauer
7a591e3da5
added missing env vars to zammad init (#154) 2020-03-26 13:34:05 +01:00
André Bauer
76f7e0ee3b
Update .env (#152) 2020-03-23 13:24:13 +01:00
André Bauer
2f60d1fd14
Update tests.sh 2020-03-13 14:01:02 +01:00
André Bauer
5025b5e7b5
added filldb to tests 2020-03-13 02:23:39 +01:00
André Bauer
c5c359c658
fix nginx config (#148)
Signed-off-by: André Bauer <monotek23@gmail.com>
2020-03-12 23:16:24 +01:00
André Bauer
4dd0d5200d
Delete .travis.yml 2020-03-07 16:54:01 +01:00
André Bauer
d9a7d7ea20
test dockerhub images too (#146)
* fixed indentation

* added docker-compose lint

Signed-off-by: André Bauer <monotek23@gmail.com>

* test dockerhub images too

* pull images in separate step

* added smilye

* lowered timeouts
2020-03-07 13:21:46 +01:00
André Bauer
8e57219902
added docker-compose.yml lint (#145)
* fixed indentation

* added docker-compose lint

Signed-off-by: André Bauer <monotek23@gmail.com>
2020-03-07 04:19:55 +01:00
André Bauer
73def89f3b
fixed indentation (#144) 2020-03-07 03:55:36 +01:00
André Bauer
581434287c
github action test (#143)
* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>

* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>

* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>

* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>

* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>

* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>

* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>

* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>

* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>

* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>

* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>

* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>

* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>

* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>

* github action test

Signed-off-by: André Bauer <monotek23@gmail.com>
2020-03-06 18:50:38 +01:00
André Bauer
f93db7f2e8
added image build to ci & change db checks / migration (#142)
* updated image to 3.3.0-11

Signed-off-by: André Bauer <monotek23@gmail.com>

* add image build to ci / changed db cehcks

Signed-off-by: André Bauer <monotek23@gmail.com>

* added repo user var

Signed-off-by: André Bauer <monotek23@gmail.com>

* added needs

Signed-off-by: André Bauer <monotek23@gmail.com>

* added executable bit

Signed-off-by: André Bauer <monotek23@gmail.com>

* test

Signed-off-by: André Bauer <monotek23@gmail.com>

* test

Signed-off-by: André Bauer <monotek23@gmail.com>

* test

Signed-off-by: André Bauer <monotek23@gmail.com>
2020-03-06 14:41:59 +01:00
André Bauer
de6941235d
updated image to 3.3.0-11 (#141)
Signed-off-by: André Bauer <monotek23@gmail.com>
2020-03-06 11:51:52 +01:00
André Bauer
b28b513b74 Merge branch 'master' of github.com:monotek/zammad-docker-compose 2020-03-05 15:50:04 +01:00
André Bauer
6f26f26185 fixed docker lint file paths 2020-03-05 15:48:26 +01:00
André Bauer
aad03052f7 Merge remote-tracking branch 'upstream/master' 2020-03-05 15:42:13 +01:00
Thorsten Eckel
1d1daab582 Required changes for 3.3 release. 2020-03-05 15:15:02 +01:00
Thorsten Eckel
589efbc3a6 Building of Elasticsearch broken: Installation of ingest-attachment fails with error code 141.
```
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional permissions     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.lang.RuntimePermission accessClassInPackage.sun.java2d.cmm.kcms
* java.lang.RuntimePermission accessDeclaredMembers
* java.lang.RuntimePermission getClassLoader
* java.lang.reflect.ReflectPermission suppressAccessChecks
* java.security.SecurityPermission createAccessControlContext
* java.security.SecurityPermission insertProvider
* java.security.SecurityPermission putProviderProperty.BC
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

-> Installed ingest-attachment
The command '/bin/bash -e -o pipefail -c yes | /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment' returned a non-zero code: 141
```
2020-03-05 14:36:07 +01:00
André Bauer
028f6f4f5d
added autowizard as test (#139)
* added autowizard as test

Signed-off-by: André Bauer <monotek23@gmail.com>

* fix filename

Signed-off-by: André Bauer <monotek23@gmail.com>

* removed workflow needs

Signed-off-by: André Bauer <monotek23@gmail.com>

* added another sleep to see some more logs

Signed-off-by: André Bauer <monotek23@gmail.com>

* remove sleep

Signed-off-by: André Bauer <monotek23@gmail.com>
2020-02-28 00:38:52 +01:00
André Bauer
b075bd1a8f remove sleep
Signed-off-by: André Bauer <monotek23@gmail.com>
2020-02-28 00:38:31 +01:00
André Bauer
4b1b190219 added another sleep to see some more logs
Signed-off-by: André Bauer <monotek23@gmail.com>
2020-02-28 00:17:56 +01:00
André Bauer
eb0e5980d4 removed workflow needs
Signed-off-by: André Bauer <monotek23@gmail.com>
2020-02-28 00:08:26 +01:00
André Bauer
4ef5d6366f fix filename
Signed-off-by: André Bauer <monotek23@gmail.com>
2020-02-28 00:06:46 +01:00
André Bauer
d1a516a7ed added autowizard as test
Signed-off-by: André Bauer <monotek23@gmail.com>
2020-02-28 00:02:06 +01:00
André Bauer
20b99bcaa1
removed deletion of tmp file 2020-02-27 12:42:50 +01:00
André Bauer
0b787b2da0
raised sleep to 30 seconds to get some more logs 2020-02-27 12:42:06 +01:00
André Bauer
cb046658ff
set ci timeout to 10 min 2020-02-27 12:39:59 +01:00
André Bauer
2876dcc893
removed blankline (#137) 2020-02-27 10:23:28 +01:00
André Bauer
de63808d4b removed blankline 2020-02-27 10:22:00 +01:00
André Bauer
48e920e91d
updated status badge 2020-02-27 00:38:25 +01:00
André Bauer
6d5cfd786c
Update README.md 2020-02-27 00:36:07 +01:00
André Bauer
33beea77df
test github action (#136)
* changed github action
2020-02-27 00:33:46 +01:00
André Bauer
7fe85067fa
added github action (#135) 2020-02-26 17:54:14 +01:00
André Bauer
00153731d1
removed unused POSTGRES_DB var 2020-02-26 01:25:27 +01:00
André Bauer
d35dc01480
fixed sortorder 2020-02-25 20:00:31 +01:00
André Bauer
0867f031ff
added link to postgres changes 2020-02-25 19:56:48 +01:00
André Bauer
0b74566b74
added postgres fixes to upgrading section 2020-02-25 19:14:25 +01:00
André Bauer
5f405aadd4
set fixed version (3.2.0-13) 2020-02-25 15:52:56 +01:00
André Bauer
607fa4a02a
fixes for postgres / use official memcached container (#130)
* use fixed postgres & memcached versions & fix missing postgres env var

* remove memcached contaienr build

* fixed another version label

* added postgres password to backup command

* set postgres user & pass in .env file

* fixed postgres in backup container

* use zammad repo
2020-02-24 17:50:19 +01:00
André Bauer
9b81b9f544
Update docker-compose.yml 2020-02-21 17:50:30 +01:00
André Bauer
b8c641997e
Update docker-entrypoint.sh 2020-02-20 16:18:45 +01:00
André Bauer
351c90ed86
Update README.md 2020-02-20 16:18:13 +01:00
André Bauer
2a2525d932
Update README.md 2020-02-20 13:24:36 +01:00
André Bauer
a12991b3cd
Update README.md 2020-02-20 13:22:35 +01:00
André Bauer
3e87923fc7
Update README.md 2020-02-19 23:15:23 +01:00
André Bauer
39569fd728
Update README.md 2020-02-19 23:14:14 +01:00
André Bauer
3d2a73474f
added possibility to purge es index 2020-02-19 23:08:11 +01:00
André Bauer
b25456ff7d
Update Dockerfile 2020-02-18 21:52:09 +01:00
31 changed files with 385 additions and 495 deletions

17
.env
View File

@ -1,5 +1,14 @@
# don't forget to add the minus before the version
# example: VERSION=-2.9.0-1
IMAGE_REPO=zammad/zammad-docker-compose
VERSION=
ELASTICSEARCH_VERSION=8.8.0
IMAGE_REPO=ghcr.io/zammad/zammad
MEMCACHE_SERVERS=zammad-memcached:11211
MEMCACHE_VERSION=1.6.20-alpine
POSTGRES_DB=zammad_production
POSTGRES_PASS=zammad
POSTGRES_USER=zammad
POSTGRES_HOST=zammad-postgresql
POSTGRES_PORT=5432
POSTGRES_VERSION=15.3-alpine
REDIS_URL=redis://zammad-redis:6379
REDIS_VERSION=7.0.5-alpine
RESTART=always
VERSION=6.0.0-66

View File

@ -1,9 +1,11 @@
version: '2'
services:
---
version: "2"
services:
zammad-nginx:
environment:
- VIRTUAL_HOST=helpdesk.domain.tld
- NGINX_SERVER_SCHEME=https
networks:
- default
- proxy_2_zammad

View File

@ -1,4 +1,6 @@
---
version: '2'
services:
frontend:
image: jwilder/nginx-proxy:alpine
@ -10,7 +12,7 @@ services:
- ./certs:/etc/nginx/certs
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- 2_apps
- 2_apps
networks:
2_apps:

View File

@ -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
*

31
.github/auto_wizard.json vendored Normal file
View File

@ -0,0 +1,31 @@
{
"Token": "docker_compose_token",
"TextModuleLocale": {
"Locale": "en-us"
},
"Users": [
{
"login": "info@zammad.org",
"firstname": "Zam",
"lastname": "Mad",
"email": "info@zammad.org",
"organization": "Zammad",
"password": "Zammad"
}
],
"Settings": [
{
"name": "product_name",
"value": "Zammad Service Desk"
},
{
"name": "system_online_service",
"value": true
}
],
"Organizations": [
{
"name": "Zammad"
}
]
}

16
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,16 @@
---
version: 2
updates:
- package-ecosystem: "docker"
directory: "/containers/zammad"
schedule:
interval: "weekly"
time: "09:00"
timezone: "Europe/Berlin"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
time: "09:00"
timezone: "Europe/Berlin"

3
.github/linters/.markdown-lint.yml vendored Normal file
View File

@ -0,0 +1,3 @@
---
MD013:
line_length: 600

37
.github/release-drafter.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: "🚀 Features"
labels:
- "feature"
- "enhancement"
- title: "🐛 Bug Fixes"
labels:
- "fix"
- "bugfix"
- "bug"
- title: "🧹 Maintenance"
labels:
- "chore"
- "dependencies"
version-resolver:
major:
labels:
- "feature"
minor:
labels:
- "enhancement"
patch:
labels:
- "fix"
- "bugfix"
- "bug"
- "chore"
- "dependencies"
default: patch
template: |
## Changes
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION

18
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,18 @@
---
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

51
.github/tests.sh vendored Executable file
View File

@ -0,0 +1,51 @@
#!/bin/bash
#
# run zammad tests
#
set -o errexit
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 15
done
sleep 30
echo
echo "Success - Zammad is up :)"
echo
echo
echo "Execute autowizard..."
echo
docker exec --env=AUTOWIZARD_RELATIVE_PATH=var/auto_wizard.json --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-docker-compose_zammad-railsserver_1 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 rails r "p User.find_by(email: 'info@zammad.org')" | grep 'info@zammad.org'
echo
echo "Check DB for AutoWizard user successfull :)"
echo
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 rails r "FillDb.load(agents: 1,customers: 1,groups: 1,organizations: 1,overviews: 1,tickets: 1)"
echo
echo "DB fill successful :)"
echo

25
.github/workflows/ci-remote-image.yaml vendored Normal file
View File

@ -0,0 +1,25 @@
---
name: ci-remote-image
on:
pull_request:
jobs:
run-remote-image-docker-compose:
timeout-minutes: 20
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: pull docker-compose images
run: docker-compose pull
- name: run docker-compose up
run: docker-compose up --detach
- name: add autowizard file
run: docker cp .github/auto_wizard.json zammad-docker-compose_zammad-railsserver_1:/opt/zammad/var
- name: run tests
run: .github/tests.sh

32
.github/workflows/ci.yaml vendored Normal file
View File

@ -0,0 +1,32 @@
---
name: ci
on:
pull_request:
jobs:
lint-docker-compose-file:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: lint zammad docker-compose file
run: docker-compose config
super-linter:
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Lint Code Base
uses: github/super-linter/slim@v5
env:
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LINTER_RULES_PATH: .github/linters
VALIDATE_ALL_CODEBASE: false
VALIDATE_JSCPD: false

22
.github/workflows/release-drafter.yaml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Release Drafter
on:
push:
branches:
- master
pull_request:
types: [opened, reopened, synchronize]
permissions:
contents: read
jobs:
update_release_draft:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-22.04
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,13 +0,0 @@
dist: xenial
sudo: required
group: deprecated
services:
- docker
before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -o Dpkg::Options::="--force-confnew" -y install docker-ce
- echo "${DOCKER_PASSWORD}" | docker login -u="${DOCKER_USERNAME}" --password-stdin
install: true
script: hooks/build

View File

@ -1,13 +0,0 @@
MAINTAINER Zammad <info@zammad.org>
ARG BUILD_DATE
LABEL org.label-schema.build-date="$BUILD_DATE" \
org.label-schema.name="Zammad" \
org.label-schema.license="AGPL-3.0" \
org.label-schema.description="Docker container for Zammad - Dummy Dockerfile for DockerHub autobuilds" \
org.label-schema.url="https://zammad.org" \
org.label-schema.vcs-url="https://github.com/zammad/zammad" \
org.label-schema.vcs-type="Git" \
org.label-schema.vendor="Zammad" \
org.label-schema.schema-version="2.9.0" \
org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up"

View File

@ -2,41 +2,51 @@
Zammad is a web based open source helpdesk/ticket system with many features
to manage customer communication via several channels like telephone, facebook,
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?
twitter, chat and emails. It is distributed under the GNU AFFERO General Public
License (AGPL). Do you receive many emails and want to answer them with a team of agents?
You're going to love Zammad!
## Use cases
## What is zammad-docker-compose repo for?
This repository is the starting point if you want to:
This repo is meant to be the starting point for somebody who likes to use dockerized multi-container Zammad in production.
- deploy Zammad in a containerized production environment
- test the current `stable` or `develop` versions of Zammad
## Getting started
## Getting started with zammad-docker-compose
[Learn more on Zammads documentation](https://docs.zammad.org/en/latest/install/docker-compose.html)
https://docs.zammad.org/en/latest/install-docker-compose.html
## Upgrading
For upgrading instructions see our [Releases](https://github.com/zammad/zammad-docker-compose/releases).
## Build Status
[![Build Status](https://travis-ci.org/zammad/zammad-docker-compose.svg?branch=master)](https://travis-ci.org/zammad/zammad-docker-compose)
## Status
[![ci-remote-image](https://github.com/zammad/zammad-docker-compose/actions/workflows/ci-remote-image.yaml/badge.svg)](https://github.com/zammad/zammad-docker-compose/actions/workflows/ci-remote-image.yaml) [![Dockerhub Pulls](https://badgen.net/docker/pulls/zammad/zammad-docker-compose?icon=docker&label=pulls)](https://hub.docker.com/r/zammad/zammad-docker-compose/)
## Using a reverse proxy
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.
To run Zammad behind a reverse 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
Elasticsearch is an optional, but strongly recommended dependency for Zammad. More details can be found in the [documentation](https://docs.zammad.org/en/latest/prerequisites/software.html#elasticsearch-optional). There are however certain scenarios when running without Elasticsearch may be desired, e.g. for very small teams, for teams with limited budget or as a temporary solution for an unplanned Elasticsearch downtime or planned cluster upgrade.
Elasticsearch is enabled by default in the example `docker-compose.yml` file. It is also by default required to run the "zammad-init" command. Disabling Elasticsearch is possible by setting a special environment variable: `ELASTICSEARCH_ENABLED=false` for the `zammad-init` container and removing all references to Elasticsearch everywhere else: the `zammad-elasticsearch` container, its volume and links to it.

View File

@ -1,17 +0,0 @@
FROM docker.elastic.co/elasticsearch/elasticsearch:7.6.0
MAINTAINER Zammad <info@zammad.org>
ARG BUILD_DATE
LABEL org.label-schema.build-date="$BUILD_DATE" \
org.label-schema.name="Zammad" \
org.label-schema.license="AGPL-3.0" \
org.label-schema.description="Docker container for Zammad - Elasticsearch" \
org.label-schema.url="https://zammad.org" \
org.label-schema.vcs-url="https://github.com/zammad/zammad" \
org.label-schema.vcs-type="Git" \
org.label-schema.vendor="Zammad" \
org.label-schema.schema-version="2.9.0" \
org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up"
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin remove x-pack --purge && \
yes | /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment

View File

@ -1,23 +0,0 @@
FROM memcached:alpine
MAINTAINER Zanmmad <info@zammad.org>
ENV MEMCACHED_SIZE 256M
LABEL org.label-schema.build-date="$BUILD_DATE" \
org.label-schema.name="Zammad" \
org.label-schema.license="AGPL-3.0" \
org.label-schema.description="Docker container for Zammad - Memcached Container" \
org.label-schema.url="https://zammad.org" \
org.label-schema.vcs-url="https://github.com/zammad/zammad" \
org.label-schema.vcs-type="Git" \
org.label-schema.vendor="Zammad" \
org.label-schema.schema-version="2.9.0" \
org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up"
# docker init
USER root
COPY containers/zammad-memcached/docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
USER memcache
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["zammad-memcached"]

View File

@ -1,9 +0,0 @@
#!/bin/sh
set -e
if [ "$1" = 'zammad-memcached' ]; then
echo "starting memcached..."
exec memcached -m "${MEMCACHED_SIZE}"
fi

View File

@ -1,23 +0,0 @@
FROM postgres:9.6-alpine
MAINTAINER Zammad <info@zammad.org>
ARG BUILD_DATE
ENV BACKUP_SLEEP 86400
ENV HOLD_DAYS 10
ENV ZAMMAD_DIR /opt/zammad
ENV BACKUP_DIR /var/tmp/zammad
LABEL org.label-schema.build-date="$BUILD_DATE" \
org.label-schema.name="Zammad" \
org.label-schema.license="AGPL-3.0" \
org.label-schema.description="Docker container for Zammad - Postgresql" \
org.label-schema.url="https://zammad.org" \
org.label-schema.vcs-url="https://github.com/zammad/zammad" \
org.label-schema.vcs-type="Git" \
org.label-schema.vendor="Zammad" \
org.label-schema.schema-version="2.9.0" \
org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up"
# copy backup script
COPY containers/zammad-postgresql/backup.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/backup.sh

View File

@ -1,63 +0,0 @@
FROM ruby:2.5.5-slim AS builder
# note: zammad is currently incompatible to alpine because of:
# https://github.com/docker-library/ruby/issues/113
MAINTAINER Zammad <info@zammad.org>
ARG BUILD_DATE
ARG DEBIAN_FRONTEND=noninteractive
ENV GIT_BRANCH stable
ENV GIT_URL ${PROJECT_URL}.git
ENV GOSU_VERSION 1.11
ENV PROJECT_URL https://github.com/zammad/zammad
ENV RAILS_ENV production
ENV TAR_GZ_URL ${PROJECT_URL}/archive/${GIT_BRANCH}.tar.gz
ENV ZAMMAD_DIR /opt/zammad
ENV ZAMMAD_READY_FILE ${ZAMMAD_DIR}/tmp/zammad.ready
ENV ZAMMAD_TMP_DIR /tmp/zammad-${GIT_BRANCH}
ENV ZAMMAD_USER zammad
# install zammad
COPY containers/zammad/setup.sh /tmp
RUN chmod +x /tmp/setup.sh; \
/tmp/setup.sh install
FROM ruby:2.5.5-slim
MAINTAINER Zammad <info@zammad.org>
ARG BUILD_DATE
ARG DEBIAN_FRONTEND=noninteractive
LABEL org.label-schema.build-date="$BUILD_DATE" \
org.label-schema.name="Zammad" \
org.label-schema.license="AGPL-3.0" \
org.label-schema.description="Docker container for Zammad - Data Container" \
org.label-schema.url="https://zammad.org" \
org.label-schema.vcs-url="https://github.com/zammad/zammad" \
org.label-schema.vcs-type="Git" \
org.label-schema.vendor="Zammad" \
org.label-schema.schema-version="2.9.0" \
org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up"
ENV GIT_BRANCH stable
ENV RAILS_ENV production
ENV ZAMMAD_DIR /opt/zammad
ENV ZAMMAD_READY_FILE ${ZAMMAD_DIR}/tmp/zammad.ready
ENV ZAMMAD_TMP_DIR /tmp/zammad-${GIT_BRANCH}
ENV ZAMMAD_USER zammad
COPY containers/zammad/setup.sh /tmp
RUN chmod +x /tmp/setup.sh; \
/tmp/setup.sh run
COPY --from=builder ${ZAMMAD_TMP_DIR} ${ZAMMAD_TMP_DIR}
COPY --from=builder /usr/local/bin/gosu /usr/local/bin/gosu
COPY --from=builder /usr/local/bundle /usr/local/bundle
# docker init
COPY containers/zammad/docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
WORKDIR ${ZAMMAD_DIR}

View File

@ -1,165 +0,0 @@
#!/usr/bin/env bash
set -e
: "${AUTOWIZARD_JSON:=''}"
: "${ELASTICSEARCH_HOST:=zammad-elasticsearch}"
: "${ELASTICSEARCH_PORT:=9200}"
: "${ELASTICSEARCH_SCHEMA:=http}"
: "${ELASTICSEARCH_SSL_VERIFY:=true}"
: "${MEMCACHED_HOST:=zammad-memcached}"
: "${MEMCACHED_PORT:=11211}"
: "${POSTGRESQL_HOST:=zammad-postgresql}"
: "${POSTGRESQL_PORT:=5432}"
: "${POSTGRESQL_USER:=postgres}"
: "${POSTGRESQL_PASS:=}"
: "${POSTGRESQL_DB:=zammad_production}"
: "${POSTGRESQL_DB_CREATE:=true}"
: "${ZAMMAD_RAILSSERVER_HOST:=zammad-railsserver}"
: "${ZAMMAD_RAILSSERVER_PORT:=3000}"
: "${ZAMMAD_WEBSOCKET_HOST:=zammad-websocket}"
: "${ZAMMAD_WEBSOCKET_PORT:=6042}"
: "${NGINX_SERVER_NAME:=_}"
function check_zammad_ready {
sleep 15
until [ -f "${ZAMMAD_READY_FILE}" ]; do
echo "waiting for init container to finish install or update..."
sleep 10
done
}
# zammad init
if [ "$1" = 'zammad-init' ]; then
# install / update zammad
test -f "${ZAMMAD_READY_FILE}" && rm "${ZAMMAD_READY_FILE}"
rsync -a --delete --exclude 'public/assets/images/*' --exclude 'storage/fs/*' "${ZAMMAD_TMP_DIR}/" "${ZAMMAD_DIR}"
rsync -a "${ZAMMAD_TMP_DIR}"/public/assets/images/ "${ZAMMAD_DIR}"/public/assets/images
until (echo > /dev/tcp/"${POSTGRESQL_HOST}"/"${POSTGRESQL_PORT}") &> /dev/null; do
echo "zammad railsserver waiting for postgresql server to be ready..."
sleep 5
done
cd "${ZAMMAD_DIR}"
# configure database
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: ${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
echo "initialising / updating database..."
# check if database exists / update to new version
set +e
bundle exec rake db:migrate &> /dev/null
DB_MIGRATE="$?"
# check if database is populated
if [ "${DB_MIGRATE}" == "0" ]; then
bundle exec rails r "Setting.set('es_url', '${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}')" &> /dev/null
DB_SETTINGS="$?"
fi
set -e
# create database if not exists
if [ "${DB_MIGRATE}" != "0" ] && [ "${POSTGRESQL_DB_CREATE}" == "true" ]; then
echo "creating database..."
bundle exec rake db:create
fi
# populate database and create autowizard.json on first install
if [ "${DB_SETTINGS}" != "0" ]; then
echo "seeding database..."
bundle exec rake db:seed
if [ -n "${AUTOWIZARD_JSON}" ]; then
echo "${AUTOWIZARD_JSON}" | base64 -d > auto_wizard.json
fi
fi
# es config
echo "changing settings..."
bundle exec rails r "Setting.set('es_url', '${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}')"
if [ -n "${ELASTICSEARCH_USER}" ] && [ -n "${ELASTICSEARCH_PASS}" ]; then
bundle exec rails r "Setting.set('es_user', \"${ELASTICSEARCH_USER}\")"
bundle exec rails r "Setting.set('es_password', \"${ELASTICSEARCH_PASS}\")"
fi
until (echo > /dev/tcp/${ELASTICSEARCH_HOST}/${ELASTICSEARCH_PORT}) &> /dev/null; do
echo "zammad railsserver waiting for elasticsearch server to be ready..."
sleep 5
done
if [ "${ELASTICSEARCH_SSL_VERIFY}" == "false" ]; then
SSL_SKIP_VERIFY="-k"
else
SSL_SKIP_VERIFY=""
fi
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
# chown everything to zammad user
chown -R "${ZAMMAD_USER}":"${ZAMMAD_USER}" "${ZAMMAD_DIR}"
# create install ready file
su -c "echo 'zammad-init' > ${ZAMMAD_READY_FILE}" "${ZAMMAD_USER}"
fi
# zammad nginx
if [ "$1" = 'zammad-nginx' ]; then
check_zammad_ready
# configure nginx
if ! env | grep -q KUBERNETES; then
sed -e "s#server .*:3000#server ${ZAMMAD_RAILSSERVER_HOST}:${ZAMMAD_RAILSSERVER_PORT}#g" -e "s#server .*:6042#server ${ZAMMAD_WEBSOCKET_HOST}:${ZAMMAD_WEBSOCKET_PORT}#g" -e "s#server_name .*#server_name ${NGINX_SERVER_NAME};#g" -e 's#/var/log/nginx/zammad.\(access\|error\).log#/dev/stdout#g' < contrib/nginx/zammad.conf > /etc/nginx/sites-enabled/default
fi
echo "starting nginx..."
exec /usr/sbin/nginx -g 'daemon off;'
fi
# zammad-railsserver
if [ "$1" = 'zammad-railsserver' ]; then
test -f /opt/zammad/tmp/pids/server.pid && rm /opt/zammad/tmp/pids/server.pid
check_zammad_ready
cd "${ZAMMAD_DIR}"
echo "starting railsserver..."
#shellcheck disable=SC2101
exec gosu "${ZAMMAD_USER}":"${ZAMMAD_USER}" bundle exec rails server puma -b [::] -p "${ZAMMAD_RAILSSERVER_PORT}" -e "${RAILS_ENV}"
fi
# zammad-scheduler
if [ "$1" = 'zammad-scheduler' ]; then
check_zammad_ready
cd "${ZAMMAD_DIR}"
echo "starting scheduler..."
exec gosu "${ZAMMAD_USER}":"${ZAMMAD_USER}" bundle exec script/scheduler.rb run
fi
# zammad-websocket
if [ "$1" = 'zammad-websocket' ]; then
check_zammad_ready
cd "${ZAMMAD_DIR}"
echo "starting websocket server..."
exec gosu "${ZAMMAD_USER}":"${ZAMMAD_USER}" bundle exec script/websocket-server.rb -b 0.0.0.0 -p "${ZAMMAD_WEBSOCKET_PORT}" start
fi

View File

@ -1,43 +0,0 @@
#!/usr/bin/env bash
set -e
# install dependencies
if [ "$1" = 'install' ]; then
PACKAGES="build-essential curl git libimlib2-dev libpq-dev"
elif [ "$1" = 'run' ]; then
PACKAGES="curl libimlib2 libpq5 nginx rsync"
fi
apt-get update
apt-get upgrade -y
apt-get install -y --no-install-recommends ${PACKAGES}
rm -rf /var/lib/apt/lists/*
# install gosu
if [ "$1" = 'install' ]; then
curl -s -J -L -o /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture)"
chmod +x /usr/local/bin/gosu
gosu nobody true
fi
# install zammad
groupadd -g 1000 "${ZAMMAD_USER}"
useradd -M -d "${ZAMMAD_DIR}" -s /bin/bash -u 1000 -g 1000 "${ZAMMAD_USER}"
if [ "$1" = 'install' ]; then
cd "$(dirname "${ZAMMAD_TMP_DIR}")"
curl -s -J -L -O "${TAR_GZ_URL}"
tar -xzf zammad-"${GIT_BRANCH}".tar.gz
rm zammad-"${GIT_BRANCH}".tar.gz
cd "${ZAMMAD_TMP_DIR}"
bundle install --without test development mysql
contrib/packager.io/fetch_locales.rb
sed -e 's#.*adapter: postgresql# adapter: nulldb#g' -e 's#.*username:.*# username: postgres#g' -e 's#.*password:.*# password: \n host: zammad-postgresql\n#g' < contrib/packager.io/database.yml.pkgr > config/database.yml
sed -i "/require 'rails\/all'/a require\ 'nulldb'" config/application.rb
sed -i '/# Use a different logger for distributed setups./a \ \ config.logger = Logger.new(STDOUT)' config/environments/production.rb
sed -i 's/.*scheduler_\(err\|out\).log.*//g' script/scheduler.rb
touch db/schema.rb
bundle exec rake assets:precompile
rm -r tmp/cache
chown -R "${ZAMMAD_USER}":"${ZAMMAD_USER}" "${ZAMMAD_TMP_DIR}"
fi

View File

@ -0,0 +1,19 @@
---
version: '3'
services:
zammad-init:
image: zammad-local
zammad-nginx:
image: zammad-local
zammad-railsserver:
image: zammad-local
zammad-scheduler:
image: zammad-local
zammad-websocket:
image: zammad-local

View File

@ -1,6 +1,8 @@
version: '2'
---
version: '3'
services:
zammad-nginx:
ports:
- "80:80"
- "8080:8080"

View File

@ -1,4 +1,5 @@
version: '2'
---
version: '3.8'
services:
@ -6,54 +7,65 @@ services:
command: ["zammad-backup"]
depends_on:
- zammad-railsserver
entrypoint: /usr/local/bin/backup.sh
image: ${IMAGE_REPO}:zammad-postgresql${VERSION}
links:
- zammad-postgresql
entrypoint: /usr/local/bin/backup.sh
environment:
- BACKUP_TIME=03:00
- HOLD_DAYS=10
- POSTGRESQL_DB=${POSTGRES_DB}
- POSTGRESQL_USER=${POSTGRES_USER}
- POSTGRESQL_PASSWORD=${POSTGRES_PASS}
- TZ=Europe/Berlin
image: postgres:${POSTGRES_VERSION}
restart: ${RESTART}
volumes:
- zammad-backup:/var/tmp/zammad
- zammad-data:/opt/zammad
- zammad-var:/opt/zammad/var:ro
- ./scripts/backup.sh:/usr/local/bin/backup.sh:ro
zammad-elasticsearch:
image: ${IMAGE_REPO}:zammad-elasticsearch${VERSION}
image: bitnami/elasticsearch:${ELASTICSEARCH_VERSION}
restart: ${RESTART}
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
- elasticsearch-data:/bitnami/elasticsearch/data
zammad-init:
command: ["zammad-init"]
depends_on:
- zammad-postgresql
image: ${IMAGE_REPO}:zammad${VERSION}
links:
- zammad-elasticsearch
- zammad-postgresql
environment:
- MEMCACHE_SERVERS=${MEMCACHE_SERVERS}
- REDIS_URL=${REDIS_URL}
image: ${IMAGE_REPO}:${VERSION}
restart: on-failure
user: 0:0
volumes:
- zammad-data:/opt/zammad
- zammad-config-nginx:/etc/nginx/sites-enabled
- zammad-var:/opt/zammad/var
zammad-memcached:
command: ["zammad-memcached"]
image: ${IMAGE_REPO}:zammad-memcached${VERSION}
command: memcached -m 256M
image: memcached:${MEMCACHE_VERSION}
restart: ${RESTART}
zammad-nginx:
command: ["zammad-nginx"]
expose:
- "8080"
depends_on:
- zammad-railsserver
image: ${IMAGE_REPO}:zammad${VERSION}
links:
- zammad-railsserver
- zammad-websocket
image: ${IMAGE_REPO}:${VERSION}
restart: ${RESTART}
volumes:
- zammad-data:/opt/zammad
expose:
- "80"
- zammad-config-nginx:/etc/nginx/sites-enabled:ro
- zammad-var:/opt/zammad/var:ro
zammad-postgresql:
image: ${IMAGE_REPO}:zammad-postgresql${VERSION}
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASS}
image: postgres:${POSTGRES_VERSION}
restart: ${RESTART}
volumes:
- postgresql-data:/var/lib/postgresql/data
@ -63,48 +75,59 @@ services:
depends_on:
- zammad-memcached
- zammad-postgresql
image: ${IMAGE_REPO}:zammad${VERSION}
links:
- zammad-elasticsearch
- zammad-memcached
- zammad-postgresql
- zammad-redis
environment:
- MEMCACHE_SERVERS=${MEMCACHE_SERVERS}
- REDIS_URL=${REDIS_URL}
image: ${IMAGE_REPO}:${VERSION}
restart: ${RESTART}
volumes:
- zammad-data:/opt/zammad
- zammad-var:/opt/zammad/var
zammad-redis:
image: redis:${REDIS_VERSION}
restart: ${RESTART}
volumes:
- redis-data:/data
zammad-scheduler:
command: ["zammad-scheduler"]
depends_on:
- zammad-memcached
- zammad-railsserver
image: ${IMAGE_REPO}:zammad${VERSION}
links:
- zammad-elasticsearch
- zammad-memcached
- zammad-postgresql
- zammad-redis
environment:
- MEMCACHE_SERVERS=${MEMCACHE_SERVERS}
- REDIS_URL=${REDIS_URL}
image: ${IMAGE_REPO}:${VERSION}
restart: ${RESTART}
volumes:
- zammad-data:/opt/zammad
- zammad-var:/opt/zammad/var
zammad-websocket:
command: ["zammad-websocket"]
depends_on:
- zammad-memcached
- zammad-railsserver
image: ${IMAGE_REPO}:zammad${VERSION}
links:
- zammad-postgresql
- zammad-memcached
- zammad-redis
environment:
- MEMCACHE_SERVERS=${MEMCACHE_SERVERS}
- REDIS_URL=${REDIS_URL}
image: ${IMAGE_REPO}:${VERSION}
restart: ${RESTART}
volumes:
- zammad-data:/opt/zammad
- zammad-var:/opt/zammad/var
volumes:
elasticsearch-data:
driver: local
postgresql-data:
driver: local
redis-data:
driver: local
zammad-backup:
driver: local
zammad-data:
zammad-config-nginx:
driver: local
zammad-var:
driver: local

View File

@ -1,37 +0,0 @@
#!/bin/bash
#
# build hook for dockerhubs autobuild feature
#
set -e
. "hooks/config"
#shellcheck disable=SC2153
for DOCKER_IMAGE in ${DOCKER_IMAGES}; do
if [ "${TRAVIS}" == 'true' ] || [ "${CIRCLECI}" == 'true' ]; then
if [ -n "${ZAMMAD_VERSION}" ]; then
DOCKER_TAG="-t ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-${ZAMMAD_VERSION}"
else
ZAMMAD_VERSION="latest"
fi
echo "Build Zammad Docker image ${DOCKER_IMAGE} with version ${ZAMMAD_VERSION} for DockerHubs ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE} repo"
docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE} -t ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-latest ${DOCKER_TAG} -f containers/${DOCKER_IMAGE}/Dockerfile .
docker push ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}
docker push ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-latest
if [ "${ZAMMAD_VERSION}" != "latest" ]; then
docker push ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-${ZAMMAD_VERSION}
fi
else
echo "Build Zammad Docker image ${DOCKER_IMAGE} for DockerHubs ${DOCKER_REPO}:${DOCKER_IMAGE} repo"
docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t "${DOCKER_REPO}:${DOCKER_IMAGE}" -f containers/"${DOCKER_IMAGE}"/Dockerfile .
docker push ${DOCKER_REPO}:${DOCKER_IMAGE}
fi
done

View File

@ -1,6 +0,0 @@
#!/bin/bash
#
# build hooks config
#
DOCKER_IMAGES="zammad zammad-elasticsearch zammad-memcached zammad-postgresql"

View File

@ -1,6 +0,0 @@
#!/bin/bash
#
# build hook for dockerhubs autobuild feature
#
exit 0

View File

@ -1,3 +1,4 @@
---
version: '2'
services:

View File

@ -2,15 +2,16 @@
set -e
: "${ZAMMAD_DIR:=/opt/zammad/var}"
: "${BACKUP_DIR:=/var/tmp/zammad}"
: "${ZAMMAD_RAILSSERVER_HOST:=zammad-railsserver}"
: "${ZAMMAD_RAILSSERVER_PORT:=3000}"
: "${POSTGRESQL_USER:=postgres}"
: "${POSTGRESQL_HOST:=zammad-postgresql}"
: "${POSTGRESQL_PORT:=5432}"
: "${POSTGRESQL_DB:=zammad_production}"
function check_railsserver_available {
until (echo > /dev/tcp/${ZAMMAD_RAILSSERVER_HOST}/${ZAMMAD_RAILSSERVER_PORT}) &> /dev/null; do
until (echo > "/dev/tcp/$ZAMMAD_RAILSSERVER_HOST/$ZAMMAD_RAILSSERVER_PORT") &> /dev/null; do
echo "waiting for railsserver to be ready..."
sleep 60
done
@ -23,7 +24,7 @@ function zammad_backup {
# delete old backups
if [ -d "${BACKUP_DIR}" ] && [ -n "$(ls "${BACKUP_DIR}")" ]; then
find "${BACKUP_DIR}"/*_zammad_*.gz -type f -mtime +"${HOLD_DAYS}" -exec rm {} \;
find "${BACKUP_DIR}"/*_zammad_*.gz -type f -mtime +"${HOLD_DAYS}" -delete
fi
if [ "${NO_FILE_BACKUP}" != "yes" ]; then
@ -32,7 +33,9 @@ function zammad_backup {
fi
#db backup
pg_dump --dbname=postgresql://"${POSTGRESQL_USER}"@"${POSTGRESQL_HOST}":"${POSTGRESQL_PORT}"/"${POSTGRESQL_DB}" | gzip > "${BACKUP_DIR}"/"${TIMESTAMP}"_zammad_db.psql.gz
pg_dump --dbname=postgresql://"${POSTGRESQL_USER}:${POSTGRESQL_PASSWORD}@${POSTGRESQL_HOST}:${POSTGRESQL_PORT}/${POSTGRESQL_DB}" | gzip > "${BACKUP_DIR}"/"${TIMESTAMP}"_zammad_db.psql.gz
echo "backup finished :)"
}
if [ "$1" = 'zammad-backup' ]; then
@ -40,10 +43,15 @@ if [ "$1" = 'zammad-backup' ]; then
check_railsserver_available
while true; do
NOW_TIMESTAMP=$(date +%s)
TOMORROW_DATE=$(date -d@"$((NOW_TIMESTAMP + 24*60*60))" +%Y-%m-%d)
zammad_backup
# wait until next backup
sleep "${BACKUP_SLEEP}"
NEXT_TIMESTAMP=$(date -d "$TOMORROW_DATE $BACKUP_TIME" +%s)
NOW_TIMESTAMP=$(date +%s)
sleep $((NEXT_TIMESTAMP - NOW_TIMESTAMP))
done
fi