Skip to content

Commit

Permalink
main -> dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kanshi committed Aug 13, 2024
2 parents 7cce6a8 + a4d88b6 commit 5276043
Show file tree
Hide file tree
Showing 2 changed files with 556 additions and 90 deletions.
83 changes: 44 additions & 39 deletions operations/deploy-live.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,32 @@ job "sbws-live" {
source = "sbws-live"
}

volume "sbws-destination-live" {
type = "host"
read_only = true
source = "sbws-destination-live"
}

network {
mode = "bridge"

port "http-port" {
static = 9277
to = 80
# host_network = "wireguard"
}

port "orport" {
static = 9291
}

port "control-port" {
static = 9251
host_network = "wireguard"
}

port "orport" {
static = 9291
}
}

task "sbws-relay-live-task" {
driver = "docker"

env {
ANON_USER = "root"
}

volume_mount {
volume = "sbws-live"
destination = "/var/lib/anon"
Expand All @@ -79,14 +79,14 @@ job "sbws-live" {
}

resources {
cpu = 512
memory = 1024
cpu = 2048
memory = 2500
}

template {
change_mode = "noop"
data = <<EOH
User root
User anond
Nickname AnonSBWS
Expand All @@ -95,7 +95,9 @@ DataDirectory /var/lib/anon/anon-data
ControlPort {{ env `NOMAD_PORT_control_port` }}
SocksPort auto
SafeLogging 1
ConnectionPadding auto
SafeLogging 0
UseEntryGuards 0
ProtocolWarnings 1
FetchDirInfoEarly 1
Expand All @@ -112,7 +114,7 @@ ORPort {{ env `NOMAD_PORT_orport` }}

service {
name = "sbws-relay-live"
tags = ["sbws", "logging"]
tags = ["logging"]
port = "control-port"
}
}
Expand Down Expand Up @@ -144,8 +146,8 @@ ORPort {{ env `NOMAD_PORT_orport` }}
}

resources {
cpu = 1000
memory = 1500
cpu = 1024
memory = 2560
}

template {
Expand Down Expand Up @@ -189,8 +191,7 @@ external_control_port = {{ env `NOMAD_PORT_control_port` }}
driver = "docker"

config {
image = "svforte/sbws-destination:latest"
force_pull = true
image = "nginx:1.27"
volumes = [
"local/nginx-sbws:/etc/nginx/conf.d/default.conf:ro"
]
Expand All @@ -199,45 +200,49 @@ external_control_port = {{ env `NOMAD_PORT_control_port` }}

resources {
cpu = 128
memory = 1500
memory = 256
}

volume_mount {
volume = "sbws-destination-live"
destination = "/data"
read_only = false
}

service {
name = "sbws-destination-live"
tags = ["sbws", "logging"]
tags = ["logging"]
port = "http-port"
check {
name = "sbws destination nginx http server alive"
type = "tcp"
name = "sbws live destination nginx alive"
type = "http"
path = "/"
interval = "10s"
timeout = "10s"
check_restart {
limit = 10
grace = "30s"
limit = 3
grace = "10s"
}
}
}

template {
change_mode = "noop"
data = <<EOH
server {
root /app/destination/data;
autoindex on;
server {
root /data;
index index.html;
autoindex on;
listen 0.0.0.0:{{ env `NOMAD_PORT_http_port` }};
listen 0.0.0.0:80;
location / {
try_files $uri $uri/ =404;
}
location / {
try_files $uri $uri/ =404;
}
location ~/\.ht {
deny all;
}
}
location ~/\.ht {
deny all;
}
}
EOH
destination = "local/nginx-sbws"
}
Expand Down
Loading

0 comments on commit 5276043

Please sign in to comment.