Skip to content

Commit f2fe34d

Browse files
committed
fix(guard): use intercom_address for guard service discovery
1 parent f8a1d36 commit f2fe34d

File tree

7 files changed

+8
-9
lines changed
  • docker/dev-full
  • packages
    • common/config/src/config/server/rivet
    • core/services/cluster/src/workflows/server/install/install_scripts/components/rivet
    • edge
      • infra/guard/server/src/routing
      • services/pegboard/src/workflows/client

7 files changed

+8
-9
lines changed

docker/dev-full/rivet-edge-server/config.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"cluster_id": "11ca8960-acab-4963-909c-99d72af3e1cb",
99
"datacenter_id": "f288913c-735d-4188-bf9b-2fcf6eac7b9c",
1010
"server_id": "174aca2a-98b7-462c-9ad9-3835094a9a10",
11-
"intercom_endpoint": "http://rivet-server:8081"
11+
"intercom_address": "http://rivet-server:8081"
1212
},
1313
"guard": {
1414
// TLS not configured for local development

docker/dev-full/rivet-guard/config.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"cluster_id": "11ca8960-acab-4963-909c-99d72af3e1cb",
2121
"datacenter_id": "f288913c-735d-4188-bf9b-2fcf6eac7b9c",
2222
"server_id": "174aca2a-98b7-462c-9ad9-3835094a9a10",
23-
"intercom_endpoint": "http://rivet-server:8081"
23+
"intercom_address": "http://rivet-server:8081"
2424
},
2525
"guard": {
2626
// TLS not configured for local development

packages/common/config/src/config/server/rivet/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,10 +843,12 @@ pub struct Edge {
843843
pub cluster_id: Uuid,
844844
pub datacenter_id: Uuid,
845845
pub server_id: Uuid,
846-
pub intercom_endpoint: Url,
846+
/// Url of the core cluster.
847+
pub intercom_address: Url,
847848
/// This API address will be used if there are no worker servers listed in the cluster package
848849
#[serde(default)]
849850
pub api_lan_address: Option<(String, u16)>,
850851
#[serde(default)]
851852
pub redirect_logs_dir: Option<PathBuf>,
852853
}
854+

packages/core/services/cluster/src/workflows/server/install/install_scripts/components/rivet/guard.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub fn configure(config: &rivet_config::Config) -> GlobalResult<String> {
5858
datacenter_id: Uuid::nil(),
5959
server_id: Uuid::nil(),
6060
api_lan_address: None,
61-
intercom_endpoint: Url::parse(&format!("http://127.0.0.1:{TUNNEL_API_EDGE_PORT}"))?,
61+
intercom_address: Url::parse(&format!("http://127.0.0.1:{TUNNEL_API_EDGE_PORT}"))?,
6262
redirect_logs_dir: Some(PathBuf::from("/var/log/rivet-guard")),
6363
}),
6464
status: server_config.rivet.status.clone(),

packages/core/services/cluster/src/workflows/server/install/install_scripts/components/rivet/worker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub fn configure(config: &rivet_config::Config) -> GlobalResult<String> {
7272
datacenter_id: Uuid::nil(),
7373
server_id: Uuid::nil(),
7474
api_lan_address: None,
75-
intercom_endpoint: Url::parse(&format!("http://127.0.0.1:{TUNNEL_API_EDGE_PORT}"))?,
75+
intercom_address: Url::parse(&format!("http://127.0.0.1:{TUNNEL_API_EDGE_PORT}"))?,
7676
redirect_logs_dir: Some(PathBuf::from("/var/log/rivet-edge-server")),
7777
}),
7878
..Default::default()

packages/edge/infra/guard/server/src/routing/api.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ use service_discovery::ServiceDiscovery;
1010
use url::Url;
1111
use uuid::Uuid;
1212

13-
// TODO: Copied from cluster/src/workflows/server/install/install_scripts/components/rivet/mod.rs
14-
const TUNNEL_API_EDGE_PORT: u16 = 5010;
15-
1613
/// Route requests to the API service
1714
#[tracing::instrument(skip_all)]
1815
pub async fn route_api_request(

packages/edge/services/pegboard/src/workflows/client/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ async fn publish_registered(ctx: &ActivityCtx, input: &PublishRegisteredInput) -
510510

511511
let config = Configuration {
512512
client: rivet_pools::reqwest::client().await?,
513-
base_path: util::url::to_string_without_slash(&edge.intercom_endpoint),
513+
base_path: util::url::to_string_without_slash(&edge.intercom_address),
514514
bearer_access_token: Some(token),
515515
..Default::default()
516516
};

0 commit comments

Comments
 (0)