pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/fastd add net/fastd



details:   https://anonhg.NetBSD.org/pkgsrc/rev/af0d976509e3
branches:  trunk
changeset: 454947:af0d976509e3
user:      nia <nia%pkgsrc.org@localhost>
date:      Thu Jun 24 14:01:31 2021 +0000

description:
add net/fastd


fastd is a very small VPN daemon which tunnels IP packets and Ethernet frames
over UDP. It supports various modern encryption and authentication schemes
and can be used in many different network topologies (1:1, 1:n, meshed).

diffstat:

 net/fastd/DESCR                     |   3 +
 net/fastd/Makefile                  |  76 +++++++++++++++++++++++++++++++++++++
 net/fastd/PLIST                     |   4 +
 net/fastd/distinfo                  |   7 +++
 net/fastd/files/fastd.conf          |  36 +++++++++++++++++
 net/fastd/files/fastd.sh            |  20 +++++++++
 net/fastd/patches/patch-src_iface.c |  15 +++++++
 7 files changed, 161 insertions(+), 0 deletions(-)

diffs (189 lines):

diff -r 3dac1cefe2ac -r af0d976509e3 net/fastd/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/fastd/DESCR   Thu Jun 24 14:01:31 2021 +0000
@@ -0,0 +1,3 @@
+fastd is a very small VPN daemon which tunnels IP packets and Ethernet frames
+over UDP. It supports various modern encryption and authentication schemes
+and can be used in many different network topologies (1:1, 1:n, meshed).
diff -r 3dac1cefe2ac -r af0d976509e3 net/fastd/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/fastd/Makefile        Thu Jun 24 14:01:31 2021 +0000
@@ -0,0 +1,76 @@
+# $NetBSD: Makefile,v 1.1 2021/06/24 14:01:31 nia Exp $
+
+DISTNAME=      fastd-21
+CATEGORIES=    net
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=NeoRaider/}
+GITHUB_TAG=    v${PKGVERSION_NOREV}
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://github.com/NeoRaider/fastd
+COMMENT=       Fast and small VPN tunnelling daemon
+LICENSE=       modified-bsd
+
+USE_TOOLS+=    bison pkg-config
+
+MESON_ARGS+=   -Dsystemd=disabled
+
+# breaks compatibility with older and embedded x86
+MESON_ARGS+=   -Dmac_ghash_pclmulqdq=disabled
+MESON_ARGS+=   -Dcipher_salsa20_xmm=disabled
+MESON_ARGS+=   -Dcipher_salsa2012_xmm=disabled
+
+MESON_ARGS+=   --sysconfdir=${PKG_SYSCONFDIR:Q}
+
+RCD_SCRIPTS=   fastd
+
+PYTHON_FOR_BUILD_ONLY= tool
+
+EGDIR=                 share/examples/fastd
+
+INSTALLATION_DIRS+=    ${PKGMANDIR}/man1
+INSTALLATION_DIRS+=    ${EGDIR}
+
+BUILD_DEFS+=           VARBASE
+
+.include "../../mk/bsd.prefs.mk"
+
+PKG_SYSCONFSUBDIR=     fastd
+
+CONF_FILES+=           ${PREFIX}/${EGDIR}/fastd.conf \
+                       ${PKG_SYSCONFDIR}/fastd.conf
+
+FASTD_USER?=           fastd
+FASTD_GROUP?=          fastd
+PKG_GROUPS=            ${FASTD_GROUP}
+PKG_USERS=             ${FASTD_USER}:${FASTD_GROUP}
+PKG_GROUPS_VARS=       FASTD_USER
+PKG_USERS_VARS=                FASTD_GROUP
+
+OWN_DIRS+=             ${PKG_SYSCONFDIR}/peers
+OWN_DIRS_PERMS+=       ${VARBASE}/run/fastd \
+                       ${FASTD_USER} ${FASTD_GROUP} 0755
+
+SUBST_CLASSES+=                paths
+SUBST_STAGE.paths=     pre-configure
+SUBST_MESSAGE.paths=   Fixing absolute paths.
+SUBST_FILES.paths=     fastd.conf
+SUBST_VARS.paths=      PREFIX VARBASE PKG_SYSCONFDIR
+SUBST_VARS.paths+=     FASTD_USER FASTD_GROUP
+
+FILES_SUBST+=          PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q}
+
+post-extract:
+       ${CP} ${FILESDIR}/fastd.conf ${WRKSRC}/fastd.conf
+
+post-install:
+       ${INSTALL_MAN} ${WRKSRC}/doc/fastd.1 \
+           ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/fastd.1
+       ${INSTALL_MAN} ${WRKSRC}/fastd.conf \
+           ${DESTDIR}${PREFIX}/${EGDIR}/fastd.conf
+
+.include "../../devel/meson/build.mk"
+.include "../../security/libsodium/buildlink3.mk"
+.include "../../security/libuecc/buildlink3.mk"
+.include "../../security/openssl/buildlink3.mk"
+.include "../../textproc/json-c/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r 3dac1cefe2ac -r af0d976509e3 net/fastd/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/fastd/PLIST   Thu Jun 24 14:01:31 2021 +0000
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST,v 1.1 2021/06/24 14:01:31 nia Exp $
+bin/fastd
+man/man1/fastd.1
+share/examples/fastd/fastd.conf
diff -r 3dac1cefe2ac -r af0d976509e3 net/fastd/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/fastd/distinfo        Thu Jun 24 14:01:31 2021 +0000
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2021/06/24 14:01:31 nia Exp $
+
+SHA1 (fastd-21.tar.gz) = 07b29afc9cca65c94da123a854798eeccf7f4235
+RMD160 (fastd-21.tar.gz) = 4b9f3cc72981c70b37d20d3908d06abacf88ee83
+SHA512 (fastd-21.tar.gz) = 5ddd843ece8af7fe20633c1c205a5c55b5394bcc758618143b002bfdd5e927d9183a57915d9ce59131bd161e0f77986cbe6ad78e1b8f25a28239ad96340bc6fd
+Size (fastd-21.tar.gz) = 211874 bytes
+SHA1 (patch-src_iface.c) = 0a8465db5de2eb1151ecac6611395fb77a61dba8
diff -r 3dac1cefe2ac -r af0d976509e3 net/fastd/files/fastd.conf
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/fastd/files/fastd.conf        Thu Jun 24 14:01:31 2021 +0000
@@ -0,0 +1,36 @@
+# $NetBSD: fastd.conf,v 1.1 2021/06/24 14:01:31 nia Exp $
+
+# Log warnings and errors to stderr
+log level warn;
+
+# Log everything to syslog
+log to syslog level debug;
+
+# Drop privileges and run as the fastd user
+drop capabilities yes;
+user "@FASTD_USER@";
+group "@FASTD_GROUP@";
+
+# Create a status socket
+status socket "@VARBASE@/run/fastd/fastd.sock";
+
+# Set the interface name
+mode tap;
+interface "tap0";
+
+# Support salsa2012+umac and null methods, prefer salsa2012+umac
+method "salsa2012+umac";
+method "null";
+
+# Bind to a fixed port, IPv4 only
+bind 0.0.0.0:10000;
+
+# Generate a secret key with `fastd --generate-key`
+secret "CHANGE_ME";
+
+# Set the interface MTU for TAP mode with xsalsa20/aes128 over IPv4 with a base MTU of 1492 (PPPoE)
+# (see MTU selection documentation)
+mtu 1426;
+
+# Include peers from the directory 'peers'
+include peers from "peers";
diff -r 3dac1cefe2ac -r af0d976509e3 net/fastd/files/fastd.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/fastd/files/fastd.sh  Thu Jun 24 14:01:31 2021 +0000
@@ -0,0 +1,20 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: fastd.sh,v 1.1 2021/06/24 14:01:31 nia Exp $
+#
+# PROVIDE: fastd 
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name="fastd"
+rcvar=${name}
+required_files="@PKG_SYSCONFDIR@/fastd.conf"
+pidfile="@VARBASE@/run/fastd/${name}.pid"
+command="@PREFIX@/bin/fastd"
+command_args="--daemon"
+command_args="${command_args} --pid-file ${pidfile}"
+command_args="${command_args} --config @PKG_SYSCONFDIR@/fastd.conf"
+
+load_rc_config $name
+run_rc_command "$1"
diff -r 3dac1cefe2ac -r af0d976509e3 net/fastd/patches/patch-src_iface.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/fastd/patches/patch-src_iface.c       Thu Jun 24 14:01:31 2021 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_iface.c,v 1.1 2021/06/24 14:01:31 nia Exp $
+
+Add support for NetBSD.
+
+--- src/iface.c.orig   2020-10-19 19:24:26.000000000 +0000
++++ src/iface.c
+@@ -338,7 +338,7 @@ static void cleanup_iface(UNUSED fastd_i
+ 
+ #endif
+ 
+-#elif __APPLE__
++#elif defined(__APPLE__) || defined(__NetBSD__)
+ 
+ /** Opens the TUN/TAP device */
+ static bool open_iface(fastd_iface_t *iface, const char *ifname, uint16_t mtu) {



Home | Main Index | Thread Index | Old Index