Package Details: wg2nd 0.2.1-2

Git Clone URL: https://aur.archlinux.org/wg2nd.git (read-only, click to copy)
Package Base: wg2nd
Description: A utility to convert WireGuard configurations from wg-quick(8) format into systemd-networkd compatible configurations.
Upstream URL: https://www.git.flu0r1ne.net/wg2nd/about/
Licenses: GPL, MIT
Submitter: flu0r1ne
Maintainer: flu0r1ne
Last Packager: flu0r1ne
Votes: 0
Popularity: 0.000000
First Submitted: 2023-09-12 21:46 (UTC)
Last Updated: 2024-06-05 21:56 (UTC)

Dependencies (3)

Required by (0)

Sources (1)

Latest Comments

ato2 commented on 2024-11-19 07:25 (UTC)

On latest current, makepkg ==> Making package: wg2nd 0.2.1-2 (Tue Nov 19 08:23:11 2024) ==> Checking runtime dependencies... ==> Checking buildtime dependencies... ==> Retrieving sources... -> Cloning wg2nd git repo... Cloning into bare repository '/srv/src/wg2nd'... fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists. ==> ERROR: Failure while downloading wg2nd git repo Aborting...

flu0r1ne commented on 2023-11-22 06:03 (UTC)

I was unable to replicate the issue, but I removed the .git suffix from source. The source can be downloaded from both URLs on my side; therefore, I opted for the URL without the .git suffix. I hope this resolves the issue.

itoffshore commented on 2023-11-22 00:33 (UTC)

I still see the source error (due to .git) in yay:

==> Making package: wg2nd 0.2.0-1 (Wed 22 Nov 2023 00:06:16 GMT)
==> Retrieving sources...
  -> Cloning wg2nd git repo...
Cloning into bare repository '/var/build/sources/wg2nd'...
fatal: repository 'https://git.flu0r1ne.net/wg2nd.git/' not found
==> ERROR: Failure while downloading wg2nd git repo
    Aborting...
 -> error downloading sources: /tmp/makepkg/wg2nd 
         context: exit status 1 


:: (1/1) Parsing SRCINFO: wg2nd
==> Making package: wg2nd 0.2.0-1 (Wed 22 Nov 2023 00:06:19 GMT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Cloning wg2nd git repo...
Cloning into bare repository '/var/build/sources/wg2nd'...
fatal: repository 'https://git.flu0r1ne.net/wg2nd.git/' not found
==> ERROR: Failure while downloading wg2nd git repo
    Aborting...
 -> error making: wg2nd-exit status 1
 -> Failed to install the following packages. Manual intervention is required:
wg2nd - exit status 1

& also from makepkg -s (using the PKGBUILD from the latest snapshot)

==> Making package: wg2nd 0.2.0-1 (Wed 22 Nov 2023 00:27:48 GMT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Cloning wg2nd git repo...
Cloning into bare repository '/var/build/sources/wg2nd'...
fatal: repository 'https://git.flu0r1ne.net/wg2nd.git/' not found
==> ERROR: Failure while downloading wg2nd git repo
    Aborting...

removing the .git lets the build complete:

source=("git+git://git.flu0r1ne.net/wg2nd#tag=$_pkgver")
...
==> Finished making: wg2nd 0.2.0-1 (Wed 22 Nov 2023 00:31:01 GMT)

flu0r1ne commented on 2023-11-21 02:58 (UTC)

I updated to v0.2.0 and removed the 'v' from the version number.

.git needs to be removed from source.

I'm not sure what you mean by this. I was able to perform a clean install with:

git clone https://aur.archlinux.org/wg2nd.git
makepkg
sudo pacman -U wg2nd-0.2.0-1-x86_64.pkg.tar.zst

The rest of the issues are addressed on the GitHub mirror. Thanks.

itoffshore commented on 2023-11-10 23:48 (UTC) (edited on 2023-11-11 15:35 (UTC) by itoffshore)

The following PKGBUILD changes fix the current build error:

pkgver=0.1.0
_pkgver=v$pkgver
source=("git+git://git.flu0r1ne.net/wg2nd#tag=$_pkgver")
  • .git needs to be removed from source
  • pkgver should be major / minor integers (0.1.0) - which builds a correct pkg name of wg2nd-0.1.0-1-x86_64.pkg.tar.zst

Improvement ideas:

  • I think in https://git.flu0r1ne.net/wg2nd/tree/src/main.cpp#n228 - you should be checking if wg2nd is being run as root before trying to set root permissions. Or perhaps better to just quit with a message if not being run as root (so the secure permissions are always applied to the output files).

  • Generating keyfiles would be nice as an option (or perhaps NOT generating keyfiles as a --nokeys option & using PresharedKey / PrivateKey embedded in the netdev file). This would reduce the number of configuration files & leave a single netdev file to set permissions on. This --nokeys option would also allow configuration to be created locally without incorrect key paths.

  • Including in the netdev the # Name: host_label comment from wg-meshconf config output (that appears just under each [peer] section) would also be useful.
  • The netdev names are generated automatically from the detected # Name: host_label - this would be nice to override too as users may have firewall scripts across their hosts that a expect standard interface name (e.g wg0)
  • ActivationPolicy = up is probably a better default than manual - & could also be made configurable via a command line option.
  • ipv4 routing entries should probably have Scope=link set.

wg2nd works well with output from wg-meshconf - which I forked to add preshared keys:

#!/bin/sh
# run this as root

input_dir='/path/to/wg-meshconf/output'
config_list=$(ls $input_dir/*.conf)

if [ -n "$config_list" ]; then
        for x in $config_list; do
                output=$(echo "${x%.*}")
                mkdir -p $output
                echo "creating files in $output from $x"
                wg2nd install -o $output $x
        done
fi

wg2nd is very useful - thanks very much ;o)