diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2021-08-12 13:14:49 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2021-08-20 12:03:17 -0400 |
commit | 24269204508d8cf8f963eb9c7d149d18840e4dad (patch) | |
tree | c94ac0fdab5496fa4969098604ffcfaa87c18678 /sundry/spine_search_cgi | |
parent | configuration reorganized into config files (diff) |
config, clean up and make a bit more consistent
- check version settings with:
rg -A2 _version_set$ org
Diffstat (limited to 'sundry/spine_search_cgi')
-rw-r--r-- | sundry/spine_search_cgi/dub.json | 6 | ||||
-rw-r--r-- | sundry/spine_search_cgi/src/spine_search.d | 30 | ||||
-rwxr-xr-x | sundry/spine_search_cgi/src/spine_search.d_ | 32 | ||||
-rw-r--r-- | sundry/spine_search_cgi/views/configuration.txt | 4 | ||||
-rw-r--r-- | sundry/spine_search_cgi/views/configuration_suggested.txt | 4 |
5 files changed, 50 insertions, 26 deletions
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 = "<a href=\"" + ~ conf.http_request_type ~ "://" + ~ conf.http_host + ~ "\">" + ~ _cfg.cgi_search_form_title + ~ "</a>"; 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) { <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title> - ≅ SiSU spine search form + %s </title> <meta name="sourcefile" content="SiSU.sst"> <link rel="generator" href="sisudoc.org"> @@ -1351,6 +1360,7 @@ void cgi_function_intro(Cgi cgi) { </head> <body lang="en" xml:lang="en"> ┃", + conf.cgi_search_form_title, conf.http_request_type, conf.http_host, ); @@ -1361,14 +1371,16 @@ void cgi_function_intro(Cgi cgi) { <tr><td width="20%%"> <table summary="home button / home information" border="0" cellpadding="2" cellspacing="0"> <tr><td align="left"> - ≅ SiSU spine search form + %s </td></tr> </table> </td> <td> </td></tr> </table> - ┃"); + ┃", + 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 = "<a href=\"" + ~ conf.http_request_type ~ "://" + ~ conf.http_host + ~ "\">" + ~ _cfg.cgi_search_form_title + ~ "</a>"; 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) { <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title> - ≅ SiSU spine search form + %s </title> <meta name="sourcefile" content="SiSU.sst"> <link rel="generator" href="sisudoc.org"> @@ -1353,6 +1362,7 @@ void cgi_function_intro(Cgi cgi) { </head> <body lang="en" xml:lang="en"> ┃", + conf.cgi_search_form_title, conf.http_request_type, conf.http_host, ); @@ -1363,14 +1373,16 @@ void cgi_function_intro(Cgi cgi) { <tr><td width="20%%"> <table summary="home button / home information" border="0" cellpadding="2" cellspacing="0"> <tr><td align="left"> - ≅ SiSU spine search form + %s </td></tr> </table> </td> <td> </td></tr> </table> - ┃"); + ┃", + 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"; } |