Commit graph

84 commits

Author SHA1 Message Date
Дамјан Георгиевски
a671e47edf rename to src/directory_listing.rs 2020-09-20 00:53:31 +02:00
Дамјан Георгиевски
98fbec274c enable the .tar handler 2020-09-14 23:44:00 +02:00
Дамјан Георгиевски
070a878c75 re-implement io::Write for StreamWriter
since the `.wait()` has been removed from futures 0.1 sink::Sink trait,
use futures 0.3 `executor::block_on` function to run an async block in
the sync environment of `write`.

https://docs.rs/futures/0.1.29/futures/sink/trait.Sink.html#method.wait
https://docs.rs/futures/0.3.5/futures/executor/fn.block_on.html
2020-09-14 23:37:25 +02:00
Дамјан Георгиевски
4b25b26bb2 update bytes to be compatible with actix_web::Bytes 2020-09-14 23:36:39 +02:00
Дамјан Георгиевски
cce8560bd5 Begin port to actix-web 3.0
* actix-files is quite easy to use now
* uses futures 0.3 now, and async/await. the streaming archiver is not
  ported yet.

0.11.x versions will be dev versions until the port is done
2020-09-12 04:28:20 +02:00
Дамјан Георгиевски
ec93e016bf cargo update 2020-01-16 13:05:55 +01:00
Дамјан Георгиевски
cd71dc8bee let's actually commit Cargo.lock 2019-09-21 21:25:43 +02:00
Дамјан Георгиевски
da69d3de6f clippy and rustfmt anoyances 2019-09-21 21:24:44 +02:00
Дамјан Георгиевски
c68cf3a3e8 improve cli help text
and add a `-w` as short for `--chdir`
2019-09-21 21:24:41 +02:00
Дамјан Георгиевски
9c6ff4eddf rename channel to threaded_archiver
I think that reflects its purpose much better
2019-09-21 21:17:39 +02:00
Дамјан Георгиевски
90e834722c
travis: use standard cargo cache on travis
https://changelog.travis-ci.com/rust-caching-improvements-106581

seems to have been improved/fixed
2019-09-14 15:33:55 +02:00
Дамјан Георгиевски
302df9eff2 let's track binary sizes 2019-08-29 01:40:08 +02:00
Дамјан Георгиевски
6fbe1b22ea update percent-encoding and htmlescape
* percent-encoding 1.0 to 2.0
* actualy move from htmlescape to v_htmlescape

code updated for some api changes too
2019-08-28 19:44:22 +02:00
Дамјан Георгиевски
6cdc2b2ada travis: windows releases work now
* on windows the target has a .exe suffix
  we need the file name to add to the release zip
* install zip on windows with choco
* also remove tests - since there aren't any

no code changes
2019-06-16 23:56:10 +02:00
Дамјан Георгиевски
acedfa2a6c remove some actix_web:: prefixes 2019-06-16 18:03:26 +02:00
Дамјан Георгиевски
85f1df81a1 refactor with actix-web 1.0.0
* actix-web 1.0.0 brought some changes in how associated data is accessed, and how
handlers are written.
* static files are now a separate crate `actix-files`.
* web::run now creates the App and the Server and runs the server. they really want to
  have HttpServer::new and App::new in the same scope
  (I couldn't find a proper signature for the create_app function)
* replace .trim_right_matches (depreceated in rust 1.33) with .trim_end_matches

https://github.com/actix/actix-web/blob/web-v1.0.0/MIGRATION.md
2019-06-16 17:27:09 +02:00
Дамјан Георгиевски
6e76b4c5df update README with a note about zip and a similar project 2019-06-10 12:41:03 +02:00
Damjan Georgievski
447c361b48 bump version to 0.9.0 2019-01-18 00:40:05 +01:00
Damjan Georgievski
cba32451b3 some more "edition 2018" updates
`extern crate` and `#[macro_use]` are no longer needed
2019-01-18 00:24:42 +01:00
Damjan Georgievski
0596f72c8d rust 1.32 now defaults to the system allocator
https://blog.rust-lang.org/2019/01/17/Rust-1.32.0.html#jemalloc-is-removed-by-default
2019-01-18 00:14:16 +01:00
Damjan Georgievski
072b427828 opt-level = 'z' for smaller binaries
https://doc.rust-lang.org/cargo/reference/manifest.html#the-profile-sections
> 'z' reduces size even more
2019-01-18 00:10:09 +01:00
Damjan Georgievski
33fde259d3 test travis cache
revert 3f871d17
2019-01-18 00:07:15 +01:00
Дамјан Георгиевски
09cba55dc8 use rust language edition 2018 (introduced in 1.31) 2018-12-06 20:08:26 +01:00
Дамјан Георгиевски
595ebed94d update travis setup
only make release builds on tags, but don't build twice
2018-10-20 19:07:31 +02:00
Дамјан Георгиевски
3f871d1779 explicit caching instead of the default cache: cargo
Based on the suggestions at
https://levans.fr/rust_travis_cache.html
"Beware the rust cache on Travis"
2018-10-20 17:18:43 +02:00
Дамјан Георгиевски
47600fe218 Revert "test a simplified travis.yml"
This reverts commit d0516ecb21.

nope, I do need the TARGET variable to know where the build goes anyway
2018-10-20 16:38:07 +02:00
Дамјан Георгиевски
d0516ecb21 test a simplified travis.yml 2018-10-20 16:31:39 +02:00
Дамјан Георгиевски
2742a39aaa update for a change after actix-web 0.7.8
somewhere between 0.7.8 and 0.7.12 `web::create_app` started returning a
`Result`.
2018-10-20 15:04:13 +02:00
Дамјан Георгиевски
609d273ab2
some deduplication from the travis matrix
always use `cache: cargo` and `rust: stable` anyway
2018-10-13 16:13:57 +02:00
Дамјан Георгиевски
92c0cc310e
add windows support in travis
https://blog.travis-ci.com/2018-10-11-windows-early-release
2018-10-13 16:10:43 +02:00
Дамјан Георгиевски
7a0572de80 use system alocator instead of jmalloc
Rust 1.28 feature. saves 300kb in executable size
2018-08-03 15:41:00 +02:00
Дамјан Георгиевски
d6fd817ce0 optimize for size in the release build
3.7mb stripped, down from 4.7mb

opt-level = 's' is supported since Rust 1.28
2018-08-03 15:20:02 +02:00
Дамјан Георгиевски
4346b5d559 since actix-web 0.7.2 this is the default log format 2018-07-26 18:53:04 +02:00
Damjan Georgievski
306c545151 let's return a Result from create_app
with the possibility that any errors could be reported/handled by the
caller. the lambda in server::new(|| ...) doesn't care though
2018-07-23 00:32:59 +02:00
Damjan Georgievski
d2f9578b68 add some headers to the favicon
* content-type to image/png
* cache control for 24h
2018-07-22 17:45:28 +02:00
Damjan Georgievski
1aeb2c1bf6 smaller font in footer 2018-07-22 17:27:40 +02:00
Damjan Georgievski
b139b6113a return error instead of expect()
expect() is an unwrap() with a message. use the ? macro to just return
the error from main for a cleaner output
2018-07-22 17:14:01 +02:00
Damjan Georgievski
bd1429ebb6 explain why these won't panic 2018-07-22 17:09:53 +02:00
Damjan Georgievski
71482ffacd don't panic on r.metadata()
use unwrap_or() instead of unwrap() to avoid panics if metadata can't be
read from a direntry.

optimistic_is_dir will just return false in that case (same as non
directory)
2018-07-22 17:08:21 +02:00
Damjan Georgievski
625bbcc0b9 replace the unwrap with a error return
don't panic on std::fs::read_dir error (although permission errors are
returned as 404 responses)
2018-07-22 07:41:05 +02:00
Damjan Georgievski
9058452d93 set_current_dir: don't unwrap, return error
the difference is a panic vs a clean error
2018-07-22 07:25:07 +02:00
Damjan Georgievski
01f0001594 dark style, footer, homepage 2018-07-22 06:55:58 +02:00
Damjan Georgievski
481a984277 mac os doesn't support --strip-unneeded 2018-07-22 06:05:34 +02:00
Damjan Georgievski
d8cb0f6986 improve wording 2018-07-22 06:00:48 +02:00
Damjan Georgievski
37ff4197f6 add travis badge in README 2018-07-22 05:59:23 +02:00
Damjan Georgievski
592ea53524 many improvements to the html generated
- css is now in src/style.css - included in the executable at compile time
- use writeln!/write! macros instead of push_str + format!
- properly generate the link to the .tar for the current directory

v0.6
2018-07-22 05:51:55 +02:00
Damjan Georgievski
1a12b3aa30 canonicalized root directory is now also an App state
- used to setup the StaticFiles handler
- also for the .tar file handler

additionally, PathBuf::from_param is used to forbid certain paths, see:
https://actix.rs/api/actix-web/stable/actix_web/dev/trait.FromParam.html
2018-07-22 05:39:32 +02:00
Damjan Georgievski
8a86739f14 don't overwrite RUST_LOG if it exists 2018-07-22 03:53:39 +02:00
Damjan Georgievski
e56cf130fe strip binaries for release deploys 2018-07-21 22:17:19 +02:00
Damjan Georgievski
dfe3f18f21 let's try making releases via travis
supports both mac os x and linux
2018-07-21 21:28:16 +02:00