diff --git a/infra/firewall.tf b/infra/firewall.tf index 1a1d8c5..e156549 100644 --- a/infra/firewall.tf +++ b/infra/firewall.tf @@ -1,6 +1,24 @@ resource "hcloud_firewall" "prod" { name= "prod" + rule { + direction ="in" + protocol = "icmp" + source_ips = [ + "0.0.0.0/0", + "::/0" + ] + } + rule { + direction ="in" + protocol = "udp" + port = "51820" + source_ips = [ + "0.0.0.0/0", + "::/0" + ] + } + rule { direction ="in" protocol = "tcp" port = "80" @@ -18,28 +36,11 @@ resource "hcloud_firewall" "prod" { "::/0" ] } - # torrent UDH port - rule { - direction ="in" - protocol = "udp" - port = "6881" - source_ips = [ - "0.0.0.0/0", - "::/0" - ] - } - # wireguard port - rule { - direction ="in" - protocol = "udp" - port = "51820" - source_ips = [ - "0.0.0.0/0", - "::/0" - ] +} - } -# torrent listen port + +resource "hcloud_firewall" "torrent" { + name = "torrent" rule { direction ="in" protocol = "tcp" @@ -50,9 +51,10 @@ resource "hcloud_firewall" "prod" { ] } - rule { + rule { direction ="in" - protocol = "icmp" + protocol = "udp" + port = "6881" source_ips = [ "0.0.0.0/0", "::/0" diff --git a/infra/server.tf b/infra/server.tf index 8c83ab3..ad9a704 100644 --- a/infra/server.tf +++ b/infra/server.tf @@ -8,6 +8,7 @@ resource "hcloud_server" "HomeLab2" { firewall_ids = [ hcloud_firewall.prod.id, hcloud_firewall.Gitea_SSH.id, + hcloud_firewall.torrent.id, hcloud_firewall.mail.id, ] labels = {