shithub: werc

Download patch

ref: a213c90c1e28696dce4be33b0f6a71fda97c7eb6
parent: 300999d3e739e00096c1bc8c3c6e9850ca28a206
author: khm <khm@9front.org>
date: Mon May 25 15:20:16 EDT 2020

apps: rename 'search' to 'duckduckgo'

just in case we want to bring in a 'real' search app like e.g.
the one in wercchan, for which see
https://github.com/kfarwell/werchan/tree/master/apps/search

diff: cannot open b/apps/duckduckgo//null: file does not exist: 'b/apps/duckduckgo//null' diff: cannot open a/apps/search//null: file does not exist: 'a/apps/search//null'
--- /dev/null
+++ b/apps/duckduckgo/HOWTO
@@ -1,0 +1,16 @@
+The default path for site search is /_search/.  Assuming you want to keep
+that default, you could enable site search like so:
+
+
+mkdir -p /www/werc/sites/MYSITE/_search/_werc/
+echo 'conf_enable_duckduckgo' > /www/werc/sites/MYSITE/_search/_werc/config
+mkdir -p /www/werc/sites/MYSITE/_werc/lib/
+cp /www/werc/apps/search/footer.inc.sample /www/werc/sites/MYSITE/_werc/lib/
+
+Searches will POST to /_search/ and from there get redirected to Duck Duck 
+Go with a site:$SERVER_NAME prefix.  To have the search path URL be some-
+thing differen, you'll have to edit line 23 of app.rc to point to the new
+path.
+
+TODO: make it automatically work no matter which directory the app is 
+enabled in.
--- /dev/null
+++ b/apps/duckduckgo/app.rc
@@ -1,0 +1,29 @@
+fn conf_enable_duckduckgo {
+    enable_duckduckgo=yes
+    conf_enable_app duckduckgo
+		pageTitle='Site Search'
+}
+
+
+fn duckduckgo_init {
+	get_post_args q
+	if (! ~ $#q 0) {
+		redirect_string = 'https://duckduckgo.com/?q=site:'$SERVER_NAME^'+'^$"q
+		http_redirect $redirect_string '302 Found'
+	}
+	if not {
+		handler_body_main='duckduckgo_body'
+	}
+}
+
+fn duckduckgo_body {
+    echo '
+<h1>Site search</h1>
+<h3>using DuckDuckGo</h3>
+<form action="/_search/" method="POST">
+<input type="text" name="q" placeholder="Search text...">
+<input type="submit" value="Search">
+</form>'
+
+}
+
--- /dev/null
+++ b/apps/duckduckgo/footer.inc.sample
@@ -1,0 +1,3 @@
+<div><a href="http://werc.cat-v.org">Powered by werc</a></div>
+
+<div><form action="/_search/" method="POST"><input type="text" name="q" placeholder="Site search..."><input type="submit" display="Search"></form></div>
--- a/apps/search/HOWTO
+++ /dev/null
@@ -1,16 +1,0 @@
-The default path for site search is /_search/.  Assuming you want to keep
-that default, you could enable site search like so:
-
-
-mkdir -p /www/werc/sites/MYSITE/_search/_werc/
-echo 'conf_enable_search' > /www/werc/sites/MYSITE/_search/_werc/config
-mkdir -p /www/werc/sites/MYSITE/_werc/lib/
-cp /www/werc/apps/search/footer.inc.sample /www/werc/sites/MYSITE/_werc/lib/
-
-Searches will POST to /_search/ and from there get redirected to Duck Duck 
-Go with a site:$SERVER_NAME prefix.  To have the search path URL be some-
-thing differen, you'll have to edit line 23 of app.rc to point to the new
-path.
-
-TODO: make it automatically work no matter which directory the app is 
-enabled in.
--- a/apps/search/app.rc
+++ /dev/null
@@ -1,29 +1,0 @@
-fn conf_enable_search {
-    enable_search=yes
-    conf_enable_app search
-		pageTitle='Site Search'
-}
-
-
-fn search_init {
-	get_post_args q
-	if (! ~ $#q 0) {
-		redirect_string = 'https://duckduckgo.com/?q=site:'$SERVER_NAME^'+'^$"q
-		http_redirect $redirect_string '302 Found'
-	}
-	if not {
-		handler_body_main='search_body'
-	}
-}
-
-fn search_body {
-    echo '
-<h1>Site search</h1>
-<h3>using DuckDuckGo</h3>
-<form action="/_search/" method="POST">
-<input type="text" name="q" placeholder="Search text...">
-<input type="submit" value="Search">
-</form>'
-
-}
-
--- a/apps/search/footer.inc.sample
+++ /dev/null
@@ -1,3 +1,0 @@
-<div><a href="http://werc.cat-v.org">Powered by werc</a></div>
-
-<div><form action="/_search/" method="POST"><input type="text" name="q" placeholder="Site search..."><input type="submit" display="Search"></form></div>