net-vpn/nebula-mesh - 0.13.0 (inode64-overlay)

Search

Install

Install this version:

emerge -a =net-vpn/nebula-mesh-0.13.0

If this version is masked, you can unmask it using the autounmask tool or standard emerge options:

autounmask =net-vpn/nebula-mesh-0.13.0

Or alternatively:

emerge --autounmask-write -a =net-vpn/nebula-mesh-0.13.0

Package Information

Description:
Self-hosted control plane for the Nebula mesh VPN
Homepage:
https://github.com/forgekeep/nebula-mesh
License:
MIT

Ebuild Details

Version EAPI Keywords Slot
0.13.0 8 ~amd64 ~x86 0
View Raw Ebuild
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module systemd tmpfiles

DESCRIPTION="Self-hosted control plane for the Nebula mesh VPN"
HOMEPAGE="https://github.com/forgekeep/nebula-mesh"

SRC_URI="https://github.com/forgekeep/nebula-mesh/archive/v${PV}.tar.gz -> ${P}.tar.gz
	https://www.inode64.com/dist/${P}-vendor.tar.xz
"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+agent mgmt"
REQUIRED_USE="|| ( agent mgmt )"

DATA_DIR="/var/lib/nebula-mgmt"
DATABASE_FILE="${DATA_DIR}/nebula.db"
CONFIG_MGMT_FILE="/etc/nebula-mgmt/server.yml"
CONFIG_AGENT_FILE="/etc/nebula-agent/agent.yml"

RDEPEND="
	mgmt? (
		acct-group/nebula-mgmt
		acct-user/nebula-mgmt
		dev-libs/openssl
	)
	agent? ( net-vpn/nebula )
"

src_prepare() {
	default

	sed -i -e 's|/usr/local/bin/|/usr/bin/|g' deploy/systemd/nebula-{agent,mgmt}.service || die
}

src_compile() {
	if use agent; then
		ego build -trimpath -ldflags "-s -w" -o nebula-agent ./cmd/nebula-agent || die
	fi
	if use mgmt; then
		ego build -trimpath -ldflags "-s -w" -o nebula-mgmt ./cmd/nebula-mgmt || die
	fi
}

src_test() {
	ego test ./... || die "test failed"
}

src_install() {
	dodoc README.md CHANGELOG.md

	if use agent; then
		dobin nebula-agent

		insopts -m0600
		insinto /etc/nebula-agent
		doins configs/agent.example.yml
		fperms 0700 /etc/nebula-agent

		newinitd "${FILESDIR}/nebula-agent.initd" nebula-agent
		newconfd "${FILESDIR}/nebula-agent.confd" nebula-agent
		systemd_dounit deploy/systemd/nebula-agent.service

		dotmpfiles "${FILESDIR}/nebula-agent.tmpfiles.conf"
	fi

	if use mgmt; then
		dobin nebula-mgmt

		insopts -m0600
		insinto /etc/nebula-mgmt
		doins configs/server.example.yml
		fperms 0700 /etc/nebula-mgmt
		fowners -R nebula-mgmt:nebula-mgmt /etc/nebula-mgmt

		newinitd "${FILESDIR}/nebula-mgmt.initd" nebula-mgmt
		newconfd "${FILESDIR}/nebula-mgmt.confd" nebula-mgmt
		systemd_dounit deploy/systemd/nebula-mgmt.service

		dotmpfiles "${FILESDIR}/nebula-mgmt.tmpfiles.conf"
	fi
}

pkg_postinst() {
	if use agent; then
		elog "Copy /etc/nebula-agent/agent.example.yml to ${CONFIG_AGENT_FILE}"
		elog "and adjust it before starting the nebula-agent service."

		tmpfiles_process nebula-agent.tmpfiles.conf
	fi
	if use mgmt; then
		elog "Copy /etc/nebula-mgmt/server.example.yml to ${CONFIG_MGMT_FILE}"
		elog "and adjust it before starting the nebula-mgmt service."

		tmpfiles_process nebula-mgmt.tmpfiles.conf

		if [[ ! -e "${EROOT}${DATABASE_FILE}" ]]; then
			elog
			elog "Execute the following command to finish installation:"
			elog
			elog "# emerge --config \"=${CATEGORY}/${PF}\""
		fi
	fi
}

pkg_config() {
	if ! use mgmt; then
		einfo "Nothing to configure: the mgmt USE flag is disabled."
		return
	fi

	if [[ ! -e "${EROOT}${CONFIG_MGMT_FILE}" ]]; then
		einfo "Creating ${EROOT}${CONFIG_MGMT_FILE}"
		cat > "${EROOT}${CONFIG_MGMT_FILE}" <<-EOF || die
			listen: 127.0.0.1:8080
			data_dir: ${DATA_DIR}
			db_path: ${DATABASE_FILE}
			log_level: info
			master_key: "$(openssl rand -base64 32)"
		EOF
		chmod 0600 "${EROOT}${CONFIG_MGMT_FILE}" || die
		chown nebula-mgmt:nebula-mgmt "${EROOT}${CONFIG_MGMT_FILE}" || die
	fi

	einfo "Initializing database."
	"${EROOT}"/usr/bin/nebula-mgmt init --config "${EROOT}${CONFIG_MGMT_FILE}" || die
	chown nebula-mgmt:nebula-mgmt "${EROOT}${DATABASE_FILE}" || die
}

USE Flags

Manage flags for this package: euse -i <flag> -p net-vpn/nebula-mesh | euse -E <flag> -p net-vpn/nebula-mesh | euse -D <flag> -p net-vpn/nebula-mesh

Global/Standard Flags

agent
Default: Enabled (+)

Inherited Eclasses

Dependencies

RDEPEND

	mgmt? (
		acct-group/nebula-mgmt
		acct-user/nebula-mgmt
		dev-libs/openssl
	)
	agent? ( net-vpn/nebula )

Manifest for 0.13.0

Type File Size Source URLs
DIST nebula-mesh-0.13.0-vendor.tar.xz 7308188 bytes https://www.inode64.com/dist/nebula-mesh-0.13.0-vendor.tar.xz
DIST nebula-mesh-0.13.0.tar.gz 2366211 bytes https://github.com/forgekeep/nebula-mesh/archive/v0.13.0.tar.gz