aurweb/docker/nginx-entrypoint.sh
Kevin Morris 3ea515d705
fix(Docker): use cert chain for nginx
Additionally, simplify some of the certificate generation
scripts and rename `ca.ext` to `localhost.ext`.

Certificates should be regenerated as of this commit.
Users can run `rm -rf ./cache/*` to clear out any existing
certs, which will cause the `ca` service to regenerate them.

Additionally, since Docker infrastructure has been modified,
a new `aurweb:latest` image will need to be built.

See https://gitlab.archlinux.org/archlinux/aurweb/-/wikis/Docker

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-09-13 14:19:48 -07:00

21 lines
681 B
Bash
Executable file

#!/bin/bash
set -eou pipefail
# Setup a config for our mysql db.
cp -vf conf/config.dev conf/config
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config
sed -ri 's/^(host) = .+/\1 = mariadb/' conf/config
sed -ri 's/^(user) = .+/\1 = aur/' conf/config
sed -ri 's/^;?(password) = .+/\1 = aur/' conf/config
# Setup http(s) stuff.
sed -ri "s|^(aur_location) = .+|\1 = https://localhost:8444|" conf/config
sed -ri 's/^(disable_http_login) = .+/\1 = 1/' conf/config
cat /cache/localhost.cert.pem /cache/ca.root.pem \
> /etc/ssl/certs/localhost.cert.pem
cp -vf /cache/localhost.key.pem /etc/ssl/private/localhost.key.pem
cp -vf /docker/config/nginx.conf /etc/nginx/nginx.conf
exec "$@"