fix: various minor bugs
This commit is contained in:
parent
7d9241c000
commit
db4f5eca5f
5 changed files with 11 additions and 6 deletions
|
@ -10,3 +10,4 @@ COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint
|
COPY entrypoint.sh /entrypoint
|
||||||
ENTRYPOINT [ "sh", "/entrypoint" ]
|
ENTRYPOINT [ "sh", "/entrypoint" ]
|
||||||
|
CMD [ "nginx", "-g", "daemon off;" ]
|
|
@ -18,6 +18,8 @@ server {
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
|
|
||||||
|
# SSL will be managed by certbot, no need to insert SSL config.
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://$host$request_uri;
|
proxy_pass http://$host$request_uri;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
trap exit TERM
|
trap exit TERM
|
||||||
|
|
||||||
if [ -n "${CERTBOT_DOMAINS}" ]; then
|
if [ -n "${CERTBOT_DOMAINS}" ]; then
|
||||||
|
sleep 5
|
||||||
echo "registering domains..."
|
echo "registering domains..."
|
||||||
|
|
||||||
certbot --nginx -n --agree-tos \
|
certbot --nginx -n --agree-tos \
|
||||||
|
@ -12,11 +13,10 @@ if [ -n "${CERTBOT_DOMAINS}" ]; then
|
||||||
while :; do
|
while :; do
|
||||||
echo "renewing domains..."
|
echo "renewing domains..."
|
||||||
certbot --nginx -n renew
|
certbot --nginx -n renew
|
||||||
nginx -s reload
|
|
||||||
sleep 12h & wait $!
|
sleep 12h & wait $!
|
||||||
done &
|
done &
|
||||||
else
|
else
|
||||||
echo "skipping certbot due to no domains!"
|
echo "skipping certbot due to no domains!"
|
||||||
fi
|
fi &
|
||||||
|
|
||||||
exec nginx -g "daemon off;"
|
exec "$@"
|
|
@ -3,5 +3,6 @@
|
||||||
if ! [ -d "servers/${1:-$HOSTNAME}" ]; then
|
if ! [ -d "servers/${1:-$HOSTNAME}" ]; then
|
||||||
echo "setting up servers/${1:-$HOSTNAME}..."
|
echo "setting up servers/${1:-$HOSTNAME}..."
|
||||||
cp -r servers/skel/. servers/${1:-$HOSTNAME}
|
cp -r servers/skel/. servers/${1:-$HOSTNAME}
|
||||||
|
sed -i "s/localhost/${1:-$HOSTNAME}.ixvd.net/g" servers/${1:-$HOSTNAME}/docker-compose.d/custom/nginx/conf.d/default.conf
|
||||||
echo "server configuration for \`${1:-$HOSTNAME}\`." >servers/${1:-$HOSTNAME}/README.md
|
echo "server configuration for \`${1:-$HOSTNAME}\`." >servers/${1:-$HOSTNAME}/README.md
|
||||||
fi
|
fi
|
|
@ -7,5 +7,6 @@ if grep -q "debian" /etc/os-release; then
|
||||||
cifs-utils \
|
cifs-utils \
|
||||||
restic \
|
restic \
|
||||||
docker.io \
|
docker.io \
|
||||||
docker-compose
|
docker-compose \
|
||||||
|
apparmor
|
||||||
fi
|
fi
|
Loading…
Reference in a new issue