Compare commits

...

3 Commits

Author SHA1 Message Date
sigoden
f66e129985 chore(release): version v0.10.1 2022-06-03 07:21:15 +08:00
sigoden
7c3970480e chore: add type comments to assets/js 2022-06-03 07:18:12 +08:00
sigoden
34bc8d411a fix: panic when bind already used port 2022-06-03 07:15:41 +08:00
5 changed files with 16 additions and 41 deletions

View File

@@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file.
## [0.10.1] - 2022-06-02
### Bug Fixes
- Panic when bind already used port
## [0.10.0] - 2022-06-02
### Bug Fixes
@@ -19,10 +25,6 @@ All notable changes to this project will be documented in this file.
- Change auth logic/options
- Improve ui
### Miscellaneous Tasks
- Insert cli output
### Refactor
- Small improvement
@@ -52,12 +54,6 @@ All notable changes to this project will be documented in this file.
- Add some headers to res
- Support render-index/render-spa
### Miscellaneous Tasks
- Move src/assets out of src
- Update description
- Upgrade version
## [0.7.0] - 2022-05-31
### Bug Fixes
@@ -71,10 +67,6 @@ All notable changes to this project will be documented in this file.
- Drag and drop uploads, upload folder
### Miscellaneous Tasks
- Upgrade version
## [0.6.0] - 2022-05-31
### Features
@@ -83,10 +75,6 @@ All notable changes to this project will be documented in this file.
- Distinct upload and delete operation
- Support range requests
### Miscellaneous Tasks
- Upgrade version
### Refactor
- Improve code quality
@@ -99,12 +87,6 @@ All notable changes to this project will be documented in this file.
- Add no-auth-read options
- Unzip zip file when unload
### Miscellaneous Tasks
- Reorganize web static files
- Rename src/static to src/assets
- Upgrade version
## [0.4.0] - 2022-05-29
### Features
@@ -112,10 +94,6 @@ All notable changes to this project will be documented in this file.
- Replace --static option to --no-edit
- Add cors
### Miscellaneous Tasks
- Upgrade version
## [0.3.0] - 2022-05-29
### Documentation
@@ -162,10 +140,6 @@ All notable changes to this project will be documented in this file.
- Add logger
- Download folder as zip file
### Miscellaneous Tasks
- Update cargo metadata
## [0.1.0] - 2022-05-26
### Bug Fixes
@@ -183,11 +157,6 @@ All notable changes to this project will be documented in this file.
- Support delete operation
- Remove parent path
### Miscellaneous Tasks
- Add readme and license
- Update cargo metadata
### Styling
- Cargo fmt

2
Cargo.lock generated
View File

@@ -286,7 +286,7 @@ dependencies = [
[[package]]
name = "duf"
version = "0.10.0"
version = "0.10.1"
dependencies = [
"async-walkdir",
"async_zip",

View File

@@ -1,6 +1,6 @@
[package]
name = "duf"
version = "0.10.0"
version = "0.10.1"
edition = "2021"
authors = ["sigoden <sigoden@gmail.com>"]
description = "Duf is a fully functional file server."

View File

@@ -1,4 +1,10 @@
/**
* @type Element
*/
let $pathsTable, $pathsTableBody, $uploadersTable;
/**
* @type string
*/
let baseDir;
class Uploader {

View File

@@ -63,7 +63,7 @@ pub async fn serve(args: Args) -> BoxResult<()> {
.with_single_cert(certs.clone(), key.clone())?;
let tls_acceptor = TlsAcceptor::from(Arc::new(config));
let arc_acceptor = Arc::new(tls_acceptor);
let listener = TcpListener::bind(&socket_addr).await.unwrap();
let listener = TcpListener::bind(&socket_addr).await?;
let incoming = tokio_stream::wrappers::TcpListenerStream::new(listener);
let incoming = hyper::server::accept::from_stream(incoming.filter_map(|socket| async {
match socket {
@@ -86,7 +86,7 @@ pub async fn serve(args: Args) -> BoxResult<()> {
print_listening(args.address.as_str(), args.port, true);
server.await?;
} else {
let server = hyper::Server::bind(&socket_addr).serve(make_service_fn(move |_| {
let server = hyper::Server::try_bind(&socket_addr)?.serve(make_service_fn(move |_| {
let inner = inner.clone();
async move {
Ok::<_, Infallible>(service_fn(move |req| {