summaryrefslogtreecommitdiffstats
path: root/.ship
diff options
context:
space:
mode:
Diffstat (limited to '.ship')
-rw-r--r--.ship/Caddyfile18
-rw-r--r--.ship/service17
2 files changed, 35 insertions, 0 deletions
diff --git a/.ship/Caddyfile b/.ship/Caddyfile
new file mode 100644
index 0000000..88ed6d3
--- /dev/null
+++ b/.ship/Caddyfile
@@ -0,0 +1,18 @@
1nostr-grpc.x.bdw.to {
2 # Route native gRPC to port 50051
3 @grpc {
4 header Content-Type application/grpc*
5 }
6 reverse_proxy @grpc localhost:50051 {
7 transport http {
8 versions h2c
9 }
10 }
11
12 # Everything else (Connect, WebSocket, HTML) to port 8006
13 reverse_proxy localhost:8006 {
14 # Enable WebSocket support
15 header_up Upgrade {http.request.header.Upgrade}
16 header_up Connection {http.request.header.Connection}
17 }
18}
diff --git a/.ship/service b/.ship/service
new file mode 100644
index 0000000..9305ef4
--- /dev/null
+++ b/.ship/service
@@ -0,0 +1,17 @@
1[Unit]
2Description=nostr-grpc
3After=network.target
4
5[Service]
6Type=simple
7User=nostr-grpc
8WorkingDirectory=/var/lib/nostr-grpc
9EnvironmentFile=/etc/ship/env/nostr-grpc.env
10ExecStart=/usr/local/bin/nostr-grpc -db relay.db -grpc-addr localhost:50051 -ws-addr localhost:8006 -public-url nostr-grpc.x.bdw.to
11Restart=always
12RestartSec=5s
13NoNewPrivileges=true
14PrivateTmp=true
15
16[Install]
17WantedBy=multi-user.target