forked from Deuxfleurs/infrastructure
Switch Matrix+Plume to IPv6, Add Trusted Net to ip6tables
This commit is contained in:
parent
aba3ba723c
commit
03680a992b
4 changed files with 40 additions and 20 deletions
|
@ -16,7 +16,7 @@ DATABASE_URL=postgres://plume:{{ key "secrets/plume/pgsql_pw" | trimSpace }}@psq
|
||||||
MIGRATION_DIRECTORY=migrations/postgres
|
MIGRATION_DIRECTORY=migrations/postgres
|
||||||
|
|
||||||
USE_HTTPS=0
|
USE_HTTPS=0
|
||||||
ROCKET_ADDRESS=0.0.0.0
|
ROCKET_ADDRESS=::
|
||||||
ROCKET_PORT=7878
|
ROCKET_PORT=7878
|
||||||
|
|
||||||
MEDIA_UPLOAD_DIRECTORY=/app/static/media
|
MEDIA_UPLOAD_DIRECTORY=/app/static/media
|
||||||
|
|
|
@ -9,11 +9,8 @@ job "im" {
|
||||||
|
|
||||||
config {
|
config {
|
||||||
image = "superboum/amd64_synapse:v36"
|
image = "superboum/amd64_synapse:v36"
|
||||||
|
network_mode = "host"
|
||||||
readonly_rootfs = true
|
readonly_rootfs = true
|
||||||
port_map {
|
|
||||||
client_port = 8008
|
|
||||||
federation_port = 8448
|
|
||||||
}
|
|
||||||
command = "python"
|
command = "python"
|
||||||
args = [
|
args = [
|
||||||
"-m", "synapse.app.homeserver",
|
"-m", "synapse.app.homeserver",
|
||||||
|
@ -95,16 +92,12 @@ job "im" {
|
||||||
resources {
|
resources {
|
||||||
cpu = 1000
|
cpu = 1000
|
||||||
memory = 4000
|
memory = 4000
|
||||||
network {
|
|
||||||
port "client_port" { }
|
|
||||||
port "federation_port" { }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
service {
|
service {
|
||||||
name = "synapse-client"
|
name = "synapse-client"
|
||||||
port = "client_port"
|
port = 8008
|
||||||
address_mode = "host"
|
address_mode = "driver"
|
||||||
tags = [
|
tags = [
|
||||||
"matrix",
|
"matrix",
|
||||||
"traefik.enable=true",
|
"traefik.enable=true",
|
||||||
|
@ -115,7 +108,8 @@ job "im" {
|
||||||
]
|
]
|
||||||
check {
|
check {
|
||||||
type = "tcp"
|
type = "tcp"
|
||||||
port = "client_port"
|
port = 8008
|
||||||
|
address_mode = "driver"
|
||||||
interval = "60s"
|
interval = "60s"
|
||||||
timeout = "5s"
|
timeout = "5s"
|
||||||
check_restart {
|
check_restart {
|
||||||
|
@ -128,8 +122,8 @@ job "im" {
|
||||||
|
|
||||||
service {
|
service {
|
||||||
name = "synapse-federation"
|
name = "synapse-federation"
|
||||||
port = "federation_port"
|
port = 8448
|
||||||
address_mode = "host"
|
address_mode = "driver"
|
||||||
tags = [
|
tags = [
|
||||||
"matrix",
|
"matrix",
|
||||||
"traefik.enable=true",
|
"traefik.enable=true",
|
||||||
|
|
|
@ -13,9 +13,7 @@ job "plume" {
|
||||||
driver = "docker"
|
driver = "docker"
|
||||||
config {
|
config {
|
||||||
image = "superboum/plume:v1"
|
image = "superboum/plume:v1"
|
||||||
port_map {
|
network_mode = "host"
|
||||||
web_port = 7878
|
|
||||||
}
|
|
||||||
#command = "cat"
|
#command = "cat"
|
||||||
#args = [ "/dev/stdout" ]
|
#args = [ "/dev/stdout" ]
|
||||||
volumes = [
|
volumes = [
|
||||||
|
@ -51,11 +49,12 @@ job "plume" {
|
||||||
"traefik.frontend.entryPoints=https,http",
|
"traefik.frontend.entryPoints=https,http",
|
||||||
"traefik.frontend.rule=Host:plume.deuxfleurs.fr",
|
"traefik.frontend.rule=Host:plume.deuxfleurs.fr",
|
||||||
]
|
]
|
||||||
port = "web_port"
|
port = 7878
|
||||||
address_mode = "host"
|
address_mode = "driver"
|
||||||
check {
|
check {
|
||||||
type = "tcp"
|
type = "tcp"
|
||||||
port = "web_port"
|
port = 7878
|
||||||
|
address_mode = "driver"
|
||||||
interval = "60s"
|
interval = "60s"
|
||||||
timeout = "5s"
|
timeout = "5s"
|
||||||
check_restart {
|
check_restart {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
:FORWARD DROP [0:0]
|
:FORWARD DROP [0:0]
|
||||||
:OUTPUT ACCEPT [0:0]
|
:OUTPUT ACCEPT [0:0]
|
||||||
|
|
||||||
|
# Declaring our chains
|
||||||
|
-N DEUXFLEURS-TRUSTED-NET
|
||||||
|
-N DEUXFLEURS-TRUSTED-PORT
|
||||||
|
|
||||||
# Internet Control Message Protocol
|
# Internet Control Message Protocol
|
||||||
# (required)
|
# (required)
|
||||||
-A INPUT -p icmp -j ACCEPT
|
-A INPUT -p icmp -j ACCEPT
|
||||||
|
@ -21,6 +25,29 @@
|
||||||
-A INPUT -s ::1/128 -j ACCEPT
|
-A INPUT -s ::1/128 -j ACCEPT
|
||||||
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
|
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
|
||||||
|
|
||||||
|
# Who is part of our trusted net?
|
||||||
|
# Max@Bruxelles
|
||||||
|
-A DEUXFLEURS-TRUSTED-NET -s 2a02:1811:3606:4800::0/64 -j DEUXFLEURS-TRUSTED-PORT
|
||||||
|
# Max@Suresnes
|
||||||
|
-A DEUXFLEURS-TRUSTED-NET -s 2a01:e0a:183:7be2::0/64 -j DEUXFLEURS-TRUSTED-PORT
|
||||||
|
# LX@Rennes
|
||||||
|
-A DEUXFLEURS-TRUSTED-NET -s 2a02:8428:81d6:6901::0/64 -j DEUXFLEURS-TRUSTED-PORT
|
||||||
|
# ADRN@Gandi
|
||||||
|
-A DEUXFLEURS-TRUSTED-NET -s 2001:4b98:dc0:41:216:3eff:fe9b:1afb/128 -j DEUXFLEURS-TRUSTED-PORT
|
||||||
|
# Quentin@Rennes
|
||||||
|
-A DEUXFLEURS-TRUSTED-NET -s 2a01:e35:2fdc:dbe0::0/64 -j DEUXFLEURS-TRUSTED-PORT
|
||||||
|
# Source address is not trusted
|
||||||
|
-A DEUXFLEURS-TRUSTED-NET -j RETURN
|
||||||
|
|
||||||
|
# What can do our trusted net?
|
||||||
|
# Access garage basically
|
||||||
|
-A DEUXFLEURS-TRUSTED-PORT -p tcp --dport 3901 -j ACCEPT
|
||||||
|
# Port is not allowed
|
||||||
|
-A DEUXFLEURS-TRUSTED-PORT -j RETURN
|
||||||
|
|
||||||
|
# Let's check if the user comes from our trusted network
|
||||||
|
-A INPUT -j DEUXFLEURS-TRUSTED-NET
|
||||||
|
|
||||||
COMMIT
|
COMMIT
|
||||||
|
|
||||||
*nat
|
*nat
|
||||||
|
|
Loading…
Reference in a new issue