mirror of
https://gitlab.univ-nantes.fr/glicid-public/guix-glicid.git
synced 2025-04-29 13:48:36 +02:00
updating caddy service
This commit is contained in:
parent
edb6a815a0
commit
a7d20c978c
1 changed files with 16 additions and 8 deletions
|
@ -24,13 +24,13 @@
|
|||
(group "caddy")
|
||||
(system? #t)
|
||||
(home-directory "/var/lib/caddy")
|
||||
(shell (file-append bash "/sbin/nologin")))))
|
||||
(shell (file-append shadow "/sbin/nologin")))))
|
||||
|
||||
(define-record-type* <caddy-configuration> caddy-configuration
|
||||
make-caddy-configuration
|
||||
caddy-configuration?
|
||||
(caddy caddy (default caddy-dirty))
|
||||
(config-file config-file (default "/etc/caddy/Caddyfile"))
|
||||
(config-file config-file (default ""))
|
||||
(log-file log-file (default "/var/log/caddy.log"))
|
||||
)
|
||||
|
||||
|
@ -42,26 +42,33 @@
|
|||
(requirement '(user-processes))
|
||||
(respawn? #t)
|
||||
(respawn-delay 10)
|
||||
(start #~(make-forkexec-constructor (list #$(file-append caddy "/sbin/caddy")
|
||||
(start #~(make-forkexec-constructor (list "/run/privileged/bin/caddy"
|
||||
"run"
|
||||
"-c"
|
||||
#$config-file
|
||||
#$@(if config-file
|
||||
(list "-c" config-file)
|
||||
'())
|
||||
)
|
||||
#:log-file #$log-file
|
||||
#:environment-variables (list "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:/run/privileged/bin"
|
||||
"HOME=/var/lib/caddy")
|
||||
#: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")
|
||||
(capabilities "cap_net_admin,cap_net_bind_service=+ep")
|
||||
)))
|
||||
|
||||
(define %caddy-activation
|
||||
#~(begin
|
||||
(chmod "/var/lib/caddy" #o0770)
|
||||
#t ))
|
||||
|
||||
(define caddy-service-type
|
||||
(service-type
|
||||
(name 'caddy)
|
||||
|
@ -70,6 +77,7 @@
|
|||
(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))
|
||||
(service-extension activation-service-type (const %caddy-activation))
|
||||
))
|
||||
(description "run caddy web server service")))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue