feat: add WireGuard VPS setup automation script (#2810)

* feat: add WireGuard VPS setup automation script

Adds a comprehensive bash script that automates:
- SSH key setup and authentication
- WireGuard installation on remote VPS
- Configuration download and import to NetworkManager
- User-friendly CLI interface with validation
- Detailed status messages and error handling
- Instructions for exposing services via ACME/Let's Encrypt

* use cat heredoc for issue files to fix formatting

Replaces echo with cat heredoc when writing to /etc/issue and /etc/issue.net to properly preserve escape sequences and prevent unwanted newlines in login prompts.

* add convent `wg-vps-setup` symlink to PATH

* sync ssh privkey on init

* Update default ssh key location

* simplify to use existing StartOS SSH keys and fix .ssh permission

* finetune

* Switch to start9labs repo

* rename some files

* set correct ownership

---------

Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
Mariusz Kogen
2025-01-23 00:53:31 +01:00
committed by GitHub
parent baa4c1fd25
commit 2aaae5265a
7 changed files with 438 additions and 36 deletions

14
debian/postinst vendored
View File

@@ -26,8 +26,12 @@ if [ -f /etc/default/grub ]; then
fi
# set local and remote login prompt
echo "StartOS v$(cat /usr/lib/startos/VERSION.txt) [\\m] on \\n.local (\\l)" > /etc/issue
echo "StartOS v$(cat /usr/lib/startos/VERSION.txt)" > /etc/issue.net
cat << EOF > /etc/issue
StartOS v$(cat /usr/lib/startos/VERSION.txt) [\\m] on \\n.local (\\l)
EOF
cat << EOF > /etc/issue.net
StartOS v$(cat /usr/lib/startos/VERSION.txt)
EOF
# change timezone
rm -f /etc/localtime
@@ -102,8 +106,10 @@ CookieAuthentication 1
EOF
rm -rf /var/lib/tor/*
ln -sf /usr/lib/startos/scripts/tor-check.sh /usr/bin/tor-check
ln -sf /usr/lib/startos/scripts/gather_debug_info.sh /usr/bin/gather-debug
ln -sf /usr/lib/startos/scripts/chroot-and-upgrade /usr/bin/chroot-and-upgrade
ln -sf /usr/lib/startos/scripts/tor-check /usr/bin/tor-check
ln -sf /usr/lib/startos/scripts/gather-debug-info /usr/bin/gather-debug-info
ln -sf /usr/lib/startos/scripts/wg-vps-setup /usr/bin/wg-vps-setup
echo "fs.inotify.max_user_watches=1048576" > /etc/sysctl.d/97-startos.conf