Added docker building.

This commit is contained in:
2023-02-21 19:56:36 +00:00
parent f5b43573c8
commit b6ab9c8888
31 changed files with 1476 additions and 75 deletions

View File

@ -11,9 +11,10 @@ pub fn create(args: ServerConfig, token: Arc<RwLock<Option<String>>>) -> anyhow:
let addr = (args.host.clone(), args.port);
let server = HttpServer::new(move || {
App::new()
.wrap(actix_web::middleware::Logger::new(
"\"%r\" \"-\" \"%s\" \"%a\" \"%D\"",
))
.wrap(
actix_web::middleware::Logger::new("\"%r\" \"-\" \"%s\" \"%a\" \"%D\"")
.exclude("/health"),
)
.app_data(Data::new(token.clone()))
.app_data(Data::new(args.clone()))
.service(login)

View File

@ -1,5 +1,16 @@
use askama::Template;
/// Index pages.
///
/// This page is used to authenticate users.
/// It has two states: activated or not.
///
/// It the activated is false, we
/// render two input fields, with telegram code
/// and server's password.
///
/// If the user is authenticated, we just render
/// some random information.
#[derive(Template)]
#[template(path = "index.html")]
pub struct Index {