From 30cff0f11149ea2a85b025d143aa4a46369c87f0 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Mon, 7 Dec 2020 10:20:37 +0300 Subject: . --- admin/entry | 2 ++ article/entry | 2 ++ article/list/butterfly/content | 10 ++++++++++ article/list/butterfly/title | 1 + article/list/juniper | 10 ++++++++++ article/list/licorice | 5 +++++ article/template | 13 +++++++++++++ data/404.html | 4 ++++ data/index.html | 4 ++++ entry | 18 ++++++++++++++++++ proc/123/request/cookie | 2 ++ proc/123/request/file/avatar | 1 + proc/123/request/meta | 4 ++++ proc/123/request/param | 2 ++ proc/123/request/urlparam | 1 + site/404.html | 4 ---- site/act/admin | 3 --- site/act/article | 5 ----- site/act/entry | 18 ------------------ site/article/butterfly/content | 10 ---------- site/article/butterfly/title | 1 - site/article/juniper | 10 ---------- site/article/licorice | 5 ----- site/index.html | 4 ---- site/proc/123/request/cookie | 2 -- site/proc/123/request/file/avatar | 1 - site/proc/123/request/meta | 4 ---- site/proc/123/request/param | 2 -- site/proc/123/request/urlparam | 1 - site/template/admin | 0 site/template/article | 13 ------------- 31 files changed, 79 insertions(+), 83 deletions(-) create mode 100644 admin/entry create mode 100644 article/entry create mode 100644 article/list/butterfly/content create mode 100644 article/list/butterfly/title create mode 100644 article/list/juniper create mode 100644 article/list/licorice create mode 100644 article/template create mode 100644 data/404.html create mode 100644 data/index.html create mode 100644 entry create mode 100644 proc/123/request/cookie create mode 100644 proc/123/request/file/avatar create mode 100644 proc/123/request/meta create mode 100644 proc/123/request/param create mode 100644 proc/123/request/urlparam delete mode 100644 site/404.html delete mode 100644 site/act/admin delete mode 100644 site/act/article delete mode 100644 site/act/entry delete mode 100644 site/article/butterfly/content delete mode 100644 site/article/butterfly/title delete mode 100644 site/article/juniper delete mode 100644 site/article/licorice delete mode 100644 site/index.html delete mode 100644 site/proc/123/request/cookie delete mode 100644 site/proc/123/request/file/avatar delete mode 100644 site/proc/123/request/meta delete mode 100644 site/proc/123/request/param delete mode 100644 site/proc/123/request/urlparam delete mode 100644 site/template/admin delete mode 100644 site/template/article diff --git a/admin/entry b/admin/entry new file mode 100644 index 0000000..c72a79a --- /dev/null +++ b/admin/entry @@ -0,0 +1,2 @@ +#!/bin/bash +cat $base/data/404.html diff --git a/article/entry b/article/entry new file mode 100644 index 0000000..c72a79a --- /dev/null +++ b/article/entry @@ -0,0 +1,2 @@ +#!/bin/bash +cat $base/data/404.html diff --git a/article/list/butterfly/content b/article/list/butterfly/content new file mode 100644 index 0000000..5ecbc59 --- /dev/null +++ b/article/list/butterfly/content @@ -0,0 +1,10 @@ +Butterflies are insects in the macrolepidopteran clade +Rhopalocera from the order Lepidoptera, which also includes moths. +Adult butterflies have large, often brightly coloured wings, +and conspicuous, fluttering flight. +The group comprises the large superfamily Papilionoidea, +which contains at least one former group, +the skippers (formerly the superfamily "Hesperioidea"), +and the most recent analyses suggest it also contains the moth-butterflies +(formerly the superfamily "Hedyloidea"). +Butterfly fossils date to the Paleocene, about 56 million years ago. diff --git a/article/list/butterfly/title b/article/list/butterfly/title new file mode 100644 index 0000000..a32b910 --- /dev/null +++ b/article/list/butterfly/title @@ -0,0 +1 @@ +Butterfly diff --git a/article/list/juniper b/article/list/juniper new file mode 100644 index 0000000..66e3d03 --- /dev/null +++ b/article/list/juniper @@ -0,0 +1,10 @@ +title Juniper +content Junipers are coniferous trees and shrubs in the genus Juniperus + of the cypress family Cupressaceae. + Depending on taxonomic viewpoint, between 50 and 67 species of junipers are + widely distributed throughout the Northern Hemisphere, from the Arctic, + south to tropical Africa, from Ziarat, Pakistan, east to eastern Tibet + in the Old World, and in the mountains of Central America. + The highest-known juniper forest occurs at an altitude of 16,000 ft (4,900 m) + in southeastern Tibet and the northern Himalayas, + creating one of the highest tree-lines on earth. diff --git a/article/list/licorice b/article/list/licorice new file mode 100644 index 0000000..613b1b7 --- /dev/null +++ b/article/list/licorice @@ -0,0 +1,5 @@ +title Licorice +content Liquorice (British English) or licorice (American English) + is the common name of Glycyrrhiza glabra, + a flowering plant of the bean family Fabaceae, + from the root of which a sweet, aromatic flavouring can be extracted. diff --git a/article/template b/article/template new file mode 100644 index 0000000..fec42d7 --- /dev/null +++ b/article/template @@ -0,0 +1,13 @@ +list + page + List of articles + +

Here are some articles for you:

+ + + + item
  • $title
  • +page + $title + $content + diff --git a/data/404.html b/data/404.html new file mode 100644 index 0000000..49d5ddf --- /dev/null +++ b/data/404.html @@ -0,0 +1,4 @@ + +404 Not Found +

    404 Not Found

    + diff --git a/data/index.html b/data/index.html new file mode 100644 index 0000000..e163357 --- /dev/null +++ b/data/index.html @@ -0,0 +1,4 @@ + +Welcome! +

    Welcome!

    + diff --git a/entry b/entry new file mode 100644 index 0000000..b42d378 --- /dev/null +++ b/entry @@ -0,0 +1,18 @@ +#!/bin/bash +# This is the process to be called. +# $proc and $base (initial working directory) is already set. +# Requested path is in $1, any other request data is in proc/$proc/request. +# Usually you want to dispatch the path here and call some other programs. =) +# Path has ending / and no starting one (apth for root is empty). +# Response meta should be formed in proc/$proc/response, +# output is response body. +after () { test -z "${2##*$1*}" && echo -n "${2#*$1}"; } +startswith() { case $2 in "$1"*) true;; *) false;; esac; } +if test -z "$1" +then cat index.html +elif startswith "article/" "$1" +then cd article; ./entry "$(after / $1)" +elif startswith "admin/" "$1" +then cd admin; ./entry "$(after / $1)" +else cat 404.html +fi diff --git a/proc/123/request/cookie b/proc/123/request/cookie new file mode 100644 index 0000000..07766a7 --- /dev/null +++ b/proc/123/request/cookie @@ -0,0 +1,2 @@ +monster-name monster-value +another-name another-value diff --git a/proc/123/request/file/avatar b/proc/123/request/file/avatar new file mode 100644 index 0000000..61a0691 --- /dev/null +++ b/proc/123/request/file/avatar @@ -0,0 +1 @@ +Some image, probably PNG. (Too lazy to insert actual one.) diff --git a/proc/123/request/meta b/proc/123/request/meta new file mode 100644 index 0000000..f58e6e5 --- /dev/null +++ b/proc/123/request/meta @@ -0,0 +1,4 @@ +host veresov.pro +port 80 +method POST +secure no diff --git a/proc/123/request/param b/proc/123/request/param new file mode 100644 index 0000000..5bc8bae --- /dev/null +++ b/proc/123/request/param @@ -0,0 +1,2 @@ +name Aleksey Veresov +email aleksey@veresov.pro diff --git a/proc/123/request/urlparam b/proc/123/request/urlparam new file mode 100644 index 0000000..e5e0334 --- /dev/null +++ b/proc/123/request/urlparam @@ -0,0 +1 @@ +q how many cows? diff --git a/site/404.html b/site/404.html deleted file mode 100644 index 49d5ddf..0000000 --- a/site/404.html +++ /dev/null @@ -1,4 +0,0 @@ - -404 Not Found -

    404 Not Found

    - diff --git a/site/act/admin b/site/act/admin deleted file mode 100644 index e87c758..0000000 --- a/site/act/admin +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -# Some admin act. (No such now, so 404.) -cat 404.html diff --git a/site/act/article b/site/act/article deleted file mode 100644 index fbd4d5a..0000000 --- a/site/act/article +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -if test -z "$1" -then # Response list of articles -else # Response article page -fi diff --git a/site/act/entry b/site/act/entry deleted file mode 100644 index 33fd084..0000000 --- a/site/act/entry +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# This is the process to be called. -# $proc and $base (initial working directory) is already set. -# Requested path is in $1, any other request data is in proc/$proc/request. -# Usually you want to dispatch the path here and call some other programs. =) -# Path has ending / and no starting one (apth for root is empty). -# Response meta should be formed in proc/$proc/response, -# output is response body. -after () { test -z "${2##*$1*}" && echo -n "${2#*$1}"; } -startswith() { case $2 in "$1"*) true;; *) false;; esac; } -if test -z "$1" -then cat index.html -elif startswith "article/" "$1" -then ./act/article "$(after / $1)" -elif startswith "admin/" "$1" -then ./act/admin "$(after / $1)" -else cat 404.html -fi diff --git a/site/article/butterfly/content b/site/article/butterfly/content deleted file mode 100644 index 5ecbc59..0000000 --- a/site/article/butterfly/content +++ /dev/null @@ -1,10 +0,0 @@ -Butterflies are insects in the macrolepidopteran clade -Rhopalocera from the order Lepidoptera, which also includes moths. -Adult butterflies have large, often brightly coloured wings, -and conspicuous, fluttering flight. -The group comprises the large superfamily Papilionoidea, -which contains at least one former group, -the skippers (formerly the superfamily "Hesperioidea"), -and the most recent analyses suggest it also contains the moth-butterflies -(formerly the superfamily "Hedyloidea"). -Butterfly fossils date to the Paleocene, about 56 million years ago. diff --git a/site/article/butterfly/title b/site/article/butterfly/title deleted file mode 100644 index a32b910..0000000 --- a/site/article/butterfly/title +++ /dev/null @@ -1 +0,0 @@ -Butterfly diff --git a/site/article/juniper b/site/article/juniper deleted file mode 100644 index 66e3d03..0000000 --- a/site/article/juniper +++ /dev/null @@ -1,10 +0,0 @@ -title Juniper -content Junipers are coniferous trees and shrubs in the genus Juniperus - of the cypress family Cupressaceae. - Depending on taxonomic viewpoint, between 50 and 67 species of junipers are - widely distributed throughout the Northern Hemisphere, from the Arctic, - south to tropical Africa, from Ziarat, Pakistan, east to eastern Tibet - in the Old World, and in the mountains of Central America. - The highest-known juniper forest occurs at an altitude of 16,000 ft (4,900 m) - in southeastern Tibet and the northern Himalayas, - creating one of the highest tree-lines on earth. diff --git a/site/article/licorice b/site/article/licorice deleted file mode 100644 index 613b1b7..0000000 --- a/site/article/licorice +++ /dev/null @@ -1,5 +0,0 @@ -title Licorice -content Liquorice (British English) or licorice (American English) - is the common name of Glycyrrhiza glabra, - a flowering plant of the bean family Fabaceae, - from the root of which a sweet, aromatic flavouring can be extracted. diff --git a/site/index.html b/site/index.html deleted file mode 100644 index e163357..0000000 --- a/site/index.html +++ /dev/null @@ -1,4 +0,0 @@ - -Welcome! -

    Welcome!

    - diff --git a/site/proc/123/request/cookie b/site/proc/123/request/cookie deleted file mode 100644 index 07766a7..0000000 --- a/site/proc/123/request/cookie +++ /dev/null @@ -1,2 +0,0 @@ -monster-name monster-value -another-name another-value diff --git a/site/proc/123/request/file/avatar b/site/proc/123/request/file/avatar deleted file mode 100644 index 61a0691..0000000 --- a/site/proc/123/request/file/avatar +++ /dev/null @@ -1 +0,0 @@ -Some image, probably PNG. (Too lazy to insert actual one.) diff --git a/site/proc/123/request/meta b/site/proc/123/request/meta deleted file mode 100644 index f58e6e5..0000000 --- a/site/proc/123/request/meta +++ /dev/null @@ -1,4 +0,0 @@ -host veresov.pro -port 80 -method POST -secure no diff --git a/site/proc/123/request/param b/site/proc/123/request/param deleted file mode 100644 index 5bc8bae..0000000 --- a/site/proc/123/request/param +++ /dev/null @@ -1,2 +0,0 @@ -name Aleksey Veresov -email aleksey@veresov.pro diff --git a/site/proc/123/request/urlparam b/site/proc/123/request/urlparam deleted file mode 100644 index e5e0334..0000000 --- a/site/proc/123/request/urlparam +++ /dev/null @@ -1 +0,0 @@ -q how many cows? diff --git a/site/template/admin b/site/template/admin deleted file mode 100644 index e69de29..0000000 diff --git a/site/template/article b/site/template/article deleted file mode 100644 index fec42d7..0000000 --- a/site/template/article +++ /dev/null @@ -1,13 +0,0 @@ -list - page - List of articles - -

    Here are some articles for you:

    - - - - item
  • $title
  • -page - $title - $content - -- cgit v1.2.3