server/config: revamp

- Adds options `socket_path` and `password_file`
This commit is contained in:
2024-08-19 16:47:34 +02:00
parent 48240489a7
commit ed12a3153b
3 changed files with 92 additions and 31 deletions

View File

@@ -7,7 +7,7 @@ use tokio::net::UnixStream as TokioUnixStream;
use crate::{
core::common::{UnixUser, DEFAULT_CONFIG_PATH, DEFAULT_SOCKET_PATH},
server::{config::read_config_form_path, server_loop::handle_requests_for_single_session},
server::{config::read_config_from_path, server_loop::handle_requests_for_single_session},
};
// TODO: this function is security critical, it should be integration tested
@@ -140,7 +140,7 @@ fn run_forked_server(
server_socket: StdUnixStream,
unix_user: UnixUser,
) -> anyhow::Result<()> {
let config = read_config_form_path(Some(config_path))?;
let config = read_config_from_path(Some(config_path))?;
let result: anyhow::Result<()> = tokio::runtime::Builder::new_current_thread()
.enable_all()