Compare commits

...

7 Commits

Author SHA1 Message Date
ddcb041f3f Bump version
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2020-09-19 14:23:21 +02:00
2a73370c9f Use normalize path middleware 2020-09-19 14:22:56 +02:00
689a2109fa Merge pull request #175 from vbrandl/dependabot/cargo/actix-web-3.0.2
Bump actix-web from 3.0.0 to 3.0.2
2020-09-19 14:16:00 +02:00
e82146c912 Merge pull request #174 from vbrandl/dependabot/cargo/serde-1.0.116
Bump serde from 1.0.115 to 1.0.116
2020-09-19 14:15:51 +02:00
568398f1c6 Bump actix-web from 3.0.0 to 3.0.2
Bumps [actix-web](https://github.com/actix/actix-web) from 3.0.0 to 3.0.2.
- [Release notes](https://github.com/actix/actix-web/releases)
- [Changelog](https://github.com/actix/actix-web/blob/master/CHANGES.md)
- [Commits](https://github.com/actix/actix-web/compare/web-v3.0.0...web-v3.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-16 04:18:46 +00:00
1cc6363cba Bump serde from 1.0.115 to 1.0.116
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.115 to 1.0.116.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.115...v1.0.116)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-14 04:18:28 +00:00
dcfca96051 Bump version
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2020-09-12 14:22:00 +02:00
3 changed files with 16 additions and 15 deletions

14
Cargo.lock generated
View File

@ -252,9 +252,9 @@ dependencies = [
[[package]]
name = "actix-web"
version = "3.0.0"
version = "3.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e665de333edabd0421799822dac3e7d8a25a63bb995ae1f60cd99619d8ddda8"
checksum = "36de80175eb1f0a5c518024ce0d23646b54a23008279e090ca1848f6f1448bf4"
dependencies = [
"actix-codec 0.3.0",
"actix-http",
@ -918,7 +918,7 @@ dependencies = [
[[package]]
name = "hoc"
version = "0.14.0"
version = "0.14.2"
dependencies = [
"actix-rt",
"actix-web",
@ -1888,9 +1888,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]]
name = "serde"
version = "1.0.115"
version = "1.0.116"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e54c9a88f2da7238af84b5101443f0c0d0a3bbdc455e34a5c9497b1903ed55d5"
checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5"
dependencies = [
"serde_derive",
]
@ -1907,9 +1907,9 @@ dependencies = [
[[package]]
name = "serde_derive"
version = "1.0.115"
version = "1.0.116"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "609feed1d0a73cc36a0182a840a9b37b4a82f0b1150369f0536a9e3f2a31dc48"
checksum = "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8"
dependencies = [
"proc-macro2",
"quote",

View File

@ -1,12 +1,12 @@
[package]
name = "hoc"
version = "0.14.0"
version = "0.14.2"
authors = ["Valentin Brandl <vbrandl@riseup.net>"]
edition = "2018"
build = "build.rs"
[dependencies]
actix-web = "3.0.0"
actix-web = "3.0.2"
badge = "0.3.0"
bytes = "0.5.6"
futures = "0.3.5"
@ -17,7 +17,7 @@ log4rs = "0.13.0"
number_prefix = "0.4.0"
openssl-probe = "0.1.2"
reqwest = "0.10.8"
serde = "1.0.115"
serde = "1.0.116"
serde_derive = "1.0.103"
serde_json = "1.0.57"
structopt = "0.3.17"

View File

@ -29,7 +29,8 @@ use crate::{
};
use actix_web::{
http::header::{CacheControl, CacheDirective, Expires, LOCATION},
middleware, web, App, HttpResponse, HttpServer, Responder,
middleware::{self, normalize::TrailingSlash},
web, App, HttpResponse, HttpServer, Responder,
};
use badge::{Badge, BadgeOptions};
use git2::{BranchType, Repository};
@ -124,7 +125,7 @@ fn hoc(repo: &str, repo_dir: &str, cache_dir: &str, branch: &str) -> Result<(u64
arg.push("--".to_string());
arg.push(".".to_string());
let output = Command::new("git")
.args(&dbg!(arg))
.args(&arg)
.current_dir(&repo_dir)
.output()?
.stdout;
@ -186,8 +187,8 @@ where
data.1.to_lowercase()
);
info!("Deleting cache and repository for {}", repo);
let cache_dir = dbg!(format!("{}/{}.json", &state.cache, repo));
let repo_dir = dbg!(format!("{}/{}", &state.repos, repo));
let cache_dir = format!("{}/{}.json", &state.cache, repo);
let repo_dir = format!("{}/{}", &state.repos, repo);
std::fs::remove_file(&cache_dir).or_else(|e| {
if e.kind() == io::ErrorKind::NotFound {
Ok(())
@ -412,7 +413,7 @@ async fn start_server() -> std::io::Result<()> {
App::new()
.data(state.clone())
.wrap(middleware::Logger::default())
// .wrap(middleware::NormalizePath::default())
.wrap(middleware::NormalizePath::new(TrailingSlash::Trim))
.service(index)
.service(web::resource("/tacit-css.min.css").route(web::get().to(css)))
// TODO