mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
24 lines
638 B
Bash
Executable file
24 lines
638 B
Bash
Executable file
#!/bin/bash
|
|
set -eou pipefail
|
|
|
|
# If production.{cert,key}.pem exists, prefer them. This allows
|
|
# user customization of the certificates that FastAPI uses.
|
|
# Otherwise, fallback to localhost.{cert,key}.pem, generated by `ca`.
|
|
|
|
CERT=/data/production.cert.pem
|
|
KEY=/data/production.key.pem
|
|
|
|
DEST_CERT=/etc/ssl/certs/web.cert.pem
|
|
DEST_KEY=/etc/ssl/private/web.key.pem
|
|
|
|
if [ -f "$CERT" ]; then
|
|
cp -vf "$CERT" "$DEST_CERT"
|
|
cp -vf "$KEY" "$DEST_KEY"
|
|
else
|
|
cat /data/localhost.cert.pem /data/root_ca.crt > "$DEST_CERT"
|
|
cp -vf /data/localhost.key.pem "$DEST_KEY"
|
|
fi
|
|
|
|
cp -vf /docker/config/nginx.conf /etc/nginx/nginx.conf
|
|
|
|
exec "$@"
|