Added checks for the missing certificates

This should fix the nginx and cron supervisor "jobs"
This commit is contained in:
Alexander Trost
2015-10-18 11:46:00 +02:00
parent 821328a343
commit 0f865c1a19
5 changed files with 29 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ database:
- "/opt/docker/postgresql/dicts/en_us.dict:/usr/share/postgresql/9.4/tsearch_data/en_us.dict"
- "/opt/docker/postgresql/dicts/en_us.affix:/usr/share/postgresql/9.4/tsearch_data/en_us.affix"
- "/opt/docker/postgresql/dicts/zulip_english.stop:/usr/share/postgresql/9.4/tsearch_data/zulip_english.stop"
memcache:
memcached:
image: "quay.io/sameersbn/memcached:latest"
restart: always
rabbitmq:
@@ -31,13 +31,13 @@ zulip:
- "443:443"
links:
- database
- memcache
- memcached
- rabbitmq
- camo
- redis
environment:
DB_HOST: "database"
MEMCACHED_HOST: "memcache"
MEMCACHED_HOST: "memcached"
REDIS_HOST: "redis"
RABBITMQ_HOST: "rabbitmq"
ZULIP_USER_EMAIL: "example@example.com"

View File

@@ -120,6 +120,24 @@ secretsSetup(){
unset SECRET_KEY
}
zulipSetup(){
if [ ! -d "$DATA_DIR/certs" ]; then
echo "No certs given."
return 1
fi
if [ ! -e "/etc/ssl/private/zulip.key" ]; then
if [ ! -e "$DATA_DIR/certs/zulip.key" ]; then
echo "No zulip.key given in $DATA_DIR."
return 1
fi
ln -sfT "$DATA_DIR/certs/zulip.key" "/etc/ssl/private/zulip.key"
fi
if [ ! -e "/etc/ssl/certs/zulip.combined-chain.crt" ]; then
if [ ! -e "$DATA_DIR/certs/zulip.combined-chain.crt" ]; then
echo "No zulip.combined-chain.crt given in $DATA_DIR."
return 1
fi
ln -sfT "$DATA_DIR/certs/zulip.combined-chain.crt" "/etc/ssl/certs/zulip.combined-chain.crt"
fi
cat >> "$ZULIP_ZPROJECT_SETTINGS" <<EOF
CACHES = {
'default': {
@@ -250,7 +268,10 @@ if [ ! -f "$DATA_DIR/.initiated" ]; then
echo "Secrets generated and set."
echo "Setting Zulip settings ..."
# Setup zulip settings
zulipSetup
if ! zulipSetup; then
echo "Zulip setup failed."
exit 1
fi
echo "Zulip settings setup done."
echo "Setting up database settings and server ..."
# setup database

View File

@@ -1,5 +1,7 @@
user zulip;
daemon off;
worker_processes auto;
pid /var/run/nginx.pid;

View File

@@ -1,5 +1,5 @@
[program:cron]
command = /usr/sbin/cron -f
command = /usr/sbin/cron -f -L 15
stdout_events_enabled=true
stderr_events_enabled=true
autorestart = true

View File

@@ -1,4 +1,4 @@
[program:cron]
[program:nginx]
command = /usr/sbin/nginx
stdout_events_enabled=true
stderr_events_enabled=true