Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/target
test.yaml
test.yaml

binaries/geph5-ios/geph5/geph5.xcodeproj/xcuserdata
binaries/geph5-ios/geph5/geph5.xcodeproj/project.xcworkspace/xcuserdata
59 changes: 39 additions & 20 deletions Cargo.lock

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

14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,17 @@ opt-level = 3
[profile.release-dbg]
inherits = "dev"
opt-level = 3

[patch.crates-io]
# We currently need two egui PRs to fix iOS builds:
# https://github.com/emilk/egui/pull/4855
# https://github.com/emilk/egui/pull/4851
# I've combined the changes in a branch in my fork:
egui = { git = "https://github.com/lucasmerlin/egui", branch = "eframe_ios_fixes" }
eframe = { git = "https://github.com/lucasmerlin/egui", branch = "eframe_ios_fixes" }
egui-wgpu = { git = "https://github.com/lucasmerlin/egui", branch = "eframe_ios_fixes" }
egui_extras = { git = "https://github.com/lucasmerlin/egui", branch = "eframe_ios_fixes" }
emath = { git = "https://github.com/lucasmerlin/egui", branch = "eframe_ios_fixes" }


winit = { git = "https://github.com/lucasmerlin/winit", branch = "geph-v0.29.x" }
7 changes: 5 additions & 2 deletions binaries/geph5-client-gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ icon = ["icon.png"]
anyhow = "1.0.86"
csv = "1.3.0"
# dirs = "5.0.1"
eframe = { version = "0.28.1" }
eframe = { version = "0.28.1", default-features = false }
egui = "0.28.1"
moka = { version = "0.12.7", features = ["sync"] }
arc-writer = { path = "../../libraries/arc-writer" }
Expand Down Expand Up @@ -56,10 +56,13 @@ strip-ansi-escapes = "0.2.0"
[build-dependencies]
winresource = "0.1"

[target.'cfg(not(target_os = "android"))'.dependencies]
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
single-instance = "0.3.3"
native-dialog = "0.7.0"

[target.'cfg(not(target_os = "ios"))'.dependencies]
eframe = { version = "0.28.1", default-features = true }

[target.'cfg(windows)'.dependencies]
winreg = "0.52.0"
winapi = { version = "0.3.9", features = ["wininet"] }
2 changes: 1 addition & 1 deletion binaries/geph5-client-gui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl App {
}
});

#[cfg(not(target_os = "android"))]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
if let Err(err) = result.inner {
use native_dialog::MessageType;
let _ = native_dialog::MessageDialog::new()
Expand Down
3 changes: 3 additions & 0 deletions binaries/geph5-client-gui/src/pac/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ pub use macos::*;
mod dummy;
#[cfg(target_os = "android")]
pub use dummy::*;

#[cfg(target_os = "ios")]
pub use dummy::*;
2 changes: 1 addition & 1 deletion binaries/geph5-client-gui/src/tabs/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl Logs {
if let Some(Ok(logs)) = logs {
let logs = strip_ansi_escapes::strip_str(logs.join("\n"));

#[cfg(not(target_os = "android"))]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
if ui.button(l10n("export_logs")).clicked() {
use native_dialog::FileDialog;
let path = FileDialog::new()
Expand Down
4 changes: 3 additions & 1 deletion binaries/geph5-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ async-dup = "1.2.4"
async-trait = "0.1.80"
atomic_float = "1.0.0"
aws-config = "1.5.4"
aws-sdk-lambda = "1.35.0"
aws-sdk-lambda = { version = "1.35.0", features = ["rustls"] }
aws-smithy-runtime = "1"
blake3 = "1.5.1"
blind-rsa-signatures = "0.15.1"
bytes = "1.6.0"
Expand All @@ -34,6 +35,7 @@ hex = "0.4.3"
http = "1.1.0"
http-body-util = "0.1.2"
hyper = { version = "1.4.0", features = ["http1", "client", "server"] }
hyper-rustls = { version = "0.24.2", features = ["webpki-roots"] }
hyper-util = { version = "0.1.6" }
ipstack-geph = "0.2.0"
# ipstack-geph={path="../../../ipstack-geph"}
Expand Down
15 changes: 15 additions & 0 deletions binaries/geph5-client/src/broker/aws_lambda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use aws_config::BehaviorVersion;
use aws_sdk_lambda::{config::Credentials, primitives::Blob};
use nanorpc::{JrpcRequest, JrpcResponse, RpcTransport};
use serde::Deserialize;
use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder;

pub struct AwsLambdaTransport {
pub function_name: String,
Expand All @@ -16,6 +17,19 @@ pub struct AwsLambdaTransport {
impl RpcTransport for AwsLambdaTransport {
type Error = anyhow::Error;
async fn call_raw(&self, req: JrpcRequest) -> Result<JrpcResponse, Self::Error> {
// To use webpki-roots we need to create a custom http client, as explained here: https://github.com/smithy-lang/smithy-rs/discussions/3022

// Create a connector that will be used to establish TLS connections
let tls_connector = hyper_rustls::HttpsConnectorBuilder::new()
.with_webpki_roots()
.https_only()
.enable_http1()
.enable_http2()
.build();

// Create a hyper-based HTTP client that uses this TLS connector.
let http_client = HyperClientBuilder::new().build(tls_connector);

let client = aws_sdk_lambda::Client::new(
&aws_config::defaults(BehaviorVersion::v2024_03_28())
.region(string_to_static_str(self.region.clone()))
Expand All @@ -26,6 +40,7 @@ impl RpcTransport for AwsLambdaTransport {
None,
"test",
))
.http_client(http_client)
.load()
.await,
);
Expand Down
4 changes: 2 additions & 2 deletions binaries/geph5-client/src/vpn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ mod linux;
#[cfg(target_os = "linux")]
pub use linux::*;

#[cfg(target_os = "android")]
#[cfg(any(target_os = "android", target_os = "ios"))]
mod dummy;

#[cfg(target_os = "android")]
#[cfg(any(target_os = "android", target_os = "ios"))]
pub use dummy::*;

use std::{net::Ipv4Addr, time::Duration};
Expand Down
14 changes: 14 additions & 0 deletions binaries/geph5-ios/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "geph5-ios"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["staticlib"]

[dependencies]

# I couldn't get it to work with glow, but I think wgpu shoulg be better on iOS anyway, since it uses metal (opengl is deprecated on iOS)
eframe = { version = "0.28.1", features = ["wgpu", "default_fonts"], default-features = false }

geph5-client-gui = { path = "../geph5-client-gui" }
7 changes: 7 additions & 0 deletions binaries/geph5-ios/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/zsh

if [ $CONFIGURATION = "Release" ]; then
cargo build --target aarch64-apple-ios --release
else
cargo build --target aarch64-apple-ios
fi
Loading