unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: Marius Bakke <mbakke@fastmail.com>
Cc: 32771@debbugs.gnu.org
Subject: [bug#32771] [PATCH 2/2] services: Add Varnish service.
Date: Sat, 22 Sep 2018 20:53:11 +0100	[thread overview]
Message-ID: <87va6xwbq0.fsf@cbaines.net> (raw)
In-Reply-To: <20180919133027.12799-2-mbakke@fastmail.com>

[-- Attachment #1: Type: text/plain, Size: 2506 bytes --]

Hey Marius,

I've not got much experience with Varnish, but this patch applies, and
the system test passes :)

Marius Bakke <mbakke@fastmail.com> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

  reply	other threads:[~2018-09-23  0:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 13:28 [bug#32771] [PATCH 0/2] Varnish service Marius Bakke
2018-09-19 13:30 ` [bug#32771] [PATCH 1/2] gnu: varnish: Use absolute file name of "rm" Marius Bakke
2018-09-19 13:30   ` [bug#32771] [PATCH 2/2] services: Add Varnish service Marius Bakke
2018-09-22 19:53     ` Christopher Baines [this message]
2018-09-25 22:52       ` bug#32771: " Marius Bakke
2018-09-28 19:35         ` [bug#32771] " Christopher Baines
2018-09-22 17:06   ` [bug#32771] [PATCH 1/2] gnu: varnish: Use absolute file name of "rm" Christopher Baines

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87va6xwbq0.fsf@cbaines.net \
    --to=mail@cbaines.net \
    --cc=32771@debbugs.gnu.org \
    --cc=mbakke@fastmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).