From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3sYp-0001Dq-JA for guix-patches@gnu.org; Sat, 22 Sep 2018 20:47:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3rhI-0006IW-Ib for guix-patches@gnu.org; Sat, 22 Sep 2018 19:52:27 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:45785) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g3rhI-0006Hf-CT for guix-patches@gnu.org; Sat, 22 Sep 2018 19:52:24 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g3nyc-0002ws-Eb for guix-patches@gnu.org; Sat, 22 Sep 2018 15:54:02 -0400 Subject: [bug#32771] [PATCH 2/2] services: Add Varnish service. Resent-Message-ID: References: <20180919133027.12799-1-mbakke@fastmail.com> <20180919133027.12799-2-mbakke@fastmail.com> From: Christopher Baines In-reply-to: <20180919133027.12799-2-mbakke@fastmail.com> Date: Sat, 22 Sep 2018 20:53:11 +0100 Message-ID: <87va6xwbq0.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Marius Bakke Cc: 32771@debbugs.gnu.org --=-=-= Content-Type: text/plain Hey Marius, I've not got much experience with Varnish, but this patch applies, and the system test passes :) Marius Bakke writes: > +@subsubheading Varnish Cache > +@cindex Varnish > +Varnish is a fast cache server that sits in between web applications > +and end users. It proxies requests from clients and caches the > +accessed URLs such that multiple requests for the same resource only > +creates one request to the back-end. > + > +@defvr {Scheme Variable} varnish-service-type > +A service type for the Varnish daemon. > +@end defvr Given there are not other service types for Varnish in Guix, "The service type ..." would probably be clearer here, or just "Service type ...". > +@deftp {Data Type} varnish-configuration > +Data type representing the @code{varnish} service configuration. > +This type has the following parameters: > + > +@table @asis > +@item @code{package} (default: @code{varnish}) > +The Varnish package to use. > + > +@item @code{name} (default: @code{"default"}) > +A name for this Varnish instance. Varnish will create a directory in > +@file{/var/varnish/} with this name and keep temporary files there. If > +the name starts with a forward slash, it is interpreted as an absolute > +directory name. Most services in Guix use /var/lib for data, would this work for Varnish? Also, I wonder if you'd considered supporing running multiple instances of varnishd, I guess the "name" might come in useful then. > +@c Varnish does not support HTTPS, so keep this URL to avoid confusion. > +For example, to mirror @url{http://www.gnu.org,www.gnu.org} with VCL you > +can do something along these lines: Does "@c" mean a comment? > +(define %varnish-accounts > + (list (user-group > + (name "varnish") > + (system? #t)) > + (user-account > + (name "varnish") > + (group "varnish") > + (system? #t) > + (comment "Varnish Cache User") > + (home-directory "/var/varnish") > + (shell (file-append shadow "/sbin/nologin"))))) > + > +(define %varnish-activation > + #~(begin > + (use-modules (guix build utils)) > + (let ((home-dir "/var/varnish") > + (user (getpwnam "varnish"))) > + (mkdir-p home-dir) > + (chown home-dir (passwd:uid user) (passwd:gid user)) > + (chmod home-dir #o755)))) Is this necessary, as I think the users home directory might be automatically created? Anyway, this looks pretty much good to me. Thanks, Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlumnadfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XfG6w/+J1m1//2ShTG/uLPKv6f9C7p9M00wFEz/1otwsoZaV8ftRZw5lkEVR5Jr AXnqRQrlGPymsdy4vqnPfa/bQECPLaDUlOUPRRdwaUa710zK03vDNUxJ9KyjneLu QOHfC5WMqAvoTvbmVua1uModX4n/4epdoMVQRhNkzLaH/IeWFJ8qveZMo2LSEr4I 59YNQT2/40OuhKuDkHQSI0ghPiKGOFKr/vnR01/nTjIuQx8JW1cAbnLRa8IzuqYp NS8Pio9hzzq6e3Dvy4pyv4t81REXiUg+uQcncTPFqDS6Hn2fr3UgTE5eaUshP72f FAZCCSoK9l29FaWKHKS9NzfO60Ib4xxSMflDsn9q1IenxAxfmY6qFe01yMTmTJIs vTSEfJQzO9SZpDsqPJ3lXJPCrvBB7XP/r5zeMTHQPuDCMsgnnbGN5H2MB9VuBHYi jjYl6b8fulwKP/Apr4flN1GF7prdM9dJQwHfUaB1UsY901pHhJNPJsfc88wSWhkn N9EvpT5XDDS/fNj5J320k7MXvIY0redLOzjXTh9y5bHP6z19yl0vkGgz+ZNYoDjN 063lsrlX+KjR3FjLmPKue9qDH6S6tYHBIZujPgifukU5ASouvg4/cvM+rUzvgfyY p44SVFKEIgo7gssVSh/ZpzULw3CrZi5ZqX9atuN0KvbS9vp6yKs= =t5w+ -----END PGP SIGNATURE----- --=-=-=--