diff --git a/.travis.yml b/.travis.yml index 61e67ca..1eabf6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,6 @@ dist: bionic services: docker install: make build-all before_script: sudo apt-get install -y ldap-utils openssl jq -script: make test-all +script: + - make test-pull + - make test-all diff --git a/Makefile b/Makefile index 8f1d26f..9b66d06 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ SRC_VER ?= $(shell $(SRC_CMD)) IMG_REPO ?= $(BLD_REPO) IMG_VER ?= $(BLD_VER) TST_ENV ?= -C test -TST_TGTE ?= $(addprefix test-,all diff down env htop imap lmtp logs mail pop3 sh sv up) +TST_TGTE ?= $(addprefix test-,all diff down env htop imap lmtp logs mail pop3 pull sh sv up) TST_TGTI ?= test_% test-up_% _version = $(if $(findstring $(BLD_TGT),$(1)),\ $(if $(findstring latest,$(2)),latest $(1) $(SRC_VER) $(1)-$(SRC_VER),$(2) $(1)-$(2)),\ diff --git a/README.md b/README.md index 6812de9..39da94e 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ![docker stars](https://img.shields.io/docker/stars/mlan/kopano.svg?label=stars&style=popout-square&logo=docker) ![docker pulls](https://img.shields.io/docker/pulls/mlan/kopano.svg?label=pulls&style=popout-square&logo=docker) -This (non official) repository provides dockerized web mail service as well as Exchange ActiveSync (EAS), ICAL, IMAP and POP3 service. It is based on [Kopano](https://kopano.com) core components, as well as the Kopano WebApp and [Z-Push](http://z-push.org/). The image uses [nightly built packages](https://download.kopano.io/community/) which are provided by the Kopano community. +This (non official) repository provides dockerized web mail service as well as Exchange ActiveSync (EAS), IMAP, POP3 and ICAL service (and their secure variants IMAPS, POP3S and ICALS). It is based on [Kopano](https://kopano.com) core components, as well as the Kopano WebApp and [Z-Push](http://z-push.org/). The image uses [nightly built packages](https://download.kopano.io/community/) which are provided by the Kopano community. Hopefully this repository can be retired once the Kopano community make official images available. To learn more about this activity see [zokradonh/kopano-docker](https://github.com/zokradonh/kopano-docker). @@ -14,10 +14,13 @@ Hopefully this repository can be retired once the Kopano community make official - Groupware server [Kopano WebApp](https://kopano.io/) - [Exchange ActiveSync (EAS)](https://en.wikipedia.org/wiki/Exchange_ActiveSync) server [Z-Push](http://z-push.org/) -- Multi-staged build providing the images `full`, `debugtools` and `core` +- IMAP, POP3 and ICAL service Kopano +- Secure protocols IMAPS, POP3S and ICALS. +- Hooks for integrating [Let’s Encrypt](https://letsencrypt.org/) LTS certificates using the reverse proxy [Traefik](https://docs.traefik.io/) +- Multi-staged build providing the images `full` and `core` - Configuration using environment variables - Log directed to docker daemon with configurable level -- Built in utility script [conf](src/docker/bin/conf) helping configuring Kopano components, WebApp and Z-Push +- Built in utility script [run](src/docker/bin/run) helping configuring Kopano components, WebApp and Z-Push - Health check - Hook for theming - Demo based on `docker-compose.yml` and `Makefile` files diff --git a/test/Makefile b/test/Makefile index 573fcf7..6c5457c 100644 --- a/test/Makefile +++ b/test/Makefile @@ -7,8 +7,6 @@ _ip = $(shell docker inspect -f \ '{{range .NetworkSettings.Networks}}{{println .IPAddress}}{{end}}' \ $(1) | head -n1) -CURL_DBG ?= - TST_NAME ?= test SSL_KEYF ?= priv_key.pem SSL_CRTF ?= cert.pem @@ -48,7 +46,7 @@ SQL_ENV ?= \ -e MYSQL_PASSWORD=$(SQL_PASS) \ APP_NAME ?= app -APP_IMAG ?= +APP_IMG ?= APP_FQDN ?= $(APP_NAME).$(MAIL_DOM) APP_VOL ?= APP_SSLD ?= /etc/kopano/ssl @@ -74,6 +72,19 @@ APPF_ENV ?= $(APPS_ENV) \ APPA_ENV ?= $(APPS_ENV) \ -v $(shell pwd)/$(TST_ACMD):/$(TST_ACMD) +AUT_NAME ?= auth +AUT_IMG ?= mlan/openldap +AUT_FQDN ?= $(AUT_NAME).$(MAIL_DOM) +AUT_VOL ?= +AUT_ENV ?= $(NET_ENV) \ +--name $(AUT_NAME) \ +--hostname $(AUT_FQDN) \ + +CURL_OPT ?= -s -v +CURL_IMG ?= curlimages/curl +CURL_ENV ?= $(NET_ENV) \ +-i --rm + DB_NAME ?= db DB_IMG ?= mariadb DB_FQDN ?= $(DB_NAME).$(MAIL_DOM) @@ -83,13 +94,7 @@ DB_ENV ?= $(NET_ENV) $(SQL_ENV) \ --hostname $(DB_FQDN) \ -e MYSQL_ROOT_PASSWORD=$(SQL_PASS) -AUT_NAME ?= auth -AUT_IMG ?= mlan/openldap -AUT_FQDN ?= $(AUT_NAME).$(MAIL_DOM) -AUT_VOL ?= -AUT_ENV ?= $(NET_ENV) \ ---name $(AUT_NAME) \ ---hostname $(AUT_FQDN) \ +#GREP_ENV ?= --color=always TST_W8S1 ?= 1 TST_W8S2 ?= 80 @@ -107,6 +112,8 @@ test-all: test-up_0 test_1 test_2 test_3 test_%: test-up_% test-waitl_% test-logs_% test-service_% test-down_% +test-pull: + $(addprefix docker pull -q ,$(CURL_IMG); $(AUT_IMG); $(DB_IMG)) test-up_0: test-up-net # @@ -185,7 +192,7 @@ test-service_%: test-pop3_% test-imap_% test-http_% # test-logs_%: - -docker container logs $(APP_NAME) | grep 'docker-entrypoint.sh' + -docker container logs $(APP_NAME) # | grep 'docker-entrypoint.sh' test-waits_%: case $* in [1-4]) sleep $(TST_W8S1);; *) sleep $(TST_W8S2);; esac @@ -215,7 +222,7 @@ test-up-auth_%: test-lmtp: test-lmtp_0 test-lmtp_%: printf "LHLO mx\nMAIL FROM: \nRCPT TO: <$(MAIL_US1)@$(MAIL_DOM)>\nDATA\nFrom: A tester \nTo: <$(MAIL_US1)@$(MAIL_DOM)>\nDate: $$(date)\nSubject: $(MAIL_SUB)$*\n$(MAIL_MSG)$*\n.\nQUIT\n"\ - | nc -C $(call _ip,$(APP_NAME)) 2003 > /dev/null + | nc -C $(call _ip,$(APP_NAME)) 2003 # > /dev/null case $* in [1-3]) sleep $(TST_W8S1);; [4-9]) sleep $(TST_W8S2);; esac test-cfg_%: @@ -227,19 +234,19 @@ test-cfg_%: test-imap: test-imap_0 test-imaps: test-imap_9 test-imap_%: test-cfg_% test-lmtp_% - docker run -i --rm $(NET_ENV) curlimages/curl imap$(cfg_s)://$(APP_NAME)/inbox \ - -s --ssl --anyauth -k -X "fetch 1 all" -u $(MAIL_US1):$(MAIL_PW1) | grep --color=always $(MAIL_SUB)$* + docker run $(CURL_ENV) $(CURL_IMG) $(CURL_OPT) imap$(cfg_s)://$(APP_NAME)/inbox \ + --ssl --anyauth -k -X "fetch 1 all" -u $(MAIL_US1):$(MAIL_PW1) | grep $(GREP_ENV) $(MAIL_SUB)$* test-pop3: test-pop3_0 test-pop3s: test-pop3_9 test-pop3_%: test-cfg_% test-lmtp_% - docker run -i --rm $(NET_ENV) curlimages/curl pop3$(cfg_s)://$(APP_NAME)/1 \ - -s --ssl --anyauth -k -u $(MAIL_US1):$(MAIL_PW1) | grep --color=always $(MAIL_SUB)$* + docker run $(CURL_ENV) $(CURL_IMG) $(CURL_OPT) pop3$(cfg_s)://$(APP_NAME)/1 \ + --ssl --anyauth -k -u $(MAIL_US1):$(MAIL_PW1) | grep $(GREP_ENV) $(MAIL_SUB)$* test-http: test-http_9 test-http_%: test-cfg_% if [ $* -ge 3 ]; then \ - docker run -i --rm $(NET_ENV) curlimages/curl http://$(APP_NAME) -s | grep --color=always $(WEB_TIT) \ + docker run $(CURL_ENV) $(CURL_IMG) $(CURL_OPT) http://$(APP_NAME) | grep $(GREP_ENV) $(WEB_TIT) \ ; fi test-env: