mirror of
				https://github.com/zokradonh/kopano-docker
				synced 2025-10-30 18:07:46 +00:00 
			
		
		
		
	implement new env variable to disable all automatic actions (#434)
* implement new env variable to disable all automatic actions fixes https://github.com/zokradonh/kopano-docker/issues/360 * wrap the remaining services in checks if autoconfigure/disable_checks is used * move definition of AUTOCONFIGURE variable into base image * add logic to kapps and kdav container * add autoconfigure to konnect container * update build stage to latest golang * add autoconfig to remaining images * delete obsolete apache config in z-push folder * when specifying config paths use KOPANO_CONFIG_PATH * also use env variable in helper scripts * add message about removal of kopano-cli
This commit is contained in:
		
							parent
							
								
									3d7ff97aab
								
							
						
					
					
						commit
						d514ef44cb
					
				| @ -11,6 +11,7 @@ ARG KOPANO_UID=999 | |||||||
| ARG KOPANO_GID=999 | ARG KOPANO_GID=999 | ||||||
| 
 | 
 | ||||||
| ENV \ | ENV \ | ||||||
|  |     AUTOCONFIGURE=true \ | ||||||
|     BASE_VERSION=2.2.0 \ |     BASE_VERSION=2.2.0 \ | ||||||
|     DEBIAN_FRONTEND=noninteractive \ |     DEBIAN_FRONTEND=noninteractive \ | ||||||
|     DEBUG="" |     DEBUG="" | ||||||
|  | |||||||
| @ -1,3 +1,3 @@ | |||||||
| #!/bin/bash | #!/bin/bash | ||||||
| 
 | 
 | ||||||
| /usr/sbin/kopano-autorespond -C /tmp/kopano/autorespond.cfg "$@" | /usr/sbin/kopano-autorespond -C "$KOPANO_CONFIG_PATH/autorespond.cfg" "$@" | ||||||
|  | |||||||
| @ -1,3 +1,8 @@ | |||||||
| #!/bin/bash | #!/bin/bash | ||||||
| 
 | 
 | ||||||
| /usr/sbin/kopano-cli --config /tmp/kopano/admin.cfg "$@" | if [ ! -f /usr/sbin/kopano-cli ]; then | ||||||
|  | 	echo "kopano-cli has been removed from Kopano Groupware Core 10 and upwards. Please use kopano-admin instead." | ||||||
|  | 	exit 1 | ||||||
|  | fi | ||||||
|  | 
 | ||||||
|  | /usr/sbin/kopano-cli --config "$KOPANO_CONFIG_PATH/admin.cfg" "$@" | ||||||
|  | |||||||
| @ -4,6 +4,7 @@ set -eu # unset variables are errors & non-zero return values exit the whole scr | |||||||
| [ "$DEBUG" ] && set -x | [ "$DEBUG" ] && set -x | ||||||
| 
 | 
 | ||||||
| ADDITIONAL_KOPANO_PACKAGES=${ADDITIONAL_KOPANO_PACKAGES:-""} | ADDITIONAL_KOPANO_PACKAGES=${ADDITIONAL_KOPANO_PACKAGES:-""} | ||||||
|  | AUTOCONFIGURE=${AUTOCONFIGURE:-true} # when set to false will disable all automatic configuration actions | ||||||
| KCCONF_SERVER_MYSQL_SOCKET=${KCCONF_SERVER_MYSQL_SOCKET:-""} | KCCONF_SERVER_MYSQL_SOCKET=${KCCONF_SERVER_MYSQL_SOCKET:-""} | ||||||
| DISABLE_CHECKS=${DISABLE_CHECKS:-false} | DISABLE_CHECKS=${DISABLE_CHECKS:-false} | ||||||
| DISABLE_CONFIG_CHANGES=${DISABLE_CONFIG_CHANGES:-false} | DISABLE_CONFIG_CHANGES=${DISABLE_CONFIG_CHANGES:-false} | ||||||
| @ -16,8 +17,10 @@ KCCONF_SPOOLER_SERVER_SOCKET=${KCCONF_SPOOLER_SERVER_SOCKET:-"file:///var/run/ko | |||||||
| KOPANO_CON=${KOPANO_CON:-"file:///var/run/kopano/server.sock"} | KOPANO_CON=${KOPANO_CON:-"file:///var/run/kopano/server.sock"} | ||||||
| KCCONF_SPOOLER_SMTP_SERVER=${KCCONF_SPOOLER_SMTP_SERVER:-mail} | KCCONF_SPOOLER_SMTP_SERVER=${KCCONF_SPOOLER_SMTP_SERVER:-mail} | ||||||
| KCCONF_SPOOLER_SMTP_PORT=${KCCONF_SPOOLER_SMTP_PORT:-25} | KCCONF_SPOOLER_SMTP_PORT=${KCCONF_SPOOLER_SMTP_PORT:-25} | ||||||
|  | KOPANO_CONFIG_PATH=${KOPANO_CONFIG_PATH:-/tmp/kopano} | ||||||
| 
 | 
 | ||||||
| # copy configuration files to /tmp/kopano to prevent modification of mounted config files | if [ "${AUTOCONFIGURE}" == true ]; then | ||||||
|  | 	# copy configuration files to /tmp/kopano (default value of $KOPANO_CONFIG_PATH)  to prevent modification of mounted config files | ||||||
| 	mkdir -p /tmp/kopano | 	mkdir -p /tmp/kopano | ||||||
| 	cp /etc/kopano/*.cfg /tmp/kopano | 	cp /etc/kopano/*.cfg /tmp/kopano | ||||||
| 
 | 
 | ||||||
| @ -56,6 +59,7 @@ fi | |||||||
| 
 | 
 | ||||||
| 	# ensure removed pid-file on unclean shutdowns and mounted volumes | 	# ensure removed pid-file on unclean shutdowns and mounted volumes | ||||||
| 	rm -f /var/run/kopano/"$SERVICE_TO_START".pid | 	rm -f /var/run/kopano/"$SERVICE_TO_START".pid | ||||||
|  | fi | ||||||
| 
 | 
 | ||||||
| coreversion=$(dpkg-query --showformat='${Version}' --show kopano-server) | coreversion=$(dpkg-query --showformat='${Version}' --show kopano-server) | ||||||
| echo "Using Kopano Groupware Core: $coreversion" | echo "Using Kopano Groupware Core: $coreversion" | ||||||
| @ -67,7 +71,7 @@ if [ $# -gt 0 ]; then | |||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| # services need to be aware of the machine-id | # services need to be aware of the machine-id | ||||||
| if [[ "$DISABLE_CHECKS" == false  ]]; then | if [ "${AUTOCONFIGURE}" == true ] && [ "$DISABLE_CHECKS" == false ]; then | ||||||
| 	dockerize \ | 	dockerize \ | ||||||
| 		-wait file:///etc/machine-id \ | 		-wait file:///etc/machine-id \ | ||||||
| 		-wait file:///var/lib/dbus/machine-id | 		-wait file:///var/lib/dbus/machine-id | ||||||
| @ -119,6 +123,7 @@ fi | |||||||
| # start regular service | # start regular service | ||||||
| case "$SERVICE_TO_START" in | case "$SERVICE_TO_START" in | ||||||
| server) | server) | ||||||
|  | 	if [ "${AUTOCONFIGURE}" == true ]; then | ||||||
| 		echo "Set ownership" | ts | 		echo "Set ownership" | ts | ||||||
| 		mkdir -p /kopano/data/attachments | 		mkdir -p /kopano/data/attachments | ||||||
| 		chown kopano:kopano /kopano/data/ /kopano/data/attachments | 		chown kopano:kopano /kopano/data/ /kopano/data/attachments | ||||||
| @ -139,37 +144,45 @@ server) | |||||||
| 		fi | 		fi | ||||||
| 		# pre populate database | 		# pre populate database | ||||||
| 		if dpkg --compare-versions "$coreversion" "gt" "8.7.84"; then | 		if dpkg --compare-versions "$coreversion" "gt" "8.7.84"; then | ||||||
| 		kopano-dbadm -c /tmp/kopano/server.cfg populate | 			kopano-dbadm -c "$KOPANO_CONFIG_PATH/server.cfg" populate | ||||||
|  | 		fi | ||||||
| 	fi | 	fi | ||||||
| 	# cleaning up env variables | 	# cleaning up env variables | ||||||
| 	unset "${!KCCONF_@}" | 	unset "${!KCCONF_@}" | ||||||
| 	exec "$EXE" -F | 	exec "$EXE" -F | ||||||
| 	;; | 	;; | ||||||
| dagent) | dagent) | ||||||
|  | 	if [ "${AUTOCONFIGURE}" == true ] && [ "$DISABLE_CHECKS" == false ]; then | ||||||
| 		dockerize \ | 		dockerize \ | ||||||
| 			-wait "$KOPANO_CON" \ | 			-wait "$KOPANO_CON" \ | ||||||
| 			-timeout 360s | 			-timeout 360s | ||||||
|  | 	fi | ||||||
| 	# cleaning up env variables | 	# cleaning up env variables | ||||||
| 	unset "${!KCCONF_@}" | 	unset "${!KCCONF_@}" | ||||||
| 	exec "$EXE" -l | 	exec "$EXE" -l | ||||||
| 	;; | 	;; | ||||||
| gateway) | gateway) | ||||||
|  | 	if [ "${AUTOCONFIGURE}" == true ] && [ "$DISABLE_CHECKS" == false ]; then | ||||||
| 		dockerize \ | 		dockerize \ | ||||||
| 			-wait "$KOPANO_CON" \ | 			-wait "$KOPANO_CON" \ | ||||||
| 			-timeout 360s | 			-timeout 360s | ||||||
|  | 	fi | ||||||
| 	# cleaning up env variables | 	# cleaning up env variables | ||||||
| 	unset "${!KCCONF_@}" | 	unset "${!KCCONF_@}" | ||||||
| 	exec "$EXE" -F | 	exec "$EXE" -F | ||||||
| 	;; | 	;; | ||||||
| ical) | ical) | ||||||
|  | 	if [ "${AUTOCONFIGURE}" == true ] && [ "$DISABLE_CHECKS" == false ]; then | ||||||
| 		dockerize \ | 		dockerize \ | ||||||
| 			-wait "$KOPANO_CON" \ | 			-wait "$KOPANO_CON" \ | ||||||
| 			-timeout 360s | 			-timeout 360s | ||||||
|  | 	fi | ||||||
| 	# cleaning up env variables | 	# cleaning up env variables | ||||||
| 	unset "${!KCCONF_@}" | 	unset "${!KCCONF_@}" | ||||||
| 	exec "$EXE" -F | 	exec "$EXE" -F | ||||||
| 	;; | 	;; | ||||||
| grapi) | grapi) | ||||||
|  | 	if [ "${AUTOCONFIGURE}" == true ]; then | ||||||
| 		LC_CTYPE=en_US.UTF-8 | 		LC_CTYPE=en_US.UTF-8 | ||||||
| 		export socket_path=/var/run/kopano/grapi | 		export socket_path=/var/run/kopano/grapi | ||||||
| 		export pid_file="$socket_path/grapi.pid" | 		export pid_file="$socket_path/grapi.pid" | ||||||
| @ -188,9 +201,10 @@ grapi) | |||||||
| 			fi | 			fi | ||||||
| 			;; | 			;; | ||||||
| 		esac | 		esac | ||||||
| 	sed s/\ *=\ */=/g /tmp/kopano/grapi.cfg > /tmp/grapi-env | 		sed s/\ *=\ */=/g "$KOPANO_CONFIG_PATH/grapi.cfg" > /tmp/grapi-env | ||||||
| 		# shellcheck disable=SC2046 | 		# shellcheck disable=SC2046 | ||||||
| 		export $(grep -v '^#' /tmp/grapi-env | xargs -d '\n') | 		export $(grep -v '^#' /tmp/grapi-env | xargs -d '\n') | ||||||
|  | 	fi | ||||||
| 	# cleaning up env variables | 	# cleaning up env variables | ||||||
| 	unset "${!KCCONF_@}" | 	unset "${!KCCONF_@}" | ||||||
| 	# the backend option is only available in more recent versions of grapi | 	# the backend option is only available in more recent versions of grapi | ||||||
| @ -203,6 +217,7 @@ grapi) | |||||||
| 	fi | 	fi | ||||||
| 	;; | 	;; | ||||||
| kapi) | kapi) | ||||||
|  | 	if [ "${AUTOCONFIGURE}" == true ]; then | ||||||
| 		mkdir -p /kopano/data/kapi-kvs | 		mkdir -p /kopano/data/kapi-kvs | ||||||
| 		if [ "$KCCONF_KAPID_INSECURE" = "yes" ]; then | 		if [ "$KCCONF_KAPID_INSECURE" = "yes" ]; then | ||||||
| 			dockerize \ | 			dockerize \ | ||||||
| @ -214,54 +229,63 @@ kapi) | |||||||
| 			-wait "$KCCONF_KAPID_OIDC_ISSUER_IDENTIFIER"/.well-known/openid-configuration \ | 			-wait "$KCCONF_KAPID_OIDC_ISSUER_IDENTIFIER"/.well-known/openid-configuration \ | ||||||
| 			-timeout 360s | 			-timeout 360s | ||||||
| 		fi | 		fi | ||||||
| 	kapiversion=$(dpkg-query --showformat='${Version}' --show kopano-kapid) |  | ||||||
| 	echo "Using Kopano Kapi: $kapiversion" |  | ||||||
| 		LC_CTYPE=en_US.UTF-8 | 		LC_CTYPE=en_US.UTF-8 | ||||||
| 	sed s/\ *=\ */=/g /tmp/kopano/kapid.cfg > /tmp/kapid-env | 		sed s/\ *=\ */=/g "$KOPANO_CONFIG_PATH/kapid.cfg" > /tmp/kapid-env | ||||||
| 		# shellcheck disable=SC2046 | 		# shellcheck disable=SC2046 | ||||||
| 		export $(grep -v '^#' /tmp/kapid-env | xargs -d '\n') | 		export $(grep -v '^#' /tmp/kapid-env | xargs -d '\n') | ||||||
| 		"$EXE" setup | 		"$EXE" setup | ||||||
|  | 	fi | ||||||
| 	# cleaning up env variables | 	# cleaning up env variables | ||||||
| 	unset "${!KCCONF_@}" | 	unset "${!KCCONF_@}" | ||||||
|  | 	kapiversion=$(dpkg-query --showformat='${Version}' --show kopano-kapid) | ||||||
|  | 	echo "Using Kopano Kapi: $kapiversion" | ||||||
| 	exec "$EXE" serve --log-timestamp=false | 	exec "$EXE" serve --log-timestamp=false | ||||||
| 	;; | 	;; | ||||||
| monitor) | monitor) | ||||||
|  | 	if [ "${AUTOCONFIGURE}" == true ] && [ "$DISABLE_CHECKS" == false ]; then | ||||||
| 		dockerize \ | 		dockerize \ | ||||||
| 			-wait "$KOPANO_CON" \ | 			-wait "$KOPANO_CON" \ | ||||||
| 			-timeout 360s | 			-timeout 360s | ||||||
|  | 	fi | ||||||
| 	# cleaning up env variables | 	# cleaning up env variables | ||||||
| 	unset "${!KCCONF_@}" | 	unset "${!KCCONF_@}" | ||||||
| 	exec "$EXE" -F | 	exec "$EXE" -F | ||||||
| 	;; | 	;; | ||||||
| search) | search) | ||||||
|  | 	if [ "${AUTOCONFIGURE}" == true ] && [ "$DISABLE_CHECKS" == false ]; then | ||||||
| 		dockerize \ | 		dockerize \ | ||||||
| 			-wait "$KOPANO_CON" \ | 			-wait "$KOPANO_CON" \ | ||||||
| 			-timeout 360s | 			-timeout 360s | ||||||
| 		# give kopano-server a moment to settler before starting search | 		# give kopano-server a moment to settler before starting search | ||||||
| 		sleep 5 | 		sleep 5 | ||||||
|  | 	fi | ||||||
| 	# cleaning up env variables | 	# cleaning up env variables | ||||||
| 	unset "${!KCCONF_@}" | 	unset "${!KCCONF_@}" | ||||||
| 	# with commit 702bb3fccb3 search does not need -F any longer | 	# with commit 702bb3fccb3 search does not need -F any longer | ||||||
| 	searchversion=$(dpkg-query --showformat='${Version}' --show kopano-search) | 	searchversion=$(dpkg-query --showformat='${Version}' --show kopano-search) | ||||||
| 	if dpkg --compare-versions "$searchversion" "gt" "8.7.82.165"; then | 	if dpkg --compare-versions "$searchversion" "gt" "8.7.82.165"; then | ||||||
| 		exec "$EXE" --config /tmp/kopano/search.cfg | 		exec "$EXE" --config "$KOPANO_CONFIG_PATH/search.cfg" | ||||||
| 	else | 	else | ||||||
| 		exec /usr/bin/python3 "$EXE" --config /tmp/kopano/search.cfg -F | 		exec /usr/bin/python3 "$EXE" --config "$KOPANO_CONFIG_PATH/search.cfg" -F | ||||||
| 	fi | 	fi | ||||||
| 	;; | 	;; | ||||||
| spamd) | spamd) | ||||||
|  | 	if [ "${AUTOCONFIGURE}" == true ] && [ "$DISABLE_CHECKS" == false ]; then | ||||||
| 		dockerize \ | 		dockerize \ | ||||||
| 			-wait "$KOPANO_CON" \ | 			-wait "$KOPANO_CON" \ | ||||||
| 			-timeout 360s | 			-timeout 360s | ||||||
|  | 	fi | ||||||
| 	# cleaning up env variables | 	# cleaning up env variables | ||||||
| 	unset "${!KCCONF_@}" | 	unset "${!KCCONF_@}" | ||||||
| 	exec "$EXE" --config /tmp/kopano/spamd.cfg -F | 	exec "$EXE" --config "$KOPANO_CONFIG_PATH/spamd.cfg" -F | ||||||
| 	;; | 	;; | ||||||
| spooler) | spooler) | ||||||
|  | 	if [ "${AUTOCONFIGURE}" == true ] && [ "$DISABLE_CHECKS" == false ]; then | ||||||
| 		dockerize \ | 		dockerize \ | ||||||
| 			-wait "$KOPANO_CON" \ | 			-wait "$KOPANO_CON" \ | ||||||
| 			-wait tcp://"$KCCONF_SPOOLER_SMTP_SERVER":"$KCCONF_SPOOLER_SMTP_PORT" \ | 			-wait tcp://"$KCCONF_SPOOLER_SMTP_SERVER":"$KCCONF_SPOOLER_SMTP_PORT" \ | ||||||
| 			-timeout 1080s | 			-timeout 1080s | ||||||
|  | 	fi | ||||||
| 	# cleaning up env variables | 	# cleaning up env variables | ||||||
| 	unset "${!KCCONF_@}" | 	unset "${!KCCONF_@}" | ||||||
| 	exec "$EXE" -F | 	exec "$EXE" -F | ||||||
|  | |||||||
| @ -1,16 +1,19 @@ | |||||||
| #!/bin/bash | #!/bin/bash | ||||||
| 
 | 
 | ||||||
| ADDITIONAL_KOPANO_PACKAGES=${ADDITIONAL_KOPANO_PACKAGES:-""} | ADDITIONAL_KOPANO_PACKAGES=${ADDITIONAL_KOPANO_PACKAGES:-""} | ||||||
|  | AUTOCONFIGURE=${AUTOCONFIGURE:-true} # when set to false will disable all automatic configuration actions | ||||||
| 
 | 
 | ||||||
| set -eu # unset variables are errors & non-zero return values exit the whole script | set -eu # unset variables are errors & non-zero return values exit the whole script | ||||||
| [ "$DEBUG" ] && set -x | [ "$DEBUG" ] && set -x | ||||||
| 
 | 
 | ||||||
|  | if [ "${AUTOCONFIGURE}" == true ]; then | ||||||
| 	# copy configuration files to /tmp/kopano to prevent modification of mounted config files | 	# copy configuration files to /tmp/kopano to prevent modification of mounted config files | ||||||
| 	mkdir -p /tmp/kopano | 	mkdir -p /tmp/kopano | ||||||
| 	cp /etc/kopano/*.cfg /tmp/kopano | 	cp /etc/kopano/*.cfg /tmp/kopano | ||||||
| 
 | 
 | ||||||
| 	echo "Applying cfg changes from env" | 	echo "Applying cfg changes from env" | ||||||
| 	/usr/bin/python3 /kopano/cfg-from-env.py | 	/usr/bin/python3 /kopano/cfg-from-env.py | ||||||
|  | fi | ||||||
| 
 | 
 | ||||||
| meetversion=$(dpkg-query --showformat='${Version}' --show kopano-calendar-webapp) | meetversion=$(dpkg-query --showformat='${Version}' --show kopano-calendar-webapp) | ||||||
| echo "Using Kopano Calendar: $meetversion" | echo "Using Kopano Calendar: $meetversion" | ||||||
| @ -21,6 +24,7 @@ if [ $# -gt 0 ]; then | |||||||
| 	exit | 	exit | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
|  | if [ "${AUTOCONFIGURE}" == true ]; then | ||||||
| 	cp /usr/share/doc/kopano-calendar-webapp/config.json.in /tmp/calendar.json | 	cp /usr/share/doc/kopano-calendar-webapp/config.json.in /tmp/calendar.json | ||||||
| 	CONFIG_JSON="/tmp/calendar.json" | 	CONFIG_JSON="/tmp/calendar.json" | ||||||
| 	# TODO move into extra file to make it easier to reuse | 	# TODO move into extra file to make it easier to reuse | ||||||
| @ -72,6 +76,7 @@ export $(grep -v '^#' /tmp/kweb-env | xargs -d '\n') | |||||||
| 	dockerize \ | 	dockerize \ | ||||||
| 		-wait file:///etc/machine-id \ | 		-wait file:///etc/machine-id \ | ||||||
| 		-wait file:///var/lib/dbus/machine-id | 		-wait file:///var/lib/dbus/machine-id | ||||||
|  | fi | ||||||
| 
 | 
 | ||||||
| # cleaning up env variables | # cleaning up env variables | ||||||
| unset "${!KCCONF_@}" | unset "${!KCCONF_@}" | ||||||
|  | |||||||
| @ -1,13 +1,16 @@ | |||||||
| #!/bin/bash | #!/bin/bash | ||||||
| 
 | 
 | ||||||
|  | ADDITIONAL_KOPANO_PACKAGES=${ADDITIONAL_KOPANO_PACKAGES:-""} | ||||||
|  | AUTOCONFIGURE=${AUTOCONFIGURE:-true} # when set to false will disable all automatic configuration actions | ||||||
|  | 
 | ||||||
| # define default value for serverhostname and serverport if not passed into container | # define default value for serverhostname and serverport if not passed into container | ||||||
| KCCONF_SERVERHOSTNAME=${KCCONF_SERVERHOSTNAME:-127.0.0.1} | KCCONF_SERVERHOSTNAME=${KCCONF_SERVERHOSTNAME:-127.0.0.1} | ||||||
| KCCONF_SERVERPORT=${KCCONF_SERVERPORT:-236} | KCCONF_SERVERPORT=${KCCONF_SERVERPORT:-236} | ||||||
| ADDITIONAL_KOPANO_PACKAGES=${ADDITIONAL_KOPANO_PACKAGES:-""} |  | ||||||
| 
 | 
 | ||||||
| set -eu # unset variables are errors & non-zero return values exit the whole script | set -eu # unset variables are errors & non-zero return values exit the whole script | ||||||
| [ "$DEBUG" ] && set -x | [ "$DEBUG" ] && set -x | ||||||
| 
 | 
 | ||||||
|  | if [ "${AUTOCONFIGURE}" == true ]; then | ||||||
| 	# Hint: this is not compatible with a read-only container. | 	# Hint: this is not compatible with a read-only container. | ||||||
| 	# The general recommendation is to already build a container that has all required packages installed. | 	# The general recommendation is to already build a container that has all required packages installed. | ||||||
| 	ADDITIONAL_KOPANO_PACKAGES=$(echo "$ADDITIONAL_KOPANO_PACKAGES" | tr -d '"') | 	ADDITIONAL_KOPANO_PACKAGES=$(echo "$ADDITIONAL_KOPANO_PACKAGES" | tr -d '"') | ||||||
| @ -51,6 +54,7 @@ chown -R www-data:www-data /run/sessions | |||||||
| 	#dockerize \ | 	#dockerize \ | ||||||
| 	#	-wait file:///etc/machine-id \ | 	#	-wait file:///etc/machine-id \ | ||||||
| 	#	-wait file:///var/lib/dbus/machine-id | 	#	-wait file:///var/lib/dbus/machine-id | ||||||
|  | fi | ||||||
| 
 | 
 | ||||||
| touch /var/log/kdav/kdav.log | touch /var/log/kdav/kdav.log | ||||||
| chown www-data:www-data /var/log/kdav/kdav.log | chown www-data:www-data /var/log/kdav/kdav.log | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| ARG CODE_VERSION=0.33.5 | ARG CODE_VERSION=0.33.5 | ||||||
| 
 | 
 | ||||||
| FROM golang:1.13.5-alpine3.10 as builder-sponge | FROM golang:1.15-alpine3.12 as builder-sponge | ||||||
| 
 | 
 | ||||||
| RUN apk add --no-cache git | RUN apk add --no-cache git | ||||||
| RUN go get -d -v github.com/go-moreutils/sponge | RUN go get -d -v github.com/go-moreutils/sponge | ||||||
| @ -10,7 +10,9 @@ FROM kopano/konnectd:${CODE_VERSION} | |||||||
| 
 | 
 | ||||||
| ARG CODE_VERSION | ARG CODE_VERSION | ||||||
| 
 | 
 | ||||||
| ENV CODE_VERSION="${CODE_VERSION}" \ | ENV \ | ||||||
|  |     AUTOCONFIGURE=true \ | ||||||
|  |     CODE_VERSION="${CODE_VERSION}" \ | ||||||
|     DEBUG="" \ |     DEBUG="" \ | ||||||
|     FQDN=localhost \ |     FQDN=localhost \ | ||||||
|     KONNECT_BACKEND="kc" \ |     KONNECT_BACKEND="kc" \ | ||||||
|  | |||||||
| @ -11,6 +11,7 @@ if [ $# -gt 0 ]; then | |||||||
| 	exit | 	exit | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
|  | if [ "${AUTOCONFIGURE}" = true ]; then | ||||||
| 	signing_private_key=${signing_private_key:-"/etc/kopano/konnectd-signing-private-key.pem"} | 	signing_private_key=${signing_private_key:-"/etc/kopano/konnectd-signing-private-key.pem"} | ||||||
| 	validation_keys_path=${validation_keys_path:-"/etc/kopano/konnectkeys"} | 	validation_keys_path=${validation_keys_path:-"/etc/kopano/konnectkeys"} | ||||||
| 
 | 
 | ||||||
| @ -112,6 +113,7 @@ if [ "${external_oidc_provider:-}" = "yes" ]; then | |||||||
| 			exit 1 | 			exit 1 | ||||||
| 		fi | 		fi | ||||||
| 	fi | 	fi | ||||||
|  | fi | ||||||
| 
 | 
 | ||||||
| # source additional configuration from Konnect cfg (potentially overwrites env vars) | # source additional configuration from Konnect cfg (potentially overwrites env vars) | ||||||
| if [ -e /etc/kopano/konnectd.cfg ]; then | if [ -e /etc/kopano/konnectd.cfg ]; then | ||||||
|  | |||||||
| @ -2,7 +2,9 @@ ARG CODE_VERSION=0.1.0 | |||||||
| FROM kopano/kwmbridged:${CODE_VERSION} | FROM kopano/kwmbridged:${CODE_VERSION} | ||||||
| 
 | 
 | ||||||
| ARG CODE_VERSION | ARG CODE_VERSION | ||||||
| ENV CODE_VERSION="${CODE_VERSION}" | ENV \ | ||||||
|  |     AUTOCONFIGURE=true \ | ||||||
|  |     CODE_VERSION="${CODE_VERSION}" | ||||||
| 
 | 
 | ||||||
| LABEL maintainer=az@zok.xyz \ | LABEL maintainer=az@zok.xyz \ | ||||||
|     org.label-schema.name="Kopano Kwmbridge container" \ |     org.label-schema.name="Kopano Kwmbridge container" \ | ||||||
|  | |||||||
| @ -45,6 +45,7 @@ if [ "$INSECURE" = "yes" ]; then | |||||||
| 	set -- "$@" --insecure | 	set -- "$@" --insecure | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
|  | if [ "${AUTOCONFIGURE}" = true ]; then | ||||||
| 	if [ "$INSECURE" = "yes" ]; then | 	if [ "$INSECURE" = "yes" ]; then | ||||||
| 		dockerize \ | 		dockerize \ | ||||||
| 		-skip-tls-verify \ | 		-skip-tls-verify \ | ||||||
| @ -60,6 +61,7 @@ fi | |||||||
| 	dockerize \ | 	dockerize \ | ||||||
| 		-wait file:///etc/machine-id \ | 		-wait file:///etc/machine-id \ | ||||||
| 		-wait file:///var/lib/dbus/machine-id | 		-wait file:///var/lib/dbus/machine-id | ||||||
|  | fi | ||||||
| 
 | 
 | ||||||
| exec kwmbridged serve \ | exec kwmbridged serve \ | ||||||
| 	"$@" | 	"$@" | ||||||
|  | |||||||
| @ -2,7 +2,9 @@ ARG CODE_VERSION=1.2.0 | |||||||
| FROM kopano/kwmserverd:${CODE_VERSION} | FROM kopano/kwmserverd:${CODE_VERSION} | ||||||
| 
 | 
 | ||||||
| ARG CODE_VERSION | ARG CODE_VERSION | ||||||
| ENV CODE_VERSION="${CODE_VERSION}" | ENV \ | ||||||
|  |     AUTOCONFIGURE=true \ | ||||||
|  |     CODE_VERSION="${CODE_VERSION}" | ||||||
| 
 | 
 | ||||||
| LABEL maintainer=az@zok.xyz \ | LABEL maintainer=az@zok.xyz \ | ||||||
|     org.label-schema.name="Kopano Kwmserver container" \ |     org.label-schema.name="Kopano Kwmserver container" \ | ||||||
|  | |||||||
| @ -68,6 +68,7 @@ if [ -n "${public_guest_access_regexp:-}" ]; then | |||||||
| 	set -- "$@" --public-guest-access-regexp="$public_guest_access_regexp" | 	set -- "$@" --public-guest-access-regexp="$public_guest_access_regexp" | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
|  | if [ "${AUTOCONFIGURE}" = true ]; then | ||||||
| 	if [ "$INSECURE" = "yes" ]; then | 	if [ "$INSECURE" = "yes" ]; then | ||||||
| 		dockerize \ | 		dockerize \ | ||||||
| 		-skip-tls-verify \ | 		-skip-tls-verify \ | ||||||
| @ -83,6 +84,7 @@ fi | |||||||
| 	dockerize \ | 	dockerize \ | ||||||
| 		-wait file:///etc/machine-id \ | 		-wait file:///etc/machine-id \ | ||||||
| 		-wait file:///var/lib/dbus/machine-id | 		-wait file:///var/lib/dbus/machine-id | ||||||
|  | fi | ||||||
| 
 | 
 | ||||||
| registration_conf=${registration_conf:-/etc/kopano/kwmserverd-registration.yaml} | registration_conf=${registration_conf:-/etc/kopano/kwmserverd-registration.yaml} | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -5,12 +5,14 @@ ADDITIONAL_KOPANO_PACKAGES=${ADDITIONAL_KOPANO_PACKAGES:-""} | |||||||
| set -eu # unset variables are errors & non-zero return values exit the whole script | set -eu # unset variables are errors & non-zero return values exit the whole script | ||||||
| [ "$DEBUG" ] && set -x | [ "$DEBUG" ] && set -x | ||||||
| 
 | 
 | ||||||
|  | if [ "${AUTOCONFIGURE}" == true ]; then | ||||||
| 	# copy configuration files to /tmp/kopano to prevent modification of mounted config files | 	# copy configuration files to /tmp/kopano to prevent modification of mounted config files | ||||||
| 	mkdir -p /tmp/kopano | 	mkdir -p /tmp/kopano | ||||||
| 	cp /etc/kopano/*.cfg /tmp/kopano | 	cp /etc/kopano/*.cfg /tmp/kopano | ||||||
| 
 | 
 | ||||||
| 	echo "Applying cfg changes from env" | 	echo "Applying cfg changes from env" | ||||||
| 	/usr/bin/python3 /kopano/cfg-from-env.py | 	/usr/bin/python3 /kopano/cfg-from-env.py | ||||||
|  | fi | ||||||
| 
 | 
 | ||||||
| meetversion=$(dpkg-query --showformat='${Version}' --show kopano-meet-webapp) | meetversion=$(dpkg-query --showformat='${Version}' --show kopano-meet-webapp) | ||||||
| echo "Using Kopano Meet: $meetversion" | echo "Using Kopano Meet: $meetversion" | ||||||
| @ -21,6 +23,7 @@ if [ $# -gt 0 ]; then | |||||||
| 	exit | 	exit | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
|  | if [ "${AUTOCONFIGURE}" == true ]; then | ||||||
| 	cp /usr/share/doc/kopano-meet-webapp/config.json.in /tmp/meet.json | 	cp /usr/share/doc/kopano-meet-webapp/config.json.in /tmp/meet.json | ||||||
| 	CONFIG_JSON="/tmp/meet.json" | 	CONFIG_JSON="/tmp/meet.json" | ||||||
| 	echo "Updating $CONFIG_JSON" | 	echo "Updating $CONFIG_JSON" | ||||||
| @ -69,6 +72,7 @@ export $(grep -v '^#' /tmp/kweb-env | xargs -d '\n') | |||||||
| 	dockerize \ | 	dockerize \ | ||||||
| 		-wait file:///etc/machine-id \ | 		-wait file:///etc/machine-id \ | ||||||
| 		-wait file:///var/lib/dbus/machine-id | 		-wait file:///var/lib/dbus/machine-id | ||||||
|  | fi | ||||||
| 
 | 
 | ||||||
| # cleaning up env variables | # cleaning up env variables | ||||||
| unset "${!KCCONF_@}" | unset "${!KCCONF_@}" | ||||||
|  | |||||||
| @ -12,7 +12,7 @@ LABEL maintainer=az@zok.xyz \ | |||||||
|     org.label-schema.schema-version="1.0" |     org.label-schema.schema-version="1.0" | ||||||
| 
 | 
 | ||||||
| ENV \ | ENV \ | ||||||
|     AUTOCONFIG=yes \ |     AUTOCONFIGURE=true \ | ||||||
|     CODE_VERSION="${CODE_VERSION}" \ |     CODE_VERSION="${CODE_VERSION}" \ | ||||||
|     DEFAULTREDIRECT="/webapp" \ |     DEFAULTREDIRECT="/webapp" \ | ||||||
|     KONNECTPATH=kopanoid \ |     KONNECTPATH=kopanoid \ | ||||||
|  | |||||||
| @ -11,7 +11,7 @@ fi | |||||||
| export CADDYPATH="$KOPANO_KWEB_ASSETS_PATH" | export CADDYPATH="$KOPANO_KWEB_ASSETS_PATH" | ||||||
| 
 | 
 | ||||||
| # services need to be aware of the machine-id | # services need to be aware of the machine-id | ||||||
| if [ "$AUTOCONFIG" = "yes" ]; then | if [ "$AUTOCONFIGURE" = true ]; then | ||||||
| 	dockerize \ | 	dockerize \ | ||||||
| 		-wait file:///etc/machine-id \ | 		-wait file:///etc/machine-id \ | ||||||
| 		-wait file:///var/lib/dbus/machine-id | 		-wait file:///var/lib/dbus/machine-id | ||||||
|  | |||||||
| @ -9,6 +9,7 @@ ADDITIONAL_KOPANO_WEBAPP_PLUGINS=${ADDITIONAL_KOPANO_WEBAPP_PLUGINS:-""} | |||||||
| set -eu # unset variables are errors & non-zero return values exit the whole script | set -eu # unset variables are errors & non-zero return values exit the whole script | ||||||
| [ "$DEBUG" ] && set -x | [ "$DEBUG" ] && set -x | ||||||
| 
 | 
 | ||||||
|  | if [ "${AUTOCONFIGURE}" == true ]; then | ||||||
| 	# shellcheck source=php/start-helper.sh | 	# shellcheck source=php/start-helper.sh | ||||||
| 	source /kopano/start-helper.sh | 	source /kopano/start-helper.sh | ||||||
| 
 | 
 | ||||||
| @ -77,6 +78,7 @@ chown -R www-data:www-data /run/sessions /tmp/webapp /var/lib/kopano-webapp/tmp | |||||||
| 	#dockerize \ | 	#dockerize \ | ||||||
| 	#	-wait file:///etc/machine-id \ | 	#	-wait file:///etc/machine-id \ | ||||||
| 	#	-wait file:///var/lib/dbus/machine-id | 	#	-wait file:///var/lib/dbus/machine-id | ||||||
|  | fi | ||||||
| 
 | 
 | ||||||
| set +u | set +u | ||||||
| # cleaning up env variables | # cleaning up env variables | ||||||
|  | |||||||
| @ -1,8 +0,0 @@ | |||||||
| <VirtualHost *:80> |  | ||||||
| 	DocumentRoot /var/www/ |  | ||||||
| 
 |  | ||||||
| 	LogFormat "%{X-Forwarded-For}i %{%a %b %d %T %Y}t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy |  | ||||||
| 	ErrorLog "|/bin/cat" |  | ||||||
| 	CustomLog "|/bin/cat" proxy |  | ||||||
| 
 |  | ||||||
| </VirtualHost> |  | ||||||
| @ -39,6 +39,7 @@ php_cfg_gen() { | |||||||
| 	fi | 	fi | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | if [ "${AUTOCONFIGURE}" == true ]; then | ||||||
| 	# Hint: this is not compatible with a read-only container. | 	# Hint: this is not compatible with a read-only container. | ||||||
| 	# The general recommendation is to already build a container that has all required packages installed. | 	# The general recommendation is to already build a container that has all required packages installed. | ||||||
| 	ADDITIONAL_KOPANO_PACKAGES=$(echo "$ADDITIONAL_KOPANO_PACKAGES" | tr -d '"') | 	ADDITIONAL_KOPANO_PACKAGES=$(echo "$ADDITIONAL_KOPANO_PACKAGES" | tr -d '"') | ||||||
| @ -138,6 +139,7 @@ chown -R www-data:www-data /run/sessions | |||||||
| 	#dockerize \ | 	#dockerize \ | ||||||
| 	#	-wait file:///etc/machine-id \ | 	#	-wait file:///etc/machine-id \ | ||||||
| 	#	-wait file:///var/lib/dbus/machine-id | 	#	-wait file:///var/lib/dbus/machine-id | ||||||
|  | fi | ||||||
| 
 | 
 | ||||||
| echo "Activate z-push log rerouting" | echo "Activate z-push log rerouting" | ||||||
| mkdir -p /var/log/z-push/ | mkdir -p /var/log/z-push/ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user