From 24269204508d8cf8f963eb9c7d149d18840e4dad Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 12 Aug 2021 13:14:49 -0400 Subject: config, clean up and make a bit more consistent - check version settings with: rg -A2 _version_set$ org --- sundry/spine_search_cgi/dub.json | 6 ++-- sundry/spine_search_cgi/src/spine_search.d | 30 ++++++++++++++------ sundry/spine_search_cgi/src/spine_search.d_ | 32 +++++++++++++++------- sundry/spine_search_cgi/views/configuration.txt | 4 +-- .../views/configuration_suggested.txt | 4 +-- 5 files changed, 50 insertions(+), 26 deletions(-) (limited to 'sundry/spine_search_cgi') diff --git a/sundry/spine_search_cgi/dub.json b/sundry/spine_search_cgi/dub.json index a07db56..1668969 100644 --- a/sundry/spine_search_cgi/dub.json +++ b/sundry/spine_search_cgi/dub.json @@ -34,9 +34,9 @@ { "name": "arsd.cgi", "description": "cgi", - "homepage": "https://github.com/dlang-community/d2sqlite3", - "authors": [ "Aadam Ruppee" ], - "copyright": "Copyright 2011-18 Aadam Ruppee", + "homepage": "https://code.dlang.org/packages/arsd-official", + "authors": [ "Adam Ruppee" ], + "copyright": "Copyright 2011-18 Adam Ruppee", "license": "BSL-1.0", "sourcePaths": [ "./src/ext_depends_cgi/arsd" ], "configurations": [ diff --git a/sundry/spine_search_cgi/src/spine_search.d b/sundry/spine_search_cgi/src/spine_search.d index a2d290a..2f9de26 100644 --- a/sundry/spine_search_cgi/src/spine_search.d +++ b/sundry/spine_search_cgi/src/spine_search.d @@ -72,6 +72,8 @@ void cgi_function_intro(Cgi cgi) { string doc_collection_sub_root; string cgi_root; string cgi_script_name; + string cgi_search_form_title; + string cgi_search_form_html_title; string data_path_html; string http_url; string query_base_url; @@ -80,12 +82,19 @@ void cgi_function_intro(Cgi cgi) { string db_path; } auto conf = Config(); - conf.http_request_type = environment.get("REQUEST_SCHEME", _cfg.http_request_type); - conf.http_host = environment.get("SERVER_NAME", _cfg.http_host); - conf.web_doc_root_path = environment.get("DOCUMENT_ROOT", _cfg.www_doc_root); - conf.doc_collection_sub_root = "/spine/static"; // (output_path - web_doc_root_path) - conf.cgi_root = environment.get("CONTEXT_DOCUMENT_ROOT", _cfg.cgi_bin_subpath); - conf.cgi_script_name = environment.get("SCRIPT_NAME", _cfg.cgi_filename); + conf.http_request_type = environment.get("REQUEST_SCHEME", _cfg.http_request_type); + conf.http_host = environment.get("SERVER_NAME", _cfg.http_host); + conf.web_doc_root_path = environment.get("DOCUMENT_ROOT", _cfg.www_doc_root); + conf.doc_collection_sub_root = "/spine/static"; // (output_path - web_doc_root_path) + conf.cgi_root = environment.get("CONTEXT_DOCUMENT_ROOT", _cfg.cgi_bin_subpath); + conf.cgi_script_name = environment.get("SCRIPT_NAME", _cfg.cgi_filename); + conf.cgi_search_form_title = _cfg.cgi_search_form_title; // ≅ SiSU spine search form + conf.cgi_search_form_html_title = "" + ~ _cfg.cgi_search_form_title + ~ ""; conf.query_base_url = conf.http_request_type ~ "://" ~ conf.http_host ~ "/" ~ conf.cgi_script_name ~ "?"; conf.query_string = environment.get("QUERY_STRING", ""); conf.http_url = environment.get("HTTP_REFERER", conf.query_base_url ~ conf.query_string); @@ -547,7 +556,7 @@ void cgi_function_intro(Cgi cgi) { - ≅ SiSU spine search form + %s @@ -1351,6 +1360,7 @@ void cgi_function_intro(Cgi cgi) { ┃", + conf.cgi_search_form_title, conf.http_request_type, conf.http_host, ); @@ -1361,14 +1371,16 @@ void cgi_function_intro(Cgi cgi) {
- ≅ SiSU spine search form + %s
- ┃"); + ┃", + conf.cgi_search_form_html_title, + ); } { string post_value(string field_name, string type="box", string set="on") { diff --git a/sundry/spine_search_cgi/src/spine_search.d_ b/sundry/spine_search_cgi/src/spine_search.d_ index fca2b2b..b22c959 100755 --- a/sundry/spine_search_cgi/src/spine_search.d_ +++ b/sundry/spine_search_cgi/src/spine_search.d_ @@ -73,6 +73,8 @@ void cgi_function_intro(Cgi cgi) { string doc_collection_sub_root; string cgi_root; string cgi_script_name; + string cgi_search_form_title; + string cgi_search_form_html_title; string data_path_html; string http_url; string query_base_url; @@ -81,13 +83,20 @@ void cgi_function_intro(Cgi cgi) { string db_path; } auto conf = Config(); - conf.http_request_type = environment.get("REQUEST_SCHEME", _cfg.http_request_type); - conf.http_host = environment.get("SERVER_NAME", _cfg.http_host); - // conf.http_host = environment.get("HTTP_HOST", _cfg.http_host); - conf.web_doc_root_path = environment.get("DOCUMENT_ROOT", _cfg.www_doc_root); - conf.doc_collection_sub_root = "/spine/static"; // (output_path - web_doc_root_path) - conf.cgi_root = environment.get("CONTEXT_DOCUMENT_ROOT", _cfg.cgi_bin_subpath); - conf.cgi_script_name = environment.get("SCRIPT_NAME", _cfg.cgi_filename); + conf.http_request_type = environment.get("REQUEST_SCHEME", _cfg.http_request_type); + conf.http_host = environment.get("SERVER_NAME", _cfg.http_host); + // conf.http_host = environment.get("HTTP_HOST", _cfg.http_host); + conf.web_doc_root_path = environment.get("DOCUMENT_ROOT", _cfg.www_doc_root); + conf.doc_collection_sub_root = "/spine/static"; // (output_path - web_doc_root_path) + conf.cgi_root = environment.get("CONTEXT_DOCUMENT_ROOT", _cfg.cgi_bin_subpath); + conf.cgi_script_name = environment.get("SCRIPT_NAME", _cfg.cgi_filename); + conf.cgi_search_form_title = _cfg.cgi_search_form_title; // ≅ SiSU spine search form + conf.cgi_search_form_html_title = "" + ~ _cfg.cgi_search_form_title + ~ ""; conf.query_base_url = conf.http_request_type ~ "://" ~ conf.http_host ~ "/" ~ conf.cgi_script_name ~ "?"; conf.query_string = environment.get("QUERY_STRING", ""); conf.http_url = environment.get("HTTP_REFERER", conf.query_base_url ~ conf.query_string); @@ -549,7 +558,7 @@ void cgi_function_intro(Cgi cgi) { - ≅ SiSU spine search form + %s @@ -1353,6 +1362,7 @@ void cgi_function_intro(Cgi cgi) { ┃", + conf.cgi_search_form_title, conf.http_request_type, conf.http_host, ); @@ -1363,14 +1373,16 @@ void cgi_function_intro(Cgi cgi) {
- ≅ SiSU spine search form + %s
- ┃"); + ┃", + conf.cgi_search_form_html_title, + ); } { string post_value(string field_name, string type="box", string set="on") { diff --git a/sundry/spine_search_cgi/views/configuration.txt b/sundry/spine_search_cgi/views/configuration.txt index 0138149..1486315 100644 --- a/sundry/spine_search_cgi/views/configuration.txt +++ b/sundry/spine_search_cgi/views/configuration.txt @@ -2,10 +2,10 @@ struct Cfg { string http_request_type = "http"; string http_host = "localhost"; string www_url_doc_root = "http://localhost"; - string www_doc_root = "/srv/www/spine/static"; // "/var/www/html" - string cgi_bin_root = "/var/www/cgi/cgi-bin/"; // "/usr/lib/cgi-bin" + string www_doc_root = "/srv/www/spine/static"; string cgi_bin_subpath = "/cgi-bin"; string cgi_filename = "spine_search"; // "spine-search" + string cgi_search_form_title = "≅ SiSU Spine search"; string db_sqlite_path = "/var/www/sqlite"; string db_sqlite_filename = "spine.search.db"; } diff --git a/sundry/spine_search_cgi/views/configuration_suggested.txt b/sundry/spine_search_cgi/views/configuration_suggested.txt index c66da03..5ba5175 100644 --- a/sundry/spine_search_cgi/views/configuration_suggested.txt +++ b/sundry/spine_search_cgi/views/configuration_suggested.txt @@ -3,10 +3,10 @@ struct Cfg { string http_request_type = "http"; string http_host = "localhost"; string www_url_doc_root = "http://localhost"; - string www_doc_root = "/srv/www/spine/static"; // "/var/www/html" - string cgi_bin_root = "/var/www/cgi/cgi-bin/"; // "/usr/lib/cgi-bin" + string www_doc_root = "/srv/www/spine/static"; string cgi_bin_subpath = "/cgi-bin"; string cgi_filename = "spine_search"; // "spine-search" + string cgi_search_form_title = "≅ SiSU Spine search"; string db_sqlite_path = "/var/www/sqlite"; string db_sqlite_filename = "spine.search.db"; } -- cgit v1.2.3