feat(id.tjo.space): changes

This commit is contained in:
Tine 2025-03-06 20:10:20 +01:00
parent 4651a73e6d
commit a81ea0cdd9
Signed by: mentos1386
SSH key fingerprint: SHA256:MNtTsLbihYaWF8j1fkOHfkKNlnN1JQfxEU/rBU8nCGw
2 changed files with 13 additions and 26 deletions
id.tjo.space

View file

@ -1,12 +1,6 @@
#!/bin/bash
set -euo pipefail
if [[ $EUID -eq 0 ]]; then
echo "$0 is being run as root. Please run as a regular user." 1>&2
exit 2
fi
##
echo "== Fetch Source Code (from git)"
cd "$HOME/service"
# Clone if not yet cloned
@ -23,21 +17,14 @@ else
git reset --hard origin/main
fi
function provision() {
##
echo "=== Installing Dependencies"
apt update -y
apt install -y \
git \
podman
echo "=== Installing Dependencies"
apt update -y
apt install -y \
git \
podman
##
echo "=== Configure Firewall"
ufw allow 22/tcp # SSH
ufw allow 443/tcp # HTTPS
ufw allow 636/tcp # LDAPS
ufw enable
}
echo "=== Provision the System (as root)"
sudo -u root bash -c "$(declare -f provision); provision"
echo "=== Configure Firewall"
ufw allow 22/tcp # SSH
ufw allow 443/tcp # HTTPS
ufw allow 636/tcp # LDAPS
ufw enable

View file

@ -40,7 +40,7 @@ resource "hcloud_server" "main" {
filename: /swapfile
size: 512M
runcmd:
- su ubuntu -c "bash <(curl -s https://raw.githubusercontent.com/tjo-space/tjo-space-infrastructure/refs/heads/main/install.sh)"
- bash <(curl -s https://raw.githubusercontent.com/tjo-space/tjo-space-infrastructure/refs/heads/main/install.sh)
EOF
}
@ -48,7 +48,7 @@ resource "dnsimple_zone_record" "a" {
for_each = toset(var.nodes)
zone_name = "tjo.space"
name = "id.tjo.space"
name = "next.id"
value = hcloud_server.main[each.key].ipv4_address
type = "A"
ttl = 300
@ -58,7 +58,7 @@ resource "dnsimple_zone_record" "aaaa" {
for_each = toset(var.nodes)
zone_name = "tjo.space"
name = "id.tjo.space"
name = "next.id"
value = hcloud_server.main[each.key].ipv6_address
type = "AAAA"
ttl = 300