Compare commits

..

No commits in common. "88283b8d959db6ed0e8a9f68dfa018eaafd97b2d" and "cae3691f06d59949d73a75bf614c1d14d56273e0" have entirely different histories.

3 changed files with 99 additions and 43 deletions

View File

@ -27,6 +27,9 @@
cloudflare-warp-configuration
cloudflare-warp-service-type
miniflux-configuration
miniflux-service-type
home-wakapi-configuration
home-wakapi-service-type
@ -246,6 +249,82 @@ headers. This can expose sensitive information in your logs.")
(default-value (cloudflare-warp-configuration))
(description "Run warp-svc, the Cloudflare Warp daemon.")))
;;;
;;; Miniflux
;;;
(define-maybe string)
(define-configuration miniflux-configuration
(miniflux
(file-like miniflux)
"The miniflux package.")
(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.")
(no-serialization))
(define %miniflux-accounts
(list (user-account
(name "miniflux")
(group "nogroup")
(system? #t)
(home-directory "/var/empty")
(shell (file-append shadow "/sbin/nologin")))))
(define %miniflux-postgresql-role
(list (postgresql-role
(name "miniflux")
(create-database? #t))))
(define miniflux-shepherd-service
(match-record-lambda <miniflux-configuration>
(miniflux log-file proxy-url options)
(let ((config-file (mixed-text-file
"miniflux.conf"
(apply string-append
(map (lambda (option)
(format #f "~a=~a~%"
(car option) (cdr option)))
options)))))
(list (shepherd-service
(documentation "Run miniflux.")
(provision '(miniflux))
(requirement '(postgres user-processes))
(start #~(make-forkexec-constructor
(list #$(file-append miniflux "/bin/miniflux")
"-config-file" #$config-file)
#:user "miniflux"
#:group "nogroup"
#: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
(service-type
(name 'miniflux)
(extensions
(list (service-extension account-service-type
(const %miniflux-accounts))
(service-extension postgresql-role-service-type
(const %miniflux-postgresql-role))
(service-extension shepherd-root-service-type
miniflux-shepherd-service)))
(default-value (miniflux-configuration))
(description "Run Miniflux, a minimalist and opinionated feed reader.")))
;;;
;;; Wakapi

View File

@ -96,9 +96,6 @@
(config
ini-config
"")
(postgresql-password-file
string
"")
(shepherd-provision
(list-of-symbols '(grafana))
"")
@ -120,12 +117,10 @@
(home-directory "/var/lib/grafana")))))
(define grafana-postgresql-role
(match-record-lambda <grafana-configuration>
(postgresql-password-file)
(lambda _
(list (postgresql-role
(name "grafana")
(create-database? #t)
(password-file postgresql-password-file)))))
(create-database? #t)))))
(define grafana-activation
(lambda _

View File

@ -149,6 +149,7 @@ reload its configuration file."))
caddy-privileged-programs)
(service-extension shepherd-root-service-type
caddy-shepherd-services)))
(default-value #f)
(description "")))
@ -175,9 +176,6 @@ reload its configuration file."))
(config
ini-config
"")
(postgresql-password-file
string
"")
(no-serialization))
(define %forgejo-accounts
@ -189,13 +187,10 @@ reload its configuration file."))
(comment "Forgejo user")
(home-directory "/var/lib/forgejo"))))
(define forgejo-postgresql-role
(match-record-lambda <forgejo-configuration>
(postgresql-password-file)
(list (postgresql-role
(name "forgejo")
(create-database? #t)
(password-file postgresql-password-file)))))
(define %forgejo-postgresql-role
(list (postgresql-role
(name "forgejo")
(create-database? #t))))
(define forgejo-activation
#~(begin
@ -249,11 +244,9 @@ reload its configuration file."))
(list (service-extension account-service-type
(const %forgejo-accounts))
(service-extension postgresql-role-service-type
forgejo-postgresql-role)
(const %forgejo-postgresql-role))
(service-extension profile-service-type
(lambda (config)
(cons (forgejo-configuration-forgejo config)
(forgejo-configuration-git-packages config))))
forgejo-configuration-git-packages)
(service-extension activation-service-type
(const forgejo-activation))
(service-extension shepherd-root-service-type
@ -508,9 +501,6 @@ test its configuration file."))
(log-file
(string "/var/log/misskey.log")
"Log file to use.")
(postgresql-password-file
string
"")
(no-serialization))
(define %misskey-accounts
@ -521,13 +511,10 @@ test its configuration file."))
(home-directory "/var/empty")
(shell (file-append shadow "/sbin/nologin")))))
(define misskey-postgresql-role
(match-record-lambda <misskey-configuration>
(postgresql-password-file)
(list (postgresql-role
(name "misskey")
(create-database? #t)
(password-file postgresql-password-file)))))
(define %misskey-postgresql-role
(list (postgresql-role
(name "misskey")
(create-database? #t))))
(define misskey-activation
(match-record-lambda <misskey-configuration>
@ -572,7 +559,7 @@ test its configuration file."))
(list (service-extension account-service-type
(const %misskey-accounts))
(service-extension postgresql-role-service-type
misskey-postgresql-role)
(const %misskey-postgresql-role))
(service-extension log-rotation-service-type
(compose list misskey-configuration-log-file))
(service-extension activation-service-type
@ -680,9 +667,6 @@ test its configuration file."))
(extra-options
(alist '())
"Extra options.")
(postgresql-password-file
string
"")
(no-serialization))
(define %vaultwarden-accounts
@ -693,13 +677,10 @@ test its configuration file."))
(home-directory "/var/empty")
(shell (file-append shadow "/sbin/nologin")))))
(define vaultwarden-postgresql-role
(match-record-lambda <vaultwarden-configuration>
(postgresql-password-file)
(list (postgresql-role
(name "vaultwarden")
(create-database? #t)
(password-file postgresql-password-file)))))
(define %vaultwarden-postgresql-role
(list (postgresql-role
(name "vaultwarden")
(create-database? #t))))
(define vaultwarden-activation
(match-record-lambda <vaultwarden-configuration>
@ -757,11 +738,12 @@ test its configuration file."))
(list (service-extension account-service-type
(const %vaultwarden-accounts))
(service-extension postgresql-role-service-type
vaultwarden-postgresql-role)
(const %vaultwarden-postgresql-role))
(service-extension activation-service-type
vaultwarden-activation)
(service-extension log-rotation-service-type
(compose list vaultwarden-configuration-log-file))
(service-extension oci-container-service-type
vaultwarden-oci-containers)))
(default-value (vaultwarden-configuration))
(description "Run Vaultwarden, a Bitwarden compatible server.")))