GNU bug report logs - #71673
[PATCH] services: nginx: Print extra-content before the server-blocks.

Previous Next

Package: guix-patches;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Thu, 20 Jun 2024 11:17:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 71673 in the body.
You can then email your comments to 71673 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#71673; Package guix-patches. (Thu, 20 Jun 2024 11:17:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tomas Volf <~@wolfsden.cz>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 20 Jun 2024 11:17:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: guix-patches <at> gnu.org
Cc: Tomas Volf <~@wolfsden.cz>
Subject: [PATCH] services: nginx: Print extra-content before the server-blocks.
Date: Thu, 20 Jun 2024 13:14:48 +0200
The configuration file is processed sequentially, which meant that there was
no way to set for example log format shared between the server-blocks, because
the final configuration file would have this order:

  ...
  http {
    ...
    server {
    }
    ...
    $extra-content
  }

Moving the extra-content before the serialization of server-blocks resolves
this.

* gnu/services/web.scm (default-nginx-config): Move extra-content before
server-blocks.

Change-Id: Ie8286a533dfed575abc58a0f4800706b3ad6adc2
---
While this I assume *could* be considered a backwards incompatible change, I
cannot really think of anything that it would break.

 gnu/services/web.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 406117c457..e3887d0ed8 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -768,11 +768,11 @@ (define (default-nginx-config config)
                 (number->string server-names-hash-bucket-max-size)
                 ";\n")
                "")
+           extra-content
            "\n"
            (map emit-nginx-upstream-config upstream-blocks)
            (map emit-nginx-server-config server-blocks)
-           extra-content
-           "\n}\n"))))
+           "}\n"))))

 (define %nginx-accounts
   (list (user-group (name "nginx") (system? #t))
--
2.45.1




Information forwarded to guix-patches <at> gnu.org:
bug#71673; Package guix-patches. (Sun, 06 Oct 2024 15:41:01 GMT) Full text and rfc822 format available.

Message #8 received at 71673 <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: 71673 <at> debbugs.gnu.org
Cc: Tomas Volf <~@wolfsden.cz>
Subject: [PATCH v2] services: nginx: Print extra-content before the
 server-blocks.
Date: Sun,  6 Oct 2024 17:40:14 +0200
The configuration file is processed sequentially, which meant that there was
no way to set for example log format shared between the server-blocks, because
the final configuration file would have this order:

  ...
  http {
    ...
    server {
    }
    ...
    $extra-content
  }

Moving the extra-content before the serialization of server-blocks resolves
this.

* gnu/services/web.scm (default-nginx-config): Move extra-content before
server-blocks.

Change-Id: Ie8286a533dfed575abc58a0f4800706b3ad6adc2
---
Rebase on latest master.

 gnu/services/web.scm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index cc6f4e6d9b..84ce88aa80 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -770,10 +770,7 @@ (define (default-nginx-config config)
                 (number->string server-names-hash-bucket-max-size)
                 ";\n")
                "")
-           "\n"
-           (map emit-nginx-upstream-config upstream-blocks)
-           (map emit-nginx-server-config server-blocks)
-           (match extra-content
+	   (match extra-content
              ((? list? extra-content)
               (map (lambda (line)
                      `("    " ,line "\n"))
@@ -781,7 +778,10 @@ (define (default-nginx-config config)
              ;; XXX: For compatibility strings and gexp's are inserted
              ;; directly.
              (_ extra-content))
-           "\n}\n"))))
+           "\n"
+           (map emit-nginx-upstream-config upstream-blocks)
+           (map emit-nginx-server-config server-blocks)
+           "}\n"))))

 (define %nginx-accounts
   (list (user-group (name "nginx") (system? #t))
--
2.46.0




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Wed, 20 Nov 2024 22:40:02 GMT) Full text and rfc822 format available.

Notification sent to Tomas Volf <~@wolfsden.cz>:
bug acknowledged by developer. (Wed, 20 Nov 2024 22:40:02 GMT) Full text and rfc822 format available.

Message #13 received at 71673-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tomas Volf <~@wolfsden.cz>
Cc: 71673-done <at> debbugs.gnu.org
Subject: Re: [bug#71673] [PATCH v2] services: nginx: Print extra-content
 before the server-blocks.
Date: Wed, 20 Nov 2024 23:39:24 +0100
Tomas Volf <~@wolfsden.cz> skribis:

> The configuration file is processed sequentially, which meant that there was
> no way to set for example log format shared between the server-blocks, because
> the final configuration file would have this order:
>
>   ...
>   http {
>     ...
>     server {
>     }
>     ...
>     $extra-content
>   }
>
> Moving the extra-content before the serialization of server-blocks resolves
> this.
>
> * gnu/services/web.scm (default-nginx-config): Move extra-content before
> server-blocks.
>
> Change-Id: Ie8286a533dfed575abc58a0f4800706b3ad6adc2

Applied, thanks!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 19 Dec 2024 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 84 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.