Compare commits
2 Commits
511e62b58c
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a5dde9ee3 | |||
| 9e09110b16 |
798
AobaClient/Cargo.lock
generated
798
AobaClient/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -6,8 +6,8 @@ edition = "2024"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
dioxus = { version = "0.7.2", features = ["router"] }
|
||||
serde = "1.0.219"
|
||||
dioxus = { version = "0.7.3", features = ["router"] }
|
||||
serde = "1.0.228"
|
||||
serde_repr = "0.1.20"
|
||||
tonic = { version = "*", default-features = false, features = [
|
||||
"codegen",
|
||||
@@ -15,7 +15,7 @@ tonic = { version = "*", default-features = false, features = [
|
||||
] }
|
||||
prost = "0.13"
|
||||
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]
|
||||
tonic-build = { version = "*", default-features = false, features = ["prost"] }
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
pub mod basic;
|
||||
mod context_menu;
|
||||
mod icons;
|
||||
mod media_grid;
|
||||
mod media_item;
|
||||
mod metrics_token;
|
||||
mod navbar;
|
||||
mod notif;
|
||||
mod pagination;
|
||||
mod passkey;
|
||||
mod search;
|
||||
pub use context_menu::*;
|
||||
pub use media_grid::*;
|
||||
@@ -14,5 +16,5 @@ pub use metrics_token::*;
|
||||
pub use navbar::*;
|
||||
pub use notif::*;
|
||||
pub use pagination::*;
|
||||
pub use passkey::*;
|
||||
pub use search::*;
|
||||
mod icons;
|
||||
|
||||
30
AobaClient/src/components/passkey.rs
Normal file
30
AobaClient/src/components/passkey.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
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() {}
|
||||
|
||||
fn create_credential() {}
|
||||
|
||||
#[component]
|
||||
pub fn PasskeyLoginButton() -> Element
|
||||
{
|
||||
rsx! {
|
||||
Button{
|
||||
text: "Login with Passkey"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,21 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
use crate::{components::MetricsToken, rpc::get_rpc_client};
|
||||
use crate::{
|
||||
components::{MetricsToken, PasskeyRegistrationButton},
|
||||
rpc::get_rpc_client,
|
||||
};
|
||||
|
||||
#[component]
|
||||
pub fn Settings() -> Element {
|
||||
pub fn Settings() -> Element
|
||||
{
|
||||
let dst = use_resource(async move || {
|
||||
let result = get_rpc_client().get_share_x_destination(()).await;
|
||||
if let Ok(d) = result {
|
||||
if let Some(r) = d.into_inner().dst_result {
|
||||
return match r {
|
||||
if let Ok(d) = result
|
||||
{
|
||||
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::Error(err) => err,
|
||||
};
|
||||
@@ -28,5 +35,6 @@ pub fn Settings() -> Element {
|
||||
pre { class: "codeSelect", "{d}" }
|
||||
}
|
||||
MetricsToken { }
|
||||
PasskeyRegistrationButton { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FFMpegCore" Version="5.2.0" />
|
||||
<PackageReference Include="FFMpegCore" Version="5.4.0" />
|
||||
<PackageReference Include="Isopoh.Cryptography.Argon2" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.7" />
|
||||
<PackageReference Include="MaybeError" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.7" />
|
||||
<PackageReference Include="MongoDB.Driver" Version="3.4.1" />
|
||||
<PackageReference Include="MongoDB.Driver.Core.Extensions.DiagnosticSources" Version="2.1.0" />
|
||||
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.6" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.12.1" />
|
||||
<PackageReference Include="ZLinq" Version="1.5.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3" />
|
||||
<PackageReference Include="MaybeError" Version="1.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.3" />
|
||||
<PackageReference Include="MongoDB.Driver" Version="3.6.0" />
|
||||
<PackageReference Include="MongoDB.Driver.Core.Extensions.DiagnosticSources" Version="3.0.0" />
|
||||
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.7" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.16.0" />
|
||||
<PackageReference Include="ZLinq" Version="1.5.5" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>9ffcc706-7f1b-48e3-bf30-eab69a90fded</UserSecretsId>
|
||||
@@ -9,22 +9,23 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Grpc.AspNetCore" Version="2.71.0" />
|
||||
<PackageReference Include="Grpc.AspNetCore.Web" Version="2.71.0" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.72.0">
|
||||
<PackageReference Include="Fido2" Version="4.0.0" />
|
||||
<PackageReference Include="Grpc.AspNetCore" Version="2.76.0" />
|
||||
<PackageReference Include="Grpc.AspNetCore.Web" Version="2.76.0" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.78.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Isopoh.Cryptography.Argon2" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.7" />
|
||||
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.12.1" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.3" />
|
||||
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.16.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
|
||||
<PackageReference Include="MimeTypesMap" Version="1.0.9" />
|
||||
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.12.0" />
|
||||
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.0" />
|
||||
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.9.0-beta.2" />
|
||||
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.12.0" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.12.0" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.12.0" />
|
||||
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.15.0" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.0" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.15.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -33,6 +34,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="Proto\Aoba.proto"></Protobuf>
|
||||
<Protobuf Include="Proto\Account.proto" />
|
||||
<Protobuf Include="Proto\Auth.proto"></Protobuf>
|
||||
<Protobuf Include="Proto\Metrics.proto"></Protobuf>
|
||||
<Protobuf Include="Proto\Types.proto"></Protobuf>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
ARG NET_VERSION="10.0"
|
||||
ARG DX_VERSION="0.7.3"
|
||||
|
||||
# Client Side build - prep deps
|
||||
FROM rust:1 AS chef
|
||||
FROM rust:1-trixie AS chef
|
||||
RUN rustup target add wasm32-unknown-unknown
|
||||
RUN cargo install cargo-chef
|
||||
WORKDIR /app
|
||||
@@ -22,7 +25,8 @@ RUN apt install -y protobuf-compiler libprotobuf-dev ffmpeg
|
||||
|
||||
# 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 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"
|
||||
ARG VERSION
|
||||
ENV APP_VERSION=$VERSION
|
||||
@@ -31,7 +35,7 @@ RUN dx bundle --release --platform web
|
||||
|
||||
# Server Build
|
||||
# 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
|
||||
USER $APP_UID
|
||||
WORKDIR /app
|
||||
@@ -39,11 +43,11 @@ EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
# 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
|
||||
WORKDIR /src
|
||||
COPY ["AobaServer/AobaServer.csproj", "AobaServer/"]
|
||||
RUN dotnet restore "./AobaServer/AobaServer.csproj"
|
||||
RUN dotnet restore "/src/AobaServer/AobaServer.csproj"
|
||||
COPY . .
|
||||
# Copy Built bundle from client builder
|
||||
COPY --from=client-builder /app/AobaClient/target/dx/aoba-client/release/web/public /src/AobaServer/wwwroot
|
||||
|
||||
13
AobaServer/Proto/Account.proto
Normal file
13
AobaServer/Proto/Account.proto
Normal 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);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ import "Proto/Types.proto";
|
||||
|
||||
service AuthRpc {
|
||||
rpc Login(Credentials) returns (LoginResponse);
|
||||
rpc LoginPasskey(PassKeyPayload) returns (LoginResponse);
|
||||
rpc LoginPasskey(PasskeyPayload) returns (LoginResponse);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,9 +9,7 @@ message Credentials{
|
||||
string password = 2;
|
||||
}
|
||||
|
||||
message PassKeyPayload {
|
||||
|
||||
}
|
||||
|
||||
|
||||
message Jwt{
|
||||
@@ -111,3 +109,14 @@ message Filter {
|
||||
string key = 1;
|
||||
repeated string values = 2;
|
||||
}
|
||||
|
||||
message PasskeyPayload {
|
||||
|
||||
}
|
||||
|
||||
message PasskeyRegistrationCreds{
|
||||
|
||||
}
|
||||
message PasskeyPublicKey{
|
||||
|
||||
}
|
||||
22
AobaServer/Services/AccountRpcService.cs
Normal file
22
AobaServer/Services/AccountRpcService.cs
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user