From: "Gábor Boskovits" <boskovits@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 37388@debbugs.gnu.org
Subject: bug#37388: <nginx-configuration> can lead to syntactically invalid configs
Date: Thu, 12 Sep 2019 14:49:10 +0200 [thread overview]
Message-ID: <CAE4v=piOdgg0wSL2VDJYo07nMPSYYUMvYvPhGnnBVQ_nVzHc+Q@mail.gmail.com> (raw)
In-Reply-To: <87d0g6q752.fsf@inria.fr>
[-- Attachment #1: Type: text/plain, Size: 2362 bytes --]
Hello,
Ludovic Courtès <ludo@gnu.org> ezt írta (időpont: 2019. szept. 12., Cs,
9:58):
> 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.
>
>
I would most probably go for the sexp version.
> Thoughts?
>
I would like to add some more information to this, which I encountered when
trying to find a solution to the last-modified issue:
1. the nginx configuration can only be extended using server blocks, so it
is not possible to inject a location or a nested location.
2. the meaning of the nginx configuration can dependent on the order of
directives in the configuration. Either we should give
and explicit mechanism for dealing with that, or disallow such
configurations.
If you feel these points to be off topic, then I can open a separate bug
for that, but these seem to relate to the confgiuration mechanism,
and should be considered when designing the new interface. Wdyt?
>
> Ludo’.
>
>
>
>
Best regards,
g_bor
--
OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:CF63:0B21
[-- Attachment #2: Type: text/html, Size: 3295 bytes --]
next prev parent reply other threads:[~2019-09-12 12:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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='CAE4v=piOdgg0wSL2VDJYo07nMPSYYUMvYvPhGnnBVQ_nVzHc+Q@mail.gmail.com' \
--to=boskovits@gmail.com \
--cc=37388@debbugs.gnu.org \
--cc=ludo@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.