diff options
Diffstat (limited to '.ship')
| -rw-r--r-- | .ship/Caddyfile | 18 | ||||
| -rw-r--r-- | .ship/service | 17 |
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 @@ | |||
| 1 | nostr-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] | ||
| 2 | Description=nostr-grpc | ||
| 3 | After=network.target | ||
| 4 | |||
| 5 | [Service] | ||
| 6 | Type=simple | ||
| 7 | User=nostr-grpc | ||
| 8 | WorkingDirectory=/var/lib/nostr-grpc | ||
| 9 | EnvironmentFile=/etc/ship/env/nostr-grpc.env | ||
| 10 | ExecStart=/usr/local/bin/nostr-grpc -db relay.db -grpc-addr localhost:50051 -ws-addr localhost:8006 -public-url nostr-grpc.x.bdw.to | ||
| 11 | Restart=always | ||
| 12 | RestartSec=5s | ||
| 13 | NoNewPrivileges=true | ||
| 14 | PrivateTmp=true | ||
| 15 | |||
| 16 | [Install] | ||
| 17 | WantedBy=multi-user.target | ||
