Compare commits

...

148 Commits

Author SHA1 Message Date
1010d5cf0d Bump version number 2020-02-12 21:02:13 +01:00
6896a22409 Handle non-existent master branch 2020-02-12 20:56:47 +01:00
3c2f06ebae Merge pull request #89 from vbrandl/dependabot/cargo/git2-0.11.0
Bump git2 from 0.9.1 to 0.11.0
2020-02-12 20:28:01 +01:00
3c945f5762 Bump git2 from 0.9.1 to 0.11.0
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.9.1 to 0.11.0.
- [Release notes](https://github.com/rust-lang/git2-rs/releases)
- [Commits](https://github.com/rust-lang/git2-rs/compare/libgit2-sys-0.9.1...git2-curl-0.11.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-12 19:17:59 +00:00
903abdefdc Remove unnecessray clone 2020-02-12 20:17:55 +01:00
01689fc89e Merge pull request #99 from vbrandl/dependabot/cargo/bytes-0.5.4
Bump bytes from 0.4.12 to 0.5.4
2020-02-12 20:16:34 +01:00
ede937d651 Bump bytes from 0.4.12 to 0.5.4
Bumps [bytes](https://github.com/tokio-rs/bytes) from 0.4.12 to 0.5.4.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v0.4.12...v0.5.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-12 19:11:52 +00:00
1805d86048 Merge branch 'master' of github.com:vbrandl/hoc 2020-02-12 20:10:14 +01:00
a81de6f89c Merge branch 'feature/dependency-upgrades' 2020-02-12 20:08:24 +01:00
dfc49c6b64 Update futures, actix and request to next major version, refactor to use async/await 2020-02-12 19:45:18 +01:00
c7cde6222a Merge remote-tracking branch 'github/dependabot/cargo/actix-web-2.0.0' into dependabot/cargo/futures-0.3.1 2020-02-12 18:47:34 +01:00
fb889aa0ec Merge pull request #108 from vbrandl/dependabot/cargo/serde_json-1.0.47
Bump serde_json from 1.0.44 to 1.0.47
2020-02-12 17:59:40 +01:00
36f29a410b Bump serde_json from 1.0.44 to 1.0.47
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.44 to 1.0.47.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.44...v1.0.47)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-12 16:59:26 +00:00
e65efb5ea1 Merge pull request #104 from vbrandl/dependabot/cargo/structopt-0.3.9
Bump structopt from 0.3.7 to 0.3.9
2020-02-12 17:58:02 +01:00
2127dbe879 Merge pull request #102 from vbrandl/dependabot/cargo/log4rs-0.10.0
Bump log4rs from 0.9.0 to 0.10.0
2020-02-12 17:57:52 +01:00
9fe0c080c7 Merge pull request #101 from vbrandl/dependabot/cargo/ructe-0.9.2
Bump ructe from 0.9.0 to 0.9.2
2020-02-12 17:57:42 +01:00
5f132ed0c8 Bump structopt from 0.3.7 to 0.3.9
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.7 to 0.3.9.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.7...v0.3.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-03 04:19:56 +00:00
5fe25b83e1 Bump log4rs from 0.9.0 to 0.10.0
Bumps [log4rs](https://github.com/estk/log4rs) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/estk/log4rs/releases)
- [Changelog](https://github.com/estk/log4rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/estk/log4rs/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 04:18:26 +00:00
72655edcfc Bump ructe from 0.9.0 to 0.9.2
Bumps [ructe](https://github.com/kaj/ructe) from 0.9.0 to 0.9.2.
- [Release notes](https://github.com/kaj/ructe/releases)
- [Commits](https://github.com/kaj/ructe/compare/v0.9.0...v0.9.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-27 04:18:28 +00:00
2ef4412f0a Merge pull request #91 from vbrandl/dependabot/cargo/serde-1.0.104
Some checks reported errors
continuous-integration/drone/push Build was killed
Bump serde from 1.0.103 to 1.0.104
2020-01-10 13:32:11 +01:00
3863a870c5 Bump serde from 1.0.103 to 1.0.104
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.103 to 1.0.104.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.103...v1.0.104)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-10 11:29:48 +00:00
7e29eab063 Merge pull request #93 from vbrandl/dependabot/cargo/ructe-0.9.0
Bump ructe from 0.8.0 to 0.9.0
2020-01-10 12:27:34 +01:00
303445f3ad Merge pull request #87 from vbrandl/dependabot/cargo/serde_json-1.0.44
Bump serde_json from 1.0.42 to 1.0.44
2020-01-10 12:26:58 +01:00
6a03ae9fff Merge pull request #86 from vbrandl/dependabot/cargo/log4rs-0.9.0
Bump log4rs from 0.8.3 to 0.9.0
2020-01-10 12:20:50 +01:00
9ac60b8a26 Bump ructe from 0.8.0 to 0.9.0
Bumps [ructe](https://github.com/kaj/ructe) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/kaj/ructe/releases)
- [Commits](https://github.com/kaj/ructe/compare/v0.8.0...v0.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-10 11:20:16 +00:00
d2c23ebf4f Bump serde_json from 1.0.42 to 1.0.44
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.42 to 1.0.44.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.42...v1.0.44)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-10 11:20:06 +00:00
d0ddc7f62d Merge pull request #95 from vbrandl/dependabot/cargo/structopt-0.3.7
Bump structopt from 0.3.5 to 0.3.7
2020-01-10 12:18:42 +01:00
164c97f453 Bump structopt from 0.3.5 to 0.3.7
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.5 to 0.3.7.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.5...v0.3.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-10 11:11:57 +00:00
c702bec8e2 Merge pull request #96 from vbrandl/dependabot/cargo/http-0.1.21
[Security] Bump http from 0.1.17 to 0.1.21
2020-01-10 11:55:39 +01:00
2c002a1865 Fix clippy lint
Some checks reported errors
continuous-integration/drone/push Build was killed
2020-01-10 11:46:30 +01:00
95efa4d875 Remove unnecessray clone
Some checks reported errors
continuous-integration/drone/push Build was killed
2020-01-10 11:40:14 +01:00
65f1575045 [Security] Bump http from 0.1.17 to 0.1.21
Bumps [http](https://github.com/hyperium/http) from 0.1.17 to 0.1.21. **This update includes security fixes.**
- [Release notes](https://github.com/hyperium/http/releases)
- [Changelog](https://github.com/hyperium/http/blob/v0.1.21/CHANGELOG.md)
- [Commits](https://github.com/hyperium/http/compare/v0.1.17...v0.1.21)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-09 20:04:27 +00:00
9f95ae74a4 Bump actix-web from 1.0.9 to 2.0.0
Bumps [actix-web](https://github.com/actix/actix-web) from 1.0.9 to 2.0.0.
- [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-v1.0.9...web-v2.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-26 04:20:46 +00:00
37159f8909 Fix path pattern
Some checks are pending
continuous-integration/drone/push Build is pending
2019-12-11 19:38:56 +01:00
0142425f1e Bump log4rs from 0.8.3 to 0.9.0
Bumps [log4rs](https://github.com/estk/log4rs) from 0.8.3 to 0.9.0.
- [Release notes](https://github.com/estk/log4rs/releases)
- [Changelog](https://github.com/estk/log4rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/estk/log4rs/compare/v0.8.3...v0.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-02 04:23:17 +00:00
b72641221b Merge pull request #80 from vbrandl/dependabot/cargo/serde_json-1.0.42
Some checks are pending
continuous-integration/drone/push Build is pending
Bump serde_json from 1.0.41 to 1.0.42
2019-11-25 17:44:24 +01:00
50d985ffd4 Bump serde_json from 1.0.41 to 1.0.42
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.41 to 1.0.42.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.41...v1.0.42)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-25 16:43:36 +00:00
8b0cc49724 Merge pull request #81 from vbrandl/dependabot/cargo/serde-1.0.103
Bump serde from 1.0.101 to 1.0.103
2019-11-25 17:42:26 +01:00
6d0d53af1b Bump serde from 1.0.101 to 1.0.103
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.101 to 1.0.103.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.101...v1.0.103)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-25 16:42:03 +00:00
b666a3e3b3 Bump futures from 0.1.29 to 0.3.1
Bumps [futures](https://github.com/rust-lang-nursery/futures-rs) from 0.1.29 to 0.3.1.
- [Release notes](https://github.com/rust-lang-nursery/futures-rs/releases)
- [Changelog](https://github.com/rust-lang-nursery/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang-nursery/futures-rs/compare/0.1.29...0.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-25 16:41:24 +00:00
f5b37ba700 Merge pull request #79 from vbrandl/dependabot/cargo/serde_derive-1.0.103
Bump serde_derive from 1.0.101 to 1.0.103
2019-11-25 17:40:49 +01:00
beb3c8330c Merge pull request #77 from vbrandl/dependabot/cargo/actix-web-1.0.9
Bump actix-web from 1.0.8 to 1.0.9
2019-11-25 17:40:13 +01:00
34ee7e3853 Merge pull request #74 from vbrandl/dependabot/cargo/ructe-0.8.0
Bump ructe from 0.7.2 to 0.8.0
2019-11-25 17:40:02 +01:00
84cf8b9a6f Merge pull request #82 from vbrandl/dependabot/cargo/structopt-0.3.5
Bump structopt from 0.3.3 to 0.3.5
2019-11-25 17:39:29 +01:00
9ef0337605 Apply cargo fmt
Some checks are pending
continuous-integration/drone/push Build is pending
2019-11-25 17:35:00 +01:00
bbf5bba490 Reduce number of parameters
Some checks are pending
continuous-integration/drone/push Build is pending
2019-11-25 17:27:16 +01:00
9991f6c545 Rollback changes 2019-11-25 17:25:43 +01:00
37e3c5ee72 Change to test cargo audit
Some checks are pending
continuous-integration/drone/push Build is pending
2019-11-25 16:57:59 +01:00
edab6fd3dd Don't run the tool in CI 2019-11-25 16:55:18 +01:00
97197190f5 Use actions-rs and caching
Some checks are pending
continuous-integration/drone/push Build is pending
2019-11-25 16:53:06 +01:00
4959fabd29 Run audit if deps changed, on merge requests and scheduled
Some checks are pending
continuous-integration/drone/push Build is pending
2019-11-25 16:50:17 +01:00
fecd5d0b6a Bump structopt from 0.3.3 to 0.3.5
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.3 to 0.3.5.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.3...v0.3.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-25 04:19:40 +00:00
1060edaebe Bump serde_derive from 1.0.101 to 1.0.103
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.101 to 1.0.103.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.101...v1.0.103)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-25 04:18:37 +00:00
bc9f411297 Bump actix-web from 1.0.8 to 1.0.9
Bumps [actix-web](https://github.com/actix/actix-web) from 1.0.8 to 1.0.9.
- [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-v1.0.8...web-v1.0.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-14 04:21:38 +00:00
7fc920cddd Bump version number
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone/tag Build is pending
2019-11-08 17:17:55 +01:00
6a4c1edf9e Bump ructe from 0.7.2 to 0.8.0
Bumps [ructe](https://github.com/kaj/ructe) from 0.7.2 to 0.8.0.
- [Release notes](https://github.com/kaj/ructe/releases)
- [Commits](https://github.com/kaj/ructe/compare/v0.7.2...v0.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-07 04:22:25 +00:00
c1ea45d517 Merge pull request #68 from vbrandl/dependabot/cargo/reqwest-0.9.22
Some checks reported errors
continuous-integration/drone/push Build was killed
Bump reqwest from 0.9.20 to 0.9.22
2019-10-14 15:37:50 +02:00
0b729da42f Merge pull request #65 from vbrandl/dependabot/cargo/actix-web-1.0.8
Bump actix-web from 1.0.7 to 1.0.8
2019-10-14 15:37:35 +02:00
c0d0aa2176 Bump reqwest from 0.9.20 to 0.9.22
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.9.20 to 0.9.22.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/v0.9.22/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.9.20...v0.9.22)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-14 13:35:53 +00:00
41159c4ba4 Merge pull request #63 from vbrandl/dependabot/cargo/serde-1.0.101
Bump serde from 1.0.100 to 1.0.101
2019-10-14 15:34:09 +02:00
b40b6bcad2 Bump serde from 1.0.100 to 1.0.101
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.100 to 1.0.101.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.100...v1.0.101)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-14 13:31:42 +00:00
6e86f49585 Merge pull request #67 from vbrandl/dependabot/cargo/serde_json-1.0.41
Bump serde_json from 1.0.40 to 1.0.41
2019-10-14 15:29:52 +02:00
c8c73b6b83 Bump serde_json from 1.0.40 to 1.0.41
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.40 to 1.0.41.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.40...v1.0.41)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-14 13:25:55 +00:00
c6cc956f4d Merge pull request #69 from vbrandl/dependabot/cargo/structopt-0.3.3
Bump structopt from 0.3.1 to 0.3.3
2019-10-14 15:23:19 +02:00
e37489d2cb Merge pull request #62 from vbrandl/dependabot/cargo/serde_derive-1.0.101
Bump serde_derive from 1.0.100 to 1.0.101
2019-10-14 15:21:43 +02:00
8246be996e Bump structopt from 0.3.1 to 0.3.3
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.1 to 0.3.3.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.1...v0.3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-11 05:01:25 +00:00
1f32f3eda4 Bump actix-web from 1.0.7 to 1.0.8
Bumps [actix-web](https://github.com/actix/actix-web) from 1.0.7 to 1.0.8.
- [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-v1.0.7...web-v1.0.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-26 04:24:19 +00:00
ab6c317241 Bump serde_derive from 1.0.100 to 1.0.101
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.100 to 1.0.101.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.100...v1.0.101)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-17 04:23:34 +00:00
1223d429db Merge pull request #60 from vbrandl/vbrandl-patch-1
All checks were successful
continuous-integration/drone/push Build is passing
Add Github actions
2019-09-09 21:39:32 +02:00
9613aa7848 Add Github actions 2019-09-09 21:39:16 +02:00
334fa8ced5 Bump version number
All checks were successful
continuous-integration/drone/push Build is passing
2019-09-09 18:19:53 +02:00
062343dd32 Merge pull request #57 from vbrandl/dependabot/cargo/serde-1.0.100
Bump serde from 1.0.99 to 1.0.100
2019-09-09 18:18:15 +02:00
bdb2a151fa Merge pull request #56 from vbrandl/dependabot/cargo/futures-0.1.29
Bump futures from 0.1.28 to 0.1.29
2019-09-09 18:17:04 +02:00
7e66393966 Bump serde from 1.0.99 to 1.0.100
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.99 to 1.0.100.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.99...v1.0.100)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-09 16:16:33 +00:00
32ac5ca0d8 Merge pull request #58 from vbrandl/dependabot/cargo/structopt-0.3.1
Bump structopt from 0.2.18 to 0.3.1
2019-09-09 18:15:19 +02:00
b3b4cd0e42 Merge pull request #59 from vbrandl/dependabot/cargo/serde_derive-1.0.100
Bump serde_derive from 1.0.99 to 1.0.100
2019-09-09 18:15:07 +02:00
be08b87bbb Bump serde_derive from 1.0.99 to 1.0.100
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.99 to 1.0.100.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.99...v1.0.100)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-09 04:25:47 +00:00
cf4d427b96 Bump structopt from 0.2.18 to 0.3.1
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.2.18 to 0.3.1.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.2.18...v0.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-09 04:25:23 +00:00
b5ebc54372 Bump futures from 0.1.28 to 0.1.29
Bumps [futures](https://github.com/rust-lang-nursery/futures-rs) from 0.1.28 to 0.1.29.
- [Release notes](https://github.com/rust-lang-nursery/futures-rs/releases)
- [Changelog](https://github.com/rust-lang-nursery/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang-nursery/futures-rs/compare/0.1.28...0.1.29)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-06 04:23:07 +00:00
231741629e Merge pull request #53 from vbrandl/dependabot/cargo/actix-web-1.0.7
All checks were successful
continuous-integration/drone/push Build is passing
Bump actix-web from 1.0.5 to 1.0.7
2019-08-30 11:22:26 +02:00
135c5756b1 Merge pull request #54 from vbrandl/dependabot/cargo/ructe-0.7.2
Bump ructe from 0.7.0 to 0.7.2
2019-08-30 11:21:07 +02:00
79cfee5fa5 Bump ructe from 0.7.0 to 0.7.2
Bumps [ructe](https://github.com/kaj/ructe) from 0.7.0 to 0.7.2.
- [Release notes](https://github.com/kaj/ructe/releases)
- [Commits](https://github.com/kaj/ructe/compare/v0.7.0...v0.7.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-29 04:27:17 +00:00
1c9b5db4e1 Bump actix-web from 1.0.5 to 1.0.7
Bumps [actix-web](https://github.com/actix/actix-web) from 1.0.5 to 1.0.7.
- [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-v1.0.5...web-v1.0.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-29 04:26:47 +00:00
6e0e452395 Bump version number
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2019-08-28 20:21:56 +02:00
9e44731650 Merge pull request #50 from vbrandl/dependabot/cargo/reqwest-0.9.20
Bump reqwest from 0.9.19 to 0.9.20
2019-08-28 20:20:37 +02:00
f673d71387 Bump reqwest from 0.9.19 to 0.9.20
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.9.19 to 0.9.20.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/v0.9.20/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.9.19...v0.9.20)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-28 18:20:05 +00:00
eda1822dce Merge pull request #51 from vbrandl/dependabot/cargo/lazy_static-1.4.0
Bump lazy_static from 1.3.0 to 1.4.0
2019-08-28 20:18:56 +02:00
fb64af3456 Bump lazy_static from 1.3.0 to 1.4.0
Bumps [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/rust-lang-nursery/lazy-static.rs/releases)
- [Commits](https://github.com/rust-lang-nursery/lazy-static.rs/compare/1.3.0...1.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-28 18:18:32 +00:00
0837284798 Merge pull request #48 from vbrandl/dependabot/cargo/serde-1.0.99
Bump serde from 1.0.98 to 1.0.99
2019-08-28 20:18:24 +02:00
a7039f15b5 Merge pull request #52 from vbrandl/dependabot/cargo/spin-0.5.2
[Security] Bump spin from 0.5.0 to 0.5.2
2019-08-28 20:16:54 +02:00
b1be281982 [Security] Bump spin from 0.5.0 to 0.5.2
Bumps [spin](https://github.com/mvdnes/spin-rs) from 0.5.0 to 0.5.2. **This update includes a security fix.**
- [Release notes](https://github.com/mvdnes/spin-rs/releases)
- [Commits](https://github.com/mvdnes/spin-rs/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-28 17:22:32 +00:00
2795995f58 Bump serde from 1.0.98 to 1.0.99
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.98 to 1.0.99.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.98...v1.0.99)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-28 07:43:01 +00:00
913cc9dc75 Merge pull request #47 from vbrandl/dependabot/cargo/serde_derive-1.0.99
Bump serde_derive from 1.0.98 to 1.0.99
2019-08-28 09:27:35 +02:00
645d6e4a2b Bump serde_derive from 1.0.98 to 1.0.99
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.98 to 1.0.99.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.98...v1.0.99)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-28 07:23:42 +00:00
e455a89de4 Fix Docker TLS certdir
All checks were successful
continuous-integration/drone/push Build is passing
2019-08-28 09:14:17 +02:00
f2cae46624 Update CI script for new docker version
All checks were successful
continuous-integration/drone/push Build is passing
2019-08-02 15:14:31 +02:00
f47cbbe81a Merge pull request #44 from vbrandl/dependabot/cargo/serde_derive-1.0.98
All checks were successful
continuous-integration/drone/push Build is passing
Bump serde_derive from 1.0.97 to 1.0.98
2019-08-02 15:01:12 +02:00
85f90c0bdb Bump serde_derive from 1.0.97 to 1.0.98
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.97 to 1.0.98.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.97...v1.0.98)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-02 13:00:35 +00:00
9143e5dbf8 Merge pull request #45 from vbrandl/dependabot/cargo/serde-1.0.98
Bump serde from 1.0.97 to 1.0.98
2019-08-02 14:59:02 +02:00
865e3c7bbd Merge pull request #46 from vbrandl/dependabot/cargo/log-0.4.8
Bump log from 0.4.7 to 0.4.8
2019-08-02 14:58:53 +02:00
5ebdd4067c Bump version number
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2019-07-29 21:50:21 +02:00
55a1405e71 Enable NormalizePath middleware
This allows double slashes in paths
2019-07-29 21:49:25 +02:00
1436336b6a Bump log from 0.4.7 to 0.4.8
Bumps [log](https://github.com/rust-lang/log) from 0.4.7 to 0.4.8.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang-nursery/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-29 04:34:22 +00:00
5a74306e49 Bump serde from 1.0.97 to 1.0.98
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.97 to 1.0.98.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.97...v1.0.98)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-29 04:33:55 +00:00
614e5a6da5 Bump version number
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2019-07-22 22:27:19 +02:00
0128e267cc Use async client to check if a repo exists 2019-07-22 22:26:37 +02:00
c3dffac5da Use async client 2019-07-22 22:25:55 +02:00
aaaff22907 Merge pull request #42 from vbrandl/dependabot/cargo/reqwest-0.9.19
Bump reqwest from 0.9.17 to 0.9.19
2019-07-22 21:39:45 +02:00
ddfcbf11f1 Bump reqwest from 0.9.17 to 0.9.19
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.9.17 to 0.9.19.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.9.17...v0.9.19)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-22 04:28:01 +00:00
3bee454548 Bump version number
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2019-07-19 17:03:24 +02:00
9cff6f1f13 Merge pull request #40 from vbrandl/dependabot/cargo/serde-1.0.97
Bump serde from 1.0.93 to 1.0.97
2019-07-19 16:43:35 +02:00
c946c5d0b4 Bump serde from 1.0.93 to 1.0.97
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.93 to 1.0.97.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.93...v1.0.97)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-19 14:41:50 +00:00
88ae90af95 Merge pull request #39 from vbrandl/dependabot/cargo/actix-web-1.0.5
Bump actix-web from 1.0.3 to 1.0.5
2019-07-19 16:40:36 +02:00
9f783dffa8 Merge pull request #41 from vbrandl/dependabot/cargo/ructe-0.7.0
Bump ructe from 0.6.4 to 0.7.0
2019-07-19 16:40:23 +02:00
2cdf64ed80 Bump ructe from 0.6.4 to 0.7.0
Bumps [ructe](https://github.com/kaj/ructe) from 0.6.4 to 0.7.0.
- [Release notes](https://github.com/kaj/ructe/releases)
- [Commits](https://github.com/kaj/ructe/compare/v0.6.4...v0.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-19 14:40:13 +00:00
9e024b530e Merge pull request #38 from vbrandl/dependabot/cargo/serde_derive-1.0.97
Bump serde_derive from 1.0.94 to 1.0.97
2019-07-19 16:38:43 +02:00
0db7b26541 Bump actix-web from 1.0.3 to 1.0.5
Bumps [actix-web](https://github.com/actix/actix-web) from 1.0.3 to 1.0.5.
- [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-v1.0.3...web-v1.0.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-18 15:13:53 +00:00
009d2c4813 Bump serde_derive from 1.0.94 to 1.0.97
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.94 to 1.0.97.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.94...v1.0.97)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-18 15:13:40 +00:00
f0ed6c2e23 Merge pull request #35 from vbrandl/dependabot/cargo/log-0.4.7
All checks were successful
continuous-integration/drone/push Build is passing
Bump log from 0.4.6 to 0.4.7
2019-07-14 14:25:47 +02:00
d16a21e74e Bump log from 0.4.6 to 0.4.7
Bumps [log](https://github.com/rust-lang/log) from 0.4.6 to 0.4.7.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang-nursery/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.6...0.4.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-11 06:35:54 +00:00
7e721ac212 Fork in for loop
[ci skip]
2019-07-07 21:01:57 +02:00
4eb5d06cd1 Fork in loop
[ci skip]
2019-07-07 20:33:08 +02:00
b71207ca51 Add helper scripts for finding and loading active repos (on github)
[ci skip]
2019-07-07 20:22:32 +02:00
f3902f800f Remove migration subcommand
All checks were successful
continuous-integration/drone/push Build is passing
2019-07-07 18:27:50 +02:00
b8e454762e Bump version number
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2019-07-07 14:53:51 +02:00
268734efdd Merge branch 'feature/commit-count'
Closes #33
2019-07-07 14:53:10 +02:00
c71925f61e Add migration subcommand 2019-07-07 14:52:42 +02:00
c5bbd14a05 Update documentation for the JSON endpoint 2019-07-07 13:36:14 +02:00
a239a3f80b Calculate number of commits
The number of commits is shown in the overview page and returned in the
JSON response.

Closes #33
2019-07-07 13:30:17 +02:00
00b4e60341 Add parse error 2019-07-07 13:29:26 +02:00
ed1cafafd0 Show commit count in overview page 2019-07-07 13:29:03 +02:00
bdb10fd54a Add commit count to the cache struct 2019-07-07 13:28:43 +02:00
1f01c3b964 Bump version number
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2019-07-05 12:50:55 +02:00
3f94789b8b Merge pull request #32 from vbrandl/dependabot/cargo/actix-web-1.0.3
Bump actix-web from 1.0.2 to 1.0.3
2019-07-05 12:49:40 +02:00
e4f8604861 Bump actix-web from 1.0.2 to 1.0.3
All checks were successful
continuous-integration/drone/push Build is passing
Bumps [actix-web](https://github.com/actix/actix-web) from 1.0.2 to 1.0.3.
- [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-v1.0.2...web-v1.0.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-03 04:24:43 +00:00
25a179dad6 Bump version number
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2019-07-02 17:13:51 +02:00
6ee44f7ba3 Revert "Update dependencies"
This reverts commit 7e13f93ee3. This
commit broke following builds. It was impossible to clone new
repositories.

Reverting the commit closes #31.
2019-07-02 17:11:58 +02:00
e9ebbee957 Bump version number
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2019-07-01 18:28:14 +02:00
5211481226 Merge pull request #30 from vbrandl/dependabot/cargo/serde_json-1.0.40
Bump serde_json from 1.0.39 to 1.0.40
2019-07-01 18:24:59 +02:00
fd230db0cb Bump serde_json from 1.0.39 to 1.0.40
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.39 to 1.0.40.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.39...v1.0.40)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-01 04:29:15 +00:00
92a95f33d4 Bump version number
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2019-06-28 15:26:12 +02:00
7e13f93ee3 Update dependencies 2019-06-28 15:25:28 +02:00
36afc8732e Merge pull request #29 from vbrandl/dependabot/cargo/serde_derive-1.0.94
All checks were successful
continuous-integration/drone/push Build is passing
Bump serde_derive from 1.0.93 to 1.0.94
2019-06-28 14:16:41 +02:00
abeed1f971 Bump serde_derive from 1.0.93 to 1.0.94
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.93 to 1.0.94.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.93...v1.0.94)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-28 04:26:03 +00:00
03a0743517 Merge pull request #27 from vbrandl/dependabot/cargo/structopt-0.2.18 2019-06-27 07:19:36 +00:00
cbfd56b33a Merge pull request #26 from vbrandl/dependabot/cargo/futures-0.1.28 2019-06-27 07:18:43 +00:00
9c5208d6e4 Bump structopt from 0.2.16 to 0.2.18
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.2.16 to 0.2.18.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/v0.2.18/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.2.16...v0.2.18)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-27 04:25:09 +00:00
92d7b6668a Bump futures from 0.1.27 to 0.1.28
Bumps [futures](https://github.com/rust-lang-nursery/futures-rs) from 0.1.27 to 0.1.28.
- [Release notes](https://github.com/rust-lang-nursery/futures-rs/releases)
- [Changelog](https://github.com/rust-lang-nursery/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang-nursery/futures-rs/compare/0.1.27...0.1.28)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-27 04:24:37 +00:00
15 changed files with 1708 additions and 1652 deletions

31
.github/workflows/audit.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: Security audit
on:
schedule:
- cron: '0 1 * * *'
push:
paths:
- 'Cargo.toml'
- 'Cargo.lock'
pull_request:
jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: /usr/share/rust/.cargo/registry
key: ${{ runner.os }}-cargo-registry
- name: Cache cargo index
uses: actions/cache@v1
with:
path: /usr/share/rust/.cargo/git
key: ${{ runner.os }}-cargo-index
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

94
.github/workflows/rust.yml vendored Normal file
View File

@ -0,0 +1,94 @@
name: Rust
on: [push, pull_request]
jobs:
lint:
name: Linting and Formatting Checks
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v1
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install rustfmt
run: rustup component add rustfmt
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Check Formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Install clippy
run: rustup component add clippy
- name: Clippy Linting
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
test:
name: Run Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
# add windows-latest when it is clear why tests are failing
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout sources
uses: actions/checkout@v1
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Run Tests
uses: actions-rs/cargo@v1
with:
command: test

View File

@ -1,6 +1,6 @@
image: docker:stable
image: docker:19.03
services:
- docker:dind
- docker:19.03-dind
stages:
- build
@ -9,6 +9,8 @@ stages:
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
# DOCKER_TLS_CERTDIR: "/certs"
DOCKER_TLS_CERTDIR: ""
CONTAINER_BUILDER_IMAGE: $CI_REGISTRY_IMAGE:builder-latest
CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest

2846
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +1,28 @@
[package]
name = "hoc"
version = "0.9.3"
version = "0.11.5"
authors = ["Valentin Brandl <vbrandl@riseup.net>"]
edition = "2018"
build = "build.rs"
[dependencies]
actix-web = "1.0.2"
actix-web = "2.0.0"
badge = "0.2.0"
bytes = "0.4.12"
futures = "0.1.27"
git2 = "0.9.1"
lazy_static = "1.3.0"
log = "0.4.6"
log4rs = "0.8.3"
bytes = "0.5.4"
futures = "0.3.1"
git2 = "0.11.0"
lazy_static = "1.4.0"
log = "0.4.8"
log4rs = "0.10.0"
number_prefix = "0.3.0"
openssl-probe = "0.1.2"
reqwest = "0.9.17"
serde = "1.0.93"
serde_derive = "1.0.93"
serde_json = "1.0.39"
structopt = "0.2.16"
reqwest = "0.10.1"
serde = "1.0.104"
serde_derive = "1.0.103"
serde_json = "1.0.47"
structopt = "0.3.9"
actix-rt = "1.0.0"
[build-dependencies]
ructe = "0.6.4"
ructe = "0.9.2"
vergen = "3.0.4"

10
scripts/find-active.sh Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env sh
set -e
DIR=${1:-repos}
for url in $(./scripts/list.sh "${DIR}")
do
(curl "${url}" --silent | grep -q hitsofcode) && echo "${url}" &
done

21
scripts/load-active.sh Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env sh
set -e
ACTIVE=${1}
if [ -z "${ACTIVE}" ]
then
echo "Usage: $0 <list of active repos>"
exit 1
fi
while IFS= read -r url
do
imgs=$(curl "${url}" --silent | grep hitsofcode | grep -o -P 'https://camo.githubusercontent.com/[a-z0-9]+/[a-z0-9]+')
[ -z "${imgs}" ] || echo "${url}"
for img in ${imgs}
do
curl "$img" --silent > /dev/null &
done
done < "${ACTIVE}"

View File

@ -9,7 +9,7 @@ use std::{
/// Enum to indicate the state of the cache
pub(crate) enum CacheState<'a> {
/// Current head and cached head are the same
Current(u64),
Current { count: u64, commits: u64 },
/// Cached head is older than current head
Old(Cache<'a>),
/// No cache was found
@ -21,7 +21,10 @@ impl<'a> CacheState<'a> {
if path.as_ref().exists() {
let cache: Cache = serde_json::from_reader(BufReader::new(File::open(path)?))?;
if cache.head == head {
Ok(CacheState::Current(cache.count))
Ok(CacheState::Current {
count: cache.count,
commits: cache.commits,
})
} else {
Ok(CacheState::Old(cache))
}
@ -30,22 +33,31 @@ impl<'a> CacheState<'a> {
}
}
pub(crate) fn calculate_new_cache(self, count: u64, head: Cow<'a, str>) -> Cache {
pub(crate) fn calculate_new_cache(self, count: u64, commits: u64, head: Cow<'a, str>) -> Cache {
match self {
CacheState::Old(mut cache) => {
cache.head = head;
cache.count += count;
cache.commits += commits;
cache
}
CacheState::No | CacheState::Current(_) => Cache { head, count },
CacheState::No | CacheState::Current { .. } => Cache {
head,
count,
commits,
},
}
}
}
#[derive(Serialize, Deserialize)]
pub(crate) struct Cache<'a> {
/// HEAD commit ref
pub head: Cow<'a, str>,
/// HoC value
pub count: u64,
/// Number of commits
pub commits: u64,
}
impl<'a> Cache<'a> {

View File

@ -48,7 +48,7 @@ pub(crate) struct Opt {
pub(crate) logfile: PathBuf,
}
pub(crate) fn init() -> Result<()> {
pub(crate) async fn init() -> Result<()> {
std::env::set_var("RUST_LOG", "actix_web=info,hoc=info");
// pretty_env_logger::init();
openssl_probe::init_ssl_cert_env_vars();

View File

@ -16,7 +16,9 @@ pub(crate) enum Error {
Io(std::io::Error),
Log(log::SetLoggerError),
LogBuilder(log4rs::config::Errors),
Parse(std::num::ParseIntError),
Serial(serde_json::Error),
GitNoMaster,
}
impl fmt::Display for Error {
@ -29,7 +31,9 @@ impl fmt::Display for Error {
Error::Io(e) => write!(fmt, "Io({})", e),
Error::Log(e) => write!(fmt, "Log({})", e),
Error::LogBuilder(e) => write!(fmt, "LogBuilder({})", e),
Error::Parse(e) => write!(fmt, "Parse({})", e),
Error::Serial(e) => write!(fmt, "Serial({})", e),
Error::GitNoMaster => write!(fmt, "Repo doesn't have master branch"),
}
}
}
@ -37,14 +41,20 @@ impl fmt::Display for Error {
impl ResponseError for Error {
fn error_response(&self) -> HttpResponse {
let mut buf = Vec::new();
templates::p500(&mut buf, VERSION_INFO, REPO_COUNT.load(Ordering::Relaxed)).unwrap();
HttpResponse::InternalServerError()
.content_type("text/html")
.body(buf)
}
fn render_response(&self) -> HttpResponse {
self.error_response()
match self {
Error::GitNoMaster => {
templates::p404_no_master(&mut buf, VERSION_INFO, REPO_COUNT.load(Ordering::Relaxed)).unwrap();
HttpResponse::NotFound()
.content_type("text/html")
.body(buf)
},
_ => {
templates::p500(&mut buf, VERSION_INFO, REPO_COUNT.load(Ordering::Relaxed)).unwrap();
HttpResponse::InternalServerError()
.content_type("text/html")
.body(buf)
}
}
}
}
@ -91,3 +101,9 @@ impl From<log4rs::config::Errors> for Error {
Error::LogBuilder(err)
}
}
impl From<std::num::ParseIntError> for Error {
fn from(err: std::num::ParseIntError) -> Self {
Error::Parse(err)
}
}

View File

@ -15,21 +15,21 @@ mod count;
mod error;
mod service;
mod statics;
mod template;
use crate::{
cache::CacheState,
error::{Error, Result},
service::{Bitbucket, FormService, GitHub, Gitlab, Service},
statics::{CLIENT, CSS, FAVICON, OPT, REPO_COUNT, VERSION_INFO},
template::RepoInfo,
};
use actix_web::{
error::ErrorBadRequest,
http::header::{CacheControl, CacheDirective, Expires},
middleware, web, App, HttpResponse, HttpServer,
};
use badge::{Badge, BadgeOptions};
use bytes::Bytes;
use futures::{unsync::mpsc, Future, Stream};
use futures::future::Future;
use git2::Repository;
use number_prefix::{NumberPrefix, Prefixed, Standalone};
use std::{
@ -60,6 +60,7 @@ struct State {
struct JsonResponse<'a> {
head: &'a str,
count: u64,
commits: u64,
}
fn pull(path: impl AsRef<Path>) -> Result<()> {
@ -69,17 +70,18 @@ fn pull(path: impl AsRef<Path>) -> Result<()> {
Ok(())
}
fn hoc(repo: &str, repo_dir: &str, cache_dir: &str) -> Result<(u64, String)> {
fn hoc(repo: &str, repo_dir: &str, cache_dir: &str) -> Result<(u64, String, u64)> {
let repo_dir = format!("{}/{}", repo_dir, repo);
let cache_dir = format!("{}/{}.json", cache_dir, repo);
let cache_dir = Path::new(&cache_dir);
let head = format!(
"{}",
Repository::open_bare(&repo_dir)?
.head()?
.target()
.ok_or(Error::Internal)?
);
let repo = Repository::open_bare(&repo_dir)?;
// TODO: do better...
let head = match repo.head() {
Ok(v) => v,
Err(_) => return Err(Error::GitNoMaster),
};
let head = format!("{}", head.target().ok_or(Error::Internal)?);
let mut arg_commit_count = vec!["rev-list".to_string(), "--count".to_string()];
let mut arg = vec![
"log".to_string(),
"--pretty=tformat:".to_string(),
@ -94,16 +96,18 @@ fn hoc(repo: &str, repo_dir: &str, cache_dir: &str) -> Result<(u64, String)> {
];
let cache = CacheState::read_from_file(&cache_dir, &head)?;
match &cache {
CacheState::Current(res) => {
CacheState::Current { count, commits } => {
info!("Using cache for {}", repo_dir);
return Ok((*res, head));
return Ok((*count, head, *commits));
}
CacheState::Old(cache) => {
info!("Updating cache for {}", repo_dir);
arg.push(format!("{}..HEAD", cache.head));
arg_commit_count.push(format!("{}..HEAD", cache.head));
}
CacheState::No => {
info!("Creating cache for {}", repo_dir);
arg_commit_count.push("HEAD".to_string());
}
};
arg.push("--".to_string());
@ -114,6 +118,13 @@ fn hoc(repo: &str, repo_dir: &str, cache_dir: &str) -> Result<(u64, String)> {
.output()?
.stdout;
let output = String::from_utf8_lossy(&output);
let output_commits = Command::new("git")
.args(&arg_commit_count)
.current_dir(&repo_dir)
.output()?
.stdout;
let output_commits = String::from_utf8_lossy(&output_commits);
let commits: u64 = output_commits.trim().parse()?;
let count: u64 = output
.lines()
.map(|s| {
@ -125,19 +136,24 @@ fn hoc(repo: &str, repo_dir: &str, cache_dir: &str) -> Result<(u64, String)> {
})
.sum();
let cache = cache.calculate_new_cache(count, (&head).into());
let cache = cache.calculate_new_cache(count, commits, (&head).into());
cache.write_to_file(cache_dir)?;
Ok((cache.count, head))
Ok((cache.count, head, commits))
}
fn remote_exists(url: &str) -> Result<bool> {
Ok(CLIENT.head(url).send()?.status() == reqwest::StatusCode::OK)
async fn remote_exists(url: &str) -> Result<bool> {
let resp = CLIENT.head(url).send().await?;
Ok(resp.status() == reqwest::StatusCode::OK)
// .map(|resp| resp.status() == reqwest::StatusCode::OK)
// .from_err()
}
enum HocResult {
Hoc {
hoc: u64,
commits: u64,
hoc_pretty: String,
head: String,
url: String,
@ -147,61 +163,63 @@ enum HocResult {
NotFound,
}
fn handle_hoc_request<T, F>(
async fn handle_hoc_request<T, F>(
state: web::Data<Arc<State>>,
data: web::Path<(String, String)>,
mapper: F,
) -> impl Future<Item = HttpResponse, Error = Error>
) -> Result<HttpResponse>
where
T: Service,
F: Fn(HocResult) -> Result<HttpResponse>,
{
futures::future::result(Ok(()))
.and_then(move |_| {
let repo = format!("{}/{}", data.0.to_lowercase(), data.1.to_lowercase());
let service_path = format!("{}/{}", T::domain(), repo);
let path = format!("{}/{}", state.repos, service_path);
let file = Path::new(&path);
let url = format!("https://{}", service_path);
if !file.exists() {
if !remote_exists(&url)? {
warn!("Repository does not exist: {}", url);
return Ok(HocResult::NotFound);
}
info!("Cloning {} for the first time", url);
create_dir_all(file)?;
let repo = Repository::init_bare(file)?;
repo.remote_add_fetch("origin", "refs/heads/*:refs/heads/*")?;
repo.remote_set_url("origin", &url)?;
REPO_COUNT.fetch_add(1, Ordering::Relaxed);
}
pull(&path)?;
let (hoc, head) = hoc(&service_path, &state.repos, &state.cache)?;
let hoc_pretty = match NumberPrefix::decimal(hoc as f64) {
Standalone(hoc) => hoc.to_string(),
Prefixed(prefix, hoc) => format!("{:.1}{}", hoc, prefix),
};
Ok(HocResult::Hoc {
hoc,
hoc_pretty,
head,
url,
repo,
service_path,
})
})
.and_then(mapper)
let repo = format!("{}/{}", data.0.to_lowercase(), data.1.to_lowercase());
let service_path = format!("{}/{}", T::domain(), repo);
let path = format!("{}/{}", state.repos, service_path);
let url = format!("https://{}", service_path);
let remote_exists = remote_exists(&url).await?;
let file = Path::new(&path);
if !file.exists() {
if !remote_exists {
warn!("Repository does not exist: {}", url);
return mapper(HocResult::NotFound);
}
info!("Cloning {} for the first time", url);
create_dir_all(file)?;
let repo = Repository::init_bare(file)?;
repo.remote_add_fetch("origin", "refs/heads/*:refs/heads/*")?;
repo.remote_set_url("origin", &url)?;
REPO_COUNT.fetch_add(1, Ordering::Relaxed);
}
pull(&path)?;
let (hoc, head, commits) = hoc(&service_path, &state.repos, &state.cache)?;
let hoc_pretty = match NumberPrefix::decimal(hoc as f64) {
Standalone(hoc) => hoc.to_string(),
Prefixed(prefix, hoc) => format!("{:.1}{}", hoc, prefix),
};
let res = HocResult::Hoc {
hoc,
commits,
hoc_pretty,
head,
url,
repo,
service_path,
};
mapper(res)
}
fn json_hoc<T: Service>(
state: web::Data<Arc<State>>,
data: web::Path<(String, String)>,
) -> impl Future<Item = HttpResponse, Error = Error> {
) -> impl Future<Output = Result<HttpResponse>> {
let mapper = |r| match r {
HocResult::NotFound => p404(),
HocResult::Hoc { hoc, head, .. } => Ok(HttpResponse::Ok().json(JsonResponse {
HocResult::Hoc {
hoc, head, commits, ..
} => Ok(HttpResponse::Ok().json(JsonResponse {
head: &head,
count: hoc,
commits,
})),
};
handle_hoc_request::<T, _>(state, data, mapper)
@ -210,8 +228,8 @@ fn json_hoc<T: Service>(
fn calculate_hoc<T: Service>(
state: web::Data<Arc<State>>,
data: web::Path<(String, String)>,
) -> impl Future<Item = HttpResponse, Error = Error> {
let mapper = |r| match r {
) -> impl Future<Output = Result<HttpResponse>> {
let mapper = move |r| match r {
HocResult::NotFound => p404(),
HocResult::Hoc { hoc_pretty, .. } => {
let badge_opt = BadgeOptions {
@ -220,9 +238,8 @@ fn calculate_hoc<T: Service>(
status: hoc_pretty,
};
let badge = Badge::new(badge_opt)?;
let (tx, rx_body) = mpsc::unbounded();
let _ = tx.unbounded_send(Bytes::from(badge.to_svg().as_bytes()));
// TODO: remove clone
let body = badge.to_svg().as_bytes().to_vec();
let expiration = SystemTime::now() + Duration::from_secs(30);
Ok(HttpResponse::Ok()
@ -234,7 +251,7 @@ fn calculate_hoc<T: Service>(
CacheDirective::NoCache,
CacheDirective::NoStore,
]))
.streaming(rx_body.map_err(|_| ErrorBadRequest("bad request"))))
.body(body))
}
};
handle_hoc_request::<T, _>(state, data, mapper)
@ -243,11 +260,12 @@ fn calculate_hoc<T: Service>(
fn overview<T: Service>(
state: web::Data<Arc<State>>,
data: web::Path<(String, String)>,
) -> impl Future<Item = HttpResponse, Error = Error> {
) -> impl Future<Output = Result<HttpResponse>> {
let mapper = |r| match r {
HocResult::NotFound => p404(),
HocResult::Hoc {
hoc,
commits,
hoc_pretty,
url,
head,
@ -255,32 +273,31 @@ fn overview<T: Service>(
service_path,
} => {
let mut buf = Vec::new();
let repo_info = RepoInfo {
commit_url: &T::commit_url(&repo, &head),
commits,
domain: &OPT.domain,
head: &head,
hoc,
hoc_pretty: &hoc_pretty,
path: &service_path,
url: &url,
};
templates::overview(
&mut buf,
VERSION_INFO,
REPO_COUNT.load(Ordering::Relaxed),
&OPT.domain,
&service_path,
&url,
hoc,
&hoc_pretty,
&head,
&T::commit_url(&repo, &head),
repo_info,
)?;
let (tx, rx_body) = mpsc::unbounded();
let _ = tx.unbounded_send(Bytes::from(buf));
Ok(HttpResponse::Ok()
.content_type("text/html")
.streaming(rx_body.map_err(|_| ErrorBadRequest("bad request"))))
Ok(HttpResponse::Ok().content_type("text/html").body(buf))
}
};
handle_hoc_request::<T, _>(state, data, mapper)
}
#[get("/")]
fn index() -> Result<HttpResponse> {
async fn index() -> Result<HttpResponse> {
let mut buf = Vec::new();
templates::index(
&mut buf,
@ -292,7 +309,7 @@ fn index() -> Result<HttpResponse> {
}
#[post("/generate")]
fn generate(params: web::Form<GeneratorForm>) -> Result<HttpResponse> {
async fn generate(params: web::Form<GeneratorForm<'_>>) -> Result<HttpResponse> {
let repo = format!("{}/{}", params.user, params.repo);
let mut buf = Vec::new();
templates::generate(
@ -304,12 +321,8 @@ fn generate(params: web::Form<GeneratorForm>) -> Result<HttpResponse> {
params.service.service(),
&repo,
)?;
let (tx, rx_body) = mpsc::unbounded();
let _ = tx.unbounded_send(Bytes::from(buf));
Ok(HttpResponse::Ok()
.content_type("text/html")
.streaming(rx_body.map_err(|_| ErrorBadRequest("bad request"))))
Ok(HttpResponse::Ok().content_type("text/html").body(buf))
}
fn p404() -> Result<HttpResponse> {
@ -318,6 +331,10 @@ fn p404() -> Result<HttpResponse> {
Ok(HttpResponse::NotFound().content_type("text/html").body(buf))
}
async fn async_p404() -> Result<HttpResponse> {
p404()
}
#[get("/tacit-css.min.css")]
fn css() -> HttpResponse {
HttpResponse::Ok().content_type("text/css").body(CSS)
@ -328,33 +345,40 @@ fn favicon32() -> HttpResponse {
HttpResponse::Ok().content_type("image/png").body(FAVICON)
}
fn main() -> Result<()> {
config::init()?;
async fn start_server() -> std::io::Result<()> {
let interface = format!("{}:{}", OPT.host, OPT.port);
let state = Arc::new(State {
repos: OPT.outdir.display().to_string(),
cache: OPT.cachedir.display().to_string(),
});
Ok(HttpServer::new(move || {
HttpServer::new(move || {
App::new()
.data(state.clone())
.wrap(middleware::Logger::default())
.wrap(middleware::NormalizePath)
.service(index)
.service(css)
.service(favicon32)
.service(generate)
.service(web::resource("/github/{user}/{repo}").to_async(calculate_hoc::<GitHub>))
.service(web::resource("/gitlab/{user}/{repo}").to_async(calculate_hoc::<Gitlab>))
.service(web::resource("/bitbucket/{user}/{repo}").to_async(calculate_hoc::<Bitbucket>))
.service(web::resource("/github/{user}/{repo}/json").to_async(json_hoc::<GitHub>))
.service(web::resource("/gitlab/{user}/{repo}/json").to_async(json_hoc::<Gitlab>))
.service(web::resource("/bitbucket/{user}/{repo}/json").to_async(json_hoc::<Bitbucket>))
.service(web::resource("/view/github/{user}/{repo}").to_async(overview::<GitHub>))
.service(web::resource("/view/gitlab/{user}/{repo}").to_async(overview::<Gitlab>))
.service(web::resource("/view/bitbucket/{user}/{repo}").to_async(overview::<Bitbucket>))
.default_service(web::resource("").route(web::get().to_async(p404)))
.service(web::resource("/github/{user}/{repo}").to(calculate_hoc::<GitHub>))
.service(web::resource("/gitlab/{user}/{repo}").to(calculate_hoc::<Gitlab>))
.service(web::resource("/bitbucket/{user}/{repo}").to(calculate_hoc::<Bitbucket>))
.service(web::resource("/github/{user}/{repo}/json").to(json_hoc::<GitHub>))
.service(web::resource("/gitlab/{user}/{repo}/json").to(json_hoc::<Gitlab>))
.service(web::resource("/bitbucket/{user}/{repo}/json").to(json_hoc::<Bitbucket>))
.service(web::resource("/view/github/{user}/{repo}").to(overview::<GitHub>))
.service(web::resource("/view/gitlab/{user}/{repo}").to(overview::<Gitlab>))
.service(web::resource("/view/bitbucket/{user}/{repo}").to(overview::<Bitbucket>))
.default_service(web::resource("").route(web::get().to(async_p404)))
})
.workers(OPT.workers)
.bind(interface)?
.run()?)
.run()
.await
}
#[actix_rt::main]
async fn main() -> std::io::Result<()> {
config::init().await.unwrap();
start_server().await
}

10
src/template.rs Normal file
View File

@ -0,0 +1,10 @@
pub struct RepoInfo<'a> {
pub commit_url: &'a str,
pub commits: u64,
pub domain: &'a str,
pub head: &'a str,
pub hoc: u64,
pub hoc_pretty: &'a str,
pub path: &'a str,
pub url: &'a str,
}

View File

@ -46,17 +46,18 @@ alt="example badge" /></a>
</pre>
<p>
You can also request the HoC as JSON by appending <code>/json</code> to the request path. This will return a JSON
object with two fields: <code>count</code> and <code>head</code> with count being the HoC value and head being the
commit ref of <code>HEAD</code>. Requesting
<a href="https://@domain/github/vbrandl/hoc/json">https://@domain/github/vbrandl/hoc/json</a> might return something
along the lines of
You can also request the HoC as JSON by appending <code>/json</code> to the request path. This will return a JSON object
with three fields: <code>count</code> (the HoC value), <code>commits</code> (the number of commits) and
<code>head</code> (the commit ref of HEAD). Requesting <a
href="https://@domain/github/vbrandl/hoc/json">https://@domain/github/vbrandl/hoc/json</a> might return something along
the lines of
</p>
<pre>
&#123;
"head" : "05736ee3ba256ec9a7227c436aef2bf43db109ab",
"count": 7582
"head": "1f01c3b964b018fb0c0c2c5b572bf4ace2968546",
"count": 8324,
"commits": 223
&#125;
</pre>

View File

@ -1,12 +1,16 @@
@use super::base;
@use crate::statics::VersionInfo;
@use crate::template::RepoInfo;
@(version_info: VersionInfo, repo_count: usize, domain: &str, path: &str, url: &str, hoc: u64, hoc_pretty: &str, head: &str, commit_url: &str)
@(version_info: VersionInfo, repo_count: usize, repo_info: RepoInfo)
@:base("Hits-of-Code Badges", "Overview", {
<p>
The project <a href="@url">@url</a> has <strong>@hoc_pretty</strong> (exactly @hoc) hits of code at <a href="@commit_url">@head</a>.
The project <a href="@repo_info.url">@repo_info.url</a> has
<strong>@repo_info.hoc_pretty</strong> (exactly @repo_info.hoc) hits of code at
<a href="@repo_info.commit_url">@repo_info.head</a>. The repository contains
<strong>@repo_info.commits</strong> commits.
</p>
<p>
@ -14,6 +18,6 @@ To include the badge in your readme, use the following markdown:
</p>
<pre>
[![Hits-of-Code](https://@domain/@path)](https://@domain/view/@path)
[![Hits-of-Code](https://@repo_info.domain/@repo_info.path)](https://@repo_info.domain/view/@repo_info.path)
</pre>
}, version_info, repo_count)

View File

@ -0,0 +1,16 @@
@use super::base;
@use crate::statics::VersionInfo;
@(version_info: VersionInfo, repo_count: usize)
@:base("Master Branch not Found - Hits-of-Code Badges", "404 - Master Branch not Found", {
<p>
<big>Sorry</big>. I couldn't find the master branch of your repositroy.
Currently this service depends on the existence of a master branch. Please go
<a href="/">back to the homepage</a>.
</p>
<p>
If you think, this is a mistake on my side, please <a href="mailto:mail+hoc@@vbrandl.net">drop me a mail</a>.
</p>
}, version_info, repo_count)