all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Apoorv Singh <apoorvs569@gmail.com>
To: 73465@debbugs.gnu.org
Subject: [bug#73465] Wireguard: Rename field private-key to private-key-file
Date: Sat, 28 Sep 2024 10:59:26 +0530	[thread overview]
Message-ID: <878qvcjqh5.fsf@gmail.com> (raw)
In-Reply-To: <87h6a4jsej.fsf@gmail.com>

Do you want me to keep both private-key and private-key-file in 
the record but still use private-key for now? but just warn about 
deprecation for the field? Something like,

```
(define-record-type* <wireguard-configuration>
  wireguard-configuration make-wireguard-configuration
  wireguard-configuration?

  ;; other fields here..

  (private-key        wireguard-configuration-private-key-file 
  ;deprecated
                      (default "/etc/wireguard/private.key"))
  (private-key-file   wireguard-configuration-private-key-file 
  ;string
                      (default "/etc/wireguard/private.key"))
```

then, in the `wireguard-configuration-file` procedure, under 
`match-record`, I should do something like,
```
  (match-record config <wireguard-configuration>
    (wireguard interface addresses port private-key peers dns   ;; 
    keeping private-key field here..
               pre-up post-up pre-down post-down table)
    (let* ((config-file (string-append interface ".conf"))
           (peer-keys (fold peers->preshared-keys (list) peers))
           (peers (map peer->config peers))
           (config
            (computed-file
             "wireguard-config"
             #~(begin
                 (use-modules (ice-9 format)
                              (srfi srfi-1))

                 (define lines
                   (list
                     ;; other stuff..

                    (when (not (string-null? #$private-key))
                      (warn-about-deprecation 'private-key
                                              #f
                                              #:replacement 
                                              'private-key-file))

                    (format #f "PostUp = ~a set %i private-key ~a\
~{ peer ~a preshared-key ~a~}" #$(file-append wireguard "/bin/wg")
#$private-key '#$peer-keys)     ;; using private-key field here 
 still..


Sorry I'm not familiar with how all this works. Just making sure 
before I commit any changes.

Also by adjust the documentation you mean edit the 
doc/guix.texi:34373 file and append something like,
```
@item @code{private-key} (default: 
@code{"/etc/wireguard/private.key"})
The private key file for the interface.  It is automatically 
generated
if the file does not exist.  'Using private-key' is deprecated use 
'private-key-file' instead.
```

-- 
- Apoorv Singh
- Sent from Emacs.




  parent reply	other threads:[~2024-09-28  6:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25  3:58 [bug#73465] [PATCH] Wireguard: Rename field private-key to private-key-file Apoorv Singh
2024-09-26 17:39 ` Sergey Trofimov
2024-09-28  5:29 ` Apoorv Singh [this message]
2024-09-30  7:04 ` [bug#73465] " Apoorv Singh
2024-10-05  3:35 ` [bug#73465] Wireguard: Deprecate and rename fields Apoorv Singh

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=878qvcjqh5.fsf@gmail.com \
    --to=apoorvs569@gmail.com \
    --cc=73465@debbugs.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.