Fix Tribes node update CLI and ACME routing

This commit is contained in:
2026-04-02 11:38:56 +02:00
parent 71ca0a2530
commit 0022cf3161
2 changed files with 3 additions and 6 deletions

View File

@@ -12,7 +12,6 @@
(use-modules (ice-9 format) (use-modules (ice-9 format)
(ice-9 ftw) (ice-9 ftw)
(ice-9 match) (ice-9 match)
(ice-9 posix)
(srfi srfi-1)) (srfi srfi-1))
(define channels-file "/etc/tribes/channels.sexp") (define channels-file "/etc/tribes/channels.sexp")
@@ -20,10 +19,7 @@
(define system-guix "/run/current-system/profile/bin/guix") (define system-guix "/run/current-system/profile/bin/guix")
(define (home-directory) (define (home-directory)
(let ((entry (getpwuid (getuid)))) (or (getenv "HOME") "/root"))
(if entry
(passwd:dir entry)
"/root")))
(define (pulled-guix) (define (pulled-guix)
(string-append (home-directory) "/.config/guix/current/bin/guix")) (string-append (home-directory) "/.config/guix/current/bin/guix"))
@@ -42,7 +38,7 @@
(format port " os update Pull channels and reconfigure the OS.~%")) (format port " os update Pull channels and reconfigure the OS.~%"))
(define (require-root) (define (require-root)
(unless (zero? (getuid)) (unless (string=? (or (getenv "USER") "") "root")
(format (current-error-port) (format (current-error-port)
"tribes os update must run as root.~%") "tribes os update must run as root.~%")
(exit 1))) (exit 1)))

View File

@@ -113,6 +113,7 @@
"}\n\n" "}\n\n"
"sub vcl_recv {\n" "sub vcl_recv {\n"
" if (req.url ~ \"^/\\\\.well-known/acme-challenge/\") {\n" " if (req.url ~ \"^/\\\\.well-known/acme-challenge/\") {\n"
" set req.backend_hint = acme;\n"
" return (pass);\n" " return (pass);\n"
" }\n\n" " }\n\n"
" return (synth(750));\n" " return (synth(750));\n"