feat(id.tjo.space): changes
This commit is contained in:
parent
4651a73e6d
commit
a81ea0cdd9
2 changed files with 13 additions and 26 deletions
id.tjo.space
|
@ -1,12 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
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)"
|
echo "== Fetch Source Code (from git)"
|
||||||
cd "$HOME/service"
|
cd "$HOME/service"
|
||||||
# Clone if not yet cloned
|
# Clone if not yet cloned
|
||||||
|
@ -23,21 +17,14 @@ else
|
||||||
git reset --hard origin/main
|
git reset --hard origin/main
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function provision() {
|
echo "=== Installing Dependencies"
|
||||||
##
|
apt update -y
|
||||||
echo "=== Installing Dependencies"
|
apt install -y \
|
||||||
apt update -y
|
git \
|
||||||
apt install -y \
|
podman
|
||||||
git \
|
|
||||||
podman
|
|
||||||
|
|
||||||
##
|
echo "=== Configure Firewall"
|
||||||
echo "=== Configure Firewall"
|
ufw allow 22/tcp # SSH
|
||||||
ufw allow 22/tcp # SSH
|
ufw allow 443/tcp # HTTPS
|
||||||
ufw allow 443/tcp # HTTPS
|
ufw allow 636/tcp # LDAPS
|
||||||
ufw allow 636/tcp # LDAPS
|
ufw enable
|
||||||
ufw enable
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "=== Provision the System (as root)"
|
|
||||||
sudo -u root bash -c "$(declare -f provision); provision"
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ resource "hcloud_server" "main" {
|
||||||
filename: /swapfile
|
filename: /swapfile
|
||||||
size: 512M
|
size: 512M
|
||||||
runcmd:
|
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
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ resource "dnsimple_zone_record" "a" {
|
||||||
for_each = toset(var.nodes)
|
for_each = toset(var.nodes)
|
||||||
|
|
||||||
zone_name = "tjo.space"
|
zone_name = "tjo.space"
|
||||||
name = "id.tjo.space"
|
name = "next.id"
|
||||||
value = hcloud_server.main[each.key].ipv4_address
|
value = hcloud_server.main[each.key].ipv4_address
|
||||||
type = "A"
|
type = "A"
|
||||||
ttl = 300
|
ttl = 300
|
||||||
|
@ -58,7 +58,7 @@ resource "dnsimple_zone_record" "aaaa" {
|
||||||
for_each = toset(var.nodes)
|
for_each = toset(var.nodes)
|
||||||
|
|
||||||
zone_name = "tjo.space"
|
zone_name = "tjo.space"
|
||||||
name = "id.tjo.space"
|
name = "next.id"
|
||||||
value = hcloud_server.main[each.key].ipv6_address
|
value = hcloud_server.main[each.key].ipv6_address
|
||||||
type = "AAAA"
|
type = "AAAA"
|
||||||
ttl = 300
|
ttl = 300
|
||||||
|
|
Loading…
Reference in a new issue