Skip to content

Commit

Permalink
Experimental host for activity pub (micropubblog)
Browse files Browse the repository at this point in the history
  • Loading branch information
bltavares committed Aug 20, 2023
1 parent 351db0a commit 2fbeb98
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
84 changes: 84 additions & 0 deletions nomad/activepub/service.nomad
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
job "activepub" {
type = "service"
datacenters = ["dc1"]

group "service" {
network {
port "web" { to = 8000 }
}

service {
name = "pub"
port = "web"
}

volume "storage" {
type = "csi"
source = "activepub"
read_only = false
attachment_mode = "file-system"
access_mode = "single-node-writer"
}
update {
max_parallel = 0
}

task "image" {
driver = "docker"

config {
image = "registry.lab.bltavares.com/bltavares/microblogpub:latest"
ports = ["web"]
}

kill_signal = "SIGKILL"

service {
check {
name = "alive"
type = "http"
path = "/"
port = "web"
interval = "5m"
timeout = "10s"
}

check_restart {
limit = 3
grace = "90s"
ignore_warnings = false
}
}

volume_mount {
volume = "storage"
destination = "/app/data"
}

resources {
cpu = 100
memory = 800
}
}

task "ingress" {
driver = "docker"

config {
image = "registry.lab.bltavares.com/cloudflare/cloudflared:latest"
args = [
"tunnel", "--no-autoupdate",
"run",
"--token", file("../../secrets/activitypub/tunnel.token"),
"--url", "${NOMAD_ADDR_web}",
"activitypub",
]
}

resources {
cpu = 10
memory = 50
}
}
}
}
17 changes: 17 additions & 0 deletions nomad/activepub/volume.nomad
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
id = "activepub"
name = "activepub"
type = "csi"
plugin_id = "nfs"

capacity_max = "10G"

capability {
access_mode = "single-node-writer"
attachment_mode = "file-system"
}

parameters {
uid = "1000"
gid = "1000"
mode = "770"
}
Binary file added secrets/activitypub/tunnel.token
Binary file not shown.

0 comments on commit 2fbeb98

Please sign in to comment.