all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#37388: <nginx-configuration> can lead to syntactically invalid configs
@ 2019-09-12  7:57 Ludovic Courtès
  2019-09-12 12:49 ` Gábor Boskovits
  2019-09-14 10:02 ` Christopher Baines
  0 siblings, 2 replies; 7+ messages in thread
From: Ludovic Courtès @ 2019-09-12  7:57 UTC (permalink / raw)
  To: bug-Guix

Hello Guix!

It’s nice that we have <nginx-configuration> but I noticed that, unlike
most or all other configuration records that we have, it’s possible to
create an <nginx-configuration> record that leads to a syntactically
invalid nginx config file.

For example, if you have a location block like this:

        (nginx-location-configuration
          (uri "/manual/")
          (body (list "alias /srv/guix-manual")))

Guix will silently create an invalid nginx config file, which you’ll
only notice once you’ve reconfigured and nginx fails to start.

See why?  That’s because we’re missing a semicolon in the “alias”
directive, and that directive is spit out directly as is.

To address it, we could have record types for <alias>, <root>, and all
the directives out there; it could be tedious, unless we automate it,
effectively creating a complete EDSL.

Another approach would be to have an sexp representation of the nginx
configuration language.  That’d effectively replace semicolons with
parentheses :-), but more importantly, that would allow us to not paste
strings as-is in the resulting config file.  The downside is that it’s
very much “free style” compared to records, but we could still
pattern-match the sexp to validate certain properties.

Thoughts?

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-24 15:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-12  7:57 bug#37388: <nginx-configuration> can lead to syntactically invalid configs Ludovic Courtès
2019-09-12 12:49 ` Gábor Boskovits
2019-09-14  9:48   ` Ludovic Courtès
2019-09-14 10:02 ` Christopher Baines
2019-09-14 12:26   ` Ludovic Courtès
2019-09-14 15:45     ` Christopher Baines
2020-08-24 15:35   ` Ludovic Courtès

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.