mirror of
https://gitlab.univ-nantes.fr/glicid-public/guix-glicid.git
synced 2025-04-29 13:48:36 +02:00
testing caddy service
This commit is contained in:
parent
1770349884
commit
edb6a815a0
1 changed files with 22 additions and 17 deletions
|
@ -29,9 +29,9 @@
|
||||||
(define-record-type* <caddy-configuration> caddy-configuration
|
(define-record-type* <caddy-configuration> caddy-configuration
|
||||||
make-caddy-configuration
|
make-caddy-configuration
|
||||||
caddy-configuration?
|
caddy-configuration?
|
||||||
(caddy caddy-configuration-caddy (default caddy-dirty))
|
(caddy caddy (default caddy-dirty))
|
||||||
(config-file caddy-config-file (default "/etc/caddy/Caddyfile"))
|
(config-file config-file (default "/etc/caddy/Caddyfile"))
|
||||||
(log-file caddy-log-file (default "/var/log/caddy.log"))
|
(log-file log-file (default "/var/log/caddy.log"))
|
||||||
)
|
)
|
||||||
|
|
||||||
(define caddy-service
|
(define caddy-service
|
||||||
|
@ -41,30 +41,35 @@
|
||||||
(documentation "Run caddy.")
|
(documentation "Run caddy.")
|
||||||
(requirement '(user-processes))
|
(requirement '(user-processes))
|
||||||
(respawn? #t)
|
(respawn? #t)
|
||||||
|
(respawn-delay 10)
|
||||||
(start #~(make-forkexec-constructor (list #$(file-append caddy "/sbin/caddy")
|
(start #~(make-forkexec-constructor (list #$(file-append caddy "/sbin/caddy")
|
||||||
|
"run"
|
||||||
"-c"
|
"-c"
|
||||||
#$config-file)
|
#$config-file
|
||||||
|
)
|
||||||
#:log-file #$log-file
|
#:log-file #$log-file
|
||||||
#:environment-variables (list
|
#:environment-variables (list "PATH=/run/current-system/profile/bin:/run/current-system/profile/sbin:/run/current-system/profile/libexec")
|
||||||
(string-append "PATH="
|
#:user "caddy"
|
||||||
"/run/current-system/profile/bin"
|
#:group "caddy"
|
||||||
":/run/current-system/profile/sbin"
|
))
|
||||||
":/run/current-system/profile/libexec"))))
|
|
||||||
(stop #~(make-kill-destructor)))))))
|
(stop #~(make-kill-destructor)))))))
|
||||||
|
|
||||||
|
|
||||||
|
(define %caddy-priv
|
||||||
|
(list
|
||||||
|
(privileged-program
|
||||||
|
(program (file-append caddy-dirty "/sbin/caddy"))
|
||||||
|
(capabilities "cap_net_bind_service=+ep")
|
||||||
|
)))
|
||||||
|
|
||||||
(define caddy-service-type
|
(define caddy-service-type
|
||||||
(service-type
|
(service-type
|
||||||
(name 'caddy)
|
(name 'caddy)
|
||||||
(default-value (caddy-configuration))
|
(default-value (caddy-configuration))
|
||||||
(extensions (list
|
(extensions (list
|
||||||
(service-extension shepherd-root-service-type (compose list caddy-service))
|
(service-extension shepherd-root-service-type caddy-service)
|
||||||
(service-extension privileged-program-service-type (const (list
|
(service-extension privileged-program-service-type (const %caddy-priv))
|
||||||
(privileged-program
|
(service-extension account-service-type (const %caddy-accounts))
|
||||||
(program (file-append caddy-dirty "/sbin/caddy"))
|
|
||||||
(capabilities "cap_net_bind_service=+ep")
|
|
||||||
(user "caddy")
|
|
||||||
(group "caddy")
|
|
||||||
))))
|
|
||||||
))
|
))
|
||||||
(description "run caddy web server service")))
|
(description "run caddy web server service")))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue