Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions services/nomad/apps/alps.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ job "alps" {
}

service {
name = "alps"
port = "http"
meta {
nginx_enable = "true"
nginx_names = "alps.s.voidlinux.org alps.voidlinux.org"
}
provider = "nomad"
name = "alps"
port = "http"

tags = [
"nginx_enable",
"nginx_names=alps.s.voidlinux.org alps.voidlinux.org",
]
}

task "alps" {
Expand Down
14 changes: 8 additions & 6 deletions services/nomad/apps/debuginfod.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ job "debuginfod" {
}

service {
name = "debuginfod"
port = "http"
meta {
nginx_enable = "true"
nginx_names = "debuginfod.s.voidlinux.org debuginfod.voidlinux.org"
}
provider = "nomad"
name = "debuginfod"
port = "http"

tags = [
"nginx_enable",
"nginx_names=debuginfod.s.voidlinux.org debuginfod.voidlinux.org",
]

check {
type = "http"
Expand Down
29 changes: 17 additions & 12 deletions services/nomad/apps/devspace.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ job "devspace" {
}

service {
name = "devspace-sftp"
port = "http"
meta {
nginx_enable = "true"
nginx_names = "devspace-sftp.voidlinux.org"
}
provider = "nomad"
name = "devspace-sftp"
port = "http"

tags = [
"nginx_enable",
"nginx_names=devspace-sftp.voidlinux.org",
]

check {
type = "http"
port = 8081
Expand Down Expand Up @@ -121,12 +124,14 @@ EOF
}

service {
name = "devspace"
port = "http"
meta {
nginx_enable = "true"
nginx_names = "devspace.voidlinux.org"
}
provider = "nomad"
name = "devspace"
port = "http"

tags = [
"nginx_enable",
"nginx_names=devspace.voidlinux.org",
]
}

task "nginx" {
Expand Down
14 changes: 8 additions & 6 deletions services/nomad/apps/etherpad.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ job "etherpad" {
}

service {
name = "pad"
port = "http"
meta {
nginx_enable = "true"
nginx_names = "pad.voidlinux.org"
}
provider = "nomad"
name = "pad"
port = "http"

tags = [
"nginx_enable",
"nginx_names=pad.voidlinux.org",
]
}

volume "etherpad" {
Expand Down
14 changes: 8 additions & 6 deletions services/nomad/apps/infradocs.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ job "infradocs" {
}

service {
name = "infradocs"
port = "http"
meta {
nginx_enable = "true"
nginx_names = "infradocs.voidlinux.org"
}
provider = "nomad"
name = "infradocs"
port = "http"

tags = [
"nginx_enable",
"nginx_names=infradocs.voidlinux.org",
]

check {
type = "http"
Expand Down
14 changes: 8 additions & 6 deletions services/nomad/apps/ircbot.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ job "ircbot" {
}

service {
name = "ircbot"
port = "http"
meta {
nginx_enable = "true"
nginx_names = "ircbot.voidlinux.org"
}
provider = "nomad"
name = "ircbot"
port = "http"

tags = [
"nginx_enable",
"nginx_names=ircbot.voidlinux.org",
]
}

task "ircbot" {
Expand Down
14 changes: 8 additions & 6 deletions services/nomad/apps/man-cgi.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ job "man-cgi" {
}

service {
name = "man-cgi"
port = "http"
meta {
nginx_enable = "true"
nginx_names = "man.voidlinux.org"
}
provider = "nomad"
name = "man-cgi"
port = "http"

tags = [
"nginx_enable",
"nginx_names=man.voidlinux.org",
]
}

task "man-cgi" {
Expand Down
14 changes: 8 additions & 6 deletions services/nomad/apps/popcorn.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ job "popcorn" {
}

service {
name = "popcorn"
port = "http"
meta {
nginx_enable = "true"
nginx_names = "popcorn.voidlinux.org"
}
provider = "nomad"
name = "popcorn"
port = "http"

tags = [
"nginx_enable",
"nginx_names=popcorn.voidlinux.org",
]
}

task "nginx" {
Expand Down
14 changes: 8 additions & 6 deletions services/nomad/apps/xq-api.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ job "xq-api" {
}

service {
name = "xq-api"
port = "http"
meta {
nginx_enable = "true"
nginx_names = "xq-api.voidlinux.org"
}
provider = "nomad"
name = "xq-api"
port = "http"

tags = [
"nginx_enable",
"nginx_names=xq-api.voidlinux.org",
]
}

task "xq-api" {
Expand Down
9 changes: 6 additions & 3 deletions services/nomad/infrastructure/nginx-sites/10-buildbot.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,23 @@ server {
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Host $host;

{{ $allocID := env "NOMAD_ALLOC_ID" }}
{{ range nomadService 1 $allocID "buildbot-www?ns=build" }}
location / {
proxy_pass http://buildbot-www.service.consul:8010/;
proxy_pass http://{{ .Address }}:{{ .Port }}/;
}

location /sse/ {
proxy_buffering off;
proxy_pass http://buildbot-www.service.consul:8010/sse/;
proxy_pass http://{{ .Address }}:{{ .Port }}//sse/;
}

location /ws {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_pass http://buildbot-www.service.consul:8010/ws;
proxy_pass http://{{ .Address }}:{{ .Port }}/ws;
proxy_read_timeout 6000s;
}
{{ end }}
}
17 changes: 10 additions & 7 deletions services/nomad/infrastructure/nginx-sites/10-proxy.conf
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
{{ range services -}}
{{ range service (printf "%s~_agent" .Name) -}}
{{ if index .ServiceMeta "nginx_enable" -}}
{{ if not (scratch.Key .Name) -}}
{{ scratch.Set .Name "1" -}}
{{ range nomadServices "?ns=*" -}}
{{ range nomadService (printf "%s?ns=%s" .Name .Namespace) -}}
{{ if in .Tags "nginx_enable" -}}
{{ range $tag := .Tags -}}
{{ if $tag | contains "nginx_names=" -}}
{{ scratch.Set "names" ($tag | trimPrefix "nginx_names=") -}}
{{ break -}}
{{ end -}}
{{ end -}}
server {
include /etc/nginx/fragments/ssl.conf;
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name {{ index .ServiceMeta "nginx_names" }};
server_name {{ scratch.Get "names" }};

location / {
proxy_set_header Host $host;
Expand All @@ -20,4 +24,3 @@ server {
{{ end -}}
{{ end -}}
{{ end -}}
{{ end -}}
14 changes: 8 additions & 6 deletions services/nomad/infrastructure/terrastate.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ job "terrastate" {
}

service {
name = "terrastate"
port = "http"
meta {
nginx_enable = "true"
nginx_names = "terrastate.s.voidlinux.org"
}
provider = "nomad"
name = "terrastate"
port = "http"

tags = [
"nginx_enable",
"nginx_names=terrastate.s.voidlinux.org",
]

check {
type = "http"
Expand Down
Loading