Skip to content

Commit

Permalink
Handle race condition causing quicktunnels to start without TLS suppo…
Browse files Browse the repository at this point in the history
…rt if available
  • Loading branch information
robballantyne committed Aug 4, 2024
1 parent 4bde918 commit a5f860e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions build/COPY_ROOT_0/opt/ai-dock/bin/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ init_set_web_credentials() {
fi
fi

# Vast.ai TLS certificates
if [[ -f /etc/instance.crt && -f /etc/instance.key ]]; then
cp /etc/instance.crt /opt/caddy/tls/container.crt
cp /etc/instance.key /opt/caddy/tls/container.key
fi

if [[ -z $WEB_USER ]]; then
export WEB_USER=user
fi
Expand Down
6 changes: 0 additions & 6 deletions build/COPY_ROOT_0/opt/ai-dock/bin/supervisor-caddy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ function start() {

port_files="/run/http_ports/*"

# Vast.ai certificates
if [[ -f /etc/instance.crt && -f /etc/instance.key ]]; then
cp /etc/instance.crt /opt/caddy/tls/container.crt
cp /etc/instance.key /opt/caddy/tls/container.key
fi

# Upgrade http to https on the same port
if [[ ${WEB_ENABLE_HTTPS,,} == true && -f /opt/caddy/tls/container.crt && /opt/caddy/tls/container.key ]]; then
export CADDY_TLS_ELEVATION_STRING=$'http_redirect\ntls'
Expand Down

0 comments on commit a5f860e

Please sign in to comment.