mirror of
https://github.com/zokradonh/kopano-docker
synced 2025-06-07 07:56:12 +00:00
make webapp container start
first start with caddyfile Signed-off-by: Felix Bartels <felix@host-consultants.de>
This commit is contained in:
parent
51af427dce
commit
8db1dc5488
@ -0,0 +1,11 @@
|
||||
webapp.kopano.demo {
|
||||
|
||||
tls self_signed
|
||||
|
||||
redir / /webapp
|
||||
|
||||
proxy /webapp kwebapp:80 {
|
||||
transparent
|
||||
websocket
|
||||
}
|
||||
}
|
@ -1,20 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# define default value for serverhostname and serverport of not passed into container
|
||||
KCCONF_SERVERHOSTNAME=${KCCONF_SERVERHOSTNAME:-127.0.0.1}
|
||||
KCCONF_SERVERPORT=${KCCONF_SERVERPORT:-237}
|
||||
|
||||
set -eu # unset variables are errors & non-zero return values exit the whole script
|
||||
|
||||
echo "Ensure directories"
|
||||
mkdir -p /run/sessions /tmp/webapp
|
||||
mkdir -p /run/sessions /tmp/webapp
|
||||
|
||||
echo "Configure webapp"
|
||||
sed -e "s#define(\"DEFAULT_SERVER\",\s*\".*\"#define(\"DEFAULT_SERVER\", \"https://${KCCONF_SERVERHOSTNAME}:${KCCONF_SERVERPORT}/kopano\"#" \
|
||||
if [ "$KCCONF_SERVERHOSTNAME" == "127.0.0.1" ]; then
|
||||
echo "Kopano WebApp is using the default: connection"
|
||||
else
|
||||
echo "Kopano WebApp is using an ip connection"
|
||||
sed -e "s#define(\"DEFAULT_SERVER\",\s*\".*\"#define(\"DEFAULT_SERVER\", \"https://${KCCONF_SERVERHOSTNAME}:${KCCONF_SERVERPORT}/kopano\"#" \
|
||||
-i /etc/kopano/webapp/config.php
|
||||
fi
|
||||
|
||||
# TODO is enabling this really neccesary when reverse proxying webapp?
|
||||
echo "Configuring Kopano WebApp for use behind a reverse proxy"
|
||||
sed \
|
||||
-e "s#define(\"INSECURE_COOKIES\",\s*.*)#define(\"INSECURE_COOKIES\", true)#" \
|
||||
-i /etc/kopano/webapp/config.php
|
||||
|
||||
echo "Configure z-push"
|
||||
sed -e "s#define([\"']MAPI_SERVER[\"'],\s*[\"']default:[\"'])#define('MAPI_SERVER', 'https://${KCCONF_SERVERHOSTNAME}:${KCCONF_SERVERPORT}/kopano')#" \
|
||||
-i /etc/z-push/kopano.conf.php
|
||||
if [ "$KCCONF_SERVERHOSTNAME" == "127.0.0.1" ]; then
|
||||
echo "Z-Push is using the default: connection"
|
||||
else
|
||||
echo "Z-Push is using an ip connection"
|
||||
sed -e "s#define([\"']MAPI_SERVER[\"'],\s*[\"']default:[\"'])#define('MAPI_SERVER', 'https://${KCCONF_SERVERHOSTNAME}:${KCCONF_SERVERPORT}/kopano')#" \
|
||||
-i /etc/z-push/kopano.conf.php
|
||||
fi
|
||||
|
||||
echo "Configuring Z-Push for use behind a reverse proxy"
|
||||
sed -e "s#define([\"']USE_CUSTOM_REMOTE_IP_HEADER[\"'],\s*false)#define('USE_CUSTOM_REMOTE_IP_HEADER', true)#" \
|
||||
-i /etc/z-push/z-push.conf.php
|
||||
-i /etc/z-push/z-push.conf.php
|
||||
|
||||
echo "Ensure config ownership"
|
||||
chown -R www-data:www-data /run/sessions /tmp/webapp
|
||||
|
Loading…
x
Reference in New Issue
Block a user