From: Ian Jackson Date: Sat, 2 Jan 2021 03:32:54 +0000 (+0000) Subject: Avoid need for bundled-sources X-Git-Tag: otter-0.2.0~52 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=dc3a34b3ad5d02a1c126a468ecd37918ace29772;p=otter.git Avoid need for bundled-sources Signed-off-by: Ian Jackson --- diff --git a/daemon/main.rs b/daemon/main.rs index 14b9544c..36d731f8 100644 --- a/daemon/main.rs +++ b/daemon/main.rs @@ -261,7 +261,7 @@ fn main() { debug!("resolved config: {:#?}", c); - { + if c.check_bundled_sources { let check = format!("{}/otter/index.html", &c.bundled_sources); fs::metadata(&check) .context(check.clone()) diff --git a/src/config.rs b/src/config.rs index 00221494..abe5a6cf 100644 --- a/src/config.rs +++ b/src/config.rs @@ -36,6 +36,8 @@ pub struct ServerConfigSpec { pub shapelibs: Option>, pub sendmail: Option, pub debug_js_inject_file: Option, + /// Disable this for local testing only. See LICENCE. + pub check_bundled_sources: Option, } #[derive(Debug,Clone)] @@ -60,6 +62,7 @@ pub struct ServerConfig { pub shapelibs: Vec, pub sendmail: String, pub debug_js_inject: Arc, + pub check_bundled_sources: bool, } impl TryFrom for WholeServerConfig { @@ -71,7 +74,7 @@ impl TryFrom for WholeServerConfig { http_port, public_url, sse_wildcard_url, rocket_workers, template_dir, nwtemplate_dir, wasm_dir, log, bundled_sources, shapelibs, sendmail, - debug_js_inject_file, + debug_js_inject_file, check_bundled_sources, } = spec; if let Some(cd) = change_directory { @@ -143,12 +146,14 @@ impl TryFrom for WholeServerConfig { None => "".into(), }); + let check_bundled_sources = check_bundled_sources.unwrap_or(true); + let server = ServerConfig { save_dir, command_socket, debug, http_port, public_url, sse_wildcard_url, rocket_workers, template_dir, nwtemplate_dir, wasm_dir, bundled_sources, shapelibs, sendmail, - debug_js_inject, + debug_js_inject, check_bundled_sources, }; WholeServerConfig { server: Arc::new(server), diff --git a/wdriver.rs b/wdriver.rs index 1cb899d5..a9b97460 100644 --- a/wdriver.rs +++ b/wdriver.rs @@ -556,6 +556,7 @@ wasm_dir = "@target@/packed-wasm" shapelibs = [ "@src@/library/*.toml" ] debug_js_inject_file = "@src@/templates/log-save.js" +check_bundled_sources = false # For testing only! see LICENCE! [log] global_level = 'debug'