From 3d239ba9fbe41556f7f997b1323a8108c4843947 Mon Sep 17 00:00:00 2001 From: xangcastle Date: Thu, 26 Feb 2026 04:00:56 -0600 Subject: [PATCH 1/2] feat: Add fallback to `PORT` environment variable for server port configuration. --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index a6444fd..a185a0a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -72,9 +72,15 @@ async fn main() -> Result<(), Box> { info!("║ ✓ Capabilities Service (REAPI v2.3) ║"); info!("╚══════════════════════════════════════════════════════════════╝"); + // Read port from RBE_PORT or PORT (Railway uses PORT) let port = std::env::var("RBE_PORT") .ok() .and_then(|p| p.parse().ok()) + .or_else(|| { + std::env::var("PORT") + .ok() + .and_then(|p| p.parse().ok()) + }) .unwrap_or(9092); let bind_address = std::env::var("RBE_BIND_ADDRESS").unwrap_or_else(|_| "0.0.0.0".to_string()); From f899be3388a1a38bd8fcee3260fd064ae7c06ee5 Mon Sep 17 00:00:00 2001 From: xangcastle Date: Thu, 26 Feb 2026 04:18:50 -0600 Subject: [PATCH 2/2] feat: Add fallback to `PORT` environment variable for server port configuration. --- examples/bazel-7.4/.bazelrc | 10 ++++++++-- examples/bazel-8.x/.bazelrc | 5 ++++- examples/bazel-9.x/.bazelrc | 5 ++++- examples/enterprise/.bazelrc | 10 ++++++++-- src/main.rs | 6 +----- 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/examples/bazel-7.4/.bazelrc b/examples/bazel-7.4/.bazelrc index 126e570..a2f5712 100644 --- a/examples/bazel-7.4/.bazelrc +++ b/examples/bazel-7.4/.bazelrc @@ -7,7 +7,10 @@ build --symlink_prefix=/ # ============================================ # Remote Cache Configuration (NodePort) # ============================================ -build:remote-cache --remote_cache=grpc://localhost:9094 +# Railway Public Remote Cache +build:remote-cache --remote_cache=grpcs://ferrisrbe-server-production.up.railway.app +# Local development (NodePort) +# build:remote-cache --remote_cache=grpc://localhost:9094 build:remote-cache --remote_upload_local_results=true build:remote-cache --remote_timeout=300 @@ -15,6 +18,9 @@ build:remote-cache --remote_timeout=300 # Remote Execution Configuration (NodePort) # ============================================ build:remote-exec --config=remote-cache -build:remote-exec --remote_executor=grpc://localhost:9092 +# Railway Public Remote Executor +build:remote-exec --remote_executor=grpcs://ferrisrbe-server-production.up.railway.app +# Local development (NodePort) +# build:remote-exec --remote_executor=grpc://localhost:9092 build:remote-exec --remote_default_exec_properties=OSFamily=linux build:remote-exec --remote_default_exec_properties=container-image= diff --git a/examples/bazel-8.x/.bazelrc b/examples/bazel-8.x/.bazelrc index 9d46b2f..3cea622 100644 --- a/examples/bazel-8.x/.bazelrc +++ b/examples/bazel-8.x/.bazelrc @@ -6,6 +6,9 @@ startup --host_jvm_args=-XX:MaxGCPauseMillis=200 build --symlink_prefix=/ # Remote Cache Configuration -build:remote-cache --remote_cache=grpc://localhost:30094 +# Railway Public Remote Cache +build:remote-cache --remote_cache=grpcs://ferrisrbe-server-production.up.railway.app +# Local development (NodePort) +# build:remote-cache --remote_cache=grpc://localhost:30094 build:remote-cache --remote_upload_local_results=true build:remote-cache --remote_timeout=300 diff --git a/examples/bazel-9.x/.bazelrc b/examples/bazel-9.x/.bazelrc index 9d46b2f..3cea622 100644 --- a/examples/bazel-9.x/.bazelrc +++ b/examples/bazel-9.x/.bazelrc @@ -6,6 +6,9 @@ startup --host_jvm_args=-XX:MaxGCPauseMillis=200 build --symlink_prefix=/ # Remote Cache Configuration -build:remote-cache --remote_cache=grpc://localhost:30094 +# Railway Public Remote Cache +build:remote-cache --remote_cache=grpcs://ferrisrbe-server-production.up.railway.app +# Local development (NodePort) +# build:remote-cache --remote_cache=grpc://localhost:30094 build:remote-cache --remote_upload_local_results=true build:remote-cache --remote_timeout=300 diff --git a/examples/enterprise/.bazelrc b/examples/enterprise/.bazelrc index 108c2b3..31199d7 100644 --- a/examples/enterprise/.bazelrc +++ b/examples/enterprise/.bazelrc @@ -8,7 +8,10 @@ build --symlink_prefix=/ # ============================================ # Remote Cache (funciona desde cualquier SO) # ============================================ -build:remote-cache --remote_cache=grpc://localhost:30094 +# Railway Public Remote Cache +build:remote-cache --remote_cache=grpcs://ferrisrbe-server-production.up.railway.app +# Local development (NodePort) +# build:remote-cache --remote_cache=grpc://localhost:30094 build:remote-cache --remote_upload_local_results=true build:remote-cache --remote_timeout=600 @@ -16,7 +19,10 @@ build:remote-cache --remote_timeout=600 # Remote Execution (requiere toolchains Linux) # ============================================ build:remote-exec --config=remote-cache -build:remote-exec --remote_executor=grpc://localhost:30092 +# Railway Public Remote Executor +build:remote-exec --remote_executor=grpcs://ferrisrbe-server-production.up.railway.app +# Local development (NodePort) +# build:remote-exec --remote_executor=grpc://localhost:30092 # Platform for remote execution build:remote-exec --extra_execution_platforms=//toolchains:linux_arm64 diff --git a/src/main.rs b/src/main.rs index a185a0a..0943fa6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -76,11 +76,7 @@ async fn main() -> Result<(), Box> { let port = std::env::var("RBE_PORT") .ok() .and_then(|p| p.parse().ok()) - .or_else(|| { - std::env::var("PORT") - .ok() - .and_then(|p| p.parse().ok()) - }) + .or_else(|| std::env::var("PORT").ok().and_then(|p| p.parse().ok())) .unwrap_or(9092); let bind_address = std::env::var("RBE_BIND_ADDRESS").unwrap_or_else(|_| "0.0.0.0".to_string());