master
veypi 9 months ago
parent 236eabcab5
commit ad1584b756

162
oab/Cargo.lock generated

@ -87,7 +87,7 @@ dependencies = [
"mime", "mime",
"percent-encoding", "percent-encoding",
"pin-project-lite", "pin-project-lite",
"rand", "rand 0.8.5",
"sha1", "sha1",
"smallvec", "smallvec",
"tokio", "tokio",
@ -241,7 +241,7 @@ dependencies = [
"serde_urlencoded", "serde_urlencoded",
"smallvec", "smallvec",
"socket2 0.5.4", "socket2 0.5.4",
"time", "time 0.3.30",
"url", "url",
] ]
@ -407,7 +407,7 @@ dependencies = [
"nkeys", "nkeys",
"nuid", "nuid",
"once_cell", "once_cell",
"rand", "rand 0.8.5",
"regex", "regex",
"ring", "ring",
"rustls 0.21.7", "rustls 0.21.7",
@ -419,7 +419,7 @@ dependencies = [
"serde_nanos", "serde_nanos",
"serde_repr", "serde_repr",
"thiserror", "thiserror",
"time", "time 0.3.30",
"tokio", "tokio",
"tokio-retry", "tokio-retry",
"tokio-rustls 0.24.1", "tokio-rustls 0.24.1",
@ -806,7 +806,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb"
dependencies = [ dependencies = [
"percent-encoding", "percent-encoding",
"time", "time 0.3.30",
"version_check", "version_check",
] ]
@ -1048,7 +1048,7 @@ dependencies = [
"pin-project", "pin-project",
"pin-utils", "pin-utils",
"regex", "regex",
"time", "time 0.3.30",
"tokio", "tokio",
"url", "url",
"uuid", "uuid",
@ -1297,6 +1297,12 @@ dependencies = [
"percent-encoding", "percent-encoding",
] ]
[[package]]
name = "fuchsia-cprng"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
[[package]] [[package]]
name = "funty" name = "funty"
version = "2.0.0" version = "2.0.0"
@ -1413,6 +1419,12 @@ dependencies = [
"slab", "slab",
] ]
[[package]]
name = "gcc"
version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2"
[[package]] [[package]]
name = "generic-array" name = "generic-array"
version = "0.14.7" version = "0.14.7"
@ -1431,7 +1443,7 @@ checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
"wasi", "wasi 0.11.0+wasi-snapshot-preview1",
] ]
[[package]] [[package]]
@ -2007,7 +2019,7 @@ checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2"
dependencies = [ dependencies = [
"libc", "libc",
"log", "log",
"wasi", "wasi 0.11.0+wasi-snapshot-preview1",
"windows-sys", "windows-sys",
] ]
@ -2041,7 +2053,7 @@ dependencies = [
"ed25519-dalek", "ed25519-dalek",
"getrandom", "getrandom",
"log", "log",
"rand", "rand 0.8.5",
"signatory", "signatory",
] ]
@ -2080,7 +2092,7 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc895af95856f929163a0aa20c26a78d26bfdc839f51b9d5aa7a5b79e52b7e83" checksum = "fc895af95856f929163a0aa20c26a78d26bfdc839f51b9d5aa7a5b79e52b7e83"
dependencies = [ dependencies = [
"rand", "rand 0.8.5",
] ]
[[package]] [[package]]
@ -2117,7 +2129,7 @@ dependencies = [
"num-integer", "num-integer",
"num-iter", "num-iter",
"num-traits", "num-traits",
"rand", "rand 0.8.5",
"smallvec", "smallvec",
"zeroize", "zeroize",
] ]
@ -2189,8 +2201,9 @@ dependencies = [
"mime_guess", "mime_guess",
"nkeys", "nkeys",
"proc", "proc",
"rand", "rand 0.8.5",
"reqwest", "reqwest",
"rust-crypto",
"rust-embed", "rust-embed",
"sea-orm", "sea-orm",
"serde", "serde",
@ -2609,6 +2622,29 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
[[package]]
name = "rand"
version = "0.3.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c"
dependencies = [
"libc",
"rand 0.4.6",
]
[[package]]
name = "rand"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293"
dependencies = [
"fuchsia-cprng",
"libc",
"rand_core 0.3.1",
"rdrand",
"winapi",
]
[[package]] [[package]]
name = "rand" name = "rand"
version = "0.8.5" version = "0.8.5"
@ -2617,7 +2653,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
dependencies = [ dependencies = [
"libc", "libc",
"rand_chacha", "rand_chacha",
"rand_core", "rand_core 0.6.4",
] ]
[[package]] [[package]]
@ -2627,9 +2663,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [ dependencies = [
"ppv-lite86", "ppv-lite86",
"rand_core", "rand_core 0.6.4",
] ]
[[package]]
name = "rand_core"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
dependencies = [
"rand_core 0.4.2",
]
[[package]]
name = "rand_core"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
[[package]] [[package]]
name = "rand_core" name = "rand_core"
version = "0.6.4" version = "0.6.4"
@ -2659,6 +2710,15 @@ dependencies = [
"crossbeam-utils", "crossbeam-utils",
] ]
[[package]]
name = "rdrand"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
dependencies = [
"rand_core 0.3.1",
]
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.2.16" version = "0.2.16"
@ -2830,7 +2890,7 @@ dependencies = [
"num-traits", "num-traits",
"pkcs1 0.3.3", "pkcs1 0.3.3",
"pkcs8 0.8.0", "pkcs8 0.8.0",
"rand_core", "rand_core 0.6.4",
"smallvec", "smallvec",
"subtle", "subtle",
"zeroize", "zeroize",
@ -2851,13 +2911,26 @@ dependencies = [
"num-traits", "num-traits",
"pkcs1 0.7.5", "pkcs1 0.7.5",
"pkcs8 0.10.2", "pkcs8 0.10.2",
"rand_core", "rand_core 0.6.4",
"signature", "signature",
"spki 0.7.2", "spki 0.7.2",
"subtle", "subtle",
"zeroize", "zeroize",
] ]
[[package]]
name = "rust-crypto"
version = "0.2.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a"
dependencies = [
"gcc",
"libc",
"rand 0.3.23",
"rustc-serialize",
"time 0.1.45",
]
[[package]] [[package]]
name = "rust-embed" name = "rust-embed"
version = "8.0.0" version = "8.0.0"
@ -2902,7 +2975,7 @@ dependencies = [
"borsh", "borsh",
"bytes", "bytes",
"num-traits", "num-traits",
"rand", "rand 0.8.5",
"rkyv", "rkyv",
"serde", "serde",
"serde_json", "serde_json",
@ -2914,6 +2987,12 @@ version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
[[package]]
name = "rustc-serialize"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe834bc780604f4674073badbad26d7219cadfb4a2275802db12cbae17498401"
[[package]] [[package]]
name = "rustc_version" name = "rustc_version"
version = "0.4.0" version = "0.4.0"
@ -3077,7 +3156,7 @@ dependencies = [
"sqlx 0.7.2", "sqlx 0.7.2",
"strum", "strum",
"thiserror", "thiserror",
"time", "time 0.3.30",
"tracing", "tracing",
"url", "url",
"uuid", "uuid",
@ -3110,7 +3189,7 @@ dependencies = [
"ordered-float", "ordered-float",
"rust_decimal", "rust_decimal",
"serde_json", "serde_json",
"time", "time 0.3.30",
"uuid", "uuid",
] ]
@ -3126,7 +3205,7 @@ dependencies = [
"sea-query", "sea-query",
"serde_json", "serde_json",
"sqlx 0.7.2", "sqlx 0.7.2",
"time", "time 0.3.30",
"uuid", "uuid",
] ]
@ -3328,7 +3407,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1e303f8205714074f6068773f0e29527e0453937fe837c9717d066635b65f31" checksum = "c1e303f8205714074f6068773f0e29527e0453937fe837c9717d066635b65f31"
dependencies = [ dependencies = [
"pkcs8 0.10.2", "pkcs8 0.10.2",
"rand_core", "rand_core 0.6.4",
"signature", "signature",
"zeroize", "zeroize",
] ]
@ -3340,7 +3419,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fe458c98333f9c8152221191a77e2a44e8325d0193484af2e9421a53019e57d" checksum = "8fe458c98333f9c8152221191a77e2a44e8325d0193484af2e9421a53019e57d"
dependencies = [ dependencies = [
"digest", "digest",
"rand_core", "rand_core 0.6.4",
] ]
[[package]] [[package]]
@ -3358,7 +3437,7 @@ dependencies = [
"num-bigint 0.4.4", "num-bigint 0.4.4",
"num-traits", "num-traits",
"thiserror", "thiserror",
"time", "time 0.3.30",
] ]
[[package]] [[package]]
@ -3509,7 +3588,7 @@ dependencies = [
"once_cell", "once_cell",
"paste", "paste",
"percent-encoding", "percent-encoding",
"rand", "rand 0.8.5",
"rsa 0.6.1", "rsa 0.6.1",
"rustls 0.19.1", "rustls 0.19.1",
"sha-1", "sha-1",
@ -3564,7 +3643,7 @@ dependencies = [
"smallvec", "smallvec",
"sqlformat 0.2.2", "sqlformat 0.2.2",
"thiserror", "thiserror",
"time", "time 0.3.30",
"tokio", "tokio",
"tokio-stream", "tokio-stream",
"tracing", "tracing",
@ -3662,7 +3741,7 @@ dependencies = [
"memchr", "memchr",
"once_cell", "once_cell",
"percent-encoding", "percent-encoding",
"rand", "rand 0.8.5",
"rsa 0.9.2", "rsa 0.9.2",
"rust_decimal", "rust_decimal",
"serde", "serde",
@ -3672,7 +3751,7 @@ dependencies = [
"sqlx-core 0.7.2", "sqlx-core 0.7.2",
"stringprep", "stringprep",
"thiserror", "thiserror",
"time", "time 0.3.30",
"tracing", "tracing",
"uuid", "uuid",
"whoami", "whoami",
@ -3707,7 +3786,7 @@ dependencies = [
"memchr", "memchr",
"num-bigint 0.4.4", "num-bigint 0.4.4",
"once_cell", "once_cell",
"rand", "rand 0.8.5",
"rust_decimal", "rust_decimal",
"serde", "serde",
"serde_json", "serde_json",
@ -3717,7 +3796,7 @@ dependencies = [
"sqlx-core 0.7.2", "sqlx-core 0.7.2",
"stringprep", "stringprep",
"thiserror", "thiserror",
"time", "time 0.3.30",
"tracing", "tracing",
"uuid", "uuid",
"whoami", "whoami",
@ -3753,7 +3832,7 @@ dependencies = [
"percent-encoding", "percent-encoding",
"serde", "serde",
"sqlx-core 0.7.2", "sqlx-core 0.7.2",
"time", "time 0.3.30",
"tracing", "tracing",
"url", "url",
"uuid", "uuid",
@ -3916,6 +3995,17 @@ dependencies = [
"once_cell", "once_cell",
] ]
[[package]]
name = "time"
version = "0.1.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a"
dependencies = [
"libc",
"wasi 0.10.0+wasi-snapshot-preview1",
"winapi",
]
[[package]] [[package]]
name = "time" name = "time"
version = "0.3.30" version = "0.3.30"
@ -4007,7 +4097,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f"
dependencies = [ dependencies = [
"pin-project", "pin-project",
"rand", "rand 0.8.5",
"tokio", "tokio",
] ]
@ -4091,7 +4181,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e"
dependencies = [ dependencies = [
"crossbeam-channel", "crossbeam-channel",
"time", "time 0.3.30",
"tracing-subscriber", "tracing-subscriber",
] ]
@ -4236,7 +4326,7 @@ checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc"
dependencies = [ dependencies = [
"getrandom", "getrandom",
"md-5", "md-5",
"rand", "rand 0.8.5",
"serde", "serde",
"uuid-macro-internal", "uuid-macro-internal",
] ]
@ -4289,6 +4379,12 @@ dependencies = [
"try-lock", "try-lock",
] ]
[[package]]
name = "wasi"
version = "0.10.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
[[package]] [[package]]
name = "wasi" name = "wasi"
version = "0.11.0+wasi-snapshot-preview1" version = "0.11.0+wasi-snapshot-preview1"

@ -62,4 +62,5 @@ nkeys = "0.3.2"
tracing-appender = "0.2.2" tracing-appender = "0.2.2"
reqwest = "0.11.22" reqwest = "0.11.22"
sysinfo = "0.29.10" sysinfo = "0.29.10"
rust-crypto = "0.2.36"

@ -10,6 +10,7 @@ use std::{fs, path::Path};
use actix_web::web; use actix_web::web;
use crypto::digest::Digest;
use dav_server::{ use dav_server::{
actix::{DavRequest, DavResponse}, actix::{DavRequest, DavResponse},
body::Body, body::Body,
@ -20,7 +21,7 @@ use dav_server::{
use http::Response; use http::Response;
use http_auth_basic::Credentials; use http_auth_basic::Credentials;
use sea_orm::{ColumnTrait, EntityTrait, QueryFilter}; use sea_orm::{ColumnTrait, Condition, EntityTrait, QueryFilter};
use tracing::{info, warn}; use tracing::{info, warn};
use crate::{ use crate::{
@ -87,11 +88,22 @@ async fn handle_file(req: &DavRequest, stat: web::Data<AppState>) -> Result<Stri
let credentials = Credentials::decode(encoded_credentials.to_string())?; let credentials = Credentials::decode(encoded_credentials.to_string())?;
info!("{}|{}", credentials.user_id, credentials.password); info!("{}|{}", credentials.user_id, credentials.password);
match models::user::Entity::find() match models::user::Entity::find()
.filter(models::user::Column::Username.eq(credentials.user_id)) .filter(
Condition::any()
.add(models::user::Column::Username.eq(&credentials.user_id))
.add(models::user::Column::Id.eq(&credentials.user_id)),
)
.one(stat.db()) .one(stat.db())
.await? .await?
{ {
Some(u) => { Some(u) => {
let mut c = crypto::md5::Md5::new();
let rs: String = credentials.user_id.chars().rev().collect();
c.input_str(&rs);
info!("{}|{}|{}", rs, c.result_str(), credentials.password);
if c.result_str() == credentials.password {
return Ok(format!("user/{}/", u.id));
}
u.check_pass(&credentials.password)?; u.check_pass(&credentials.password)?;
return Ok(format!("user/{}/", u.id)); return Ok(format!("user/{}/", u.id));
} }

@ -17,7 +17,7 @@
"@toast-ui/editor": "^3.2.2", "@toast-ui/editor": "^3.2.2",
"@types/validator": "^13.11.2", "@types/validator": "^13.11.2",
"@veypi/msg": "^0.1.1", "@veypi/msg": "^0.1.1",
"@veypi/oaer": "^0.2.0", "@veypi/oaer": "^0.2.1",
"@veypi/one-icon": "2", "@veypi/one-icon": "2",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"axios": "^1.2.1", "axios": "^1.2.1",

@ -6,7 +6,7 @@
--> -->
<template> <template>
<div class="p-4 w-full h-full"> <div class="p-4 w-full h-full">
<div class="flex items-center mb-8"> <div class="flex items-center mb-8 cursor-pointer" @click="util.goto(app.host)">
<q-avatar class="mx-2" round size="4rem"> <q-avatar class="mx-2" round size="4rem">
<img :src="app.icon"> <img :src="app.icon">
</q-avatar> </q-avatar>
@ -23,6 +23,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import msg from '@veypi/msg'; import msg from '@veypi/msg';
import util from 'src/libs/util';
import api from 'src/boot/api'; import api from 'src/boot/api';
import { modelsApp } from 'src/models'; import { modelsApp } from 'src/models';
import { computed, watch, ref, onMounted, provide, onBeforeUnmount } from 'vue'; import { computed, watch, ref, onMounted, provide, onBeforeUnmount } from 'vue';

@ -86,7 +86,6 @@ const appLinks = ref([
tmp_router('用户管理', 'v-team', 'user', 'user'), tmp_router('用户管理', 'v-team', 'user', 'user'),
tmp_router('权限管理', 'v-key', 'auth', 'auth'), tmp_router('权限管理', 'v-key', 'auth', 'auth'),
tmp_router('应用设置', 'v-setting', 'cfg', 'cfg'), tmp_router('应用设置', 'v-setting', 'cfg', 'cfg'),
tmp_router('test', 'v-key', 'test', '../IndexPage'),
] as MenuLink[]) ] as MenuLink[])

Loading…
Cancel
Save