Skip to content

Commit

Permalink
Symlink vast certificate, no copy
Browse files Browse the repository at this point in the history
  • Loading branch information
robballantyne committed Aug 5, 2024
1 parent a5f860e commit 113e874
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions build/COPY_ROOT_0/opt/ai-dock/bin/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ init_set_web_credentials() {

# 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
rm -f /opt/caddy/tls/container.*
ln -sf /etc/instance.crt /opt/caddy/tls/container.crt
ln -sf /etc/instance.key /opt/caddy/tls/container.key
fi

if [[ -z $WEB_USER ]]; then
Expand Down
2 changes: 1 addition & 1 deletion build/COPY_ROOT_0/opt/ai-dock/bin/supervisor-caddy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function start() {
port_files="/run/http_ports/*"

# 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
if [[ ${WEB_ENABLE_HTTPS,,} == true && -s $(realpath /opt/caddy/tls/container.crt) && -s $(realpath /opt/caddy/tls/container.key) ]]; then
export CADDY_TLS_ELEVATION_STRING=$'http_redirect\ntls'
export CADDY_TLS_LISTEN_STRING="tls /opt/caddy/tls/container.crt /opt/caddy/tls/container.key"
fi
Expand Down

0 comments on commit 113e874

Please sign in to comment.