Skip to content

Open-source status page, incident response and uptime monitoring

πŸš€ Add railway (#1421)

Thibault Le Ouay0935d8dcfc12
diff --git a/apps/dashboard/src/data/regions.ts b/apps/dashboard/src/data/regions.ts
index ad22a60c5..d3c700089 100644
--- a/apps/dashboard/src/data/regions.ts
+++ b/apps/dashboard/src/data/regions.ts
@@ -283,6 +283,34 @@ export const regions = [
continent: "North America",
provider: "koyeb",
},
+ {
+ code: "railway_us-west2",
+ location: "California, USA",
+ flag: "πŸ‡ΊπŸ‡Έ",
+ continent: "North America",
+ provider: "railway",
+ },
+ {
+ code: "railway_us-east4-eqdc4a",
+ location: "Virginia, USA",
+ flag: "πŸ‡ΊπŸ‡Έ",
+ continent: "North America",
+ provider: "railway",
+ },
+ {
+ code: "railway_europe-west4-drams3a",
+ location: "Amsterdam, Netherlands",
+ flag: "πŸ‡³πŸ‡±",
+ continent: "Europe",
+ provider: "railway",
+ },
+ {
+ code: "railway_asia-southeast1-eqsg3a",
+ location: "Singapore, Singapore",
+ flag: "πŸ‡ΈπŸ‡¬",
+ continent: "Asia",
+ provider: "railway",
+ },
] as const;
export type Region = (typeof regions)[number]["code"];
@@ -342,4 +370,9 @@ export const regionColors = {
koyeb_sfo: "hsl(0 0% 45.1%)",
koyeb_tyo: "hsl(0 0% 45.1%)",
koyeb_was: "hsl(0 0% 45.1%)",
+
+ "railway_asia-southeast1-eqsg3a": "hsl(0 0% 45.1%)",
+ "railway_europe-west4-drams3a": "hsl(0 0% 45.1%)",
+ "railway_us-east4-eqdc4a": "hsl(0 0% 45.1%)",
+ "railway_us-west2": "hsl(0 0% 45.1%)",
} satisfies Record<Region, string>;
diff --git a/apps/railway-proxy/Dockerfile b/apps/railway-proxy/Dockerfile
new file mode 100644
index 000000000..70bd763ee
--- /dev/null
+++ b/apps/railway-proxy/Dockerfile
@@ -0,0 +1,19 @@
+FROM golang:1.25-alpine
+
+# Set the working directory
+WORKDIR /app
+
+# Copy go.mod and go.sum files (if they exist)
+COPY go.mod ./
+
+# Copy the source code
+COPY . .
+
+# Build the application
+RUN go build -o main .
+
+# Expose the port your app runs on
+EXPOSE 8080
+
+# Run the application
+CMD ["./main"]
diff --git a/apps/railway-proxy/go.mod b/apps/railway-proxy/go.mod
new file mode 100644
index 000000000..5fdc0e0da
--- /dev/null
+++ b/apps/railway-proxy/go.mod
@@ -0,0 +1,43 @@
+module github.com/openstatushq/openstatus/apps/railway-proxy
+
+go 1.25.1
+
+require (
+ github.com/gin-gonic/gin v1.11.0
+ github.com/rs/zerolog v1.34.0
+)
+
+require (
+ github.com/bytedance/sonic v1.14.0 // indirect
+ github.com/bytedance/sonic/loader v0.3.0 // indirect
+ github.com/cloudwego/base64x v0.1.6 // indirect
+ github.com/gabriel-vasile/mimetype v1.4.8 // indirect
+ github.com/gin-contrib/sse v1.1.0 // indirect
+ github.com/go-playground/locales v0.14.1 // indirect
+ github.com/go-playground/universal-translator v0.18.1 // indirect
+ github.com/go-playground/validator/v10 v10.27.0 // indirect
+ github.com/goccy/go-json v0.10.2 // indirect
+ github.com/goccy/go-yaml v1.18.0 // indirect
+ github.com/json-iterator/go v1.1.12 // indirect
+ github.com/klauspost/cpuid/v2 v2.3.0 // indirect
+ github.com/leodido/go-urn v1.4.0 // indirect
+ github.com/mattn/go-colorable v0.1.13 // indirect
+ github.com/mattn/go-isatty v0.0.20 // indirect
+ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
+ github.com/modern-go/reflect2 v1.0.2 // indirect
+ github.com/pelletier/go-toml/v2 v2.2.4 // indirect
+ github.com/quic-go/qpack v0.5.1 // indirect
+ github.com/quic-go/quic-go v0.54.0 // indirect
+ github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
+ github.com/ugorji/go/codec v1.3.0 // indirect
+ go.uber.org/mock v0.5.0 // indirect
+ golang.org/x/arch v0.20.0 // indirect
+ golang.org/x/crypto v0.40.0 // indirect
+ golang.org/x/mod v0.25.0 // indirect
+ golang.org/x/net v0.42.0 // indirect
+ golang.org/x/sync v0.16.0 // indirect
+ golang.org/x/sys v0.35.0 // indirect
+ golang.org/x/text v0.27.0 // indirect
+ golang.org/x/tools v0.34.0 // indirect
+ google.golang.org/protobuf v1.36.9 // indirect
+)
diff --git a/apps/railway-proxy/go.sum b/apps/railway-proxy/go.sum
new file mode 100644
index 000000000..0169c6d56
--- /dev/null
+++ b/apps/railway-proxy/go.sum
@@ -0,0 +1,100 @@
+github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=
+github.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=
+github.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=
+github.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
+github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=
+github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=
+github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM=
+github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
+github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w=
+github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM=
+github.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=
+github.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=
+github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
+github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
+github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
+github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
+github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
+github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
+github.com/go-playground/validator/v10 v10.27.0 h1:w8+XrWVMhGkxOaaowyKH35gFydVHOvC0/uWoy2Fzwn4=
+github.com/go-playground/validator/v10 v10.27.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo=
+github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
+github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
+github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
+github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
+github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
+github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
+github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
+github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
+github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
+github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
+github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
+github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
+github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
+github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
+github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
+github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
+github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
+github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
+github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
+github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
+github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
+github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
+github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
+github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
+github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
+github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
+github.com/quic-go/quic-go v0.54.0 h1:6s1YB9QotYI6Ospeiguknbp2Znb/jZYjZLRXn9kMQBg=
+github.com/quic-go/quic-go v0.54.0/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=
+github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
+github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
+github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
+github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
+github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
+github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
+github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
+github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
+github.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=
+github.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=
+go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=
+go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=
+golang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=
+golang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=
+golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
+golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
+golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w=
+golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
+golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
+golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
+golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
+golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
+golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
+golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
+golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
+golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
+golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
+golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
+google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw=
+google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/apps/railway-proxy/main.go b/apps/railway-proxy/main.go
new file mode 100644
index 000000000..c57486e29
--- /dev/null
+++ b/apps/railway-proxy/main.go
@@ -0,0 +1,97 @@
+package main
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "net/http"
+ "net/http/httputil"
+ "net/url"
+ "os"
+ "os/signal"
+ "syscall"
+
+ "github.com/gin-gonic/gin"
+ "github.com/rs/zerolog/log"
+)
+
+func proxy(c *gin.Context) {
+
+ var targetUrl string
+
+ region := c.Request.Header.Get("railway-region")
+
+ switch region {
+ case "europe-west4-drams3a":
+ targetUrl = "http://openstatus-checker-eu-west.railway.internal:8080"
+ case "us-east4-eqdc4a":
+ targetUrl = "http://openstatus-checker-us-east.railway.internal:8080"
+ case "us-west2":
+ targetUrl = "http://openstatus-checker-us-west.railway.internal:8080"
+ case "asia-southeast1-eqsg3a":
+ targetUrl = "http://checker-southeast-asia.railway.internal:8080"
+ default:
+ fmt.Println("No region")
+ }
+ remote, err := url.Parse(targetUrl)
+ if err != nil {
+ panic(err)
+ }
+
+ proxy := httputil.NewSingleHostReverseProxy(remote)
+
+ c.Request.Host = remote.Host
+
+ proxy.ServeHTTP(c.Writer, c.Request)
+}
+
+func main() {
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+ done := make(chan os.Signal, 1)
+ signal.Notify(done, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
+
+ go func() {
+ <-done
+ cancel()
+ }()
+
+ cloudProvider := env("CLOUD_PROVIDER", "railway")
+ region := env("RAILWAY_REPLICA_REGION", env("REGION", "local"))
+ router := gin.New()
+
+ //Create a catchall route
+ router.NoRoute(proxy)
+
+ router.GET("/healthz", func(c *gin.Context) {
+ c.JSON(http.StatusOK, gin.H{"message": "pong", "region": region, "provider": cloudProvider})
+ })
+
+ httpServer := &http.Server{
+ Addr: fmt.Sprintf("0.0.0.0:%s", env("PORT", "8080")),
+ Handler: router,
+ }
+
+ go func() {
+ if err := httpServer.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
+ log.Ctx(ctx).Error().Err(err).Msg("failed to start http server")
+ cancel()
+ }
+ }()
+
+ <-ctx.Done()
+ if err := httpServer.Shutdown(ctx); err != nil {
+ log.Ctx(ctx).Error().Err(err).Msg("failed to shutdown http server")
+
+ return
+ }
+
+}
+
+func env(key, fallback string) string {
+ if value, ok := os.LookupEnv(key); ok {
+ return value
+ }
+
+ return fallback
+}
diff --git a/apps/web/src/app/api/checker/cron/_cron.ts b/apps/web/src/app/api/checker/cron/_cron.ts
index bf8f3a5f8..ace1db796 100644
--- a/apps/web/src/app/api/checker/cron/_cron.ts
+++ b/apps/web/src/app/api/checker/cron/_cron.ts
@@ -224,6 +224,9 @@ const createCronTask = async ({
if (regionInfo.provider === "koyeb") {
regionHeader = { "X-KOYEB-REGION-OVERRIDE": region.replace("koyeb_", "") };
}
+ if (regionInfo.provider === "railway") {
+ regionHeader = { "railway-region": region.replace("railway_", "") };
+ }
const newTask: google.cloud.tasks.v2beta3.ITask = {
httpRequest: {
headers: {
@@ -255,6 +258,8 @@ function generateUrl({
return `https://openstatus-checker.fly.dev/checker/${row.jobType}?monitor_id=${row.id}`;
case "koyeb":
return `https://openstatus-checker.koyeb.app/checker/${row.jobType}?monitor_id=${row.id}`;
+ case "railway":
+ return `https://railway-proxy-production-9cb1.up.railway.app/checker/${row.jobType}?monitor_id=${row.id}`;
default:
throw new Error("Invalid jobType");
diff --git a/apps/web/src/components/monitor-charts/chart.tsx b/apps/web/src/components/monitor-charts/chart.tsx
index 7ce558b05..7314b1764 100644
--- a/apps/web/src/components/monitor-charts/chart.tsx
+++ b/apps/web/src/components/monitor-charts/chart.tsx
@@ -150,4 +150,17 @@ const chartConfig: Record<Region, { label: string; color: string }> = {
koyeb_sin: { label: "SIN (koyeb)", color: "hsl(0 0% 45.1%)" },
koyeb_tyo: { label: "TYO (koyeb)", color: "hsl(0 0% 45.1%)" },
koyeb_was: { label: "WAS (koyeb)", color: "hsl(0 0% 45.1%)" },
+ "railway_asia-southeast1-eqsg3a": {
+ label: "asia-southeast1-eqsg3a (railway)",
+ color: "hsl(0 0% 45.1%)",
+ },
+ "railway_europe-west4-drams3a": {
+ label: "europe-west4-drams3a (railway)",
+ color: "hsl(0 0% 45.1%)",
+ },
+ "railway_us-west2": { label: "us-west2 (railway)", color: "hsl(0 0% 45.1%)" },
+ "railway_us-east4-eqdc4a": {
+ label: "us-east4-eqdc4a (railway)",
+ color: "hsl(0 0% 45.1%)",
+ },
};
diff --git a/apps/web/src/components/ping-response-analysis/utils.ts b/apps/web/src/components/ping-response-analysis/utils.ts
index b04d0f6d0..969f9a00f 100644
--- a/apps/web/src/components/ping-response-analysis/utils.ts
+++ b/apps/web/src/components/ping-response-analysis/utils.ts
@@ -176,6 +176,10 @@ export async function checkRegion(
"X-KOYEB-REGION-OVERRIDE": region.replace("koyeb_", ""),
};
break;
+ case "railway":
+ endpoint = `https://railway-proxy-production-9cb1.up.railway.app/ping/${region}`;
+ regionHeader = { "railway-region": region.replace("railway_", "") };
+ break;
default:
break;
}
diff --git a/packages/db/src/schema/constants.ts b/packages/db/src/schema/constants.ts
index 24f8615c6..9fb285103 100644
--- a/packages/db/src/schema/constants.ts
+++ b/packages/db/src/schema/constants.ts
@@ -47,6 +47,13 @@ export const koyebRegions = [
"koyeb_sfo",
] as const;
+export const railwayRegions = [
+ "railway_europe-west4-drams3a",
+ "railway_us-east4-eqdc4a",
+ "railway_asia-southeast1-eqsg3a",
+ "railway_us-west2",
+] as const;
+
export const freeFlyRegions = [
"iad",
"ams",
@@ -66,7 +73,12 @@ export const monitorPeriodicity = [
"other",
] as const;
-export const monitorRegions = [...flyRegions, ...koyebRegions] as const;
+export const monitorRegions = [
+ ...flyRegions,
+ ...koyebRegions,
+ ...railwayRegions,
+] as const;
+
export const monitorPeriodicitySchema = z.enum(monitorPeriodicity);
export const monitorRegionSchema = z.enum(monitorRegions);
export const monitorFlyRegionSchema = z.enum(flyRegions);
diff --git a/packages/utils/index.ts b/packages/utils/index.ts
index 2487040c0..c42794717 100644
--- a/packages/utils/index.ts
+++ b/packages/utils/index.ts
@@ -444,6 +444,34 @@ export const regionDict: Record<Region, RegionInfo> = {
continent: "North America",
provider: "koyeb",
},
+ "railway_us-west2": {
+ code: "railway_us-west2",
+ location: "California, USA",
+ flag: "πŸ‡ΊπŸ‡Έ",
+ continent: "North America",
+ provider: "railway",
+ },
+ "railway_us-east4-eqdc4a": {
+ code: "railway_us-east4-eqdc4a",
+ location: "Virginia, USA",
+ flag: "πŸ‡ΊπŸ‡Έ",
+ continent: "North America",
+ provider: "railway",
+ },
+ "railway_europe-west4-drams3a": {
+ code: "railway_europe-west4-drams3a",
+ location: "Amsterdam, Netherlands",
+ flag: "πŸ‡³πŸ‡±",
+ continent: "Europe",
+ provider: "railway",
+ },
+ "railway_asia-southeast1-eqsg3a": {
+ code: "railway_asia-southeast1-eqsg3a",
+ location: "Singapore, Singapore",
+ flag: "πŸ‡ΈπŸ‡¬",
+ continent: "Asia",
+ provider: "railway",
+ },
} as const;
// const r = t.flatMap((u) => u[1].continent);