3 Commits

Author SHA1 Message Date
3a5dde9ee3 update .net + passkey wip 2026-03-10 17:48:07 -04:00
9e09110b16 update dockerfile + wip passkey implementation 2026-03-02 17:07:30 -05:00
511e62b58c sticky pagination
All checks were successful
Build and Push Image / build-and-push (push) Successful in 4m6s
2025-12-28 15:20:21 -05:00
15 changed files with 637 additions and 560 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

@@ -21,6 +21,8 @@
top: 0; top: 0;
position: sticky; position: sticky;
z-index: 100; z-index: 100;
backdrop-filter: blur(20px);
box-shadow: 0 3px 10px $mainBGColor;
} }
body { body {
@@ -201,7 +203,7 @@ form {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
gap: 5; gap: 5;
padding: 2px; padding: 10px;
a { a {
transition: all 0.25s ease-out; transition: all 0.25s ease-out;

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,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"
}
}
}

View File

@@ -3,7 +3,7 @@ use dioxus::prelude::*;
#[component] #[component]
pub fn Search(query: Signal<String>, page: Signal<i32>) -> Element { pub fn Search(query: Signal<String>, page: Signal<i32>) -> Element {
rsx! { rsx! {
div { class: "searchBar stickyTop", div { class: "searchBar",
input { input {
r#type: "search", r#type: "search",
placeholder: "Search Files", placeholder: "Search Files",

View File

@@ -8,8 +8,11 @@ pub fn Home() -> Element {
let max_page = use_signal(|| 1 as i32); let max_page = use_signal(|| 1 as i32);
let item_count = use_signal(|| 0 as i32); let item_count = use_signal(|| 0 as i32);
rsx! { rsx! {
Search { query, page }, div {
Pagination { page, max_page, item_count }, class: "stickyTop",
Search { query, page },
Pagination { page, max_page, item_count },
}
MediaGrid { query: query.cloned(), page: page.cloned(), max_page, total_items: item_count } MediaGrid { query: query.cloned(), page: page.cloned(), max_page, total_items: item_count }
} }
} }

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,22 +1,22 @@
<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>
<ItemGroup> <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="Isopoh.Cryptography.Argon2" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.7" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3" />
<PackageReference Include="MaybeError" Version="1.1.0" /> <PackageReference Include="MaybeError" Version="1.2.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.7" /> <PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.3" />
<PackageReference Include="MongoDB.Driver" Version="3.4.1" /> <PackageReference Include="MongoDB.Driver" Version="3.6.0" />
<PackageReference Include="MongoDB.Driver.Core.Extensions.DiagnosticSources" Version="2.1.0" /> <PackageReference Include="MongoDB.Driver.Core.Extensions.DiagnosticSources" Version="3.0.0" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.6" /> <PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.7" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.12.1" /> <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.16.0" />
<PackageReference Include="ZLinq" Version="1.5.1" /> <PackageReference Include="ZLinq" Version="1.5.5" />
</ItemGroup> </ItemGroup>
</Project> </Project>

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,22 +9,23 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Grpc.AspNetCore" Version="2.71.0" /> <PackageReference Include="Fido2" Version="4.0.0" />
<PackageReference Include="Grpc.AspNetCore.Web" Version="2.71.0" /> <PackageReference Include="Grpc.AspNetCore" Version="2.76.0" />
<PackageReference Include="Grpc.Tools" Version="2.72.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> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Isopoh.Cryptography.Argon2" Version="2.0.0" /> <PackageReference Include="Isopoh.Cryptography.Argon2" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.7" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.3" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.12.1" /> <PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.16.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" /> <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
<PackageReference Include="MimeTypesMap" Version="1.0.9" /> <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.Exporter.Prometheus.AspNetCore" Version="1.9.0-beta.2" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.12.0" /> <PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.15.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.12.0" /> <PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.12.0" /> <PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.15.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -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

@@ -1,113 +1,122 @@
syntax = "proto3"; syntax = "proto3";
option csharp_namespace = "Aoba.RPC"; option csharp_namespace = "Aoba.RPC";
package aoba; package aoba;
import "google/protobuf/empty.proto"; import "google/protobuf/empty.proto";
message Credentials{ message Credentials{
string user = 1; string user = 1;
string password = 2; string password = 2;
} }
message PassKeyPayload {
}
message Jwt{
string token = 1;
message Jwt{ }
string token = 1;
} message LoginResponse{
oneof result {
message LoginResponse{ Jwt jwt = 1;
oneof result { LoginError error = 2;
Jwt jwt = 1; }
LoginError error = 2; }
}
} message LoginError{
string message = 1;
message LoginError{ }
string message = 1;
} message PageFilter {
optional int32 page = 1;
message PageFilter { optional int32 pageSize = 2;
optional int32 page = 1; optional string query = 3;
optional int32 pageSize = 2; }
optional string query = 3;
} message Id {
string value = 1;
message Id { }
string value = 1;
} message MediaResponse {
oneof result {
message MediaResponse { MediaModel value = 1;
oneof result { google.protobuf.Empty empty = 2;
MediaModel value = 1; }
google.protobuf.Empty empty = 2; }
}
} message ListResponse {
repeated MediaModel items = 1;
message ListResponse { Pagination pagination = 2;
repeated MediaModel items = 1; }
Pagination pagination = 2;
} message Pagination {
int32 page = 1;
message Pagination { int32 pageSize = 2;
int32 page = 1; int32 totalPages = 3;
int32 pageSize = 2; int32 totalItems = 4;
int32 totalPages = 3; optional string query = 5;
int32 totalItems = 4; }
optional string query = 5;
} message UserResponse {
oneof userResult {
message UserResponse { UserModel user = 1;
oneof userResult { google.protobuf.Empty empty = 2;
UserModel user = 1; }
google.protobuf.Empty empty = 2; }
}
} message UserModel {
Id id = 1;
message UserModel { string username = 2;
Id id = 1; string email = 3;
string username = 2; bool isAdmin = 4;
string email = 3; }
bool isAdmin = 4;
}
message MediaModel {
Id id = 1;
message MediaModel { string fileName = 2;
Id id = 1; MediaType mediaType = 3;
string fileName = 2; string ext = 4;
MediaType mediaType = 3; int32 viewCount = 5;
string ext = 4; Id owner = 6;
int32 viewCount = 5; string thumbUrl = 7;
Id owner = 6; string mediaUrl = 8;
string thumbUrl = 7; }
string mediaUrl = 8;
} enum MediaType {
Image = 0;
enum MediaType { Audio = 1;
Image = 0; Video = 2;
Audio = 1; Text = 3;
Video = 2; Code = 4;
Text = 3; Raw = 5;
Code = 4; }
Raw = 5;
} message ShareXResponse {
oneof dstResult {
message ShareXResponse { string destination = 1;
oneof dstResult { string error = 2;
string destination = 1; }
string error = 2; }
}
}
message SearchQuery {
optional string queryText = 1;
message SearchQuery { repeated Filter filters = 2;
optional string queryText = 1; }
repeated Filter filters = 2;
} message Filter {
string key = 1;
message Filter { repeated string values = 2;
string key = 1; }
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);
}
}