diff --git a/Cargo.toml b/Cargo.toml index 9e341ab..f6b95af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,20 +1,25 @@ [package] +name = "starchart" +repository = "https://github.com/forgeflux-org/starchart" +version = "0.1.0" authors = ["realaravinth "] description = "ForgeFlux StarChart - Federated forge spider" documentation = "https://forgeflux.org/" edition = "2021" license = "AGPLv3 or later version" -name = "starchart" -repository = "https://github.com/forgeflux-org/starchart" -version = "0.1.0" +build = "build.rs" + [dependencies] actix-rt = "2.7" -config = "0.12.0" +config = "0.11.0" lazy_static = "1.4.0" rand = "0.8.5" tera = "1.15" tokio = { version = "1.17", features = ["fs", "time"] } url = "2.2.2" +validator = { version = "0.14", features = ["derive"]} +derive_more = "0.99.17" +log = "0.4.16" [dependencies.reqwest] features = ["rustls-tls-native-roots", "gzip", "deflate", "brotli", "json"] diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..b6b8480 --- /dev/null +++ b/build.rs @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2021 Aravinth Manivannan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +use std::process::Command; + +//use cache_buster::{BusterBuilder, NoHashCategory}; + +fn main() { + let output = Command::new("git") + .args(&["rev-parse", "HEAD"]) + .output() + .expect("error in git command, is git installed?"); + let git_hash = String::from_utf8(output.stdout).unwrap(); + println!("cargo:rustc-env=GIT_HASH={}", git_hash); + + // cache_bust(); +} + +//fn cache_bust() { +// // until APPLICATION_WASM gets added to mime crate +// // PR: https://github.com/hyperium/mime/pull/138 +// // let types = vec![ +// // mime::IMAGE_PNG, +// // mime::IMAGE_SVG, +// // mime::IMAGE_JPEG, +// // mime::IMAGE_GIF, +// // mime::APPLICATION_JAVASCRIPT, +// // mime::TEXT_CSS, +// // ]; +// +// println!("cargo:rerun-if-changed=static/cache"); +// let no_hash = vec![NoHashCategory::FileExtentions(vec!["wasm"])]; +// +// let config = BusterBuilder::default() +// .source("./static/cache/") +// .result("./assets") +// .no_hash(no_hash) +// .follow_links(true) +// .build() +// .unwrap(); +// +// config.process().unwrap(); +//}