about summary refs log tree commit diff
path: root/guix/forge
diff options
context:
space:
mode:
authorArun Isaac2025-11-09 11:51:37 +0000
committerArun Isaac2025-11-09 11:51:37 +0000
commit4fb5ad671312091e10eff831600dab1b5cd4a6dd (patch)
treea372ce0b3c146e46f27b7bc3f485638098b47ff9 /guix/forge
parentb892157fe3a8dd904d518630b7df6ff2e8a1f4f9 (diff)
downloadguix-forge-4fb5ad671312091e10eff831600dab1b5cd4a6dd.tar.gz
guix-forge-4fb5ad671312091e10eff831600dab1b5cd4a6dd.tar.lz
guix-forge-4fb5ad671312091e10eff831600dab1b5cd4a6dd.zip
nginx: Move socket->proxy-pass to (forge nginx).
Diffstat (limited to 'guix/forge')
-rw-r--r--guix/forge/nginx.scm17
-rw-r--r--guix/forge/tissue.scm18
2 files changed, 18 insertions, 17 deletions
diff --git a/guix/forge/nginx.scm b/guix/forge/nginx.scm
index c932187..2e22bd8 100644
--- a/guix/forge/nginx.scm
+++ b/guix/forge/nginx.scm
@@ -36,6 +36,7 @@
             forge-nginx-configuration-acme-challenge-directory
             forge-nginx-configuration-server-blocks
             nginx-socket->string
+            socket->nginx-proxy-pass
             forge-nginx-service-type))
 
 (define-record-type* <forge-nginx-configuration>
@@ -72,6 +73,22 @@ configuration (for example, in the @code{listen} and
     (($ <forge-unix-socket> path)
      (string-append "unix:" path))))
 
+(define (socket->nginx-proxy-pass socket)
+  "Serialize @var{socket}, a forge socket, to an nginx @code{proxy_pass}
+directive."
+  (string-append
+   "proxy_pass "
+   (match socket
+     (($ <forge-host-socket> hostname port)
+      (string-append "http://" hostname ":" (number->string port)))
+     (($ <forge-ip-socket> (? ipv4-address? ip) port)
+      (string-append "http://" ip ":" (number->string port)))
+     (($ <forge-ip-socket> (? ipv6-address? ip) port)
+      (string-append "http://[" ip "]:" (number->string port)))
+     (($ <forge-unix-socket> path)
+      (string-append "http://unix:" path ":")))
+   ";"))
+
 (define (forge-nginx-server-blocks config)
   "Return list of nginx server blocks to provision for forge-web service
 specified by @var{config}."
diff --git a/guix/forge/tissue.scm b/guix/forge/tissue.scm
index 1608728..abf3e39 100644
--- a/guix/forge/tissue.scm
+++ b/guix/forge/tissue.scm
@@ -248,22 +248,6 @@
            #:log-file "/var/log/tissue.log")))
      (stop #~(make-kill-destructor)))))
 
-(define (socket->proxy-pass socket)
-  "Serialize @var{socket}, a forge socket, to an nginx @code{proxy_pass}
-directive."
-  (string-append
-   "proxy_pass "
-   (match socket
-     (($ <forge-host-socket> hostname port)
-      (string-append "http://" hostname ":" (number->string port)))
-     (($ <forge-ip-socket> (? ipv4-address? ip) port)
-      (string-append "http://" ip ":" (number->string port)))
-     (($ <forge-ip-socket> (? ipv6-address? ip) port)
-      (string-append "http://[" ip "]:" (number->string port)))
-     (($ <forge-unix-socket> path)
-      (string-append "http://unix:" path ":")))
-   ";"))
-
 (define (tissue-nginx-server-blocks config)
   "Return list of @code{<nginx-server-configuration>} extensions for
 tissue configuration @var{config}."
@@ -286,7 +270,7 @@ tissue configuration @var{config}."
             (locations
              (cons (nginx-location-configuration
                     (uri "@tissue-search")
-                    (body (list (socket->proxy-pass socket)
+                    (body (list (socket->nginx-proxy-pass socket)
                                 "proxy_set_header Host $host;")))
                    (append (map (cut project->location state-directory <>)
                                 projects)