Skip to content

Commit

Permalink
chore: rename game_guard -> rivet guard (#1417)
Browse files Browse the repository at this point in the history
Fixes RVT-4141
  • Loading branch information
NathanFlurry committed Nov 21, 2024
1 parent 4eedc91 commit 76312de
Show file tree
Hide file tree
Showing 1,162 changed files with 21,463 additions and 21,957 deletions.
67 changes: 33 additions & 34 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,39 @@ edition = "2021"
authors = ["Rivet Gaming, LLC <[email protected]>"]
license = "Apache-2.0"

[workspace.dependencies.sqlx]
git = "https://github.com/rivet-gg/sqlx"
rev = "e7120f59"

[workspace.dependencies.nomad_client]
git = "https://github.com/rivet-gg/nomad-client"
rev = "abb66bf"

[workspace.dependencies.nomad_client_new]
git = "https://github.com/rivet-gg/nomad-client"
rev = "abb66bf"
package = "nomad_client"

[workspace.dependencies.async-posthog]
git = "https://github.com/rivet-gg/posthog-rs"
rev = "ef4e80e"

[workspace.dependencies.cloudflare]
git = "https://github.com/cloudflare/cloudflare-rs"
rev = "f14720e"

[workspace.dependencies.rivet-term]
git = "https://github.com/rivet-gg/rivet-term"
rev = "d539a07"

[workspace.dependencies.redis]
git = "https://github.com/rivet-gg/redis-rs"
rev = "ac3e27f"

[workspace.dependencies.serde_array_query]
git = "https://github.com/rivet-gg/serde_array_query"
rev = "b9f8bfa"

[workspace.dependencies.job-runner]
path = "packages/infra/legacy/job-runner"

Expand Down Expand Up @@ -890,40 +923,6 @@ path = "packages/services/tier"
[workspace.dependencies.rivet-api]
path = "sdks/full/rust"

[workspace.dependencies.sqlx]
git = "https://github.com/rivet-gg/sqlx"
rev = "e7120f59"

[workspace.dependencies.nomad_client]
git = "https://github.com/rivet-gg/nomad-client"
rev = "abb66bf"

[workspace.dependencies.nomad_client_new]
git = "https://github.com/rivet-gg/nomad-client"
rev = "abb66bf"
package = "nomad_client"

[workspace.dependencies.async-posthog]
git = "https://github.com/rivet-gg/posthog-rs"
rev = "ef4e80e"

[workspace.dependencies.cloudflare]
git = "https://github.com/cloudflare/cloudflare-rs"
rev = "f14720e"

[workspace.dependencies.rivet-term]
git = "https://github.com/rivet-gg/rivet-term"
rev = "d539a07"

[workspace.dependencies.redis]
# TODO: https://github.com/rivet-gg/rivet/issues/508
git = "https://github.com/rivet-gg/redis-rs"
rev = "ac3e27f"

[workspace.dependencies.serde_array_query]
git = "https://github.com/rivet-gg/serde_array_query"
rev = "b9f8bfa"

[profile.dev]
overflow-checks = false
debug = false
Expand Down
10 changes: 5 additions & 5 deletions packages/api/actor/src/route/actors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub async fn create(
routing: if let Some(routing) = p.routing {
match *routing {
models::ActorPortRouting {
game_guard: Some(gg),
guard: Some(gg),
host: None,
} => ds::types::Routing::GameGuard {
protocol: p.protocol.api_into(),
Expand All @@ -188,7 +188,7 @@ pub async fn create(
},
},
models::ActorPortRouting {
game_guard: None,
guard: None,
host: Some(_),
} => ds::types::Routing::Host {
protocol: p.protocol.api_try_into()?,
Expand Down Expand Up @@ -295,8 +295,8 @@ pub async fn create_deprecated(
},
routing: p.routing.map(|r| {
Box::new(models::ActorPortRouting {
game_guard: r.game_guard.map(|_| {
Box::new(models::ActorGameGuardRouting::default())
guard: r.game_guard.map(|_| {
Box::new(models::ActorGuardRouting::default())
}),
host: r.host.map(|_| json!({})),
})
Expand Down Expand Up @@ -558,7 +558,7 @@ fn legacy_convert_actor_to_server(
public_hostname: p.public_hostname,
public_port: p.public_port,
routing: Box::new(models::ServersPortRouting {
game_guard: p.routing.game_guard.map(|_| json!({})),
game_guard: p.routing.guard.map(|_| json!({})),
host: p.routing.host.map(|_| json!({})),
}),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl ClusterPoolGg {
self.vlan_ip_net().hosts()
}

pub fn firewall_rules(&self, gg: &super::GameGuard) -> Vec<FirewallRule> {
pub fn firewall_rules(&self, gg: &super::Guard) -> Vec<FirewallRule> {
[
FirewallRule::base_rules(),
vec![
Expand Down
10 changes: 5 additions & 5 deletions packages/common/config/src/config/server/rivet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub struct Rivet {
pub pegboard: Pegboard,

#[serde(default)]
pub game_guard: GameGuard,
pub guard: Guard,

#[serde(default)]
pub auth: Auth,
Expand Down Expand Up @@ -132,7 +132,7 @@ impl Default for Rivet {
tunnel: Default::default(),
ui: Default::default(),
pegboard: Pegboard::default(),
game_guard: GameGuard::default(),
guard: Guard::default(),
job_run: None,
auth: Auth::default(),
token: Tokens::default(),
Expand Down Expand Up @@ -465,18 +465,18 @@ impl Pegboard {
}
}

/// The port ranges define what ports Game Guard will allocate ports on. If using cluster
/// The port ranges define what ports Guard will allocate ports on. If using cluster
/// provisioning, these are also used for firewall rules.
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
#[serde(rename_all = "snake_case", deny_unknown_fields)]
pub struct GameGuard {
pub struct Guard {
pub min_ingress_port_tcp: Option<u16>,
pub max_ingress_port_tcp: Option<u16>,
pub min_ingress_port_udp: Option<u16>,
pub max_ingress_port_udp: Option<u16>,
}

impl GameGuard {
impl Guard {
pub fn min_ingress_port_tcp(&self) -> u16 {
self.min_ingress_port_tcp.unwrap_or(20000)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ fn tunnel_dynamic_config(host_tunnel: &str) -> String {

pub async fn gg_static_config(config: &rivet_config::Config) -> GlobalResult<String> {
let provision_config = config.server()?.rivet.provision()?;
let gg_config = &config.server()?.rivet.game_guard;
let gg_config = &config.server()?.rivet.guard;

let http_provider_endpoint = if let Some(api_traefik_provider_token) =
&config.server()?.rivet.token.traefik_provider
Expand Down
2 changes: 1 addition & 1 deletion packages/services/ds/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl ApiFrom<Port> for models::ActorPort {
} => (
(*protocol).api_into(),
models::ActorPortRouting {
game_guard: Some(Box::new(models::ActorGameGuardRouting {
guard: Some(Box::new(models::ActorGuardRouting {
authorization: match authorization {
PortAuthorization::None => None,
PortAuthorization::Bearer(token) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/services/ds/src/workflows/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ pub(crate) async fn resolve_image_artifact_url(
/// - TCP/TLS: random
/// - UDP: random
async fn choose_ingress_port(ctx: &ActivityCtx, protocol: GameGuardProtocol) -> GlobalResult<u16> {
let gg_config = &ctx.config().server()?.rivet.game_guard;
let gg_config = &ctx.config().server()?.rivet.guard;

match protocol {
GameGuardProtocol::Http => Ok(80),
Expand Down
2 changes: 1 addition & 1 deletion packages/services/job-run/src/workers/create/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ async fn choose_ingress_port(
) -> GlobalResult<i32> {
use backend::job::ProxyProtocol;

let gg_config = &ctx.config().server()?.rivet.game_guard;
let gg_config = &ctx.config().server()?.rivet.guard;

let ingress_port = if let Some(ingress_port) = proxied_port.ingress_port {
ingress_port as i32
Expand Down
2 changes: 1 addition & 1 deletion packages/services/linode/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl FirewallPreset {
FirewallPreset::Gg => provision_config
.pools
.gg
.firewall_rules(&config.server()?.rivet.game_guard),
.firewall_rules(&config.server()?.rivet.guard),
FirewallPreset::Ats => provision_config.pools.ats.firewall_rules(),
})
}
Expand Down
4 changes: 2 additions & 2 deletions sdks/fern/definition/actor/common.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions sdks/full/go/actor/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions sdks/full/openapi/openapi.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions sdks/full/openapi_compat/openapi.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdks/full/rust-cli/.openapi-generator/FILES

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdks/full/rust-cli/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdks/full/rust-cli/docs/ActorPortRouting.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 76312de

Please sign in to comment.