Merge branch 'devel' of gitlab.univ-nantes.fr:glicid-public/guix-glicid into devel

This commit is contained in:
Yann Dupont 2022-12-01 10:19:01 +01:00
commit 3bc68fbfb6
6 changed files with 345 additions and 457 deletions

View file

@ -15,8 +15,7 @@
#:use-module (gnu packages web)
#:use-module (gnu packages xml)
#:use-module (gnu packages tls)
#:use-module (glicid packages openldap)
)
#:use-module (glicid packages openldap))
(define-public nginx
(package
@ -31,7 +30,8 @@
(arguments
`(#:tests? #f
#:phases
(modify-phases %standard-phases
(modify-phases
%standard-phases
(add-before 'configure 'patch-/bin/sh
(lambda _
(substitute* "auto/feature"
@ -95,8 +95,8 @@
(synopsis "HTTP and reverse proxy server")
(description
"Nginx (\"engine X\") is a high-performance web and reverse proxy server
created by Igor Sysoev. It can be used both as a stand-alone web server
and as a proxy to reduce the load on back-end HTTP or mail servers.")
created by Igor Sysoev. It can be used both as a stand-alone web server
and as a proxy to reduce the load on back-end HTTP or mail servers.")
(license (list license:bsd-2 license:expat license:bsd-3 license:bsd-4))))
@ -110,13 +110,9 @@ and as a proxy to reduce the load on back-end HTTP or mail servers.")
(method git-fetch)
(uri (git-reference
(url "https://github.com/kvspb/nginx-auth-ldap")
(commit version)
)
)
(commit version)))
(file-name (git-file-name "nginx-ldap-auth-module" version))
(sha256 (base32 "023zmdir7w92dnb508ggskkc7kmd7k71hc597sb7i4xfgpwxzq1s"))
)
)
(sha256 (base32 "023zmdir7w92dnb508ggskkc7kmd7k71hc597sb7i4xfgpwxzq1s"))))
(synopsis "LDAP Authentication module for nginx")
(description "LDAP module for nginx which supports authentication against multiple LDAP servers.")
(build-system gnu-build-system)
@ -127,39 +123,23 @@ and as a proxy to reduce the load on back-end HTTP or mail servers.")
(arguments
(substitute-keyword-arguments
`(#:configure-flags '("--add-dynamic-module=.")
#:make-flags '("modules")
,@(package-arguments nginx)
)
#:make-flags '("modules") ,@(package-arguments nginx))
((#:phases phases)
`(modify-phases ,phases
(add-after 'unpack 'unpack-nginx-sources
(lambda* (#:key inputs native-inputs #:allow-other-keys)
(begin
;; The nginx source code is part of the modules source.
(format #t "decompressing nginx source code~%")
(let ((tar (assoc-ref inputs "tar")) (nginx-srcs (assoc-ref inputs "nginx-sources")))
(invoke (string-append tar "/bin/tar") "xvf" nginx-srcs "--strip-components=1")
)
#t
)
)
)
(invoke (string-append tar "/bin/tar") "xvf" nginx-srcs "--strip-components=1"))
#t )))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let ((modules-dir (string-append (assoc-ref outputs "out") "/etc/nginx/modules")))
(install-file "objs/ngx_http_auth_ldap_module.so" modules-dir)
#t
)
)
)
#t )))
(delete 'fix-root-dirs)
(delete 'install-man-page)
)
)
)
)
)
)
(delete 'install-man-page)))))))
(define-public modsecurity
(package
@ -171,9 +151,7 @@ and as a proxy to reduce the load on back-end HTTP or mail servers.")
(uri (list
(string-append "https://github.com/SpiderLabs/ModSecurity/releases/download/v" version "/modsecurity-v" version ".tar.gz")
))
(sha256 (base32 "1isng4z2xijqq92105si1zxkzlx4ifdnn38d7n38mrfp7jdwhhg2"))
)
)
(sha256 (base32 "1isng4z2xijqq92105si1zxkzlx4ifdnn38d7n38mrfp7jdwhhg2"))))
(synopsis "modsecurity module for nginx")
(description "modsecurity module for nginx.")
(license license:asl2.0)
@ -190,16 +168,12 @@ and as a proxy to reduce the load on back-end HTTP or mail servers.")
("pkg-config", pkg-config)
("nginx-sources", (package-source nginx))
))
(arguments `(
#:configure-flags (list
(arguments
`( #:configure-flags (list
(string-append "--with-curl=" (assoc-ref %build-inputs "curl"))
(string-append "--with-pcre=" (assoc-ref %build-inputs "pcre:bin") "/bin/pcre-config")
(string-append "--with-libxml=" (assoc-ref %build-inputs "libxml2"))
"--enable-standalone-module"
)
))
)
)
"--enable-standalone-module" )))))
(define-public nginx-modsecurity-module
(package
@ -238,26 +212,14 @@ and as a proxy to reduce the load on back-end HTTP or mail servers.")
(let ((tar (assoc-ref inputs "tar")) (nginx-srcs (assoc-ref inputs "nginx-sources")))
(invoke (string-append tar "/bin/tar") "xvf" nginx-srcs "--strip-components=1")
)
#t
)
)
)
#t )))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let ((modules-dir (string-append (assoc-ref outputs "out") "/etc/nginx/modules")))
(install-file "objs/ngx_http_modsecurity_module.so" modules-dir)
#t
)
)
)
#t )))
(delete 'fix-root-dirs)
(delete 'install-man-page)
)
)
)
)
)
)
(delete 'install-man-page)))))))
(define-public nginx-geoip2-module
(package
@ -270,9 +232,7 @@ and as a proxy to reduce the load on back-end HTTP or mail servers.")
(uri (list
(string-append "https://github.com/leev/ngx_http_geoip2_module/archive/refs/tags/" version ".tar.gz")
))
(sha256 (base32 "0lllgnasd97r6xkj70q42rp61cxrz8qlb64l14rmlwcd6hizqwmd"))
)
)
(sha256 (base32 "0lllgnasd97r6xkj70q42rp61cxrz8qlb64l14rmlwcd6hizqwmd"))))
(synopsis "GeoIP2 module for nginx")
(description "GeoIP2 module for nginx.")
(build-system gnu-build-system)
@ -283,9 +243,7 @@ and as a proxy to reduce the load on back-end HTTP or mail servers.")
(arguments
(substitute-keyword-arguments
`(#:configure-flags '("--add-dynamic-module=.")
#:make-flags '("modules")
,@(package-arguments nginx)
)
#:make-flags '("modules") ,@(package-arguments nginx))
((#:phases phases)
`(modify-phases ,phases
(add-after 'unpack 'unpack-nginx-sources
@ -296,27 +254,15 @@ and as a proxy to reduce the load on back-end HTTP or mail servers.")
(let ((tar (assoc-ref inputs "tar")) (nginx-srcs (assoc-ref inputs "nginx-sources")))
(invoke (string-append tar "/bin/tar") "xvf" nginx-srcs "--strip-components=1")
)
#t
)
)
)
#t )))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let ((modules-dir (string-append (assoc-ref outputs "out") "/etc/nginx/modules")))
(install-file "objs/ngx_http_geoip2_module.so" modules-dir)
(install-file "objs/ngx_stream_geoip2_module.so" modules-dir)
#t
)
)
)
#t )))
(delete 'fix-root-dirs)
(delete 'install-man-page)
)
)
)
)
)
)
(delete 'install-man-page)))))))
(define-public nginx-http_subs_filter-module
(package
@ -329,9 +275,7 @@ and as a proxy to reduce the load on back-end HTTP or mail servers.")
(uri (list
(string-append "https://github.com/yaoweibin/ngx_http_substitutions_filter_module/archive/" version ".tar.gz")
))
(sha256 (base32 "1cxb3yv6085rj50s001p2vblvz5px2v92whwjhb14kl8fnm2cans"))
)
)
(sha256 (base32 "1cxb3yv6085rj50s001p2vblvz5px2v92whwjhb14kl8fnm2cans"))))
(synopsis "substitutions_filter module for nginx")
(description "substitutions_filter module for nginx.")
(build-system gnu-build-system)
@ -341,9 +285,7 @@ and as a proxy to reduce the load on back-end HTTP or mail servers.")
(arguments
(substitute-keyword-arguments
`(#:configure-flags '("--add-dynamic-module=.")
#:make-flags '("modules")
,@(package-arguments nginx)
)
#:make-flags '("modules") ,@(package-arguments nginx))
((#:phases phases)
`(modify-phases ,phases
(add-after 'unpack 'unpack-nginx-sources
@ -354,23 +296,11 @@ and as a proxy to reduce the load on back-end HTTP or mail servers.")
(let ((tar (assoc-ref inputs "tar")) (nginx-srcs (assoc-ref inputs "nginx-sources")))
(invoke (string-append tar "/bin/tar") "xvf" nginx-srcs "--strip-components=1")
)
#t
)
)
)
#t )))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let ((modules-dir (string-append (assoc-ref outputs "out") "/etc/nginx/modules")))
(install-file "objs/ngx_http_subs_filter_module.so" modules-dir)
#t
)
)
)
#t )))
(delete 'fix-root-dirs)
(delete 'install-man-page)
)
)
)
)
)
)
(delete 'install-man-page)))))))

View file

@ -1,26 +0,0 @@
(define-module (glicid packages sssd)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module ((gnu packages sssd) #:prefix gnu:)
)
(define-public sssd-upstream-orig
(package
(inherit gnu:sssd)
(name "sssd-upstream")
(version "1_16_5")
(source
(origin
(inherit (package-source gnu:sssd))
(method git-fetch)
(uri (git-reference
(url "https://github.com/SSSD/sssd")
(commit (string-append "sssd-" version))
))
(file-name (git-file-name name version))
(sha256 (base32 "0zbs04lkjbp7y92anmafl7gzamcnq1f147p13hc4byyvjk9rg6f7"))
)
)
)
)

View file

@ -17,15 +17,15 @@
(define-record-type*
<sssd-configuration>
sssd-configuration make-sssd-configuration sssd-configuration?
(sssd-pkg sssd-pkg (default sssd))
(sssd-config-file sssd-config-file (default "/etc/sssd/sssd.conf"))
(sssd-logger sssd-logger (default "stderr"))
(sssd-debug-level sssd-debug-level (default "3"))
(pkg pkg (default sssd))
(config-file config-file (default "/etc/sssd/sssd.conf"))
(logger logger (default "stderr"))
(debug-level debug-level (default "3"))
(log-file log-file (default "/var/log/sssd/sssd.log")))
(define sssd-service
(match-lambda
(($ <sssd-configuration> sssd-pkg sssd-config-file sssd-logger sssd-debug-level log-file)
(($ <sssd-configuration> pkg config-file logger debug-level log-file)
(list
(shepherd-service
(provision '(sssd))
@ -34,11 +34,11 @@
(respawn? #t)
(start #~(make-forkexec-constructor
(list
#$(file-append sssd-pkg "/sbin/sssd")
#$(file-append pkg "/sbin/sssd")
"-i"
"-c" #$sssd-config-file
"--logger" #$sssd-logger
"-d" #$sssd-debug-level
"-c" #$config-file
"--logger" #$logger
"-d" #$debug-level
)
#:log-file #$log-file
))
@ -51,7 +51,7 @@
(mkdir-p "/var/lib/sss/db")
(mkdir-p "/var/lib/sss/mc")
(mkdir-p "/var/lib/sss/pipes/private")
(install-file #$(file-append sssd-pkg "/lib/sssd/conf/sssd.conf") "/etc/sssd/")
(install-file #$(file-append pkg "/lib/sssd/conf/sssd.conf") "/etc/sssd/")
#t ))
(define sssd-service-type

View file

@ -18,17 +18,16 @@
<squid-configuration>
squid-configuration make-squid-configuration
squid-configuration?
(squid-pkg squid-pkg (default squid))
(squid-port squid-port (default 3128))
(squid-loglevel squid-loglevel (default 1))
(squid-config-file squid-config-file (default (file-append squid "/etc/squid.conf")))
(pid-file squid-pid-file (default "/var/run/squid/squid.pid"))
(log-file squid-log-file (default "/var/log/squid/squid.log"))
)
(pkg pkg (default squid))
(port port (default 3128))
(loglevel loglevel (default 1))
(config-file config-file (default (file-append squid "/etc/squid.conf")))
(pid-file pid-file (default "/var/run/squid/squid.pid"))
(log-file log-file (default "/var/log/squid/squid.log")))
(define squid-shepherd-service
(match-lambda
(($ <squid-configuration> squid-pkg squid-port squid-loglevel squid-config-file pid-file log-file)
(($ <squid-configuration> pkg port loglevel config-file pid-file log-file)
(list
(shepherd-service
(provision '(squid))
@ -37,8 +36,8 @@
(respawn? #t)
(start #~(make-forkexec-constructor
(list
#$(file-append squid-pkg "/sbin/squid")
"-f" #$squid-config-file
#$(file-append pkg "/sbin/squid")
"-f" #$config-file
)
#:pid-file #$pid-file
#:log-file #$log-file

View file

@ -17,15 +17,15 @@
openldap-configuration make-openldap-configuration
openldap-configuration?
(openldap-pkg openldap-pkg (default openldap))
(uri openldap-uri (default "ldapi:// ldap://"))
(logflags openldap-logflags (default "0"))
(pid-file openldap-pid-file (default "/var/run/openldap/slapd.pid"))
(config-file openldap--config-file (default (file-append openldap "/etc/openldap/slapd.conf")))
(log-file openldap-log-file (default "/var/log/slapd.log")))
(uri uri (default "ldapi:// ldap://"))
(logflags logflags (default "0"))
(pid-file pid-file (default "/var/run/openldap/slapd.pid"))
(config-file config-file (default (file-append openldap "/etc/openldap/slapd.conf")))
(log-file log-file (default "/var/log/slapd.log")))
(define openldap-shepherd-service
(match-lambda
(($ <openldap-configuration> openldap-pkg uri logflags pid-file config-file log-file)
(($ <openldap-configuration> pkg uri logflags pid-file config-file log-file)
(list
(shepherd-service
(provision '(slapd))
@ -34,7 +34,7 @@
(respawn? #t)
(start #~(make-forkexec-constructor
(list
#$(file-append openldap "/libexec/slapd")
#$(file-append pkg "/libexec/slapd")
"-h" #$uri
"-d" #$logflags
"-f" #$config-file

View file

@ -29,8 +29,7 @@
slurmd-service-type
%slurm-group
%slurm-account
%slurm-accounts
))
%slurm-accounts ))
;
; Munged
;
@ -58,23 +57,21 @@
"-f" ; until we fix the permissions
"--key-file" #$key-file
)
#:log-file #$log-file
))
#:log-file #$log-file ))
(stop #~(make-kill-destructor)))))))
(define %munged-activation
#~(begin
(mkdir-p "/var/run/munge")
(mkdir-p "/var/lib/munge")
#t
))
#t ))
(define munged-service-type
(service-type
(name 'munged)
(extensions (list
(service-extension shepherd-root-service-type munged-service)
(service-extension activation-service-type (const %munged-activation)) ) )
(service-extension activation-service-type (const %munged-activation))))
(description "Run munged")))
;
@ -90,8 +87,7 @@
(home-directory "/var/spool/slurm")
(shell (file-append bash "/bin/bash"))))
(define %slurm-accounts
(list %slurm-group %slurm-account))
(define %slurm-accounts (list %slurm-group %slurm-account))
;
; slurmdbd
@ -100,9 +96,9 @@
<slurmdbd-configuration>
slurmdbd-configuration make-slurmdbd-configuration
slurmdbd-configuration?
(slurm slurm-configuration-slurm (default slurm))
(slurmdbd-conf slurmdbd-slurmdbd-conf (default (file-append slurm "/etc/slurm/slurmdbd.conf")))
(log-file slurmdbd-log-file (default "/var/log/slurm/slurmdbd.log")))
(slurm slurm (default slurm))
(slurmdbd-conf slurmdbd-conf (default (file-append slurm "/etc/slurm/slurmdbd.conf")))
(log-file log-file (default "/var/log/slurm/slurmdbd.log")))
(define slurmdbd-service
(match-lambda
@ -116,12 +112,10 @@
(start #~(make-forkexec-constructor
(list
#$(file-append slurm "/sbin/slurmdbd")
"-D"
)
"-D" )
#:log-file #$log-file
#:user (passwd:uid (getpwnam "slurm"))
#:group (passwd:gid (getpwnam "slurm"))
))
#:group (passwd:gid (getpwnam "slurm"))))
(stop #~(make-kill-destructor)))))))
(define %slurmdbd-activation
@ -144,8 +138,7 @@
(chown slurm-file (passwd:uid (getpwnam "slurm")) (passwd:gid (getpwnam "slurm")))
(chmod slurm-file #o600)
)(find-files "/etc/slurm/"))
#t
))
#t ))
(define slurmdbd-service-type
(service-type
@ -153,7 +146,7 @@
(extensions (list
(service-extension shepherd-root-service-type slurmdbd-service)
(service-extension activation-service-type (const %slurmdbd-activation))
(service-extension account-service-type (const %slurm-accounts)) ) )
(service-extension account-service-type (const %slurm-accounts))))
(description "Run slurmdbd")))
;
@ -163,9 +156,9 @@
<slurmctld-configuration>
slurmctld-configuration make-slurmctld-configuration
slurmctld-configuration?
(slurm slurm-configuration-slurm (default slurm))
(slurmctld-conf slurmctld-slurmctld-conf (default (file-append slurm "/etc/slurm/slurmctld.conf")))
(log-file slurmctld-log-file (default "/var/log/slurm/slurmctld.log")))
(slurm slurm (default slurm))
(slurmctld-conf slurmctld-conf (default (file-append slurm "/etc/slurm/slurmctld.conf")))
(log-file log-file (default "/var/log/slurm/slurmctld.log")))
(define slurmctld-service
(match-lambda
@ -180,12 +173,10 @@
(list
#$(file-append slurm "/sbin/slurmctld")
"-D" "-R"
"-f" #$slurmctld-conf
)
"-f" #$slurmctld-conf )
#:log-file #$log-file
#:user (passwd:uid (getpwnam "slurm"))
#:group (passwd:gid (getpwnam "slurm"))
))
#:group (passwd:gid (getpwnam "slurm"))))
(stop #~(make-kill-destructor)))))))
(define %slurmctld-activation
@ -216,7 +207,7 @@
(extensions (list
(service-extension shepherd-root-service-type slurmctld-service)
(service-extension activation-service-type (const %slurmctld-activation))
(service-extension account-service-type (const %slurm-accounts)) ) )
(service-extension account-service-type (const %slurm-accounts))))
(description "Run slurmctld")))
;
@ -226,12 +217,11 @@
<slurmd-configuration>
slurmd-configuration make-slurmd-configuration
slurmd-configuration?
(slurm slurm-configuration-slurm (default slurm))
(slurmd-conf slurmd-slurmd-conf (default (file-append slurm "/etc/slurm/slurm.conf")))
(log-file slurmd-log-file (default "/var/log/slurm/slurmd.log"))
(slurmctld-host slurmd-slurmctld-host (default #f)); string slurmctld-host[:port]
(log-level slurmd-log-level (default #f)); string Verbose mode. Multiple -v's increase verbosity
)
(slurm slurm (default slurm))
(slurmd-conf slurmd-conf (default (file-append slurm "/etc/slurm/slurm.conf")))
(log-file log-file (default "/var/log/slurm/slurmd.log"))
(slurmctld-host slurmctld-host (default #f))
(log-level log-level (default #f)))
(define slurmd-service
(match-lambda
@ -248,16 +238,11 @@
"-D"
#$@(if slurmctld-host
(list (string-append "--conf-server" slurmctld-host))
(list (string-append "-f" slurmd-conf))
)
(list (string-append "-f" slurmd-conf)))
#$@(if log-level
(list log-level)
'()
)
)
#:log-file #$log-file
))
'()))
#:log-file #$log-file ))
(stop #~(make-kill-destructor)))))))
(define %slurmd-activation
@ -277,5 +262,5 @@
(extensions (list
(service-extension shepherd-root-service-type slurmd-service)
(service-extension activation-service-type (const %slurmd-activation))
(service-extension account-service-type (const %slurm-accounts)) ) )
(service-extension account-service-type (const %slurm-accounts))))
(description "Run slurmd")))