Compare commits

...

30 Commits

Author SHA1 Message Date
84f4aa9be3 Migrate to config v0.12.0
All checks were successful
continuous-integration/drone/push Build is passing
2022-02-26 16:22:36 +01:00
0a518ab331 Bump config from 0.11.0 to 0.12.0
Bumps [config](https://github.com/mehcode/config-rs) from 0.11.0 to 0.12.0.
- [Release notes](https://github.com/mehcode/config-rs/releases)
- [Changelog](https://github.com/mehcode/config-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mehcode/config-rs/compare/0.11.0...0.12.0)

---
updated-dependencies:
- dependency-name: config
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-26 15:02:08 +00:00
5caed6729a Merge pull request #423 from vbrandl/dependabot/cargo/git2-0.14.0
Bump git2 from 0.13.25 to 0.14.0
2022-02-26 15:59:12 +01:00
7846872aaa Bump git2 from 0.13.25 to 0.14.0
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.13.25 to 0.14.0.
- [Release notes](https://github.com/rust-lang/git2-rs/releases)
- [Commits](https://github.com/rust-lang/git2-rs/compare/0.13.25...git2-curl-0.14.0)

---
updated-dependencies:
- dependency-name: git2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-25 04:15:36 +00:00
54e05d5d78 Bump version (v0.21.2)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-02-18 10:30:59 +01:00
7c84ae8c0e Merge pull request #420 from vbrandl/dependabot/cargo/tracing-0.1.31
All checks were successful
continuous-integration/drone/push Build is passing
Bump tracing from 0.1.30 to 0.1.31
2022-02-18 10:27:35 +01:00
256823ff11 Bump tracing from 0.1.30 to 0.1.31
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.30 to 0.1.31.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.30...tracing-0.1.31)

---
updated-dependencies:
- dependency-name: tracing
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-18 09:17:38 +00:00
00db6b1718 Merge pull request #421 from vbrandl/dependabot/cargo/tracing-subscriber-0.3.9
Bump tracing-subscriber from 0.3.8 to 0.3.9
2022-02-18 10:14:55 +01:00
f914537eb2 Bump tracing-subscriber from 0.3.8 to 0.3.9
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.8 to 0.3.9.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.8...tracing-subscriber-0.3.9)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-18 04:18:30 +00:00
5f29a3edfa Don't unwrap results in build step
All checks were successful
continuous-integration/drone/push Build is passing
2022-02-17 12:01:50 +01:00
c4b14164c0 Update actix-web 2022-02-17 12:01:16 +01:00
8f129d9175 Ignore some SEC advisories 2022-02-17 12:00:46 +01:00
3830d488b8 Merge pull request #419 from vbrandl/dependabot/cargo/tokio-1.17.0
Bump tokio from 1.16.1 to 1.17.0
2022-02-17 11:45:08 +01:00
7b5ed9ebae Bump tokio from 1.16.1 to 1.17.0
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.16.1 to 1.17.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.16.1...tokio-1.17.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-17 04:17:06 +00:00
1b504c4557 Merge pull request #418 from vbrandl/dependabot/cargo/awc-3.0.0-beta.21
All checks were successful
continuous-integration/drone/push Build is passing
Bump awc from 3.0.0-beta.20 to 3.0.0-beta.21
2022-02-16 10:12:53 +01:00
7d2a9047c3 Bump awc from 3.0.0-beta.20 to 3.0.0-beta.21
Bumps [awc](https://github.com/actix/actix-web) from 3.0.0-beta.20 to 3.0.0-beta.21.
- [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/awc-v3.0.0-beta.20...awc-v3.0.0-beta.21)

---
updated-dependencies:
- dependency-name: awc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-16 04:16:16 +00:00
1e5db2ca2a Merge pull request #417 from vbrandl/dependabot/cargo/tracing-actix-web-0.5.0-rc.3
All checks were successful
continuous-integration/drone/push Build is passing
Bump tracing-actix-web from 0.5.0-rc.2 to 0.5.0-rc.3
2022-02-14 16:49:55 +01:00
35e8eac61a Merge pull request #416 from vbrandl/dependabot/cargo/serde_json-1.0.79
Bump serde_json from 1.0.78 to 1.0.79
2022-02-14 16:49:44 +01:00
e7553c37d4 Bump tracing-actix-web from 0.5.0-rc.2 to 0.5.0-rc.3
Bumps [tracing-actix-web](https://github.com/LukeMathWalker/tracing-actix-web) from 0.5.0-rc.2 to 0.5.0-rc.3.
- [Release notes](https://github.com/LukeMathWalker/tracing-actix-web/releases)
- [Commits](https://github.com/LukeMathWalker/tracing-actix-web/compare/v0.5.0-rc.2...v0.5.0-rc.3)

---
updated-dependencies:
- dependency-name: tracing-actix-web
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-14 04:16:29 +00:00
cc6233cb63 Bump serde_json from 1.0.78 to 1.0.79
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.78 to 1.0.79.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.78...v1.0.79)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-14 04:16:24 +00:00
16743bbc26 Merge pull request #415 from vbrandl/dependabot/cargo/tracing-actix-web-0.5.0-rc.2
Bump tracing-actix-web from 0.5.0-rc.1 to 0.5.0-rc.2
2022-02-09 08:39:43 +01:00
ac479aa53d Bump tracing-actix-web from 0.5.0-rc.1 to 0.5.0-rc.2
Bumps [tracing-actix-web](https://github.com/LukeMathWalker/tracing-actix-web) from 0.5.0-rc.1 to 0.5.0-rc.2.
- [Release notes](https://github.com/LukeMathWalker/tracing-actix-web/releases)
- [Commits](https://github.com/LukeMathWalker/tracing-actix-web/compare/v0.5.0-rc.1...v0.5.0-rc.2)

---
updated-dependencies:
- dependency-name: tracing-actix-web
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-09 04:18:43 +00:00
2ca188a473 Merge pull request #414 from vbrandl/dependabot/cargo/ructe-0.14.0
All checks were successful
continuous-integration/drone/push Build is passing
Bump ructe from 0.13.4 to 0.14.0
2022-02-07 13:12:12 +00:00
2cf454e559 Merge pull request #413 from vbrandl/dependabot/cargo/futures-0.3.21
Bump futures from 0.3.19 to 0.3.21
2022-02-07 13:11:58 +00:00
690ab9ea07 Merge pull request #412 from vbrandl/dependabot/cargo/tracing-subscriber-0.3.8
Bump tracing-subscriber from 0.3.7 to 0.3.8
2022-02-07 13:11:45 +00:00
8f656f5252 Bump ructe from 0.13.4 to 0.14.0
Bumps [ructe](https://github.com/kaj/ructe) from 0.13.4 to 0.14.0.
- [Release notes](https://github.com/kaj/ructe/releases)
- [Changelog](https://github.com/kaj/ructe/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kaj/ructe/compare/v0.13.4...v0.14.0)

---
updated-dependencies:
- dependency-name: ructe
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 04:19:19 +00:00
7a61acf5e2 Bump futures from 0.3.19 to 0.3.21
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.19 to 0.3.21.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.19...0.3.21)

---
updated-dependencies:
- dependency-name: futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 04:19:05 +00:00
171d6f590b Bump tracing-subscriber from 0.3.7 to 0.3.8
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.7...tracing-subscriber-0.3.8)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 04:18:58 +00:00
d63aaee2d3 Merge pull request #411 from vbrandl/dependabot/cargo/tracing-0.1.30
All checks were successful
continuous-integration/drone/push Build is passing
Bump tracing from 0.1.29 to 0.1.30
2022-02-04 10:03:39 +01:00
e453c7aa25 Bump tracing from 0.1.29 to 0.1.30
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.29 to 0.1.30.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.29...tracing-0.1.30)

---
updated-dependencies:
- dependency-name: tracing
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-04 04:16:40 +00:00
5 changed files with 453 additions and 292 deletions

3
.cargo/audit.toml Normal file
View File

@ -0,0 +1,3 @@
[advisories]
# TODO: check if chrono fixed this
ignore = [ "RUSTSEC-2020-0159", "RUSTSEC-2020-0071" ]

690
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[package]
name = "hoc"
version = "0.21.1"
version = "0.21.2"
authors = ["Valentin Brandl <vbrandl@riseup.net>"]
edition = "2018"
build = "build.rs"
@ -14,33 +14,33 @@ name = "hoc"
[dependencies]
actix-rt = "2.6.0"
actix-web = "4.0.0-rc.1"
actix-web = "4.0.0-rc.3"
badge = "0.3.0"
bytes = "1.1.0"
config = { version = "0.11.0", features = ["toml"] }
config = { version = "0.12.0", features = ["toml"] }
dotenv = "0.15.0"
futures = "0.3.19"
git2 = "0.13.25"
futures = "0.3.21"
git2 = "0.14.0"
lazy_static = "1.4.0"
number_prefix = "0.4.0"
openssl-probe = "0.1.5"
reqwest = "0.11.9"
serde = "1.0.136"
serde_derive = "1.0.136"
serde_json = "1.0.78"
tracing = "0.1.29"
tracing-actix-web = "0.5.0-rc.1"
serde_json = "1.0.79"
tracing = "0.1.31"
tracing-actix-web = "0.5.0-rc.3"
tracing-bunyan-formatter = "0.3.2"
tracing-futures = "0.2.5"
tracing-log = "0.1.2"
tracing-subscriber = { version = "0.3.7", features = ["registry", "env-filter"] }
tracing-subscriber = { version = "0.3.9", features = ["registry", "env-filter"] }
[build-dependencies]
ructe = "0.13.4"
ructe = "0.14.0"
vergen = { version = "6.0.2", default-features = false, features = ["git"] }
[dev-dependencies]
awc = "3.0.0-beta.20"
ructe = "0.13.4"
awc = "3.0.0-beta.21"
ructe = "0.14.0"
tempfile = "3.3.0"
tokio = "1.16.1"
tokio = "1.17.0"

View File

@ -1,15 +1,12 @@
extern crate ructe;
extern crate vergen;
use ructe::Ructe;
use ructe::{Ructe, RucteError};
use vergen::{vergen, Config, ShaKind};
fn main() {
fn main() -> Result<(), RucteError> {
let mut config = Config::default();
*config.git_mut().sha_kind_mut() = ShaKind::Short;
vergen(config).expect("Unable to generate static repo info");
Ructe::from_env()
.expect("ructe")
.compile_templates("templates")
.unwrap();
Ructe::from_env()?.compile_templates("templates")
}

View File

@ -18,21 +18,16 @@ pub struct Settings {
}
impl Settings {
#[deprecated]
pub fn new() -> Result<Self, ConfigError> {
Self::load()
}
pub fn load() -> Result<Self, ConfigError> {
let mut config = Config::new();
config
.merge(File::with_name("hoc.toml").required(false))?
.merge(Environment::with_prefix("hoc"))?
Config::builder()
.add_source(File::with_name("hoc.toml").required(false))
.add_source(Environment::with_prefix("hoc"))
.set_default("repodir", "./repos")?
.set_default("cachedir", "./cache")?
.set_default("workers", 4)?
.set_default("port", 8080)?
.set_default("host", "0.0.0.0")?;
config.try_into()
.set_default("host", "0.0.0.0")?
.build()?
.try_deserialize()
}
}