From 13c1b0636bff156a4c7b6cfe94f75e5558e653bd Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Thu, 1 Sep 2022 14:55:25 +1200 Subject: [PATCH 1/3] In breezewiki.rkt, start server in thread This allows inspecting the program state using (enter! "breezewiki.rkt") in the REPL. --- breezewiki.rkt | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/breezewiki.rkt b/breezewiki.rkt index ee4f9b9..0421e12 100644 --- a/breezewiki.rkt +++ b/breezewiki.rkt @@ -24,15 +24,20 @@ (set-reload-poll-interval! #f)) (reload!) -(serve/launch/wait - #:listen-ip (if (config-true? 'debug) "127.0.0.1" #f) - #:port (string->number (config-get 'port)) - (λ (quit) - (sequencer:make - (pathprocedure:make "/" page-home) - (pathprocedure:make "/proxy" page-proxy) - (filter:make #rx"^/[a-z-]+/wiki/Category:.+$" (lift:make page-category)) - (filter:make #rx"^/[a-z-]+/wiki/.+$" (lift:make page-wiki)) - (filter:make #rx"^/[a-z-]+/search$" (lift:make page-search)) - static-dispatcher - (lift:make page-not-found)))) +(define ch (make-channel)) +(define (start) + (serve/launch/wait + #:listen-ip (if (config-true? 'debug) "127.0.0.1" #f) + #:port (string->number (config-get 'port)) + (λ (quit) + (channel-put ch (lambda () (semaphore-post quit))) + (sequencer:make + (pathprocedure:make "/" page-home) + (pathprocedure:make "/proxy" page-proxy) + (filter:make #rx"^/[a-z-]+/wiki/Category:.+$" (lift:make page-category)) + (filter:make #rx"^/[a-z-]+/wiki/.+$" (lift:make page-wiki)) + (filter:make #rx"^/[a-z-]+/search$" (lift:make page-search)) + static-dispatcher + (lift:make page-not-found))))) +(define server-t (thread start)) +(define quit (channel-get ch)) From 556c74cc53af42455da40e6f0d23ffc92e4277de Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Thu, 1 Sep 2022 14:56:07 +1200 Subject: [PATCH 2/3] Remove unnecessary requires in page-proxy --- src/page-proxy.rkt | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/page-proxy.rkt b/src/page-proxy.rkt index 3b63506..9d09527 100644 --- a/src/page-proxy.rkt +++ b/src/page-proxy.rkt @@ -4,9 +4,6 @@ racket/port ; libs (prefix-in easy: net/http-easy) - ; html libs - html-parsing - html-writing ; web server libs net/url web-server/http From 9ee1c73b7efd53b8a22327718eb592a81e3a6c10 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Thu, 1 Sep 2022 14:59:59 +1200 Subject: [PATCH 3/3] Hosting generously provided by alphamethyl --- src/page-home.rkt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/page-home.rkt b/src/page-home.rkt index c42102e..7cdbf4f 100644 --- a/src/page-home.rkt +++ b/src/page-home.rkt @@ -57,9 +57,13 @@ (div (@ (class "internal-footer")) (img (@ (class "my-logo") (src "/static/breezewiki.svg"))) ,(if (config-get 'instance-is-official) - `(p ,(format "This instance is run by the ~a developer, " (config-get 'application-name)) + `(div + (p ,(format "This instance is run by the ~a developer, " (config-get 'application-name)) (a (@ (href "https://cadence.moe/contact")) "Cadence.")) + (p "Hosting generously provided by " + (a (@ (href "://alphamethyl.barr0w.net/")) + "alphamethyl."))) `(p ,(format "This unofficial instance is based off the ~a source code, but is not controlled by the code developer." (config-get 'application-name)))) (p "Text content on wikis run by Fandom is available under the Creative Commons Attribution-Share Alike License 3.0 (Unported), "