services: Adapt to log rotation change.

* rosenthal/services/child-error.scm (clash-log-rotations)
(cloudflare-tunnel-log-rotations): Delete procedure.
(clash-service-type,cloudflare-tunnel-service-type)[extensions]: Extend
log-rotation-service-type.
* rosenthal/services/mail.scm (docker-mailserver-log-rotations): Delete
procedure.
(docker-mailserver-service-type)[extensions]: Extend
log-rotation-service-type.
* rosenthal/services/networking.scm (iwd-log-rotations)
(tailscale-log-rotations): Delete procedures.
(iwd-service-type,tailscale-service-type)[extensions]: Extend
log-rotation-service-type.
* rosenthal/services/web.scm (jellyfin-log-rotations,misskey-log-rotations)
(vaultwarden-log-rotations): Delete procedures.
(jellyfin-service-type,misskey-service-type,vaultwarden-service-type)[extensions]:
Extend log-rotation-service-type.
This commit is contained in:
Hilton Chain 2025-01-17 13:24:56 +08:00
parent 0b26a4bf0e
commit 3384f38b2b
No known key found for this signature in database
GPG Key ID: ACC66D09CA528292
4 changed files with 16 additions and 56 deletions

View File

@ -83,10 +83,6 @@
(delete-file config-dest))
(symlink #$config config-dest)))))
(define (clash-log-rotations config)
(list (log-rotation
(files (list (clash-configuration-log-file config))))))
(define clash-shepherd-service
(match-record-lambda <clash-configuration>
(clash log-file data-directory shepherd-provision)
@ -120,8 +116,8 @@
clash-activation)
(service-extension account-service-type
(const %clash-accounts))
(service-extension rottlog-service-type
clash-log-rotations)))
(service-extension log-rotation-service-type
(compose list clash-configuration-log-file))))
(default-value (clash-configuration))
(description "Run Clash.")))
@ -159,10 +155,6 @@ headers. This can expose sensitive information in your logs.")
"List of extra options.")
(no-serialization))
(define (cloudflare-tunnel-log-rotations config)
(list (log-rotation
(files (list (cloudflare-tunnel-configuration-log-file config))))))
(define cloudflare-tunnel-shepherd-service
(match-record-lambda <cloudflare-tunnel-configuration>
(cloudflared log-level log-file extra-tunnel-options
@ -192,8 +184,8 @@ headers. This can expose sensitive information in your logs.")
(extensions
(list (service-extension shepherd-root-service-type
cloudflare-tunnel-shepherd-service)
(service-extension rottlog-service-type
cloudflare-tunnel-log-rotations)))
(service-extension log-rotation-service-type
(compose list cloudflare-tunnel-configuration-log-file))))
(default-value (cloudflare-tunnel-configuration))
(description "Run cloudflared, the Cloudflare Tunnel daemon.")))

View File

@ -36,12 +36,6 @@
"List of extra Docker arguments.")
(no-serialization))
(define docker-mailserver-log-rotations
(match-record-lambda <docker-mailserver-configuration>
(log-file)
(list (log-rotation
(files (list log-file))))))
(define docker-mailserver-oci-containers
(match-record-lambda <docker-mailserver-configuration>
(data-directory log-file shepherd-requirement options extra-arguments)
@ -68,7 +62,7 @@
(extensions
(list (service-extension oci-container-service-type
docker-mailserver-oci-containers)
(service-extension rottlog-service-type
docker-mailserver-log-rotations)))
(service-extension log-rotation-service-type
(compose list docker-mailserver-configuration-log-file))))
(default-value (docker-mailserver-configuration))
(description "Run Docker Mailserver.")))

View File

@ -323,10 +323,6 @@ list, power save will be disabled."))
(define add-iwd-package
(compose list iwd-configuration-iwd))
(define (iwd-log-rotations config)
(list (log-rotation
(files (list (iwd-configuration-log-file config))))))
(define (iwd-shepherd-service config)
(match-record config <iwd-configuration>
(iwd log-file
@ -358,8 +354,8 @@ list, power save will be disabled."))
add-iwd-config-file)
(service-extension profile-service-type
add-iwd-package)
(service-extension rottlog-service-type
iwd-log-rotations)))
(service-extension log-rotation-service-type
(compose list iwd-configuration-log-file))))
(default-value (iwd-configuration))
(description "Run iwd, the iNet wireless daemon.")))
@ -406,10 +402,6 @@ to #f.")
"List of extra options.")
(no-serialization))
(define (tailscale-log-rotations config)
(list (log-rotation
(files (list (tailscale-configuration-log-file config))))))
(define tailscale-shepherd-service
(match-record-lambda <tailscale-configuration>
(tailscale iptables log-file socket state-directory
@ -447,7 +439,7 @@ to #f.")
tailscale-shepherd-service)
(service-extension profile-service-type
(compose list tailscale-configuration-tailscale))
(service-extension rottlog-service-type
tailscale-log-rotations)))
(service-extension log-rotation-service-type
(compose list tailscale-configuration-log-file))))
(default-value (tailscale-configuration))
(description "Run tailscaled.")))

View File

@ -58,12 +58,6 @@
(home-directory "/var/empty")
(shell (file-append shadow "/sbin/nologin")))))
(define jellyfin-log-rotations
(match-record-lambda <jellyfin-configuration>
(log-file)
(list (log-rotation
(files (list log-file))))))
(define jellyfin-activation
(match-record-lambda <jellyfin-configuration>
(cache-directory config-directory)
@ -106,8 +100,8 @@
(const %jellyfin-accounts))
(service-extension activation-service-type
jellyfin-activation)
(service-extension rottlog-service-type
jellyfin-log-rotations)
(service-extension log-rotation-service-type
(compose list jellyfin-configuration-log-file))
(service-extension oci-container-service-type
jellyfin-oci-containers)))
(default-value (jellyfin-configuration))
@ -147,12 +141,6 @@
(name "misskey")
(create-database? #t))))
(define misskey-log-rotations
(match-record-lambda <misskey-configuration>
(log-file)
(list (log-rotation
(files (list log-file))))))
(define misskey-activation
(match-record-lambda <misskey-configuration>
(data-directory)
@ -191,8 +179,8 @@
(const %misskey-accounts))
(service-extension postgresql-role-service-type
(const %misskey-postgresql-role))
(service-extension rottlog-service-type
misskey-log-rotations)
(service-extension log-rotation-service-type
(compose list misskey-configuration-log-file))
(service-extension activation-service-type
misskey-activation)
(service-extension oci-container-service-type
@ -243,12 +231,6 @@
(name "vaultwarden")
(create-database? #t))))
(define vaultwarden-log-rotations
(match-record-lambda <vaultwarden-configuration>
(log-file)
(list (log-rotation
(files (list log-file))))))
(define vaultwarden-activation
(match-record-lambda <vaultwarden-configuration>
(data-directory log-file)
@ -308,8 +290,8 @@
(const %vaultwarden-postgresql-role))
(service-extension activation-service-type
vaultwarden-activation)
(service-extension rottlog-service-type
vaultwarden-log-rotations)
(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))