This commit is contained in:
Hubert
2021-07-21 06:53:03 +02:00
parent 381347e66a
commit 90bc6d6d4f
5 changed files with 18 additions and 11 deletions

View File

@@ -155,13 +155,16 @@ async fn main() -> std::io::Result<()> {
env_logger::from_env(Env::default().default_filter_or("info")).init();
HttpServer::new(|| {
let auth = HttpAuthentication::basic(basic_auth_validator);
let gitust = Gitust {
repo_root_path: "/home/hubert/gitust".to_string(),
session_key: "oWe0ait9bi2Ohyiod2eeXirao1Oochie".to_string(),
};
let session_key = (&gitust.session_key).as_bytes();
App::new()
.data(Gitust {
repo_root_path: "/home/hubert/gitust".to_string(),
})
.wrap(Logger::default())
// .wrap(Logger::new("%a %{User-Agent}i"))
.wrap(CookieSession::signed(&[0; 32]).secure(false))
.wrap(CookieSession::signed(session_key).secure(false))
.data(gitust)
.service(hello)
.service(echo)
.service(hello_test)