From 9b72621135aad321c421e7464fc4339a2a52e245 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 1 Aug 2021 05:48:15 -0400 Subject: config defaults: cfte, config-file & cle --- src/doc_reform/io_in/read_config_files.d | 47 +++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 16 deletions(-) (limited to 'src/doc_reform/io_in/read_config_files.d') diff --git a/src/doc_reform/io_in/read_config_files.d b/src/doc_reform/io_in/read_config_files.d index 44f93ec..005a436 100644 --- a/src/doc_reform/io_in/read_config_files.d +++ b/src/doc_reform/io_in/read_config_files.d @@ -62,7 +62,7 @@ import doc_reform.meta.rgx; template readConfigSite() { - @system final auto readConfigSite(C,O)(C _conf_file_details, O _opt_action) { + @system final auto readConfigSite(Cf,O,Cfg)(Cf _conf_file_details, O _opt_action, Cfg _cfg) { mixin spineRgxIn; static auto rgx = RgxI(); string conf_filename = "NONE"; @@ -79,28 +79,43 @@ default: text_wrap: "80" digest: "sha256" webserv: - http: "http" - domain: "localhost" - data_http: "http" - data_domain: "localhost" - data_root_url: "http://localhost" - data_root_path: "/var/www/html" + http: "%s" + domain: "%s" + data_http: "%s" + data_domain: "%s" + data_root_url: "%s" + data_root_path: "%s" data_root_part: "" images_root_part: "image" - cgi_title: "≅ SiSU Spine search" - cgi_http: "http" - cgi_domain: "localhost" - cgi_bin_url: "http://localhost/cgi-bin" + cgi_title: "%s" + cgi_http: "%s" + cgi_domain: "%s" + cgi_bin_url: "%s" cgi_bin_part: "cgi-bin" - cgi_bin_path: "/usr/lib/cgi-bin" - cgi_search_script: "spine-search" + cgi_bin_path: "%s" + cgi_search_script: "%s" cgi_port: "" cgi_user: "" - cgi_action: "http://localhost/cgi-bin/spine-search" - db_sqlite: "spine.search.db" + cgi_action: "%s" + db_sqlite: "%s" db_pg_table: "" db_pg_user: "" -┃"); +┃", + _cfg.www_http, // http + _cfg.www_domain, // domain + _cfg.www_http, // data http + _cfg.www_domain, // data domain + _cfg.www_url_doc_root, // data root url + _cfg.www_doc_root, // data root path + _cfg.cgi_title, // cgi title + _cfg.www_http, // cgi http + _cfg.www_domain, // cgi domain + _cfg.cgi_url_root, // cgi bin url + _cfg.cgi_bin_root, // cgi bin path + _cfg.cgi_filename, // cgi filename + _cfg.cgi_url_action, // cgi action + _cfg.db_sqlite_filename, // db filename +); foreach(conf_fn; [_conf_file_details.config_filename_site]) { foreach(pth; _conf_file_details.possible_config_path_locations.config_local_site) { char[] conf_file; -- cgit v1.2.3