♻️ Move load_toml into server

main
_ 2020-11-26 23:51:10 +00:00
parent c4108f6f2f
commit a6ecb1c6a8
6 changed files with 4 additions and 4 deletions

View File

@ -103,7 +103,7 @@ async fn main () -> Result <(), Box <dyn Error>> {
tracing_subscriber::fmt::init ();
let path = PathBuf::from ("./config/ptth_server.toml");
let config_file: ConfigFile = ptth::load_toml::load (&path);
let config_file: ConfigFile = ptth::server::load_toml::load (&path);
info! ("file_server_root: {:?}", config_file.file_server_root);
let addr = SocketAddr::from(([0, 0, 0, 0], 4000));

View File

@ -27,7 +27,7 @@ fn main () -> Result <(), Box <dyn Error>> {
tracing_subscriber::fmt::init ();
let path = opt.config_path.clone ().unwrap_or_else (|| PathBuf::from ("./config/ptth_server.toml"));
let config_file: ptth::server::ConfigFile = ptth::load_toml::load (&path);
let config_file: ptth::server::ConfigFile = ptth::server::load_toml::load (&path);
if opt.print_tripcode {
println! (r#""{}" = "{}""#, config_file.name, config_file.tripcode ());

View File

@ -8,7 +8,6 @@ pub const PTTH_MAGIC_HEADER: &str = "X-PTTH-2LJYXWC4";
pub mod git_version;
pub mod graceful_shutdown;
pub mod http_serde;
pub mod load_toml;
pub mod prelude;
pub mod relay;
pub mod server;

View File

@ -537,7 +537,7 @@ async fn internal_serve_all (
use std::os::unix::fs::PermissionsExt;
let file_md = file.metadata ().await.unwrap ();
if file_md.permissions ().mode () == crate::load_toml::CONFIG_PERMISSIONS_MODE
if file_md.permissions ().mode () == super::load_toml::CONFIG_PERMISSIONS_MODE
{
return Forbidden;
}

View File

@ -23,6 +23,7 @@ use crate::{
};
pub mod file_server;
pub mod load_toml;
// Thanks to https://github.com/robsheldon/bad-passwords-index