From ccd8dcff56f4fc0ffed4c9ec6511bedeae6ca99b Mon Sep 17 00:00:00 2001 From: Toby Chui Date: Wed, 1 May 2024 20:39:26 +0800 Subject: [PATCH] Added template examples - Added a uwu version of the notfound and access control template - Added example index file for internal static web server --- example/README.md | 18 +++ example/www/html/index.html | 229 +++++++++++++++++++++++++++ example/www/templates/blacklist.html | 52 ++++++ example/www/templates/notfound.html | 42 +++++ example/www/templates/whitelist.html | 52 ++++++ 5 files changed, 393 insertions(+) create mode 100644 example/README.md create mode 100644 example/www/html/index.html create mode 100644 example/www/templates/blacklist.html create mode 100644 example/www/templates/notfound.html create mode 100644 example/www/templates/whitelist.html diff --git a/example/README.md b/example/README.md new file mode 100644 index 0000000..8a4b730 --- /dev/null +++ b/example/README.md @@ -0,0 +1,18 @@ +# Example www Folder + +This is an example www folder that contains two sub-folders. + +- `html/` +- `templates/` + +The html file contain static resources that will be served by Zoraxy build-in static web server. You can use it as a generic web server with a static site generator like [Hugo](https://gohugo.io/) or use it as a small CDN for serving your scripts / image that commonly use across many of your sites. + +The templates folder contains the template for overriding the build in error or access denied pages. The following templates are supported + +- notfound.html (Default site Not-Found error page) +- whitelist.html (Error page when client being blocked by whitelist rule) +- blacklist.html (Error page when client being blocked by blacklist rule) + + + +To use the template, copy and paste the `wwww` folder to the same directory as zoraxy executable (aka the src/ file if you `go build` with the current folder tree) . \ No newline at end of file diff --git a/example/www/html/index.html b/example/www/html/index.html new file mode 100644 index 0000000..28098ec --- /dev/null +++ b/example/www/html/index.html @@ -0,0 +1,229 @@ + + + Zoraxy Firework! + + + + + + + + \ No newline at end of file diff --git a/example/www/templates/blacklist.html b/example/www/templates/blacklist.html new file mode 100644 index 0000000..1e30ad0 --- /dev/null +++ b/example/www/templates/blacklist.html @@ -0,0 +1,52 @@ + + + + Access Denied (。ŏ_ŏ) + + + + + + +
+ +

Oh nyo, uwu have bewn bwackwisted! (。ŏ_ŏ)

+
+ + \ No newline at end of file diff --git a/example/www/templates/notfound.html b/example/www/templates/notfound.html new file mode 100644 index 0000000..1f0202a --- /dev/null +++ b/example/www/templates/notfound.html @@ -0,0 +1,42 @@ + + + + Not Found Σ(*゚д゚ノ)ノ + + + + + + +
+ +

The page uwu awe wooking fow does nowt exists own thiws sewvew Σ(*゚д゚ノ)ノ

+
+ + \ No newline at end of file diff --git a/example/www/templates/whitelist.html b/example/www/templates/whitelist.html new file mode 100644 index 0000000..1227289 --- /dev/null +++ b/example/www/templates/whitelist.html @@ -0,0 +1,52 @@ + + + + Not Whitelisted (´・ω・`) + + + + + + +
+ +

Oh nyo, youw ip iws nowt incwuded in the whitewist of thiws website (´・ω・`)

+
+ + \ No newline at end of file