Skip to content

Commit 08e73df

Browse files
committed
remove warp
1 parent b4dbb04 commit 08e73df

File tree

13 files changed

+258
-522
lines changed

13 files changed

+258
-522
lines changed

Cargo.lock

Lines changed: 0 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,5 @@ tracing = "0.1.21"
4242
tracing-core = "0.1.32"
4343
tracing-subscriber = { version = "0.3"}
4444
walkdir = "2.5"
45-
warp = "0.4.2"
4645
salvo = "0.85.0"
4746
dunce = "1"

client/src/api.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,12 @@ impl API {
142142
key: T,
143143
path: PathBuf,
144144
) -> anyhow::Result<()> {
145-
let name = path.file_name().unwrap().to_os_string();
146-
let name = name.to_str().unwrap().to_string();
147-
let file = tokio::fs::File::open(path).await?;
148-
let len = file.metadata().await?.len();
149-
let file_part = multipart::Part::stream_with_length(file, len).file_name(name);
145+
// let name = path.file_name().unwrap().to_os_string();
146+
// let name = name.to_str().unwrap().to_string();
147+
// let file = tokio::fs::File::open(path).await?;
148+
// let len = file.metadata().await?.len();
149+
// let file_part = multipart::Part::stream_with_length(file, len).file_name(name);
150+
let file_part = multipart::Part::file(&path).await?;
150151
let form = multipart::Form::new().part("file", file_part);
151152

152153
let resp = self

config.release.toml

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -19,50 +19,6 @@ addr = "0.0.0.0"
1919
## it would the port would be https.external_port(https.external_port should be defined), otherwise is false
2020
# redirect_https = true
2121

22-
# [https]
23-
# port = 443 # https bind address
24-
# addr = "0.0.0.0"
25-
## port when serving public network,default is https port. external_port should not be 0.
26-
# external_port = 443
27-
28-
## if set true, http server(80) will send client
29-
## status code:301(Moved Permanently) to tell client redirect to https
30-
31-
## default value for https ssl
32-
# [https.ssl]
33-
# private = "private.key path" # private ssl key
34-
# public = "public.cert path" # public ssl cert
35-
36-
## acme config, it doest not support run with https.ssl config.
37-
# [https.acme]
38-
## emails to Let's Encrypt needs to interact.
39-
# emails = ["mailto:[email protected]"]
40-
41-
## directory to store account and certificate
42-
## optional, default is ${file_dir}/acme
43-
# dir = "/data/acme"
44-
45-
## ci / stage / prod, default is prod, ci is just for CI test with Pebble, don't use it.
46-
# type = prod
47-
48-
## default cache config
49-
[cache]
50-
## if file size > max_size, it will not be cached. default is (10MB).
51-
# max_size = 10_000_000
52-
## gzip compression for js/json/icon/json, default is false,
53-
## only support gzip algo, and only compress cached files,
54-
## be careful to set it true
55-
# compression = false
56-
57-
## http header Cache-Control config,
58-
## optional, if not set, won't sender this header to client
59-
# [[cache.client_cache]]
60-
## 30day
61-
# expire = '30d'
62-
# extension_names = ['icon', 'gif', 'jpg', 'jpeg', 'png', 'js']
63-
# [[cache.client_cache]]
64-
# expire = '0'
65-
# extension_names = ['html']
6622

6723
## admin server config
6824
## admin server don't support hot reload. the config should not change.
@@ -95,18 +51,3 @@ addr = "0.0.0.0"
9551
## optional, when https enabled, redirect_https default value true
9652
## it would the port would be https.external_port(https.external_port should be defined), otherwise is false
9753
# redirect_https = 443
98-
99-
## this would be usefully when set https.acme
100-
# disable_acme = false
101-
# [domains.https.ssl]
102-
103-
# [domains.cache]
104-
# max_size = 10_000_000
105-
# compression = false
106-
# [[domains.cache.client_cache]]
107-
# expire = '30d' # 30day
108-
# extension_names = ['icon', 'gif', 'jpg', 'jpeg', 'png', 'js']
109-
110-
111-
# [openTelemetry]
112-
# endpoint = "http://localhost:4317"

config.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ addr = "0.0.0.0"
1919
## it would the port would be https.external_port(https.external_port should be defined), otherwise is false
2020
# redirect_https = true
2121

22-
23-
24-
## ci / stage / prod, default is prod, ci is just for CI test with Pebble, don't use it.
25-
# type = prod
26-
2722
## admin server config
2823
## admin server don't support hot reload. the config should not change.
2924
## optional, and it's disabled by default.

server/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ hyper = { workspace = true }
2424
bytes = { workspace = true }
2525

2626
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "io-std", "sync", "time", "tokio-macros"] }
27-
warp = { workspace = true, features = ["multipart", "server"] }
2827

2928
# warp inner
3029
percent-encoding = { workspace = true }
@@ -67,4 +66,4 @@ chrono = { workspace = true, features = ["serde"] }
6766
#make if let more easy
6867
tracing-core = { workspace = true }
6968

70-
salvo = { workspace = true, features = ["serve-static", "size-limiter", "trailing-slash", "affix-state"] }
69+
salvo = { workspace = true, features = ["serve-static", "size-limiter", "trailing-slash", "affix-state", "basic-auth"] }

0 commit comments

Comments
 (0)