update dockerfile + wip passkey implementation

This commit is contained in:
2026-03-02 17:07:30 -05:00
parent 511e62b58c
commit 9e09110b16
12 changed files with 497 additions and 427 deletions

798
AobaClient/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,8 +6,8 @@ edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
dioxus = { version = "0.7.2", features = ["router"] } dioxus = { version = "0.7.3", features = ["router"] }
serde = "1.0.219" serde = "1.0.228"
serde_repr = "0.1.20" serde_repr = "0.1.20"
tonic = { version = "*", default-features = false, features = [ tonic = { version = "*", default-features = false, features = [
"codegen", "codegen",
@@ -15,7 +15,7 @@ tonic = { version = "*", default-features = false, features = [
] } ] }
prost = "0.13" prost = "0.13"
tonic-web-wasm-client = "0.7" tonic-web-wasm-client = "0.7"
web-sys = { version = "0.3.77", features = ["Storage", "Window"] } web-sys = { version = "0.3.91", features = ["Storage", "Window"] }
[build-dependencies] [build-dependencies]
tonic-build = { version = "*", default-features = false, features = ["prost"] } tonic-build = { version = "*", default-features = false, features = ["prost"] }

View File

@@ -1,11 +1,13 @@
pub mod basic; pub mod basic;
mod context_menu; mod context_menu;
mod icons;
mod media_grid; mod media_grid;
mod media_item; mod media_item;
mod metrics_token; mod metrics_token;
mod navbar; mod navbar;
mod notif; mod notif;
mod pagination; mod pagination;
mod passkey;
mod search; mod search;
pub use context_menu::*; pub use context_menu::*;
pub use media_grid::*; pub use media_grid::*;
@@ -14,5 +16,5 @@ pub use metrics_token::*;
pub use navbar::*; pub use navbar::*;
pub use notif::*; pub use notif::*;
pub use pagination::*; pub use pagination::*;
pub use passkey::*;
pub use search::*; pub use search::*;
mod icons;

View File

@@ -0,0 +1,28 @@
use dioxus::prelude::*;
use crate::components::basic::Button;
#[component]
pub fn PasskeyRegistrationButton() -> Element
{
rsx! {
Button{
text: "Register Passkey",
onclick: move |e| {
}
}
}
}
fn start_passkey_registration() {}
#[component]
pub fn PasskeyLoginButton() -> Element
{
rsx! {
Button{
text: "Login with Passkey"
}
}
}

View File

@@ -1,14 +1,21 @@
use dioxus::prelude::*; use dioxus::prelude::*;
use crate::{components::MetricsToken, rpc::get_rpc_client}; use crate::{
components::{MetricsToken, PasskeyRegistrationButton},
rpc::get_rpc_client,
};
#[component] #[component]
pub fn Settings() -> Element { pub fn Settings() -> Element
{
let dst = use_resource(async move || { let dst = use_resource(async move || {
let result = get_rpc_client().get_share_x_destination(()).await; let result = get_rpc_client().get_share_x_destination(()).await;
if let Ok(d) = result { if let Ok(d) = result
if let Some(r) = d.into_inner().dst_result { {
return match r { if let Some(r) = d.into_inner().dst_result
{
return match r
{
crate::rpc::aoba::share_x_response::DstResult::Destination(json) => json, crate::rpc::aoba::share_x_response::DstResult::Destination(json) => json,
crate::rpc::aoba::share_x_response::DstResult::Error(err) => err, crate::rpc::aoba::share_x_response::DstResult::Error(err) => err,
}; };
@@ -28,5 +35,6 @@ pub fn Settings() -> Element {
pre { class: "codeSelect", "{d}" } pre { class: "codeSelect", "{d}" }
} }
MetricsToken { } MetricsToken { }
PasskeyRegistrationButton { }
} }
} }

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>9ffcc706-7f1b-48e3-bf30-eab69a90fded</UserSecretsId> <UserSecretsId>9ffcc706-7f1b-48e3-bf30-eab69a90fded</UserSecretsId>
@@ -9,6 +9,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Fido2" Version="4.0.0" />
<PackageReference Include="Grpc.AspNetCore" Version="2.71.0" /> <PackageReference Include="Grpc.AspNetCore" Version="2.71.0" />
<PackageReference Include="Grpc.AspNetCore.Web" Version="2.71.0" /> <PackageReference Include="Grpc.AspNetCore.Web" Version="2.71.0" />
<PackageReference Include="Grpc.Tools" Version="2.72.0"> <PackageReference Include="Grpc.Tools" Version="2.72.0">
@@ -33,6 +34,7 @@
<ItemGroup> <ItemGroup>
<Protobuf Include="Proto\Aoba.proto"></Protobuf> <Protobuf Include="Proto\Aoba.proto"></Protobuf>
<Protobuf Include="Proto\Account.proto" />
<Protobuf Include="Proto\Auth.proto"></Protobuf> <Protobuf Include="Proto\Auth.proto"></Protobuf>
<Protobuf Include="Proto\Metrics.proto"></Protobuf> <Protobuf Include="Proto\Metrics.proto"></Protobuf>
<Protobuf Include="Proto\Types.proto"></Protobuf> <Protobuf Include="Proto\Types.proto"></Protobuf>

View File

@@ -1,5 +1,8 @@
ARG NET_VERSION="10.0"
ARG DX_VERSION="0.7.3"
# Client Side build - prep deps # Client Side build - prep deps
FROM rust:1 AS chef FROM rust:1-trixie AS chef
RUN rustup target add wasm32-unknown-unknown RUN rustup target add wasm32-unknown-unknown
RUN cargo install cargo-chef RUN cargo install cargo-chef
WORKDIR /app WORKDIR /app
@@ -22,7 +25,8 @@ RUN apt install -y protobuf-compiler libprotobuf-dev ffmpeg
# Install `dx` # Install `dx`
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
RUN cargo binstall dioxus-cli@0.7.2 --root /.cargo -y --force ARG DX_VERSION
RUN cargo binstall dioxus-cli@${DX_VERSION} --root /.cargo -y --force
ENV PATH="/.cargo/bin:$PATH" ENV PATH="/.cargo/bin:$PATH"
ARG VERSION ARG VERSION
ENV APP_VERSION=$VERSION ENV APP_VERSION=$VERSION
@@ -31,7 +35,7 @@ RUN dx bundle --release --platform web
# Server Build # Server Build
# This stage is used when running from VS in fast mode (Default for Debug configuration) # This stage is used when running from VS in fast mode (Default for Debug configuration)
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base FROM mcr.microsoft.com/dotnet/aspnet:${NET_VERSION} AS base
RUN apt-get update && apt-get install -y ffmpeg #libvips libvips-tools RUN apt-get update && apt-get install -y ffmpeg #libvips libvips-tools
USER $APP_UID USER $APP_UID
WORKDIR /app WORKDIR /app
@@ -39,11 +43,11 @@ EXPOSE 8080
EXPOSE 8081 EXPOSE 8081
# This stage is used to build the service project # This stage is used to build the service project
FROM mcr.microsoft.com/dotnet/sdk:9.0-noble AS build FROM mcr.microsoft.com/dotnet/sdk:${NET_VERSION}-noble AS build
ARG BUILD_CONFIGURATION=Release ARG BUILD_CONFIGURATION=Release
WORKDIR /src WORKDIR /src
COPY ["AobaServer/AobaServer.csproj", "AobaServer/"] COPY ["AobaServer/AobaServer.csproj", "AobaServer/"]
RUN dotnet restore "./AobaServer/AobaServer.csproj" RUN dotnet restore "/src/AobaServer/AobaServer.csproj"
COPY . . COPY . .
# Copy Built bundle from client builder # Copy Built bundle from client builder
COPY --from=client-builder /app/AobaClient/target/dx/aoba-client/release/web/public /src/AobaServer/wwwroot COPY --from=client-builder /app/AobaClient/target/dx/aoba-client/release/web/public /src/AobaServer/wwwroot

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option csharp_namespace = "Aoba.RPC.Account";
package aoba;
import "google/protobuf/empty.proto";
import "Proto/Types.proto";
service AccountRpc {
rpc RegisterPasskey(google.protobuf.Empty) returns (PasskeyRegistrationCreds);
rpc CompletePasskeyRegistration(PasskeyPublicKey) returns (google.protobuf.Empty);
}

View File

@@ -7,6 +7,6 @@ import "Proto/Types.proto";
service AuthRpc { service AuthRpc {
rpc Login(Credentials) returns (LoginResponse); rpc Login(Credentials) returns (LoginResponse);
rpc LoginPasskey(PassKeyPayload) returns (LoginResponse); rpc LoginPasskey(PasskeyPayload) returns (LoginResponse);
} }

View File

@@ -9,9 +9,7 @@ message Credentials{
string password = 2; string password = 2;
} }
message PassKeyPayload {
}
message Jwt{ message Jwt{
@@ -110,4 +108,15 @@ message SearchQuery {
message Filter { message Filter {
string key = 1; string key = 1;
repeated string values = 2; repeated string values = 2;
}
message PasskeyPayload {
}
message PasskeyRegistrationCreds{
}
message PasskeyPublicKey{
} }

View File

@@ -0,0 +1,22 @@
using Aoba.RPC;
using Aoba.RPC.Account;
using Google.Protobuf.WellKnownTypes;
using Grpc.Core;
namespace AobaServer.Services;
public class AccountRpcService : AccountRpc.AccountRpcBase
{
public override Task<PasskeyRegistrationCreds> RegisterPasskey(Empty request, ServerCallContext context)
{
return base.RegisterPasskey(request, context);
}
public override Task<Empty> CompletePasskeyRegistration(PasskeyPublicKey request, ServerCallContext context)
{
return base.CompletePasskeyRegistration(request, context);
}
}