From: Yarl Baudig <yarl-baudig@mailoo.org>
To: 59845@debbugs.gnu.org
Cc: Yarl Baudig <yarl-baudig@mailoo.org>
Subject: [bug#59845] [PATCH 4/4] doc: Add Integrated Library System section.
Date: Mon, 5 Dec 2022 22:52:24 +0100 [thread overview]
Message-ID: <20221205215224.27623-4-yarl-baudig@mailoo.org> (raw)
In-Reply-To: <20221205215224.27623-1-yarl-baudig@mailoo.org>
doc/guix.texi (System Configuration, Services): Add Integrated Library System Services section.
doc/guix.texi (System Configuration, Services, Integrated Library System Services): Add PMB.
---
doc/guix.texi | 128 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 127 insertions(+), 1 deletion(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index a79b777826..5ec72f9ce7 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -109,6 +109,7 @@ Copyright @copyright{} 2022 Reily Siegel@*
Copyright @copyright{} 2022 Simon Streit@*
Copyright @copyright{} 2022 (@*
Copyright @copyright{} 2022 John Kehayias@*
+Copyright @copyright{} 2022 Yarl Baudig
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -402,6 +403,7 @@ Services
* Guix Services:: Services relating specifically to Guix.
* Linux Services:: Services tied to the Linux kernel.
* Hurd Services:: Services specific for a Hurd System.
+* Integrated Library System Services:: ILS services.
* Miscellaneous Services:: Other services.
Defining Services
@@ -17720,6 +17722,7 @@ declaration.
* Guix Services:: Services relating specifically to Guix.
* Linux Services:: Services tied to the Linux kernel.
* Hurd Services:: Services specific for a Hurd System.
+* Integrated Library System Services:: ILS services.
* Miscellaneous Services:: Other services.
@end menu
@@ -36726,6 +36729,129 @@ An integer specifying the baud rate of the tty.
@end table
@end deftp
+@node Integrated Library System Services
+@subsection Integrated Library System Services
+
+@cindex PMB Service
+@subsubheading PMB Service
+
+@defvr {Scheme Variable} pmb-service-type
+Service type for the @uref{https://www.sigb.net/,PMB} Integrated Library System.
+The value for this service type is a @code{<pmb-configuration>} record.
+
+The PMB service needs a web server, @code{mariadb}/@code{mysql}, @code{php} and
+is only responsible for copying and changing ownership of files from the
+@code{pmb} package.
+@end defvr
+
+Let's start with a demonstration. Here is a sample system configuration (@file{pmb.scm}):
+
+@lisp
+(use-modules (gnu))
+(use-service-modules ils web networking databases)
+(use-package-modules databases)
+
+(operating-system
+ (host-name "pmb")
+ (timezone "Europe/Paris")
+ (file-systems (cons (file-system
+ (device (file-system-label "does-not-matter"))
+ (mount-point "/")
+ (type "ext4"))
+ %base-file-systems))
+ (bootloader (bootloader-configuration
+ (bootloader grub-bootloader)
+ (targets '("/dev/sdX"))))
+ (packages (cons* mariadb %base-packages))
+ (services
+ (cons* (service dhcp-client-service-type)
+ (service php-fpm-service-type
+ (php-fpm-configuration
+ (php-ini-file
+ (plain-file "php.ini"
+ %default-pmb-php-fpm-configuration))))
+ (service nginx-service-type
+ (nginx-configuration
+ (server-blocks
+ (list (nginx-server-configuration
+ (locations
+ (list
+ %default-nginx-pmb-location))
+ (listen '("localhost:8080"))
+ (root "/srv/http/pmb")
+ (index '("index.php")))))))
+ (service mysql-service-type
+ (mysql-configuration
+ (extra-content
+ %default-pmb-mysql-configuration-extra-content)))
+ (service pmb-service-type)
+ %base-services)))
+@end lisp
+
+The interesting points are as follows.
+We import the @code{mariadb} package so that we will have access to the program
+@command{mysql}. This will be useful to set the password of the database's
+administrator. We declare a @code{php-fpm} service whose @file{php.ini} file
+is set to @code{%default-pmb-php-fpm-configuration}.
+The @code{NGinx} service is declared, with a location set to
+@code{%default-nginx-pmb-location} and a root set to @file{/srv/http/pmb}, which
+is the default for the @code{http-directory} field of @code{<pmb-configuration>}.
+The @code{mysql} service is declared with an @code{extra-content} to its configuration:
+@code{default-pmb-mysql-configuration-extra-content}. Finally the pmb service.
+
+Now let's run @command{guix system container -N pmb.scm} (@pxref{Invoking guix system}).
+Run the resulting @file{/gnu/store/...run-container}.
+Note that we want to keep the state of the database and the php files (because during
+the application setup (see below), the php files will be slightly modified. That is also why
+the PMB files need to be copied (and chowned) outside the store), we need to create
+two folders, say @file{/mnt/data/pmb} and @file{/mnt/data/mysql} and pass @option{--share}
+two times. @command{nsenter} into it to set the database's administrator password.
+
+@example
+# mkdir /mnt/data/mysql /mnt/data/pmb
+# /gnu/store/...run-container --share=/mnt/data/pmb=/srv/http/pmb \
+--share=/mnt/data/mysql=/var/lib/mysql
+# nsenter -a -t <replace-with-pid>
+# mysql
+> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('guixisgreat');
+@end example
+
+Go to @uref{localhost:8080}. Follow the steps. Note that for the database server parameters,
+``localhost'' won't work, it's ``127.0.0.1'' and the user is ``root''.
+Once the installation is complete, you are redirected to the login page. The name is ``admin'',
+the password is ``admin''.
+
+Now lets detail fields.
+
+@defvr {Scheme Variable} %default-pmb-php-fpm-configuration
+This is meant to represent the content of @file{php.ini} for the
+@code{php-fpm} service for a recommended configuration.
+@end defvr
+
+@defvr {Scheme Variable} %default-pmb-mysql-configuration-extra-content
+Extra content to be added to @code{mariadb}/@code{mysql} configuration for recommended configuration.
+@end defvr
+
+@defvr {Scheme Variable} %default-nginx-pmb-location
+Location for nginx based on @code{nginx-php-location}.
+@end defvr
+
+@deftp {Data Type} pmb-configuration
+This data type represents the configuration for PMB.
+
+@table @asis
+@item @code{pmb} (default: @code{pmb})
+
+@item @code{http-directory} (default: @file{/srv/http/pmb})
+Must match a webserver's root.
+
+@item @code{php-fpm-user} (default: @code{php-fpm})
+
+@item @code{php-fpm-group} (default: @code{php-fpm})
+
+@end table
+@end deftp
+
@node Miscellaneous Services
@subsection Miscellaneous Services
@@ -38369,7 +38495,7 @@ description: Install the given fonts on the specified ttys (fonts are per
+ tty/font pairs. The font can be the name of a font provided by the `kbd'
+ package or any valid argument to `setfont', as in this example:
+
-+ '(("tty1" . "LatGrkCyr-8x16")
++ 6 '(("tty1" . "LatGrkCyr-8x16")
+ ("tty2" . (file-append
+ font-tamzen
+ "/share/kbd/consolefonts/TamzenForPowerline10x20.psf"))
--
2.38.1
next prev parent reply other threads:[~2022-12-05 21:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 21:48 [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) Yarl Baudig
2022-12-05 21:52 ` [bug#59845] [PATCH 1/4] gnu: php: Add '--enable-soap' configure option Yarl Baudig
2022-12-05 21:52 ` [bug#59845] [PATCH 2/4] gnu: Add PMB Yarl Baudig
2022-12-05 21:52 ` [bug#59845] [PATCH 3/4] gnu: Add PMB service Yarl Baudig
2022-12-05 21:52 ` Yarl Baudig [this message]
2022-12-09 11:52 ` [bug#59845] V2 yarl baudig
2022-12-09 11:53 ` [bug#59845] [PATCH v2 1/4] gnu: php: Add '--enable-soap' configure option Yarl Baudig
2022-12-09 11:53 ` [bug#59845] [PATCH v2 2/4] gnu: Add PMB Yarl Baudig
2022-12-20 14:56 ` [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) Ludovic Courtès
2022-12-09 11:53 ` [bug#59845] [PATCH v2 3/4] gnu: Add PMB service Yarl Baudig
2022-12-20 15:03 ` [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) Ludovic Courtès
2022-12-09 11:53 ` [bug#59845] [PATCH v2 4/4] doc: Add Integrated Library System section Yarl Baudig
2022-12-20 15:13 ` [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) Ludovic Courtès
2022-12-22 17:18 ` yarl baudig
2022-12-22 22:40 ` Ludovic Courtès
2022-12-23 8:17 ` yarl baudig
2022-12-25 17:26 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221205215224.27623-4-yarl-baudig@mailoo.org \
--to=yarl-baudig@mailoo.org \
--cc=59845@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.