mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-03-31 14:54:21 +00:00
Compare commits
No commits in common. "b8c33054032a49bf1d683be7113b86a8a147c4fd" and "f35b32e3aa1e89e370e2cfb24b6dbe14d9fac8fe" have entirely different histories.
b8c3305403
...
f35b32e3aa
@ -4,7 +4,6 @@
|
||||
|
||||
(define-module (rosenthal services monitoring)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix modules)
|
||||
#:use-module (guix records)
|
||||
#:use-module (rosenthal utils serializers ini)
|
||||
#:use-module (rosenthal utils serializers yaml)
|
||||
@ -138,12 +137,7 @@
|
||||
(match-record-lambda <grafana-configuration>
|
||||
(grafana config shepherd-provision shepherd-requirement auto-start?)
|
||||
(let ((config-file
|
||||
(computed-file "grafana.ini"
|
||||
(with-extensions (list guile-ini guile-lib guile-smc)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (ini))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->ini '#$config #:port <>)))))))
|
||||
(apply mixed-text-file "grafana.ini" (ini-serialize config))))
|
||||
(list (shepherd-service
|
||||
(provision shepherd-provision)
|
||||
(requirement `(loopback postgresql user-processes
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
#:use-module (guix modules)
|
||||
#:use-module (guix records)
|
||||
#:use-module (gnu packages admin)
|
||||
#:use-module (gnu packages guile-xyz)
|
||||
#:use-module (gnu packages version-control)
|
||||
#:use-module (gnu packages video)
|
||||
#:use-module (rosenthal packages binaries)
|
||||
@ -20,7 +19,6 @@
|
||||
#:use-module (gnu services shepherd)
|
||||
#:use-module (gnu system privilege)
|
||||
#:use-module (gnu system shadow)
|
||||
#:use-module (rosenthal utils serializers ini)
|
||||
#:use-module (rosenthal utils serializers yaml)
|
||||
#:export (caddy-configuration
|
||||
caddy-service-type
|
||||
@ -173,9 +171,10 @@ reload its configuration file."))
|
||||
(git-packages
|
||||
(list-of-file-likes (list git git-lfs))
|
||||
"@code{git} and extension packages to install.")
|
||||
(config
|
||||
ini-config
|
||||
"")
|
||||
(config-file
|
||||
(file-object "/var/lib/forgejo/app.ini")
|
||||
"Filesystem path or file-like object of Forgejo configuration,
|
||||
@file{app.ini}.")
|
||||
(no-serialization))
|
||||
|
||||
(define %forgejo-accounts
|
||||
@ -205,37 +204,30 @@ reload its configuration file."))
|
||||
|
||||
(define forgejo-shepherd-service
|
||||
(match-record-lambda <forgejo-configuration>
|
||||
(forgejo config)
|
||||
(let ((config-file
|
||||
(computed-file "forgejo.ini"
|
||||
(with-extensions (list guile-ini guile-lib guile-smc)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (ini))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->ini '#$config #:port <>)))))))
|
||||
(list (shepherd-service
|
||||
(documentation "Run Forgejo.")
|
||||
(provision '(forgejo))
|
||||
(requirement '(loopback postgresql))
|
||||
(start
|
||||
#~(make-forkexec-constructor
|
||||
(list #$(file-append forgejo "/bin/forgejo")
|
||||
"--config" #$config-file)
|
||||
#:user "forgejo"
|
||||
#:group "forgejo"
|
||||
#:log-file "/var/log/forgejo.log"
|
||||
#:environment-variables
|
||||
'("GIT_EXEC_PATH=/run/current-system/profile/libexec/git-core"
|
||||
"GIT_SSL_CAINFO=/run/current-system/profile/etc/ssl/certs/ca-certificates.crt"
|
||||
"HOME=/var/lib/forgejo"
|
||||
"PATH=/run/current-system/profile/bin"
|
||||
"SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs"
|
||||
"SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt")
|
||||
#:resource-limits '((nofile 524288 524288))))
|
||||
(stop
|
||||
#~(make-kill-destructor))
|
||||
(actions
|
||||
(list (shepherd-configuration-action config-file))))))))
|
||||
(forgejo config-file)
|
||||
(list (shepherd-service
|
||||
(documentation "Run Forgejo.")
|
||||
(provision '(forgejo))
|
||||
(requirement '(loopback postgresql))
|
||||
(start
|
||||
#~(make-forkexec-constructor
|
||||
(list #$(file-append forgejo "/bin/forgejo")
|
||||
"--config" #$config-file)
|
||||
#:user "forgejo"
|
||||
#:group "forgejo"
|
||||
#:log-file "/var/log/forgejo.log"
|
||||
#:environment-variables
|
||||
'("GIT_EXEC_PATH=/run/current-system/profile/libexec/git-core"
|
||||
"GIT_SSL_CAINFO=/run/current-system/profile/etc/ssl/certs/ca-certificates.crt"
|
||||
"HOME=/var/lib/forgejo"
|
||||
"PATH=/run/current-system/profile/bin"
|
||||
"SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs"
|
||||
"SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt")
|
||||
#:resource-limits '((nofile 524288 524288))))
|
||||
(stop
|
||||
#~(make-kill-destructor))
|
||||
(actions
|
||||
(list (shepherd-configuration-action config-file)))))))
|
||||
|
||||
(define forgejo-service-type
|
||||
(service-type
|
||||
@ -251,6 +243,7 @@ reload its configuration file."))
|
||||
(const forgejo-activation))
|
||||
(service-extension shepherd-root-service-type
|
||||
forgejo-shepherd-service)))
|
||||
(default-value (forgejo-configuration))
|
||||
(description "Run Forgejo.")))
|
||||
|
||||
|
||||
@ -493,7 +486,7 @@ test its configuration file."))
|
||||
(string "misskey/misskey:latest")
|
||||
"Misskey docker image to use.")
|
||||
(config
|
||||
yaml-config
|
||||
(yaml-config '())
|
||||
"Alist of Misskey configuration, to be serialized to YAML format.")
|
||||
(data-directory
|
||||
(string "/var/lib/misskey")
|
||||
@ -530,15 +523,7 @@ test its configuration file."))
|
||||
(match-record-lambda <misskey-configuration>
|
||||
(image config data-directory log-file )
|
||||
(let ((config-file
|
||||
(computed-file "misskey.yaml"
|
||||
(with-extensions (list guile-yamlpp)
|
||||
#~(begin
|
||||
(use-modules (yamlpp))
|
||||
(call-with-output-file #$output
|
||||
(lambda (port)
|
||||
(let ((emitter (make-yaml-emitter)))
|
||||
(yaml-emit! emitter '#$config)
|
||||
(display (yaml-emitter-string emitter) port)))))))))
|
||||
(mixed-text-file "misskey.yaml" (yaml-serialize config))))
|
||||
(list (oci-container-configuration
|
||||
(user "misskey")
|
||||
(group "docker")
|
||||
@ -566,6 +551,7 @@ test its configuration file."))
|
||||
misskey-activation)
|
||||
(service-extension oci-container-service-type
|
||||
misskey-oci-containers)))
|
||||
(default-value (misskey-configuration))
|
||||
(description "Run Misskey, an interplanetary microblogging platform.")))
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user