From 198ae322c4577c7a5e199a68fdab24b850bc685e Mon Sep 17 00:00:00 2001 From: Muaz Ahmad Date: Wed, 6 Sep 2023 14:13:14 +0500 Subject: [PATCH] Add base wireguard config + nginx config --- bash_scripts/cloud-init-populate.sh | 3 ++- basic_configs/debian-hetzner-init.yaml | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bash_scripts/cloud-init-populate.sh b/bash_scripts/cloud-init-populate.sh index 91b62a1..393a9f1 100755 --- a/bash_scripts/cloud-init-populate.sh +++ b/bash_scripts/cloud-init-populate.sh @@ -5,8 +5,9 @@ PUB_KEYS=($(ls ~/.ssh/*.pub | xargs -d '\n' -n 1 basename)) set -a WRAPPER_SCRIPT=$(base64 $BASE_DIR/bash_scripts/ddns-acme-porkbun.sh -w 0) DDNS_SCRIPT=$(base64 $BASE_DIR/python_scripts/ddns-porkbun.py -w 0) +WG_CONF_BASE=$(base64 $BASE_DIR/basic_configs/wg_base.conf -w 0) +NGINX_CONF=$(base64 $BASE_DIR/basic_configs/nginx-vps/nginx.conf -w 0) read -p "VPS Username: " TARGET_USERNAME -echo $PUB_KEYS select key_file in $PUB_KEYS do SSH_PUB_KEY=$(cat ~/.ssh/$key_file) diff --git a/basic_configs/debian-hetzner-init.yaml b/basic_configs/debian-hetzner-init.yaml index ffac496..fea39b7 100644 --- a/basic_configs/debian-hetzner-init.yaml +++ b/basic_configs/debian-hetzner-init.yaml @@ -52,6 +52,14 @@ write-files: owner: root:root path: /usr/local/bin/ddns-acme-porkbun.timer permissions: '0644' + - encoding: b64 + content: ${WG_CONF_BASE} + owner: root:root + path: /etc/wireguard/wg0.conf + permissions: '0600' + - encoding: b64 + content: ${NGINX_CONF} + owner: root:root + path: /etc/nginx/nginx.conf + permissions: '0644' -runcmd: - - reboot