This commit is contained in:
parent
b0d1402431
commit
c419f92334
2 changed files with 7 additions and 1 deletions
|
@ -7,6 +7,7 @@ pub struct Config {
|
|||
pub port: Option<u16>,
|
||||
pub mail: Option<String>,
|
||||
pub lang: Option<String>,
|
||||
pub onion: Option<String>,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
|
@ -36,6 +37,7 @@ impl Config {
|
|||
port: test(a.port, d.port),
|
||||
mail: test(a.mail, d.mail),
|
||||
lang: test(a.lang, d.lang),
|
||||
onion: test(a.onion, d.onion),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use actix_files::Files;
|
||||
use actix_web::{web, App, HttpServer};
|
||||
use actix_web::{middleware::DefaultHeaders, web, App, HttpServer};
|
||||
use glob::glob;
|
||||
use minify_html::{minify, Cfg};
|
||||
use std::{
|
||||
|
@ -88,6 +88,10 @@ async fn main() -> io::Result<()> {
|
|||
HttpServer::new(move || {
|
||||
App::new()
|
||||
.app_data(web::Data::new(config.clone()))
|
||||
.wrap(DefaultHeaders::new().add((
|
||||
"Onion-Location",
|
||||
config.onion.as_deref().unwrap_or_default(),
|
||||
)))
|
||||
.service(index::page)
|
||||
.service(agreements::security)
|
||||
.service(agreements::humans)
|
||||
|
|
Loading…
Reference in a new issue