mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2025-05-19 10:45:05 +00:00
services: cloudflare-tunnel: Support token file.
* modules/rosenthal/services/child-error.scm (cloudflare-tunnel-configuration)[token-file]: New field. (cloudflare-tunnel-shepherd-service): Adjust accordingly.
This commit is contained in:
parent
f851cdabfc
commit
879f4aef54
@ -127,6 +127,8 @@
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
||||||
|
(define-maybe string)
|
||||||
|
|
||||||
(define-configuration cloudflare-tunnel-configuration
|
(define-configuration cloudflare-tunnel-configuration
|
||||||
(cloudflared
|
(cloudflared
|
||||||
(file-like cloudflared)
|
(file-like cloudflared)
|
||||||
@ -148,8 +150,11 @@ headers. This can expose sensitive information in your logs.")
|
|||||||
|
|
||||||
;; Subcommand options
|
;; Subcommand options
|
||||||
(token
|
(token
|
||||||
(string "")
|
maybe-string
|
||||||
"The Tunnel token.")
|
"The Tunnel token.")
|
||||||
|
(token-file
|
||||||
|
maybe-string
|
||||||
|
"Secert file for the Tunnel token.")
|
||||||
(extra-options
|
(extra-options
|
||||||
(list-of-strings '())
|
(list-of-strings '())
|
||||||
"List of extra options.")
|
"List of extra options.")
|
||||||
@ -158,7 +163,7 @@ headers. This can expose sensitive information in your logs.")
|
|||||||
(define cloudflare-tunnel-shepherd-service
|
(define cloudflare-tunnel-shepherd-service
|
||||||
(match-record-lambda <cloudflare-tunnel-configuration>
|
(match-record-lambda <cloudflare-tunnel-configuration>
|
||||||
(cloudflared log-level log-file extra-tunnel-options
|
(cloudflared log-level log-file extra-tunnel-options
|
||||||
token extra-options)
|
token token-file extra-options)
|
||||||
(list (shepherd-service
|
(list (shepherd-service
|
||||||
(documentation "Run cloudflared.")
|
(documentation "Run cloudflared.")
|
||||||
(provision '(cloudflare-tunnel))
|
(provision '(cloudflare-tunnel))
|
||||||
@ -175,7 +180,14 @@ headers. This can expose sensitive information in your logs.")
|
|||||||
#:group "nogroup"
|
#:group "nogroup"
|
||||||
#:log-file #$log-file
|
#:log-file #$log-file
|
||||||
#:environment-variables
|
#:environment-variables
|
||||||
(list (format #f "TUNNEL_TOKEN=~a" #$token))))
|
(list #$@(if (maybe-value-set? token)
|
||||||
|
(list (format #f "TUNNEL_TOKEN=~a"
|
||||||
|
token))
|
||||||
|
'())
|
||||||
|
#$@(if (maybe-value-set? token-file)
|
||||||
|
(list (format #f "TUNNEL_TOKEN_FILE=~a"
|
||||||
|
token-file))
|
||||||
|
'()))))
|
||||||
(stop #~(make-kill-destructor))))))
|
(stop #~(make-kill-destructor))))))
|
||||||
|
|
||||||
(define cloudflare-tunnel-service-type
|
(define cloudflare-tunnel-service-type
|
||||||
|
Loading…
Reference in New Issue
Block a user