Replace define-runtime-path with custom anytime-path function

This commit is contained in:
Cadence Ember 2023-03-08 22:56:04 +13:00
parent e0fec5fa9c
commit 453570bdc9
Signed by untrusted user: cadence
GPG key ID: BC1C2C61CF521B17
6 changed files with 50 additions and 11 deletions

View file

@ -8,8 +8,8 @@
db
memo
"static-data.rkt"
"../lib/url-utils.rkt"
"whole-utils.rkt"
"../lib/url-utils.rkt"
"../lib/xexpr-utils.rkt"
"../archiver/archiver-database.rkt"
"config.rkt")
@ -42,8 +42,8 @@
[(config-true? 'feature_offline::only)
(when (config-true? 'debug)
(printf "using offline mode for siteinfo ~a~n" wikiname))
(define row (query-maybe-row slc "select sitename, basepage, license_text, license_url from wiki where wikiname = ?"
wikiname))
(define row (query-maybe-row* "select sitename, basepage, license_text, license_url from wiki where wikiname = ?"
wikiname))
(if row
(siteinfo^ (vector-ref row 0)
(vector-ref row 1)

View file

@ -2,7 +2,6 @@
(require racket/file
racket/path
racket/port
racket/runtime-path
racket/string
net/url
web-server/http
@ -11,6 +10,7 @@
(only-in web-server/dispatchers/dispatch next-dispatcher)
"../archiver/archiver.rkt"
"../lib/mime-types.rkt"
"../lib/syntax.rkt"
"../lib/xexpr-utils.rkt"
"config.rkt"
"log.rkt")
@ -18,7 +18,7 @@
(provide
page-static-archive)
(define-runtime-path path-archive "../storage/archive")
(define path-archive (anytime-path ".." "storage/archive"))
(define ((replacer wikiname) whole url)
(format

View file

@ -8,6 +8,7 @@
(only-in web-server/dispatchers/dispatch next-dispatcher)
(prefix-in files: web-server/dispatchers/dispatch-files)
"../lib/mime-types.rkt"
"../lib/syntax.rkt"
"config.rkt")
(provide
@ -17,7 +18,7 @@
(require rackunit))
(define-runtime-path path-static "../static")
(define-runtime-path path-archive "../storage/archive")
(define path-archive (anytime-path ".." "storage/archive"))
(define hash-ext-mime-type
(hash #".css" #"text/css"

View file

@ -4,7 +4,7 @@
racket/function
racket/list
racket/match
racket/runtime-path
racket/path
racket/string
; libs
(prefix-in easy: net/http-easy)
@ -38,7 +38,7 @@
(module+ test
(require rackunit))
(define-runtime-path path-archive "../storage/archive")
(define path-archive (anytime-path ".." "storage/archive"))
(define (page-wiki-offline req)
(response-handler