aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-11-23 14:41:39 +0100
committerWojtek Kosior <koszko@koszko.org>2022-11-23 14:41:39 +0100
commit19168e8f7447183aa9bb57f8a961396765d2bd74 (patch)
treee8e340c612966d9846a4d3445b691469013b93e2
parent0ef35f69a5c5aa12d45c855ce6ea66f07efa99d5 (diff)
downloadkoszko-org-server-19168e8f7447183aa9bb57f8a961396765d2bd74.tar.gz
koszko-org-server-19168e8f7447183aa9bb57f8a961396765d2bd74.zip
refactor the WSGIScriptAlias g-exps into a separate function
-rw-r--r--container.scm35
1 files changed, 15 insertions, 20 deletions
diff --git a/container.scm b/container.scm
index 12858b9..c50a75b 100644
--- a/container.scm
+++ b/container.scm
@@ -11,6 +11,17 @@
(use-service-modules web)
(use-service-modules shepherd)
+(define* (simple-wsgi-alias-gexp package wsgi-path #:key (aliased-path "/"))
+ #~(let* ((wsgi-file (string-append #$package #$wsgi-path)))
+ (format #f
+ "\
+ <Files ~s>
+ Require all granted
+ </Files>
+ WSGIScriptAlias ~a ~a
+ "
+ wsgi-file #$aliased-path wsgi-file)))
+
(define %koszko-org-virtualhost
(httpd-virtualhost
"*:80"
@@ -28,16 +39,8 @@
WSGIScriptReloading On
"
- #~(let* ((script-rel "/share/koszko-org-website/wsgi.py")
- (wsgi-file (string-append #$koszko-org-website script-rel)))
- (format #f
- "\
- <Files ~s>
- Require all granted
- </Files>
- WSGIScriptAlias / ~a
- "
- wsgi-file wsgi-file)))))
+ (simple-wsgi-alias-gexp koszko-org-website
+ "/share/koszko-org-website/wsgi.py"))))
(define %koszkonutek-tmp-virtualhost
(httpd-virtualhost
@@ -96,16 +99,8 @@
WSGIScriptReloading On
"
- #~(let* ((script-rel "/share/hydrilla-website/wsgi.py")
- (wsgi-file (string-append #$hydrilla-website script-rel)))
- (format #f
- "\
- <Files ~s>
- Require all granted
- </Files>
- WSGIScriptAlias / ~a
- "
- wsgi-file wsgi-file)))))
+ (simple-wsgi-alias-gexp hydrilla-website
+ "/share/hydrilla-website/wsgi.py"))))
(define %wsgi-module
(httpd-module