Enable WireGuard service, change HTTPFetchClient to use wireguard proxy, and add required env vars
All checks were successful
Build And Deploy / build-and-deploy (push) Successful in 1m22s
All checks were successful
Build And Deploy / build-and-deploy (push) Successful in 1m22s
Add WireGuard-related env variables to .env.example (addresses, keys, endpoint, DNS) Resolve WIREGUARD_ENDPOINT_HOST to WIREGUARD_ENDPOINT_IP in cicd/scripts/deploy.sh and write it to .env, failing if unresolved Un-comment and enable the wireguard service in docker-compose.yml Remove an obsolete commented workflow snippet
This commit is contained in:
parent
3b64839cbd
commit
1fbcbf772a
10 changed files with 106 additions and 57 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
#######################
|
||||
# VARIABLES #
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
#######################
|
||||
# VARIABLES #
|
||||
|
|
@ -16,7 +17,7 @@ echo "${SSH_KNOWN_HOST}" > ${HOME}/.ssh/known_hosts-${SSH_HOST//./_}
|
|||
chmod -R 600 ${HOME}/.ssh/
|
||||
chmod 700 ${HOME}/.ssh
|
||||
|
||||
grep -q "Host ${SSH_HOST}" ${HOME}/.ssh/config || cat >> ${HOME}/.ssh/config <<EOF
|
||||
grep -q "Host ${SSH_HOST}" ${HOME}/.ssh/config 2>&1 1>/dev/null || cat >> ${HOME}/.ssh/config <<EOF
|
||||
Host ${SSH_HOST}
|
||||
HostName ${SSH_HOST}
|
||||
User ${SSH_USER}
|
||||
|
|
@ -32,6 +33,10 @@ Host ${SSH_HOST}
|
|||
ServerAliveInterval 10
|
||||
EOF
|
||||
|
||||
WIREGUARD_ENDPOINT_IP=$(dig +short $WIREGUARD_ENDPOINT_HOST | tail -n1)
|
||||
[[ -z ${WIREGUARD_ENDPOINT_IP} ]] && echo "Failed to resolve IP address for WIREGUARD_ENDPOINT_HOST" >&2 && exit 1
|
||||
echo "WIREGUARD_ENDPOINT_IP=${WIREGUARD_ENDPOINT_IP}" >> .env
|
||||
|
||||
DOCKER_HOST=ssh://${SSH_HOST} docker load -i ${IMAGE_FILENAME}
|
||||
|
||||
ssh ${SSH_HOST} "mkdir -p /srv/${IMAGE_NAME#*/}/"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue