mirror of
https://github.com/zokradonh/kopano-docker.git
synced 2026-08-20 21:03:06 +00:00
Add example to run meet standalone (#90)
* refactor ssl generation make ssl certificate names match container names add dns names to certificates * add example to run meet and its dependencies together with an existing kopano * update webapp example * remove port numbers from ssl cert as these could have been specified in a demo environment * set default values for HTTP, HTTPS and EMAIL fail if FQDN is unset make smtp and kopano-server ports configurable * add hint about 2015 to setup.sh * also add new defaults to webapp compose * add example for standalone core as well
This commit is contained in:
+28
-15
@@ -2,28 +2,37 @@
|
||||
|
||||
mkdir -p /kopano/ssl/clients/
|
||||
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# clean out any potential port numbers
|
||||
FQDN=${FQDN%:*}
|
||||
|
||||
if [ ! -f /kopano/ssl/ca.pem ]; then
|
||||
# https://github.com/google/easypki
|
||||
echo "Creating CA and server certificates..."
|
||||
echo "Creating CA certificate..."
|
||||
easypki create --filename internalca --organizational-unit primary --expire 3650 --ca "Internal Kopano System"
|
||||
|
||||
for s in kserver kdagent kmonitor ksearch kspooler kwebapp; do
|
||||
easypki create --ca-name internalca --organizational-unit $s --expire 3650 $s
|
||||
cp /kopano/easypki/internalca/keys/$s.key /kopano/ssl/$s.pem.tmp
|
||||
cat /kopano/easypki/internalca/certs/$s.crt >> /kopano/ssl/$s.pem.tmp
|
||||
openssl x509 -in /kopano/easypki/internalca/certs/$s.crt -pubkey -noout > /kopano/ssl/clients/$s-public.pem.tmp
|
||||
mv /kopano/ssl/$s.pem.tmp /kopano/ssl/$s.pem
|
||||
mv /kopano/ssl/clients/$s-public.pem.tmp /kopano/ssl/clients/$s-public.pem
|
||||
done
|
||||
|
||||
cp /kopano/easypki/internalca/certs/internalca.crt /kopano/ssl/ca.pem.tmp
|
||||
mv /kopano/ssl/ca.pem.tmp /kopano/ssl/ca.pem
|
||||
|
||||
for s in kopano_server kopano_dagent kopano_monitor kopano_search kopano_spooler kopano_webapp; do
|
||||
if [ ! -f /kopano/ssl/$s.pem ]; then
|
||||
echo "Creating $s certificate..."
|
||||
easypki create --ca-name internalca --organizational-unit $s --expire 3650 --dns $s --dns $FQDN $s
|
||||
cp /kopano/easypki/internalca/keys/$s.key /kopano/ssl/$s.pem.tmp
|
||||
cat /kopano/easypki/internalca/certs/$s.crt >> /kopano/ssl/$s.pem.tmp
|
||||
openssl x509 -in /kopano/easypki/internalca/certs/$s.crt -pubkey -noout > /kopano/ssl/clients/$s-public.pem.tmp
|
||||
mv /kopano/ssl/$s.pem.tmp /kopano/ssl/$s.pem
|
||||
mv /kopano/ssl/clients/$s-public.pem.tmp /kopano/ssl/clients/$s-public.pem
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Konnect - create encryption key if not already present
|
||||
enckey="/kopano/ssl/konnectd-encryption.key"
|
||||
if [ ! -f $enckey ]; then
|
||||
echo "creating new encryption key"
|
||||
echo "Creating Konnect encryption key..."
|
||||
openssl rand -out $enckey.tmp 32
|
||||
mv $enckey.tmp $enckey
|
||||
fi
|
||||
@@ -31,8 +40,8 @@ fi
|
||||
# Konnect - create token signing key if not already present
|
||||
signkey="/kopano/ssl/konnectd-tokens-signing-key.pem"
|
||||
if [ ! -f $signkey ]; then
|
||||
echo "creating new token signing key"
|
||||
openssl genpkey -algorithm RSA -out $signkey.tmp -pkeyopt rsa_keygen_bits:4096
|
||||
echo "Creating Konnect token signing key..."
|
||||
openssl genpkey -algorithm RSA -out $signkey.tmp -pkeyopt rsa_keygen_bits:4096 2&> /dev/null
|
||||
chmod go+r $signkey.tmp
|
||||
mv $signkey.tmp $signkey
|
||||
fi
|
||||
@@ -40,9 +49,13 @@ fi
|
||||
# Kapi
|
||||
secretkey="/kopano/ssl/kapid-pubs-secret.key"
|
||||
if [ ! -f $secretkey ]; then
|
||||
echo "Creating Kapi secret key..."
|
||||
openssl rand -out $secretkey.tmp -hex 64
|
||||
mv $secretkey.tmp $secretkey
|
||||
fi
|
||||
|
||||
ls -l /kopano/ssl/*.pem
|
||||
ls -l /kopano/ssl/*.key
|
||||
echo "SSL certs:"
|
||||
ls -l /kopano/ssl/*.*
|
||||
|
||||
echo "Client public keys:"
|
||||
ls -l /kopano/ssl/clients/*
|
||||
|
||||
Reference in New Issue
Block a user