From 052fdd3edf80f27daf6fd8095b3d60fe3dbcb511 Mon Sep 17 00:00:00 2001 From: vadym Date: Thu, 9 Sep 2021 10:30:55 +0300 Subject: [PATCH] changed names --- .circleci/config.yml | 70 +++++++++---------- CHANGELOG.md | 44 ++++++------ build | 8 +-- contrib/ansible/genkeys.go | 8 +-- contrib/apparmor/usr.bin.yggdrasil | 6 +- contrib/busybox-init/S42yggdrasil | 16 ++--- contrib/deb/generate.sh | 52 +++++++------- contrib/docker/Dockerfile | 4 +- contrib/docker/entrypoint.sh | 4 +- contrib/freebsd/yggdrasil | 64 ++++++++--------- contrib/macos/create-pkg.sh | 32 ++++----- contrib/macos/yggdrasil.plist | 8 +-- contrib/msi/build-msi.sh | 18 ++--- contrib/openrc/yggdrasil | 8 +-- contrib/semver/name.sh | 6 +- .../systemd/yggdrasil-default-config.service | 14 ++-- contrib/systemd/yggdrasil.service | 12 ++-- contrib/yggdrasil-brute-simple/Makefile | 10 +-- contrib/yggdrasil-brute-simple/README.md | 2 +- contrib/yggdrasil-brute-simple/util.c | 4 +- .../yggdrasil-brute-multi-curve25519.c | 6 +- .../yggdrasil-brute-multi-ed25519.c | 6 +- misc/run-schannel-netns | 12 ++-- misc/run-twolink-test | 4 +- src/address/address.go | 8 +-- src/config/config.go | 2 +- src/defaults/defaults.go | 2 +- src/defaults/defaults_darwin.go | 6 +- src/defaults/defaults_freebsd.go | 6 +- src/defaults/defaults_linux.go | 6 +- src/defaults/defaults_openbsd.go | 6 +- src/defaults/defaults_other.go | 4 +- src/defaults/defaults_windows.go | 4 +- src/multicast/multicast_darwin.go | 2 +- src/tuntap/conn.go | 8 +-- src/tuntap/tun.go | 6 +- src/util/util.go | 2 +- 37 files changed, 240 insertions(+), 240 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 34575f96..2099063e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,9 +37,9 @@ jobs: echo 'export CIVERSIONRPM=$(sh contrib/semver/version.sh --bare | tr "-" ".")' >> $BASH_ENV echo 'export CIBRANCH=$(echo $CIRCLE_BRANCH | tr -d "/")' >> $BASH_ENV case "$CINAME" in \ - "yggdrasil") (echo 'export CICONFLICTS=yggdrasil-develop' >> $BASH_ENV) ;; \ - "yggdrasil-develop") (echo 'export CICONFLICTS=yggdrasil' >> $BASH_ENV) ;; \ - *) (echo 'export CICONFLICTS="yggdrasil yggdrasil-develop"' >> $BASH_ENV) ;; \ + "mesh") (echo 'export CICONFLICTS=mesh-develop' >> $BASH_ENV) ;; \ + "mesh-develop") (echo 'export CICONFLICTS=mesh' >> $BASH_ENV) ;; \ + *) (echo 'export CICONFLICTS="mesh mesh-develop"' >> $BASH_ENV) ;; \ esac git config --global user.email "$(git log --format='%ae' HEAD -1)"; git config --global user.name "$(git log --format='%an' HEAD -1)"; @@ -55,43 +55,43 @@ jobs: name: Test debug builds command: | ./build -d - test -f yggdrasil && test -f yggdrasilctl + test -f mesh && test -f meshctl - run: name: Build for Linux (including Debian packages) command: | - rm -f {yggdrasil,yggdrasilctl} - PKGARCH=amd64 sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/$CINAME-$CIVERSION-linux-amd64 && mv yggdrasilctl /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-linux-amd64; - PKGARCH=i386 sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/$CINAME-$CIVERSION-linux-i386 && mv yggdrasilctl /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-linux-i386; - PKGARCH=mipsel sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/$CINAME-$CIVERSION-linux-mipsel && mv yggdrasilctl /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-linux-mipsel; - PKGARCH=mips sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/$CINAME-$CIVERSION-linux-mips && mv yggdrasilctl /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-linux-mips; - PKGARCH=armhf sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/$CINAME-$CIVERSION-linux-armhf && mv yggdrasilctl /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-linux-armhf; - PKGARCH=armel sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/$CINAME-$CIVERSION-linux-armel && mv yggdrasilctl /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-linux-armel; - PKGARCH=arm64 sh contrib/deb/generate.sh && mv yggdrasil /tmp/upload/$CINAME-$CIVERSION-linux-arm64 && mv yggdrasilctl /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-linux-arm64; + rm -f {mesh,meshctl} + PKGARCH=amd64 sh contrib/deb/generate.sh && mv mesh /tmp/upload/$CINAME-$CIVERSION-linux-amd64 && mv meshctl /tmp/upload/$CINAME-$CIVERSION-meshctl-linux-amd64; + PKGARCH=i386 sh contrib/deb/generate.sh && mv mesh /tmp/upload/$CINAME-$CIVERSION-linux-i386 && mv meshctl /tmp/upload/$CINAME-$CIVERSION-meshctl-linux-i386; + PKGARCH=mipsel sh contrib/deb/generate.sh && mv mesh /tmp/upload/$CINAME-$CIVERSION-linux-mipsel && mv meshctl /tmp/upload/$CINAME-$CIVERSION-meshctl-linux-mipsel; + PKGARCH=mips sh contrib/deb/generate.sh && mv mesh /tmp/upload/$CINAME-$CIVERSION-linux-mips && mv meshctl /tmp/upload/$CINAME-$CIVERSION-meshctl-linux-mips; + PKGARCH=armhf sh contrib/deb/generate.sh && mv mesh /tmp/upload/$CINAME-$CIVERSION-linux-armhf && mv meshctl /tmp/upload/$CINAME-$CIVERSION-meshctl-linux-armhf; + PKGARCH=armel sh contrib/deb/generate.sh && mv mesh /tmp/upload/$CINAME-$CIVERSION-linux-armel && mv meshctl /tmp/upload/$CINAME-$CIVERSION-meshctl-linux-armel; + PKGARCH=arm64 sh contrib/deb/generate.sh && mv mesh /tmp/upload/$CINAME-$CIVERSION-linux-arm64 && mv meshctl /tmp/upload/$CINAME-$CIVERSION-meshctl-linux-arm64; mv *.deb /tmp/upload/ - run: name: Build for Linux (RPM packages) command: | - git clone https://github.com/RiV-chain/yggdrasil-package-rpm ~/rpmbuild/SPECS + git clone https://github.com/RiV-chain/mesh-package-rpm ~/rpmbuild/SPECS cd ../ && tar -czvf ~/rpmbuild/SOURCES/v$CIVERSIONRPM --transform "s/project/RiV-mesh-$CIBRANCH-$CIVERSIONRPM/" project - sed -i "s/RiV-mesh/RiV-mesh-$CIBRANCH/" ~/rpmbuild/SPECS/yggdrasil.spec - sed -i "s/^PKGNAME=yggdrasil/PKGNAME=yggdrasil-$CIBRANCH/" ~/rpmbuild/SPECS/yggdrasil.spec - sed -i "s/^Name\:.*/Name\: $CINAME/" ~/rpmbuild/SPECS/yggdrasil.spec - sed -i "s/^Version\:.*/Version\: $CIVERSIONRPM/" ~/rpmbuild/SPECS/yggdrasil.spec - sed -i "s/^Conflicts\:.*/Conflicts\: $CICONFLICTS/" ~/rpmbuild/SPECS/yggdrasil.spec - cat ~/rpmbuild/SPECS/yggdrasil.spec - GOARCH=amd64 rpmbuild -v --nodeps --target=x86_64 -ba ~/rpmbuild/SPECS/yggdrasil.spec - #GOARCH=386 rpmbuild -v --nodeps --target=i386 -bb ~/rpmbuild/SPECS/yggdrasil.spec + sed -i "s/RiV-mesh/RiV-mesh-$CIBRANCH/" ~/rpmbuild/SPECS/mesh.spec + sed -i "s/^PKGNAME=mesh/PKGNAME=mesh-$CIBRANCH/" ~/rpmbuild/SPECS/mesh.spec + sed -i "s/^Name\:.*/Name\: $CINAME/" ~/rpmbuild/SPECS/mesh.spec + sed -i "s/^Version\:.*/Version\: $CIVERSIONRPM/" ~/rpmbuild/SPECS/mesh.spec + sed -i "s/^Conflicts\:.*/Conflicts\: $CICONFLICTS/" ~/rpmbuild/SPECS/mesh.spec + cat ~/rpmbuild/SPECS/mesh.spec + GOARCH=amd64 rpmbuild -v --nodeps --target=x86_64 -ba ~/rpmbuild/SPECS/mesh.spec + #GOARCH=386 rpmbuild -v --nodeps --target=i386 -bb ~/rpmbuild/SPECS/mesh.spec find ~/rpmbuild/RPMS/ -name '*.rpm' -exec mv {} /tmp/upload \; find ~/rpmbuild/SRPMS/ -name '*.rpm' -exec mv {} /tmp/upload \; - run: name: Build for EdgeRouter and VyOS command: | - rm -f {yggdrasil,yggdrasilctl} - git clone https://github.com/neilalexander/vyatta-yggdrasil /tmp/vyatta-yggdrasil; - cd /tmp/vyatta-yggdrasil; + rm -f {mesh,meshctl} + git clone https://github.com/neilalexander/vyatta-mesh /tmp/vyatta-mesh; + cd /tmp/vyatta-mesh; BUILDDIR_YGG=$CIRCLE_WORKING_DIRECTORY ./build-edgerouter-x $CIRCLE_BRANCH; BUILDDIR_YGG=$CIRCLE_WORKING_DIRECTORY ./build-edgerouter-lite $CIRCLE_BRANCH; BUILDDIR_YGG=$CIRCLE_WORKING_DIRECTORY ./build-vyos-i386 $CIRCLE_BRANCH @@ -140,8 +140,8 @@ jobs: name: Build for macOS command: | GO111MODULE=on GOOS=darwin GOARCH=amd64 ./build - cp yggdrasil /tmp/upload/$CINAME-$CIVERSION-darwin-amd64 - cp yggdrasilctl /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-darwin-amd64; + cp mesh /tmp/upload/$CINAME-$CIVERSION-darwin-amd64 + cp meshctl /tmp/upload/$CINAME-$CIVERSION-meshctl-darwin-amd64; - run: name: Build for macOS (.pkg format) @@ -181,23 +181,23 @@ jobs: - run: name: Build for OpenBSD command: | - rm -f {yggdrasil,yggdrasilctl} - GOOS=openbsd GOARCH=amd64 ./build && mv yggdrasil /tmp/upload/$CINAME-$CIVERSION-openbsd-amd64 && mv yggdrasilctl /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-openbsd-amd64; - GOOS=openbsd GOARCH=386 ./build && mv yggdrasil /tmp/upload/$CINAME-$CIVERSION-openbsd-i386 && mv yggdrasilctl /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-openbsd-i386; + rm -f {mesh,meshctl} + GOOS=openbsd GOARCH=amd64 ./build && mv mesh /tmp/upload/$CINAME-$CIVERSION-openbsd-amd64 && mv meshctl /tmp/upload/$CINAME-$CIVERSION-meshctl-openbsd-amd64; + GOOS=openbsd GOARCH=386 ./build && mv mesh /tmp/upload/$CINAME-$CIVERSION-openbsd-i386 && mv meshctl /tmp/upload/$CINAME-$CIVERSION-meshctl-openbsd-i386; - run: name: Build for FreeBSD command: | - rm -f {yggdrasil,yggdrasilctl} - GOOS=freebsd GOARCH=amd64 ./build && mv yggdrasil /tmp/upload/$CINAME-$CIVERSION-freebsd-amd64 && mv yggdrasilctl /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-freebsd-amd64; - GOOS=freebsd GOARCH=386 ./build && mv yggdrasil /tmp/upload/$CINAME-$CIVERSION-freebsd-i386 && mv yggdrasilctl /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-freebsd-i386; + rm -f {mesh,meshctl} + GOOS=freebsd GOARCH=amd64 ./build && mv mesh /tmp/upload/$CINAME-$CIVERSION-freebsd-amd64 && mv meshctl /tmp/upload/$CINAME-$CIVERSION-meshctl-freebsd-amd64; + GOOS=freebsd GOARCH=386 ./build && mv mesh /tmp/upload/$CINAME-$CIVERSION-freebsd-i386 && mv meshctl /tmp/upload/$CINAME-$CIVERSION-meshctl-freebsd-i386; - run: name: Build for Windows command: | - rm -f {yggdrasil,yggdrasilctl} - GOOS=windows GOARCH=amd64 ./build && mv yggdrasil.exe /tmp/upload/$CINAME-$CIVERSION-windows-amd64.exe && mv yggdrasilctl.exe /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-windows-amd64.exe; - GOOS=windows GOARCH=386 ./build && mv yggdrasil.exe /tmp/upload/$CINAME-$CIVERSION-windows-i386.exe && mv yggdrasilctl.exe /tmp/upload/$CINAME-$CIVERSION-yggdrasilctl-windows-i386.exe; + rm -f {mesh,meshctl} + GOOS=windows GOARCH=amd64 ./build && mv mesh.exe /tmp/upload/$CINAME-$CIVERSION-windows-amd64.exe && mv meshctl.exe /tmp/upload/$CINAME-$CIVERSION-meshctl-windows-amd64.exe; + GOOS=windows GOARCH=386 ./build && mv mesh.exe /tmp/upload/$CINAME-$CIVERSION-windows-i386.exe && mv meshctl.exe /tmp/upload/$CINAME-$CIVERSION-meshctl-windows-i386.exe; - persist_to_workspace: root: /tmp diff --git a/CHANGELOG.md b/CHANGELOG.md index 17a7bf24..9c059959 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,7 +56,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - The greedy routing scheme, used to forward all traffic in previous releases, is now only used for protocol traffic (i.e. DHT setup and source route discovery) - The routing logic now lives in a [standalone library](https://github.com/Arceliar/ironwood). You are encouraged **not** to use it, as it's still considered pre-alpha, but it's available for those who want to experiment with the new routing algorithm in other contexts - Session MTUs may be slightly lower now, in order to accommodate large packet headers if required -- Many of the admin functions available over `yggdrasilctl` have been changed or removed as part of rewrites to the code +- Many of the admin functions available over `meshctl` have been changed or removed as part of rewrites to the code - Several remote `debug` functions have been added temporarily, to allow for crawling and census gathering during the transition to the new version, but we intend to remove this at some point in the (possibly distant) future - The list of available functions will likely be expanded in future releases - The configuration file format has been updated in response to the changed/removed features @@ -79,7 +79,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [0.3.16] - 2021-03-18 ### Added -- New simulation code under `cmd/yggdrasilsim` (work-in-progress) +- New simulation code under `cmd/meshsim` (work-in-progress) ### Changed - Multi-threading in the switch @@ -121,7 +121,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - `DisconnectPeer` and `RemovePeer` have been separated and implemented properly now - Less nodes are stored in the DHT now, reducing ambient network traffic and possible instability -- Default config file for FreeBSD is now at `/usr/local/etc/yggdrasil.conf` instead of `/etc/yggdrasil.conf` +- Default config file for FreeBSD is now at `/usr/local/etc/mesh.conf` instead of `/etc/mesh.conf` ## [0.3.14] - 2020-03-28 ### Fixed @@ -180,9 +180,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - Go 1.13 or later is now required for building Mesh - Some exported API functions have been updated to work with standard Go interfaces: - - `net.Conn` instead of `yggdrasil.Conn` - - `net.Dialer` (the interface it would satisfy if it wasn't a concrete type) instead of `yggdrasil.Dialer` - - `net.Listener` instead of `yggdrasil.Listener` + - `net.Conn` instead of `mesh.Conn` + - `net.Dialer` (the interface it would satisfy if it wasn't a concrete type) instead of `mesh.Dialer` + - `net.Listener` instead of `mesh.Listener` - Session metadata is now updated correctly when a search completes for a node to which we already have an open session - Multicast module reloading behaviour has been improved @@ -192,14 +192,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [0.3.10] - 2019-10-10 ### Added -- The core library now includes several unit tests for peering and `yggdrasil.Conn` connections +- The core library now includes several unit tests for peering and `mesh.Conn` connections ### Changed - On recent Linux kernels, Mesh will now set the `tcp_congestion_control` algorithm used for its own TCP sockets to [BBR](https://github.com/google/bbr), which reduces latency under load - The systemd service configuration in `contrib` (and, by extension, some of our packages) now attempts to load the `tun` module, in case TUN/TAP support is available but not loaded, and it restricts Mesh to the `CAP_NET_ADMIN` capability for managing the TUN/TAP adapter, rather than letting it do whatever the (typically `root`) user can do ### Fixed -- The `yggdrasil.Conn.RemoteAddr()` function no longer blocks, fixing a deadlock when CKR is used while under heavy load +- The `mesh.Conn.RemoteAddr()` function no longer blocks, fixing a deadlock when CKR is used while under heavy load ## [0.3.9] - 2019-09-27 ### Added @@ -271,16 +271,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [0.3.6] - 2019-08-03 ### Added -- Mesh now has a public API with interfaces such as `yggdrasil.ConnDialer`, `yggdrasil.ConnListener` and `yggdrasil.Conn` for using Mesh as a transport directly within applications +- Mesh now has a public API with interfaces such as `mesh.ConnDialer`, `mesh.ConnListener` and `mesh.Conn` for using Mesh as a transport directly within applications - Session gatekeeper functions, part of the API, which can be used to control whether to allow or reject incoming or outgoing sessions dynamically (compared to the previous fixed whitelist/blacklist approach) - Support for logging to files or syslog (where supported) - Platform defaults now include the ability to set sane defaults for multicast interfaces ### Changed - Following a massive refactoring exercise, Mesh's codebase has now been broken out into modules -- Core node functionality in the `yggdrasil` package with a public API +- Core node functionality in the `mesh` package with a public API - This allows Mesh to be integrated directly into other applications and used as a transport - - IP-specific code has now been moved out of the core `yggdrasil` package, making Mesh effectively protocol-agnostic + - IP-specific code has now been moved out of the core `mesh` package, making Mesh effectively protocol-agnostic - Multicast peer discovery functionality is now in the `multicast` package - Admin socket functionality is now in the `admin` package and uses the Mesh public API - TUN/TAP, ICMPv6 and all IP-specific functionality is now in the `tuntap` package @@ -328,7 +328,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Admin socket `getTunTap` call now returns properly instead of claiming no interface is enabled in all cases -- Handling of `getRoutes` etc in `yggdrasilctl` is now working +- Handling of `getRoutes` etc in `meshctl` is now working - Local interface names are no longer leaked in multicast packets - Link-local TCP connections, particularly those initiated because of multicast beacons, are now always correctly scoped for the target interface - Mesh now correctly responds to multicast interfaces going up and down during runtime @@ -380,14 +380,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Adds flags `-c`, `-l` and `-t` to `build` script for specifying `GCFLAGS`, `LDFLAGS` or whether to keep symbol/DWARF tables ### Changed -- Default `AdminListen` in newly generated config is now `unix:///var/run/yggdrasil.sock` +- Default `AdminListen` in newly generated config is now `unix:///var/run/mesh.sock` - Formatting of `getRoutes` in the admin socket has been improved -- Debian package now adds `yggdrasil` group to assist with `AF_UNIX` admin socket permissions +- Debian package now adds `mesh` group to assist with `AF_UNIX` admin socket permissions - Crypto, address and other utility code refactored into separate Go packages ### Fixed - Switch peer convergence is now much faster again (previously it was taking up to a minute once the peering was established) -- `yggdrasilctl` is now less prone to crashing when parameters are specified incorrectly +- `meshctl` is now less prone to crashing when parameters are specified incorrectly - Panic fixed when `Peers` or `InterfacePeers` was commented out ## [0.3.0] - 2018-12-12 @@ -398,19 +398,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - New macOS .pkgs built automatically by CircleCI - Add Dockerfile to repository for Docker support - Add `-json` command line flag for generating and normalising configuration in plain JSON instead of HJSON -- Build name and version numbers are now imprinted onto the build, accessible through `yggdrasil -version` and `yggdrasilctl getSelf` +- Build name and version numbers are now imprinted onto the build, accessible through `mesh -version` and `meshctl getSelf` - Add ability to disable admin socket by setting `AdminListen` to `"none"` -- `yggdrasilctl` now tries to look for the default configuration file to find `AdminListen` if `-endpoint` is not specified -- `yggdrasilctl` now returns more useful logging in the event of a fatal error +- `meshctl` now tries to look for the default configuration file to find `AdminListen` if `-endpoint` is not specified +- `meshctl` now returns more useful logging in the event of a fatal error ### Changed - Switched to Chord DHT (instead of Kademlia, although still compatible at the protocol level) -- The `AdminListen` option and `yggdrasilctl` now default to `unix:///var/run/yggdrasil.sock` on BSDs, macOS and Linux +- The `AdminListen` option and `meshctl` now default to `unix:///var/run/mesh.sock` on BSDs, macOS and Linux - Cleaned up some of the parameter naming in the admin socket - Latency-based parent selection for the switch instead of uptime-based (should help to avoid high latency links somewhat) - Real peering endpoints now shown in the admin socket `getPeers` call to help identify peerings - Reuse the multicast port on supported platforms so that multiple Mesh processes can run -- `yggdrasilctl` now has more useful help text (with `-help` or when no arguments passed) +- `meshctl` now has more useful help text (with `-help` or when no arguments passed) ### Fixed - Memory leaks in the DHT fixed @@ -444,7 +444,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [0.2.5] - 2018-07-19 ### Changed -- Make `yggdrasilctl` less case sensitive +- Make `meshctl` less case sensitive - More verbose TCP disconnect messages ### Fixed @@ -475,7 +475,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [0.2.2] - 2018-06-21 ### Added -- Add `yggdrasilconf` utility for testing with the `vyatta-yggdrasil` package. +- Add `meshconf` utility for testing with the `vyatta-mesh` package. - Add a randomized retry delay after TCP disconnects, to prevent synchronization livelocks. ### Changed diff --git a/build b/build index 4d4686ce..d92c421a 100755 --- a/build +++ b/build @@ -34,16 +34,16 @@ if [ $IOS ]; then echo "Building framework for iOS" go get golang.org/x/mobile/bind gomobile bind -target ios -tags mobile -o Mesh.framework -ldflags="$LDFLAGS $STRIP" -gcflags="$GCFLAGS" \ - github.com/RiV-chain/yggdrasil-extras/src/mobile \ + github.com/RiV-chain/mesh-extras/src/mobile \ github.com/RiV-chain/RiV-mesh/src/config elif [ $ANDROID ]; then echo "Building aar for Android" go get golang.org/x/mobile/bind - gomobile bind -target android -tags mobile -o yggdrasil.aar -ldflags="$LDFLAGS $STRIP" -gcflags="$GCFLAGS" \ - github.com/RiV-chain/yggdrasil-extras/src/mobile \ + gomobile bind -target android -tags mobile -o mesh.aar -ldflags="$LDFLAGS $STRIP" -gcflags="$GCFLAGS" \ + github.com/RiV-chain/mesh-extras/src/mobile \ github.com/RiV-chain/RiV-mesh/src/config else - for CMD in yggdrasil yggdrasilctl ; do + for CMD in mesh meshctl ; do echo "Building: $CMD" go build $ARGS -ldflags="$LDFLAGS" -gcflags="$GCFLAGS" ./cmd/$CMD diff --git a/contrib/ansible/genkeys.go b/contrib/ansible/genkeys.go index b7e8351d..5d941ad1 100644 --- a/contrib/ansible/genkeys.go +++ b/contrib/ansible/genkeys.go @@ -1,6 +1,6 @@ /* -This file generates crypto keys for [ansible-yggdrasil](https://github.com/jcgruenhage/ansible-yggdrasil/) +This file generates crypto keys for [ansible-mesh](https://github.com/jcgruenhage/ansible-mesh/) */ package main @@ -57,8 +57,8 @@ func main() { return } defer file.Close() - file.WriteString(fmt.Sprintf("yggdrasil_public_key: %v\n", hex.EncodeToString(keys[i].pub))) - file.WriteString("yggdrasil_private_key: \"{{ vault_yggdrasil_private_key }}\"\n") + file.WriteString(fmt.Sprintf("mesh_public_key: %v\n", hex.EncodeToString(keys[i].pub))) + file.WriteString("mesh_private_key: \"{{ vault_mesh_private_key }}\"\n") file.WriteString(fmt.Sprintf("ansible_host: %v\n", keys[i].ip)) file, err = os.Create(fmt.Sprintf("host_vars/%x/vault", i)) @@ -66,7 +66,7 @@ func main() { return } defer file.Close() - file.WriteString(fmt.Sprintf("vault_yggdrasil_private_key: %v\n", hex.EncodeToString(keys[i].priv))) + file.WriteString(fmt.Sprintf("vault_mesh_private_key: %v\n", hex.EncodeToString(keys[i].priv))) bar.Increment() } bar.Finish() diff --git a/contrib/apparmor/usr.bin.yggdrasil b/contrib/apparmor/usr.bin.yggdrasil index b305199f..cecd410b 100644 --- a/contrib/apparmor/usr.bin.yggdrasil +++ b/contrib/apparmor/usr.bin.yggdrasil @@ -1,7 +1,7 @@ # Last Modified: Fri Oct 30 11:33:31 2020 #include -/usr/bin/yggdrasil { +/usr/bin/mesh { #include #include @@ -12,6 +12,6 @@ /proc/sys/net/core/somaxconn r, /sys/kernel/mm/transparent_hugepage/hpage_pmd_size r, - /etc/yggdrasil.conf rw, - /run/yggdrasil.sock rw, + /etc/mesh.conf rw, + /run/mesh.sock rw, } diff --git a/contrib/busybox-init/S42yggdrasil b/contrib/busybox-init/S42yggdrasil index 862efc25..9d6b0e39 100755 --- a/contrib/busybox-init/S42yggdrasil +++ b/contrib/busybox-init/S42yggdrasil @@ -1,9 +1,9 @@ #!/bin/sh -CONFFILE="/etc/yggdrasil.conf" +CONFFILE="/etc/mesh.conf" genconf() { - /usr/bin/yggdrasil -genconf > "$1" + /usr/bin/mesh -genconf > "$1" return $? } @@ -33,8 +33,8 @@ start() { fi fi - printf 'Starting yggdrasil: ' - if start-stop-daemon -S -q -b -x /usr/bin/yggdrasil \ + printf 'Starting mesh: ' + if start-stop-daemon -S -q -b -x /usr/bin/mesh \ -- -useconffile "$CONFFILE"; then echo "OK" else @@ -43,8 +43,8 @@ start() { } stop() { - printf "Stopping yggdrasil: " - if start-stop-daemon -K -q -x /usr/bin/yggdrasil; then + printf "Stopping mesh: " + if start-stop-daemon -K -q -x /usr/bin/mesh; then echo "OK" else echo "FAIL" @@ -52,8 +52,8 @@ stop() { } reload() { - printf "Reloading yggdrasil: " - if start-stop-daemon -K -q -s HUP -x /usr/bin/yggdrasil; then + printf "Reloading mesh: " + if start-stop-daemon -K -q -s HUP -x /usr/bin/mesh; then echo "OK" else echo "FAIL" diff --git a/contrib/deb/generate.sh b/contrib/deb/generate.sh index 3b11e683..db915abc 100644 --- a/contrib/deb/generate.sh +++ b/contrib/deb/generate.sh @@ -1,7 +1,7 @@ #!/bin/sh # This is a lazy script to create a .deb for Debian/Ubuntu. It installs -# yggdrasil and enables it in systemd. You can give it the PKGARCH= argument +# mesh and enables it in systemd. You can give it the PKGARCH= argument # i.e. PKGARCH=i386 sh contrib/deb/generate.sh if [ `pwd` != `git rev-parse --show-toplevel` ] @@ -15,10 +15,10 @@ PKGNAME=$(sh contrib/semver/name.sh) PKGVERSION=$(sh contrib/semver/version.sh --bare) PKGARCH=${PKGARCH-amd64} PKGFILE=$PKGNAME-$PKGVERSION-$PKGARCH.deb -PKGREPLACES=yggdrasil +PKGREPLACES=mesh if [ $PKGBRANCH = "master" ]; then - PKGREPLACES=yggdrasil-develop + PKGREPLACES=mesh-develop fi if [ $PKGARCH = "amd64" ]; then GOARCH=amd64 GOOS=linux ./build @@ -66,56 +66,56 @@ cat > /tmp/$PKGNAME/debian/docs << EOF Please see https://github.com/RiV-chain/RiV-mesh/ EOF cat > /tmp/$PKGNAME/debian/install << EOF -usr/bin/yggdrasil usr/bin -usr/bin/yggdrasilctl usr/bin +usr/bin/mesh usr/bin +usr/bin/meshctl usr/bin etc/systemd/system/*.service etc/systemd/system EOF cat > /tmp/$PKGNAME/debian/postinst << EOF #!/bin/sh -if ! getent group yggdrasil 2>&1 > /dev/null; then - groupadd --system --force yggdrasil || echo "Failed to create group 'yggdrasil' - please create it manually and reinstall" +if ! getent group mesh 2>&1 > /dev/null; then + groupadd --system --force mesh || echo "Failed to create group 'mesh' - please create it manually and reinstall" fi -if [ -f /etc/yggdrasil.conf ]; +if [ -f /etc/mesh.conf ]; then mkdir -p /var/backups - echo "Backing up configuration file to /var/backups/yggdrasil.conf.`date +%Y%m%d`" - cp /etc/yggdrasil.conf /var/backups/yggdrasil.conf.`date +%Y%m%d` - echo "Normalising and updating /etc/yggdrasil.conf" - /usr/bin/yggdrasil -useconf -normaliseconf < /var/backups/yggdrasil.conf.`date +%Y%m%d` > /etc/yggdrasil.conf - chgrp yggdrasil /etc/yggdrasil.conf + echo "Backing up configuration file to /var/backups/mesh.conf.`date +%Y%m%d`" + cp /etc/mesh.conf /var/backups/mesh.conf.`date +%Y%m%d` + echo "Normalising and updating /etc/mesh.conf" + /usr/bin/mesh -useconf -normaliseconf < /var/backups/mesh.conf.`date +%Y%m%d` > /etc/mesh.conf + chgrp mesh /etc/mesh.conf if command -v systemctl >/dev/null; then systemctl daemon-reload >/dev/null || true - systemctl enable yggdrasil || true - systemctl start yggdrasil || true + systemctl enable mesh || true + systemctl start mesh || true fi else - echo "Generating initial configuration file /etc/yggdrasil.conf" + echo "Generating initial configuration file /etc/mesh.conf" echo "Please familiarise yourself with this file before starting Mesh" - sh -c 'umask 0027 && /usr/bin/yggdrasil -genconf > /etc/yggdrasil.conf' - chgrp yggdrasil /etc/yggdrasil.conf + sh -c 'umask 0027 && /usr/bin/mesh -genconf > /etc/mesh.conf' + chgrp mesh /etc/mesh.conf fi EOF cat > /tmp/$PKGNAME/debian/prerm << EOF #!/bin/sh if command -v systemctl >/dev/null; then - if systemctl is-active --quiet yggdrasil; then - systemctl stop yggdrasil || true + if systemctl is-active --quiet mesh; then + systemctl stop mesh || true fi - systemctl disable yggdrasil || true + systemctl disable mesh || true fi EOF -cp yggdrasil /tmp/$PKGNAME/usr/bin/ -cp yggdrasilctl /tmp/$PKGNAME/usr/bin/ +cp mesh /tmp/$PKGNAME/usr/bin/ +cp meshctl /tmp/$PKGNAME/usr/bin/ cp contrib/systemd/*.service /tmp/$PKGNAME/etc/systemd/system/ tar -czvf /tmp/$PKGNAME/data.tar.gz -C /tmp/$PKGNAME/ \ - usr/bin/yggdrasil usr/bin/yggdrasilctl \ - etc/systemd/system/yggdrasil.service \ - etc/systemd/system/yggdrasil-default-config.service + usr/bin/mesh usr/bin/meshctl \ + etc/systemd/system/mesh.service \ + etc/systemd/system/mesh-default-config.service tar -czvf /tmp/$PKGNAME/control.tar.gz -C /tmp/$PKGNAME/debian . echo 2.0 > /tmp/$PKGNAME/debian-binary diff --git a/contrib/docker/Dockerfile b/contrib/docker/Dockerfile index a795ed9f..bdce88d7 100644 --- a/contrib/docker/Dockerfile +++ b/contrib/docker/Dockerfile @@ -9,8 +9,8 @@ RUN apk add git && ./build && go build -o /src/genkeys cmd/genkeys/main.go FROM docker.io/alpine -COPY --from=builder /src/yggdrasil /usr/bin/yggdrasil -COPY --from=builder /src/yggdrasilctl /usr/bin/yggdrasilctl +COPY --from=builder /src/mesh /usr/bin/mesh +COPY --from=builder /src/meshctl /usr/bin/meshctl COPY --from=builder /src/genkeys /usr/bin/genkeys COPY contrib/docker/entrypoint.sh /usr/bin/entrypoint.sh diff --git a/contrib/docker/entrypoint.sh b/contrib/docker/entrypoint.sh index ecb74aea..167eead1 100755 --- a/contrib/docker/entrypoint.sh +++ b/contrib/docker/entrypoint.sh @@ -6,8 +6,8 @@ CONF_DIR="/etc/RiV-chain" if [ ! -f "$CONF_DIR/config.conf" ]; then echo "generate $CONF_DIR/config.conf" - yggdrasil --genconf > "$CONF_DIR/config.conf" + mesh --genconf > "$CONF_DIR/config.conf" fi -yggdrasil --useconf < "$CONF_DIR/config.conf" +mesh --useconf < "$CONF_DIR/config.conf" exit $? diff --git a/contrib/freebsd/yggdrasil b/contrib/freebsd/yggdrasil index 58482fc9..30fb8471 100644 --- a/contrib/freebsd/yggdrasil +++ b/contrib/freebsd/yggdrasil @@ -1,72 +1,72 @@ #!/bin/sh # -# Put the yggdrasil and yggdrasilctl binaries into /usr/local/bin -# Then copy this script into /etc/rc.d/yggdrasil +# Put the mesh and meshctl binaries into /usr/local/bin +# Then copy this script into /etc/rc.d/mesh # Finally, run: -# 1. chmod +x /etc/rc.d/yggdrasil /usr/local/bin/{yggdrasil,yggdrasilctl} -# 2. echo "yggdrasil_enable=yes" >> /etc/rc.d -# 3. service yggdrasil start +# 1. chmod +x /etc/rc.d/mesh /usr/local/bin/{mesh,meshctl} +# 2. echo "mesh_enable=yes" >> /etc/rc.d +# 3. service mesh start # -# PROVIDE: yggdrasil +# PROVIDE: mesh # REQUIRE: networking # KEYWORD: . /etc/rc.subr -name="yggdrasil" -rcvar="yggdrasil_enable" +name="mesh" +rcvar="mesh_enable" start_cmd="${name}_start" stop_cmd="${name}_stop" -pidfile="/var/run/yggdrasil/${name}.pid" +pidfile="/var/run/mesh/${name}.pid" command="/usr/sbin/daemon" -command_args="-P ${pidfile} -r -f ${yggdrasil_command}" +command_args="-P ${pidfile} -r -f ${mesh_command}" -yggdrasil_start() +mesh_start() { - test ! -x /usr/local/bin/yggdrasil && ( - logger -s -t yggdrasil "Warning: /usr/local/bin/yggdrasil is missing or not executable" - logger -s -t yggdrasil "Copy the yggdrasil binary into /usr/local/bin and then chmod +x /usr/local/bin/yggdrasil" + test ! -x /usr/local/bin/mesh && ( + logger -s -t mesh "Warning: /usr/local/bin/mesh is missing or not executable" + logger -s -t mesh "Copy the mesh binary into /usr/local/bin and then chmod +x /usr/local/bin/mesh" return 1 ) - test ! -f /etc/yggdrasil.conf && ( - logger -s -t yggdrasil "Generating new configuration file into /etc/yggdrasil.conf" - /usr/local/bin/yggdrasil -genconf > /etc/yggdrasil.conf + test ! -f /etc/mesh.conf && ( + logger -s -t mesh "Generating new configuration file into /etc/mesh.conf" + /usr/local/bin/mesh -genconf > /etc/mesh.conf ) - tap_path="$(cat /etc/yggdrasil.conf | egrep -o '/dev/tap[0-9]{1,2}$')" + tap_path="$(cat /etc/mesh.conf | egrep -o '/dev/tap[0-9]{1,2}$')" tap_name="$(echo -n ${tap_path} | tr -d '/dev/')" /sbin/ifconfig ${tap_name} >/dev/null 2>&1 || ( - logger -s -t yggdrasil "Creating ${tap_name} adapter" - /sbin/ifconfig ${tap_name} create || logger -s -t yggdrasil "Failed to create ${tap_name} adapter" + logger -s -t mesh "Creating ${tap_name} adapter" + /sbin/ifconfig ${tap_name} create || logger -s -t mesh "Failed to create ${tap_name} adapter" ) - test ! -d /var/run/yggdrasil && mkdir -p /var/run/yggdrasil + test ! -d /var/run/mesh && mkdir -p /var/run/mesh - logger -s -t yggdrasil "Starting yggdrasil" - ${command} ${command_args} /usr/local/bin/yggdrasil -useconffile /etc/yggdrasil.conf \ - 1>/var/log/yggdrasil.stdout.log \ - 2>/var/log/yggdrasil.stderr.log & + logger -s -t mesh "Starting mesh" + ${command} ${command_args} /usr/local/bin/mesh -useconffile /etc/mesh.conf \ + 1>/var/log/mesh.stdout.log \ + 2>/var/log/mesh.stderr.log & } -yggdrasil_stop() +mesh_stop() { - logger -s -t yggdrasil "Stopping yggdrasil" - test -f /var/run/yggdrasil/${name}.pid && kill -TERM $(cat /var/run/yggdrasil/${name}.pid) + logger -s -t mesh "Stopping mesh" + test -f /var/run/mesh/${name}.pid && kill -TERM $(cat /var/run/mesh/${name}.pid) - tap_path="$(cat /etc/yggdrasil.conf | grep /dev/tap | egrep -o '/dev/.*$')" + tap_path="$(cat /etc/mesh.conf | grep /dev/tap | egrep -o '/dev/.*$')" tap_name="$(echo -n ${tap_path} | tr -d '/dev/')" /sbin/ifconfig ${tap_name} >/dev/null 2>&1 && ( - logger -s -t yggdrasil "Destroying ${tap_name} adapter" - /sbin/ifconfig ${tap_name} destroy || logger -s -t yggdrasil "Failed to destroy ${tap_name} adapter" + logger -s -t mesh "Destroying ${tap_name} adapter" + /sbin/ifconfig ${tap_name} destroy || logger -s -t mesh "Failed to destroy ${tap_name} adapter" ) } load_rc_config $name -: ${yggdrasil_enable:=no} +: ${mesh_enable:=no} run_rc_command "$1" diff --git a/contrib/macos/create-pkg.sh b/contrib/macos/create-pkg.sh index 4c6a5aab..0b4fe7af 100755 --- a/contrib/macos/create-pkg.sh +++ b/contrib/macos/create-pkg.sh @@ -18,9 +18,9 @@ command -v mkbom >/dev/null 2>&1 || ( # Check if we can find the files we need - they should # exist if you are running this script from the root of # the RiV-mesh repo and you have ran ./build -test -f yggdrasil || (echo "yggdrasil binary not found"; exit 1) -test -f yggdrasilctl || (echo "yggdrasilctl binary not found"; exit 1) -test -f contrib/macos/yggdrasil.plist || (echo "contrib/macos/yggdrasil.plist not found"; exit 1) +test -f mesh || (echo "mesh binary not found"; exit 1) +test -f meshctl || (echo "meshctl binary not found"; exit 1) +test -f contrib/macos/mesh.plist || (echo "contrib/macos/mesh.plist not found"; exit 1) test -f contrib/semver/version.sh || (echo "contrib/semver/version.sh not found"; exit 1) # Delete the pkgbuild folder if it already exists @@ -34,37 +34,37 @@ mkdir -p pkgbuild/root/usr/local/bin mkdir -p pkgbuild/root/Library/LaunchDaemons # Copy package contents into the pkgbuild root -cp yggdrasil pkgbuild/root/usr/local/bin -cp yggdrasilctl pkgbuild/root/usr/local/bin -cp contrib/macos/yggdrasil.plist pkgbuild/root/Library/LaunchDaemons +cp mesh pkgbuild/root/usr/local/bin +cp meshctl pkgbuild/root/usr/local/bin +cp contrib/macos/mesh.plist pkgbuild/root/Library/LaunchDaemons # Create the postinstall script cat > pkgbuild/scripts/postinstall << EOF #!/bin/sh # Normalise the config if it exists, generate it if it doesn't -if [ -f /etc/yggdrasil.conf ]; +if [ -f /etc/mesh.conf ]; then mkdir -p /Library/Preferences/Mesh - echo "Backing up configuration file to /Library/Preferences/Mesh/yggdrasil.conf.`date +%Y%m%d`" - cp /etc/yggdrasil.conf /Library/Preferences/Mesh/yggdrasil.conf.`date +%Y%m%d` - echo "Normalising /etc/yggdrasil.conf" - /usr/local/bin/yggdrasil -useconffile /Library/Preferences/Mesh/yggdrasil.conf.`date +%Y%m%d` -normaliseconf > /etc/yggdrasil.conf + echo "Backing up configuration file to /Library/Preferences/Mesh/mesh.conf.`date +%Y%m%d`" + cp /etc/mesh.conf /Library/Preferences/Mesh/mesh.conf.`date +%Y%m%d` + echo "Normalising /etc/mesh.conf" + /usr/local/bin/mesh -useconffile /Library/Preferences/Mesh/mesh.conf.`date +%Y%m%d` -normaliseconf > /etc/mesh.conf else - /usr/local/bin/yggdrasil -genconf > /etc/yggdrasil.conf + /usr/local/bin/mesh -genconf > /etc/mesh.conf fi # Unload existing Mesh launchd service, if possible -test -f /Library/LaunchDaemons/yggdrasil.plist && (launchctl unload /Library/LaunchDaemons/yggdrasil.plist || true) +test -f /Library/LaunchDaemons/mesh.plist && (launchctl unload /Library/LaunchDaemons/mesh.plist || true) # Load Mesh launchd service and start Mesh -launchctl load /Library/LaunchDaemons/yggdrasil.plist +launchctl load /Library/LaunchDaemons/mesh.plist EOF # Set execution permissions chmod +x pkgbuild/scripts/postinstall -chmod +x pkgbuild/root/usr/local/bin/yggdrasil -chmod +x pkgbuild/root/usr/local/bin/yggdrasilctl +chmod +x pkgbuild/root/usr/local/bin/mesh +chmod +x pkgbuild/root/usr/local/bin/meshctl # Pack payload and scripts ( cd pkgbuild/scripts && find . | cpio -o --format odc --owner 0:80 | gzip -c ) > pkgbuild/flat/base.pkg/Scripts diff --git a/contrib/macos/yggdrasil.plist b/contrib/macos/yggdrasil.plist index c436d4bd..a230e14d 100644 --- a/contrib/macos/yggdrasil.plist +++ b/contrib/macos/yggdrasil.plist @@ -3,12 +3,12 @@ Label - yggdrasil + mesh ProgramArguments sh -c - /usr/local/bin/yggdrasil -useconffile /etc/yggdrasil.conf + /usr/local/bin/mesh -useconffile /etc/mesh.conf KeepAlive @@ -17,8 +17,8 @@ ProcessType Interactive StandardOutPath - /tmp/yggdrasil.stdout.log + /tmp/mesh.stdout.log StandardErrorPath - /tmp/yggdrasil.stderr.log + /tmp/mesh.stderr.log diff --git a/contrib/msi/build-msi.sh b/contrib/msi/build-msi.sh index af76588b..03cf9133 100644 --- a/contrib/msi/build-msi.sh +++ b/contrib/msi/build-msi.sh @@ -58,9 +58,9 @@ cat > updateconfig.bat << EOF if not exist %ALLUSERSPROFILE%\\Mesh ( mkdir %ALLUSERSPROFILE%\\Mesh ) -if not exist %ALLUSERSPROFILE%\\Mesh\\yggdrasil.conf ( - if exist yggdrasil.exe ( - yggdrasil.exe -genconf > %ALLUSERSPROFILE%\\Mesh\\yggdrasil.conf +if not exist %ALLUSERSPROFILE%\\Mesh\\mesh.conf ( + if exist mesh.exe ( + mesh.exe -genconf > %ALLUSERSPROFILE%\\Mesh\\mesh.conf ) ) EOF @@ -139,9 +139,9 @@ cat > wix.xml << EOF wix.xml << EOF Name="Mesh" Start="auto" Type="ownProcess" - Arguments='-useconffile "%ALLUSERSPROFILE%\\Mesh\\yggdrasil.conf" -logto "%ALLUSERSPROFILE%\\Mesh\\yggdrasil.log"' + Arguments='-useconffile "%ALLUSERSPROFILE%\\Mesh\\mesh.conf" -logto "%ALLUSERSPROFILE%\\Mesh\\mesh.log"' Vital="yes" /> @@ -174,9 +174,9 @@ cat > wix.xml << EOF diff --git a/contrib/openrc/yggdrasil b/contrib/openrc/yggdrasil index 4a2e0a13..3e229187 100755 --- a/contrib/openrc/yggdrasil +++ b/contrib/openrc/yggdrasil @@ -2,10 +2,10 @@ description="An experiment in scalable routing as an encrypted IPv6 overlay network." -CONFFILE="/etc/yggdrasil.conf" +CONFFILE="/etc/mesh.conf" pidfile="/run/${RC_SVCNAME}.pid" -command="/usr/bin/yggdrasil" +command="/usr/bin/mesh" extra_started_commands="reload" depend() { @@ -36,8 +36,8 @@ start() { --pidfile "${pidfile}" \ --make-pidfile \ --background \ - --stdout /var/log/yggdrasil.stdout.log \ - --stderr /var/log/yggdrasil.stderr.log \ + --stdout /var/log/mesh.stdout.log \ + --stderr /var/log/mesh.stderr.log \ --exec "${command}" -- -useconffile "${CONFFILE}" eend $? } diff --git a/contrib/semver/name.sh b/contrib/semver/name.sh index 308e07bc..ebfb4c28 100644 --- a/contrib/semver/name.sh +++ b/contrib/semver/name.sh @@ -5,7 +5,7 @@ BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null) # Complain if the git history is not available if [ $? != 0 ] || [ -z "$BRANCH" ]; then - printf "yggdrasil" + printf "mesh" exit 0 fi @@ -14,9 +14,9 @@ BRANCH=$(echo $BRANCH | tr -d "/") # Check if the branch name is not master if [ "$BRANCH" = "master" ]; then - printf "yggdrasil" + printf "mesh" exit 0 fi # If it is something other than master, append it -printf "yggdrasil-%s" "$BRANCH" +printf "mesh-%s" "$BRANCH" diff --git a/contrib/systemd/yggdrasil-default-config.service b/contrib/systemd/yggdrasil-default-config.service index e9fe45be..a3461898 100644 --- a/contrib/systemd/yggdrasil-default-config.service +++ b/contrib/systemd/yggdrasil-default-config.service @@ -1,13 +1,13 @@ [Unit] -Description=yggdrasil default config generator -ConditionPathExists=|!/etc/yggdrasil.conf -ConditionFileNotEmpty=|!/etc/yggdrasil.conf +Description=mesh default config generator +ConditionPathExists=|!/etc/mesh.conf +ConditionFileNotEmpty=|!/etc/mesh.conf Wants=local-fs.target After=local-fs.target [Service] Type=oneshot -Group=yggdrasil -StandardOutput=file:/etc/yggdrasil.conf -ExecStart=/usr/bin/yggdrasil -genconf -ExecStartPost=/usr/bin/chmod 0640 /etc/yggdrasil.conf +Group=mesh +StandardOutput=file:/etc/mesh.conf +ExecStart=/usr/bin/mesh -genconf +ExecStartPost=/usr/bin/chmod 0640 /etc/mesh.conf diff --git a/contrib/systemd/yggdrasil.service b/contrib/systemd/yggdrasil.service index 27d27907..eca68dce 100644 --- a/contrib/systemd/yggdrasil.service +++ b/contrib/systemd/yggdrasil.service @@ -1,18 +1,18 @@ [Unit] -Description=yggdrasil +Description=mesh Wants=network.target -Wants=yggdrasil-default-config.service +Wants=mesh-default-config.service After=network.target -After=yggdrasil-default-config.service +After=mesh-default-config.service [Service] -Group=yggdrasil +Group=mesh ProtectHome=true ProtectSystem=true -SyslogIdentifier=yggdrasil +SyslogIdentifier=mesh CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE ExecStartPre=+-/sbin/modprobe tun -ExecStart=/usr/bin/yggdrasil -useconffile /etc/yggdrasil.conf +ExecStart=/usr/bin/mesh -useconffile /etc/mesh.conf ExecReload=/bin/kill -HUP $MAINPID Restart=always TimeoutStopSec=5 diff --git a/contrib/yggdrasil-brute-simple/Makefile b/contrib/yggdrasil-brute-simple/Makefile index aa2adc86..fb0f985e 100644 --- a/contrib/yggdrasil-brute-simple/Makefile +++ b/contrib/yggdrasil-brute-simple/Makefile @@ -1,12 +1,12 @@ .PHONY: all -all: util yggdrasil-brute-multi-curve25519 yggdrasil-brute-multi-ed25519 +all: util mesh-brute-multi-curve25519 mesh-brute-multi-ed25519 util: util.c gcc -Wall -std=c89 -O3 -c -o util.o util.c -yggdrasil-brute-multi-ed25519: yggdrasil-brute-multi-ed25519.c util.o - gcc -Wall -std=c89 -O3 -o yggdrasil-brute-multi-ed25519 -lsodium yggdrasil-brute-multi-ed25519.c util.o +mesh-brute-multi-ed25519: mesh-brute-multi-ed25519.c util.o + gcc -Wall -std=c89 -O3 -o mesh-brute-multi-ed25519 -lsodium mesh-brute-multi-ed25519.c util.o -yggdrasil-brute-multi-curve25519: yggdrasil-brute-multi-curve25519.c util.o - gcc -Wall -std=c89 -O3 -o yggdrasil-brute-multi-curve25519 -lsodium yggdrasil-brute-multi-curve25519.c util.o +mesh-brute-multi-curve25519: mesh-brute-multi-curve25519.c util.o + gcc -Wall -std=c89 -O3 -o mesh-brute-multi-curve25519 -lsodium mesh-brute-multi-curve25519.c util.o diff --git a/contrib/yggdrasil-brute-simple/README.md b/contrib/yggdrasil-brute-simple/README.md index f7b68765..b10b1491 100644 --- a/contrib/yggdrasil-brute-simple/README.md +++ b/contrib/yggdrasil-brute-simple/README.md @@ -1,4 +1,4 @@ -# yggdrasil-brute-simple +# mesh-brute-simple Simple program for finding curve25519 and ed25519 public keys whose sha512 hash has many leading ones. Because ed25519 private keys consist of a seed that is hashed to find the secret part of the keypair, diff --git a/contrib/yggdrasil-brute-simple/util.c b/contrib/yggdrasil-brute-simple/util.c index fd17e496..96cf6387 100644 --- a/contrib/yggdrasil-brute-simple/util.c +++ b/contrib/yggdrasil-brute-simple/util.c @@ -1,4 +1,4 @@ -#include "yggdrasil-brute.h" +#include "mesh-brute.h" int find_where(unsigned char hash[64], unsigned char besthashlist[NUMKEYS][64]) { /* Where to insert hash into sorted hashlist */ @@ -28,7 +28,7 @@ void insert_32(unsigned char itemlist[NUMKEYS][32], unsigned char item[32], int } void make_addr(unsigned char addr[32], unsigned char hash[64]) { - /* Public key hash to yggdrasil ipv6 address */ + /* Public key hash to mesh ipv6 address */ int i; int offset; unsigned char mask; diff --git a/contrib/yggdrasil-brute-simple/yggdrasil-brute-multi-curve25519.c b/contrib/yggdrasil-brute-simple/yggdrasil-brute-multi-curve25519.c index a592f38b..a14b234d 100644 --- a/contrib/yggdrasil-brute-simple/yggdrasil-brute-multi-curve25519.c +++ b/contrib/yggdrasil-brute-simple/yggdrasil-brute-multi-curve25519.c @@ -13,7 +13,7 @@ if besthash: besthash = hash */ -#include "yggdrasil-brute.h" +#include "mesh-brute.h" void seed(unsigned char sk[32]) { @@ -43,7 +43,7 @@ int main(int argc, char **argv) { int where; if (argc != 2) { - fprintf(stderr, "usage: ./yggdrasil-brute-multi-curve25519 \n"); + fprintf(stderr, "usage: ./mesh-brute-multi-curve25519 \n"); return 1; } @@ -57,7 +57,7 @@ int main(int argc, char **argv) { requestedtime = atoi(argv[1]); if (requestedtime < 0) requestedtime = 0; - fprintf(stderr, "Searching for yggdrasil curve25519 keys (this will take slightly longer than %ld seconds)\n", requestedtime); + fprintf(stderr, "Searching for mesh curve25519 keys (this will take slightly longer than %ld seconds)\n", requestedtime); sodium_memzero(bestsklist, NUMKEYS * 32); sodium_memzero(bestpklist, NUMKEYS * 32); diff --git a/contrib/yggdrasil-brute-simple/yggdrasil-brute-multi-ed25519.c b/contrib/yggdrasil-brute-simple/yggdrasil-brute-multi-ed25519.c index 02218e50..32f4558b 100644 --- a/contrib/yggdrasil-brute-simple/yggdrasil-brute-multi-ed25519.c +++ b/contrib/yggdrasil-brute-simple/yggdrasil-brute-multi-ed25519.c @@ -20,7 +20,7 @@ if besthash: besthash = hash */ -#include "yggdrasil-brute.h" +#include "mesh-brute.h" int main(int argc, char **argv) { @@ -41,7 +41,7 @@ int main(int argc, char **argv) { int where; if (argc != 2) { - fprintf(stderr, "usage: ./yggdrasil-brute-multi-curve25519 \n"); + fprintf(stderr, "usage: ./mesh-brute-multi-curve25519 \n"); return 1; } @@ -55,7 +55,7 @@ int main(int argc, char **argv) { requestedtime = atoi(argv[1]); if (requestedtime < 0) requestedtime = 0; - fprintf(stderr, "Searching for yggdrasil ed25519 keys (this will take slightly longer than %ld seconds)\n", requestedtime); + fprintf(stderr, "Searching for mesh ed25519 keys (this will take slightly longer than %ld seconds)\n", requestedtime); sodium_memzero(bestsklist, NUMKEYS * 64); sodium_memzero(besthashlist, NUMKEYS * 64); diff --git a/misc/run-schannel-netns b/misc/run-schannel-netns index 74a02942..a358e4d6 100755 --- a/misc/run-schannel-netns +++ b/misc/run-schannel-netns @@ -51,12 +51,12 @@ ip netns exec node4 ip link set lo up ip netns exec node5 ip link set lo up ip netns exec node6 ip link set lo up -echo '{AdminListen: "none"}' | ip netns exec node1 env PPROFLISTEN=localhost:6060 ./yggdrasil --useconf &> /dev/null & -echo '{AdminListen: "none"}' | ip netns exec node2 env PPROFLISTEN=localhost:6060 ./yggdrasil --useconf &> /dev/null & -echo '{AdminListen: "none"}' | ip netns exec node3 env PPROFLISTEN=localhost:6060 ./yggdrasil --useconf &> /dev/null & -echo '{AdminListen: "none"}' | ip netns exec node4 env PPROFLISTEN=localhost:6060 ./yggdrasil --useconf &> /dev/null & -echo '{AdminListen: "none"}' | ip netns exec node5 env PPROFLISTEN=localhost:6060 ./yggdrasil --useconf &> /dev/null & -echo '{AdminListen: "none"}' | ip netns exec node6 env PPROFLISTEN=localhost:6060 ./yggdrasil --useconf &> /dev/null & +echo '{AdminListen: "none"}' | ip netns exec node1 env PPROFLISTEN=localhost:6060 ./mesh --useconf &> /dev/null & +echo '{AdminListen: "none"}' | ip netns exec node2 env PPROFLISTEN=localhost:6060 ./mesh --useconf &> /dev/null & +echo '{AdminListen: "none"}' | ip netns exec node3 env PPROFLISTEN=localhost:6060 ./mesh --useconf &> /dev/null & +echo '{AdminListen: "none"}' | ip netns exec node4 env PPROFLISTEN=localhost:6060 ./mesh --useconf &> /dev/null & +echo '{AdminListen: "none"}' | ip netns exec node5 env PPROFLISTEN=localhost:6060 ./mesh --useconf &> /dev/null & +echo '{AdminListen: "none"}' | ip netns exec node6 env PPROFLISTEN=localhost:6060 ./mesh --useconf &> /dev/null & echo "Started, to continue you should (possibly w/ sudo):" echo "kill" $(jobs -p) diff --git a/misc/run-twolink-test b/misc/run-twolink-test index 987b6de8..e52e08fa 100755 --- a/misc/run-twolink-test +++ b/misc/run-twolink-test @@ -19,8 +19,8 @@ ip netns exec node2 tc qdisc add dev veth21 root tbf rate 10mbit burst 8192 late ip netns exec node1 tc qdisc add dev veth12 root tbf rate 100mbit burst 8192 latency 1ms ip netns exec node2 tc qdisc add dev veth22 root tbf rate 100mbit burst 8192 latency 1ms -echo '{AdminListen: "unix://node1.sock"}' | ip netns exec node1 env PPROFLISTEN=localhost:6060 ./yggdrasil -logging "info,warn,error,debug" -useconf &> node1.log & -echo '{AdminListen: "unix://node2.sock"}' | ip netns exec node2 env PPROFLISTEN=localhost:6060 ./yggdrasil -logging "info,warn,error,debug" -useconf &> node2.log & +echo '{AdminListen: "unix://node1.sock"}' | ip netns exec node1 env PPROFLISTEN=localhost:6060 ./mesh -logging "info,warn,error,debug" -useconf &> node1.log & +echo '{AdminListen: "unix://node2.sock"}' | ip netns exec node2 env PPROFLISTEN=localhost:6060 ./mesh -logging "info,warn,error,debug" -useconf &> node2.log & echo "Started, to continue you should (possibly w/ sudo):" echo "kill" $(jobs -p) diff --git a/src/address/address.go b/src/address/address.go index 0e2400ed..27c7fd4d 100644 --- a/src/address/address.go +++ b/src/address/address.go @@ -1,4 +1,4 @@ -// Package address contains the types used by yggdrasil to represent IPv6 addresses or prefixes, as well as functions for working with these types. +// Package address contains the types used by mesh to represent IPv6 addresses or prefixes, as well as functions for working with these types. // Of particular importance are the functions used to derive addresses or subnets from a NodeID, or to get the NodeID and bitmask of the bits visible from an address, which is needed for DHT searches. package address @@ -6,13 +6,13 @@ import ( "crypto/ed25519" ) -// Address represents an IPv6 address in the yggdrasil address range. +// Address represents an IPv6 address in the mesh address range. type Address [16]byte -// Subnet represents an IPv6 /64 subnet in the yggdrasil subnet range. +// Subnet represents an IPv6 /64 subnet in the mesh subnet range. type Subnet [8]byte -// GetPrefix returns the address prefix used by yggdrasil. +// GetPrefix returns the address prefix used by mesh. // The current implementation requires this to be a multiple of 8 bits + 7 bits. // The 8th bit of the last byte is used to signal nodes (0) or /64 prefixes (1). // Nodes that configure this differently will be unable to communicate with each other using IP packets, though routing and the DHT machinery *should* still work. diff --git a/src/config/config.go b/src/config/config.go index 6d2682e1..d192f3cc 100644 --- a/src/config/config.go +++ b/src/config/config.go @@ -30,7 +30,7 @@ type NodeConfig struct { Peers []string `comment:"List of connection strings for outbound peer connections in URI format,\ne.g. tls://a.b.c.d:e or socks://a.b.c.d:e/f.g.h.i:j. These connections\nwill obey the operating system routing table, therefore you should\nuse this section when you may connect via different interfaces."` InterfacePeers map[string][]string `comment:"List of connection strings for outbound peer connections in URI format,\narranged by source interface, e.g. { \"eth0\": [ tls://a.b.c.d:e ] }.\nNote that SOCKS peerings will NOT be affected by this option and should\ngo in the \"Peers\" section instead."` Listen []string `comment:"Listen addresses for incoming connections. You will need to add\nlisteners in order to accept incoming peerings from non-local nodes.\nMulticast peer discovery will work regardless of any listeners set\nhere. Each listener should be specified in URI format as above, e.g.\ntls://0.0.0.0:0 or tls://[::]:0 to listen on all interfaces."` - AdminListen string `comment:"Listen address for admin connections. Default is to listen for local\nconnections either on TCP/9001 or a UNIX socket depending on your\nplatform. Use this value for yggdrasilctl -endpoint=X. To disable\nthe admin socket, use the value \"none\" instead."` + AdminListen string `comment:"Listen address for admin connections. Default is to listen for local\nconnections either on TCP/9001 or a UNIX socket depending on your\nplatform. Use this value for meshctl -endpoint=X. To disable\nthe admin socket, use the value \"none\" instead."` MulticastInterfaces []MulticastInterfaceConfig `comment:"Configuration for which interfaces multicast peer discovery should be\nenabled on. Each entry in the list should be a json object which may\ncontain Regex, Beacon, Listen, and Port. Regex is a regular expression\nwhich is matched against an interface name, and interfaces use the\nfirst configuration that they match gainst. Beacon configures whether\nor not the node should send link-local multicast beacons to advertise\ntheir presence, while listening for incoming connections on Port.\nListen controls whether or not the node listens for multicast beacons\nand opens outgoing connections."` AllowedPublicKeys []string `comment:"List of peer public keys to allow incoming peering connections\nfrom. If left empty/undefined then all connections will be allowed\nby default. This does not affect outgoing peerings, nor does it\naffect link-local peers discovered via multicast."` PublicKey string `comment:"Your public key. Your peers may ask you for this to put\ninto their AllowedPublicKeys configuration."` diff --git a/src/defaults/defaults.go b/src/defaults/defaults.go index 42ad1b11..6a076395 100644 --- a/src/defaults/defaults.go +++ b/src/defaults/defaults.go @@ -11,7 +11,7 @@ type platformDefaultParameters struct { // Admin socket DefaultAdminListen string - // Configuration (used for yggdrasilctl) + // Configuration (used for meshctl) DefaultConfigFile string // Multicast interfaces diff --git a/src/defaults/defaults_darwin.go b/src/defaults/defaults_darwin.go index e16f398f..1d73dbc2 100644 --- a/src/defaults/defaults_darwin.go +++ b/src/defaults/defaults_darwin.go @@ -7,10 +7,10 @@ package defaults func GetDefaults() platformDefaultParameters { return platformDefaultParameters{ // Admin - DefaultAdminListen: "unix:///var/run/yggdrasil.sock", + DefaultAdminListen: "unix:///var/run/mesh.sock", - // Configuration (used for yggdrasilctl) - DefaultConfigFile: "/etc/yggdrasil.conf", + // Configuration (used for meshctl) + DefaultConfigFile: "/etc/mesh.conf", // Multicast interfaces DefaultMulticastInterfaces: []MulticastInterfaceConfig{ diff --git a/src/defaults/defaults_freebsd.go b/src/defaults/defaults_freebsd.go index 6c3e1c60..4351c80d 100644 --- a/src/defaults/defaults_freebsd.go +++ b/src/defaults/defaults_freebsd.go @@ -7,10 +7,10 @@ package defaults func GetDefaults() platformDefaultParameters { return platformDefaultParameters{ // Admin - DefaultAdminListen: "unix:///var/run/yggdrasil.sock", + DefaultAdminListen: "unix:///var/run/mesh.sock", - // Configuration (used for yggdrasilctl) - DefaultConfigFile: "/usr/local/etc/yggdrasil.conf", + // Configuration (used for meshctl) + DefaultConfigFile: "/usr/local/etc/mesh.conf", // Multicast interfaces DefaultMulticastInterfaces: []MulticastInterfaceConfig{ diff --git a/src/defaults/defaults_linux.go b/src/defaults/defaults_linux.go index 95c7ae95..7e0f8e18 100644 --- a/src/defaults/defaults_linux.go +++ b/src/defaults/defaults_linux.go @@ -7,10 +7,10 @@ package defaults func GetDefaults() platformDefaultParameters { return platformDefaultParameters{ // Admin - DefaultAdminListen: "unix:///var/run/yggdrasil.sock", + DefaultAdminListen: "unix:///var/run/mesh.sock", - // Configuration (used for yggdrasilctl) - DefaultConfigFile: "/etc/yggdrasil.conf", + // Configuration (used for meshctl) + DefaultConfigFile: "/etc/mesh.conf", // Multicast interfaces DefaultMulticastInterfaces: []MulticastInterfaceConfig{ diff --git a/src/defaults/defaults_openbsd.go b/src/defaults/defaults_openbsd.go index ef339546..c234a457 100644 --- a/src/defaults/defaults_openbsd.go +++ b/src/defaults/defaults_openbsd.go @@ -7,10 +7,10 @@ package defaults func GetDefaults() platformDefaultParameters { return platformDefaultParameters{ // Admin - DefaultAdminListen: "unix:///var/run/yggdrasil.sock", + DefaultAdminListen: "unix:///var/run/mesh.sock", - // Configuration (used for yggdrasilctl) - DefaultConfigFile: "/etc/yggdrasil.conf", + // Configuration (used for meshctl) + DefaultConfigFile: "/etc/mesh.conf", // Multicast interfaces DefaultMulticastInterfaces: []MulticastInterfaceConfig{ diff --git a/src/defaults/defaults_other.go b/src/defaults/defaults_other.go index d1417322..8a7a462f 100644 --- a/src/defaults/defaults_other.go +++ b/src/defaults/defaults_other.go @@ -9,8 +9,8 @@ func GetDefaults() platformDefaultParameters { // Admin DefaultAdminListen: "tcp://localhost:9001", - // Configuration (used for yggdrasilctl) - DefaultConfigFile: "/etc/yggdrasil.conf", + // Configuration (used for meshctl) + DefaultConfigFile: "/etc/mesh.conf", // Multicast interfaces DefaultMulticastInterfaces: []MulticastInterfaceConfig{ diff --git a/src/defaults/defaults_windows.go b/src/defaults/defaults_windows.go index f5a217ac..4ea8dfbf 100644 --- a/src/defaults/defaults_windows.go +++ b/src/defaults/defaults_windows.go @@ -9,8 +9,8 @@ func GetDefaults() platformDefaultParameters { // Admin DefaultAdminListen: "tcp://localhost:9001", - // Configuration (used for yggdrasilctl) - DefaultConfigFile: "C:\\Program Files\\Mesh\\yggdrasil.conf", + // Configuration (used for meshctl) + DefaultConfigFile: "C:\\Program Files\\Mesh\\mesh.conf", // Multicast interfaces DefaultMulticastInterfaces: []MulticastInterfaceConfig{ diff --git a/src/multicast/multicast_darwin.go b/src/multicast/multicast_darwin.go index e7075c0a..9ca04bb0 100644 --- a/src/multicast/multicast_darwin.go +++ b/src/multicast/multicast_darwin.go @@ -12,7 +12,7 @@ void StartAWDLBrowsing() { serviceBrowser = [[NSNetServiceBrowser alloc] init]; serviceBrowser.includesPeerToPeer = YES; } - [serviceBrowser searchForServicesOfType:@"_yggdrasil._tcp" inDomain:@""]; + [serviceBrowser searchForServicesOfType:@"_mesh._tcp" inDomain:@""]; } void StopAWDLBrowsing() { if (serviceBrowser == nil) { diff --git a/src/tuntap/conn.go b/src/tuntap/conn.go index de400989..4a9c8fcb 100644 --- a/src/tuntap/conn.go +++ b/src/tuntap/conn.go @@ -9,7 +9,7 @@ import ( "github.com/Arceliar/phony" "github.com/RiV-chain/RiV-mesh/src/address" "github.com/RiV-chain/RiV-mesh/src/util" - "github.com/RiV-chain/RiV-mesh/src/yggdrasil" + "github.com/RiV-chain/RiV-mesh/src/mesh" "golang.org/x/net/icmp" "golang.org/x/net/ipv6" ) @@ -19,7 +19,7 @@ const tunConnTimeout = 2 * time.Minute type tunConn struct { phony.Inbox tun *TunAdapter - conn *yggdrasil.Conn + conn *mesh.Conn addr address.Address snet address.Subnet stop chan struct{} @@ -181,7 +181,7 @@ func (s *tunConn) _write(bs []byte) (err error) { err = errors.New("address not allowed") return } - msg := yggdrasil.FlowKeyMessage{ + msg := mesh.FlowKeyMessage{ FlowKey: util.GetFlowKey(bs), Message: bs, } @@ -191,7 +191,7 @@ func (s *tunConn) _write(bs []byte) (err error) { return } s.Act(s.conn, func() { - if e, eok := err.(yggdrasil.ConnError); !eok { + if e, eok := err.(mesh.ConnError); !eok { if e.Closed() { s.tun.log.Debugln(s.conn.String(), "TUN/TAP generic write debug:", err) } else { diff --git a/src/tuntap/tun.go b/src/tuntap/tun.go index 1555aeef..43852b59 100644 --- a/src/tuntap/tun.go +++ b/src/tuntap/tun.go @@ -28,9 +28,9 @@ import ( type MTU uint16 // TunAdapter represents a running TUN interface and extends the -// yggdrasil.Adapter type. In order to use the TUN adapter with Mesh, you -// should pass this object to the yggdrasil.SetRouterAdapter() function before -// calling yggdrasil.Start(). +// mesh.Adapter type. In order to use the TUN adapter with Mesh, you +// should pass this object to the mesh.SetRouterAdapter() function before +// calling mesh.Start(). type TunAdapter struct { rwc *ipv6rwc.ReadWriteCloser config *config.NodeConfig diff --git a/src/util/util.go b/src/util/util.go index eeba30b9..653f98f3 100644 --- a/src/util/util.go +++ b/src/util/util.go @@ -1,4 +1,4 @@ -// Package util contains miscellaneous utilities used by yggdrasil. +// Package util contains miscellaneous utilities used by mesh. // In particular, this includes a crypto worker pool, Cancellation machinery, and a sync.Pool used to reuse []byte. package util