2023-08-28 18:25:32 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
. driglibash-base
|
|
|
|
|
|
|
|
JC_ENV=/etc/jeancloud.env
|
|
|
|
|
|
|
|
certs_path=/etc/letsencrypt/live
|
|
|
|
proxy_dir=/etc/nginx
|
|
|
|
|
|
|
|
cat > "$JC_ENV" <<EOF
|
|
|
|
proxy_dir='$proxy_dir'
|
|
|
|
nginx_conf_path='$proxy_dir/sites-enabled'
|
|
|
|
new_nginx_conf_path='$proxy_dir/new-sites-enabled'
|
|
|
|
certs_path='$certs_path'
|
|
|
|
dummy_cert_path='$certs_path/dummy'
|
2023-09-15 08:57:47 +00:00
|
|
|
servicefile=/docker/services.txt
|
2023-08-28 18:25:32 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
for dir in /docker/* ; do
|
|
|
|
service="$(basename "$dir")"
|
|
|
|
[ ! -d "$dir" ] && continue
|
|
|
|
|
|
|
|
line_in_file "HTTP_DIR='/srv/http/$service'" "/docker/$service/.env"
|
|
|
|
line_in_file "DATA_DIR='/data/$service'" "/docker/$service/.env"
|
|
|
|
line_in_file "DOCKER_DIR='/docker/$service'" "/docker/$service/.env"
|
|
|
|
line_in_file "JC_SERVICE='$service'" "/docker/$service/.env"
|
2023-09-29 07:51:22 +00:00
|
|
|
line_in_file "JC_CERT='/data/dnscerts.jean-cloud.org/certs/live/$service'" "/docker/$service/.env"
|
2023-08-28 18:25:32 +00:00
|
|
|
done
|