Skip to content

Commit

Permalink
Set platform to docker in version register
Browse files Browse the repository at this point in the history
  • Loading branch information
loriopatrick committed Aug 21, 2024
1 parent 00d02cc commit 3964e90
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ members = [
]

[workspace.package]
version = "0.15.20"
version = "0.15.21"

[workspace.dependencies]
tokio = { version = "1.39", features = ["full"] }
Expand Down
2 changes: 1 addition & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ if [ -z "${SECRET_KEY}" ]; then
fi
fi

playit -s --secret "${SECRET_KEY}" start
playit -s --secret "${SECRET_KEY}" --platform_docker start
29 changes: 20 additions & 9 deletions packages/agent_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,26 @@ pub mod signal_handle;

#[tokio::main]
async fn main() -> Result<std::process::ExitCode, CliError> {
register_version(PlayitAgentVersion {
version: AgentVersion {
platform: get_platform(),
version: env!("CARGO_PKG_VERSION").to_string(),
},
official: true,
details_website: None,
});

let matches = cli().get_matches();

/* register docker */
{
let platform = if matches.get_flag("platform_docker") {
Platform::Docker
} else {
get_platform()
};

register_version(PlayitAgentVersion {
version: AgentVersion {
platform,
version: env!("CARGO_PKG_VERSION").to_string(),
},
official: true,
details_website: None,
});
}

let mut secret = PlayitSecret::from_args(&matches).await;
let _ = secret.with_default_path().await;

Expand Down Expand Up @@ -556,6 +566,7 @@ fn cli() -> Command {
.arg(arg!(-w --secret_wait "wait for secret_path file to read secret").required(false))
.arg(arg!(-s --stdout "prints logs to stdout").required(false))
.arg(arg!(-l --log_path <PATH> "path to write logs to").required(false))
.arg(arg!(--platform_docker "overrides platform in version to be docker").required(false))
.subcommand_required(false)
.subcommand(Command::new("version"))
.subcommand(
Expand Down
2 changes: 1 addition & 1 deletion packages/agent_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "playit-agent-core"
version = "0.17.2"
version = "0.17.3"
edition = "2021"
description = "Contains the logic to create a playit.gg agent"
license = "BSD-2-Clause"
Expand Down
5 changes: 5 additions & 0 deletions packages/agent_core/src/api/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ impl<C: std::fmt::Debug> std::fmt::Display for ApiErrorNoFail<C> {
impl<C: std::fmt::Debug> std::error::Error for ApiErrorNoFail<C> {
}



pub trait PlayitHttpClient {
type Error;

Expand Down Expand Up @@ -296,6 +298,7 @@ pub enum TunnelCreateError {
PortAllocNotFound,
InvalidIpHostname,
ManagedMissingAgentId,
InvalidPortCount,
}

impl std::fmt::Display for TunnelCreateError {
Expand Down Expand Up @@ -502,6 +505,8 @@ pub enum Platform {
Android,
#[serde(rename = "ios")]
Ios,
#[serde(rename = "docker")]
Docker,
#[serde(rename = "minecraft-plugin")]
MinecraftPlugin,
#[serde(rename = "unknown")]
Expand Down

0 comments on commit 3964e90

Please sign in to comment.