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