From 1d40787105eee637fad30d2a9fd51a4f54e394ee Mon Sep 17 00:00:00 2001 From: Hilton Chain Date: Wed, 2 Oct 2024 20:41:04 +0800 Subject: [PATCH] services: miniflux: Support proxy. * rosenthal/services/child-error.scm (miniflux-configuration)[proxy-url]: New field. (miniflux-shepherd-service): Fix miniflux path. Adjust accordingly. --- rosenthal/services/child-error.scm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/rosenthal/services/child-error.scm b/rosenthal/services/child-error.scm index 647cc9a..5e05480 100644 --- a/rosenthal/services/child-error.scm +++ b/rosenthal/services/child-error.scm @@ -246,6 +246,8 @@ headers. This can expose sensitive information in your logs.") ;; +(define-maybe string) + (define-configuration miniflux-configuration (miniflux (file-like miniflux) @@ -253,6 +255,9 @@ headers. This can expose sensitive information in your logs.") (log-file (string "/var/log/miniflux.log") "Where the logs go.") + (proxy-url + maybe-string + "Proxy URL to use.") (options (alist '()) "Association list of miniflux configuration options.") @@ -273,7 +278,7 @@ headers. This can expose sensitive information in your logs.") (define miniflux-shepherd-service (match-record-lambda - (miniflux log-file options) + (miniflux log-file proxy-url options) (let ((config-file (mixed-text-file "miniflux.conf" (apply string-append @@ -286,10 +291,16 @@ headers. This can expose sensitive information in your logs.") (provision '(miniflux)) (requirement '(postgres user-processes)) (start #~(make-forkexec-constructor - (list #$miniflux "-config-file" #$config-file) + (list #$(file-append miniflux "/bin/miniflux") + "-config-file" #$config-file) #:user "miniflux" #:group "nogroup" - #:log-file #$log-file)) + #:log-file #$log-file + #:environment-variables + '#$(if (maybe-value-set? proxy-url) + (list (string-append "HTTP_PROXY=" proxy-url) + (string-append "HTTPS_PROXY=" proxy-url)) + '()))) (stop #~(make-kill-destructor))))))) (define miniflux-service-type