3 Commits

Author SHA1 Message Date
George 117923cdcb Add .vapordns subdomain by default 2021-07-06 19:23:10 +03:00
George aef2ae70d5 Copy all answer sections from the upstream server 2021-06-12 13:19:50 -04:00
George ce2342cb8f add Gentoo ebuild and openrc init file (fix #16) 2021-06-12 12:56:54 -04:00
4 changed files with 103 additions and 1 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ func init() {
flag.StringVar(&subdomain, "subdomain", "meshname.", "subdomain used to generate config") flag.StringVar(&subdomain, "subdomain", "meshname.", "subdomain used to generate config")
flag.StringVar(&useconffile, "useconffile", "", "run daemon with a config file") flag.StringVar(&useconffile, "useconffile", "", "run daemon with a config file")
flag.StringVar(&listenAddr, "listenaddr", "[::1]:53535", "address to listen on") flag.StringVar(&listenAddr, "listenaddr", "[::1]:53535", "address to listen on")
flag.StringVar(&networksconf, "networks", "ygg=200::/7,cjd=fc00::/8,meshname=::/0", "TLD=subnet list separated by comma") flag.StringVar(&networksconf, "networks", "ygg=200::/7,cjd=fc00::/8,meshname=::/0,vapordns=::/0", "TLD=subnet list separated by comma")
flag.BoolVar(&noMeshIP, "nomeship", false, "disable .meship resolver") flag.BoolVar(&noMeshIP, "nomeship", false, "disable .meship resolver")
flag.StringVar(&getName, "getname", "", "convert IPv6 address to a name") flag.StringVar(&getName, "getname", "", "convert IPv6 address to a name")
flag.StringVar(&getIP, "getip", "", "convert a name to IPv6 address") flag.StringVar(&getIP, "getip", "", "convert a name to IPv6 address")
+72
View File
@@ -0,0 +1,72 @@
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
inherit go-module
DESCRIPTION="Meshname, a universal naming system for all IPv6-based mesh networks, including CJDNS and Yggdrasil"
HOMEPAGE="https://github.com/zhoreeq/meshname"
EGO_SUM=(
"github.com/gologme/log v1.2.0"
"github.com/gologme/log v1.2.0/go.mod"
"github.com/miekg/dns v1.1.27"
"github.com/miekg/dns v1.1.27/go.mod"
"golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod"
"golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550"
"golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod"
"golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod"
"golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod"
"golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod"
"golang.org/x/net v0.0.0-20190923162816-aa69164e4478"
"golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod"
"golang.org/x/sync v0.0.0-20190423024810-112230192c58"
"golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod"
"golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod"
"golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod"
"golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe"
"golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod"
"golang.org/x/text v0.3.0/go.mod"
"golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod"
"golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod"
)
go-module_set_globals
if [[ ${PV} != *9999* ]]; then
SRC_URI="https://github.com/zhoreeq/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="amd64 ~amd64 x86 ~x86"
else
EGIT_REPO_URI="https://github.com/zhoreeq/${PN}.git"
KEYWORDS="amd64 x86"
fi
SRC_URI+="${EGO_SUM_SRC_URI}"
LICENSE="MIT"
SLOT="0"
IUSE="systemd"
DEPEND=">dev-lang/go-1.12"
src_install() {
echo ""
exeinto /usr/bin
doexe meshnamed
dodoc README.md protocol.md
if use systemd ; then
systemd_newunit "${PN}d.service" ${PN}d.service
else
newinitd "${FILESDIR}/${PN}d.initd" ${PN}d
fi
}
pkg_postinst() {
elog "The meshname config file must be generated before use:"
elog " # meshnamed -genconf <IPv6> -subdomain meshname | tee /etc/meshnamed.conf"
elog
elog "The meshname daemon will have to be started before use:"
if use systemd ; then
elog " # systemctl start meshnamed"
else
elog " # rc-service meshnamed start"
fi
}
+28
View File
@@ -0,0 +1,28 @@
#!/sbin/openrc-run
# Distributed under the terms of the GNU General Public License v2
extra_started_commands="reload"
command="/usr/bin/meshnamed"
description="Distributed naming system for IPv6 mesh networks"
pidfile="/run/meshnamed.pid"
logfile="/var/run/meshnamed.log"
start_stop_daemon_args="--user nobody --group nobody -listenaddr '[::1]:53535' -useconffile /etc/meshnamed.conf"
start() {
ebegin "Starting Distributed naming system for IPv6 mesh networks"
start-stop-daemon --start --exec "${command}" --pidfile "${pidfile}" --background \
--stdout "${logfile}" --stderr "${logfile}"
eend $?
}
stop() {
ebegin "Distributed naming system for IPv6 mesh networks"
start-stop-daemon --stop --exec "${command}" --pidfile "${pidfile}"
eend $?
}
reload() {
stop
sleep 5
start
}
+2
View File
@@ -146,6 +146,8 @@ func (s *MeshnameServer) handleMeshnameRequest(w dns.ResponseWriter, r *dns.Msg)
} }
s.log.Debugln(resp.String()) s.log.Debugln(resp.String())
m.Answer = append(m.Answer, resp.Answer...) m.Answer = append(m.Answer, resp.Answer...)
m.Ns = append(m.Ns, resp.Ns...)
m.Extra = append(m.Extra, resp.Extra...)
} }
if err := w.WriteMsg(m); err != nil { if err := w.WriteMsg(m); err != nil {