diff --git a/id.tjo.space/install.sh b/id.tjo.space/install.sh index 1fcdfb3..fc150a3 100755 --- a/id.tjo.space/install.sh +++ b/id.tjo.space/install.sh @@ -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 diff --git a/id.tjo.space/terraform/main.tf b/id.tjo.space/terraform/main.tf index 89843aa..c6a7378 100644 --- a/id.tjo.space/terraform/main.tf +++ b/id.tjo.space/terraform/main.tf @@ -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