add lokinet lokinet-gui

This commit is contained in:
joborun linux 2023-12-28 23:00:39 +02:00
parent 3fa16bde85
commit 90cc639340
22 changed files with 437 additions and 0 deletions

50
lokinet-gui/PKGBUILD Normal file
View File

@ -0,0 +1,50 @@
#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcomm/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=lokinet-gui
pkgver=1.0.1
pkgrel=02
pkgdesc="Graphical user interface for lokinet"
url="https://github.com/oxen-io/lokinet-gui"
options=(!strip)
makedepends=('nodejs' 'libxcrypt-compat' 'yarn')
source=("https://github.com/oxen-io/${pkgname}/archive/refs/tags/v${pkgver}.tar.gz"
"git-config"
"lokinet-gui.desktop")
build() {
cd "$pkgname-$pkgver"
# Build requires a working .git config.
mkdir -p .git
cp ../git-config .git/config
# Build the AppImage
yarn install --frozen-lockfile
yarn appImage
}
package() {
cd "$pkgname-$pkgver"
install -Dm 775 "release/Lokinet-GUI-1.0.0.AppImage" "${pkgdir}/usr/bin/Lokinet-GUI.AppImage"
install -Dm 644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
install -Dm 755 "${srcdir}"/lokinet-gui.desktop "${pkgdir}/usr/share/applications/lokinet-gui.desktop"
install -Dm 644 "images/lokinet-logo-white.png" "${pkgdir}/usr/share/icons/lokinet-gui.png"
}
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
license=(GPL)
sha256sums=(1e452b7bc3ce193bfc91e7681a88a78ca872073f873d37a8fe6c0a33c38fcd49 # v1.0.1.tar.gz
c42bf520ceb87783604e50fd6a3145eea34e8d6ff244bfbb77540cac2415f447 # git-config
1116ac3773bf24afd9d04d42809b3390d9aa7893717e2e1230852f5de50bcace) # lokinet-gui.desktop
## f79aba8878582bd75f64204a44ee3e97eadd683ad7b367812cbed43292e3b8b8 lokinet-gui-1.0.1-02-x86_64.pkg.tar.lz

35
lokinet-gui/PKGBUILD-aur Normal file
View File

@ -0,0 +1,35 @@
# Maintainer: Josh Ellithorpe <quest at mac dot com>
pkgname=lokinet-gui
pkgver=1.0.1
pkgrel=0
pkgdesc="Graphical user interface for lokinet"
arch=('i686' 'x86_64')
url="https://github.com/oxen-io/lokinet-gui"
options=(!strip)
makedepends=('nodejs' 'libxcrypt-compat' 'yarn')
source=("https://github.com/oxen-io/${pkgname}/archive/refs/tags/v${pkgver}.tar.gz" "git-config" "lokinet-gui.desktop")
sha256sums=('1e452b7bc3ce193bfc91e7681a88a78ca872073f873d37a8fe6c0a33c38fcd49'
'c42bf520ceb87783604e50fd6a3145eea34e8d6ff244bfbb77540cac2415f447'
'1116ac3773bf24afd9d04d42809b3390d9aa7893717e2e1230852f5de50bcace')
build() {
cd "$pkgname-$pkgver"
# Build requires a working .git config.
mkdir -p .git
cp ../git-config .git/config
# Build the AppImage
yarn install --frozen-lockfile
yarn appImage
}
package() {
cd "$pkgname-$pkgver"
install -Dm 775 "release/Lokinet-GUI-1.0.0.AppImage" "${pkgdir}/usr/bin/Lokinet-GUI.AppImage"
install -Dm 644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
install -Dm 755 "${srcdir}"/lokinet-gui.desktop "${pkgdir}/usr/share/applications/lokinet-gui.desktop"
install -Dm 644 "images/lokinet-logo-white.png" "${pkgdir}/usr/share/icons/lokinet-gui.png"
}

1
lokinet-gui/clean Normal file
View File

@ -0,0 +1 @@
rm -rf {src,pkg,v*tar.gz}

2
lokinet-gui/deps Normal file
View File

@ -0,0 +1,2 @@
yarn
libxcrypt-compat

11
lokinet-gui/git-config Normal file
View File

@ -0,0 +1,11 @@
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://github.com/oxen-io/lokinet-gui
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "dev"]
remote = origin
merge = refs/heads/dev

View File

@ -0,0 +1,8 @@
[Desktop Entry]
Name=Lokinet GUI
Exec=/usr/bin/Lokinet-GUI.AppImage
Terminal=false
Type=Application
Icon=lokinet-gui
Comment=GUI for Lokinet
Categories=Network

6
lokinet-gui/time Normal file
View File

@ -0,0 +1,6 @@
real 2m56.354s
user 2m47.059s
sys 1m13.357s

90
lokinet/PKGBUILD Normal file
View File

@ -0,0 +1,90 @@
#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcomm/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=lokinet
pkgver=0.9.11
pkgrel=06
pkgdesc="Anonymous, decentralized and IP based overlay network for the internet w/o systemd spyware"
url="https://lokinet.org"
depends=('libuv' 'libsodium' 'curl' 'zeromq' 'unbound' 'jemalloc' 'spdlog' 'fmt')
makedepends=('cmake' 'git' 'python' 'nlohmann-json')
install='lokinet.install'
source=("https://github.com/oxen-io/lokinet/releases/download/v$pkgver/lokinet-v$pkgver.tar.xz"{,.sig}
'lokinet.conf'
'lokinet.sysusers'
'lokinet.tmpfiles'
'lokinet.rules'
'fix-include.patch')
prepare() {
patch --directory="lokinet-v$pkgver" --forward --strip=1 --input="${srcdir}/fix-include.patch"
}
build() {
cd "lokinet-v$pkgver"
rm -rf build && mkdir build && cd build
# XXX cmake stuff overrides CFLAGS
cmake \
-DLOKINET_VERSIONTAG=release \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_C_FLAGS="$CFLAGS" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DNATIVE_BUILD=OFF \
-DUSE_AVX2=OFF \
-DWITH_TESTS=OFF \
-DDOWNLOAD_SODIUM=OFF \
-DSUBMODULE_CHECK=OFF \
-DWITH_SYSTEMD=OFF \
-DWITH_SETCAP=OFF \
-DBUILD_LIBLOKINET=OFF \
-DFORCE_OXENMQ_SUBMODULE=ON \
-DFORCE_OXENC_SUBMODULE=ON \
-DWITH_PEERSTATS_BACKEND=OFF \
-DOXEN_LOGGING_FORCE_SUBMODULES=ON \
-DOXEN_LOGGING_FMT_HEADER_ONLY=ON \
-DOXEN_LOGGING_SPDLOG_HEADER_ONLY=ON \
-Wno-dev \
..
make
}
package() {
cd "lokinet-v$pkgver"
install -D -m 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
cd build
make DESTDIR="$pkgdir" install
# install -D -m 644 "$srcdir/lokinet.service" "$pkgdir/usr/lib/systemd/system/lokinet.service"
# install -D -m 644 "$srcdir/lokinet-vpn@.service" "$pkgdir/usr/lib/systemd/system/lokinet-vpn@.service"
# install -D -m 644 "$srcdir/lokinet-resume.service" "$pkgdir/usr/lib/systemd/system/lokinet-resume.service"
install -D -m 644 "$srcdir/lokinet.sysusers" "$pkgdir/usr/lib/sysusers.d/lokinet.conf"
install -D -m 644 "$srcdir/lokinet.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/lokinet.conf"
install -D -m 750 -d "$pkgdir/usr/share/polkit-1/rules.d"
install -D -m 644 "$srcdir/lokinet.rules" "$pkgdir/usr/share/polkit-1/rules.d/lokinet.rules"
install -D -m 750 -d "$pkgdir/etc/loki"
}
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
license=('GPL3')
validpgpkeys=('2CE6F2743138825B7A7E521D025C02EE3A092F2D') # Jeff Becker (probably not evil) <jeff@lokinet.io> https://lokinet.io/jeff.asc
sha256sums=(c16c82c7528beae5ceca072eaf6e1a9eb4b85247f1d60352344b5ee53009391c # lokinet-v0.9.11.tar.xz
163bbfb4874e538967c224d5b5c9c099bfbc1a37477c9de9f5d26e4cbd30aebd # lokinet-v0.9.11.tar.xz.sig
ff5e7db4e65463e50978da0185487bd4a7f213f04bdb6256e221089f833c6ab6 # lokinet.conf
137cf7eeebc8737d62f3ccfad2398fb1c442a91cb9db7d650429b218dd949a00 # lokinet.sysusers
b0d87fd610bbc7ef56148590dbc6ed6a68f36ec88db783f408a66c815705fd75 # lokinet.tmpfiles
6ea4d917ce2e46b2c31af31b8c8c28054c5f977bab5b050c44e2029ab3248713 # lokinet.rules
87b563eb9941120dc9d9999345fa3aebb21884237c4226fe8419aac0c3caf9b6) # fix-include.patch
## d77024882b18cec8be14abca5b00700a173758fe41c394c583b207c85c1c7f06 lokinet-0.9.11-06-x86_64.pkg.tar.lz

82
lokinet/PKGBUILD-aur Normal file
View File

@ -0,0 +1,82 @@
# Maintainer: nekgem2 <nekgem2@firemail.cc>
pkgname=lokinet
pkgver=0.9.11
pkgrel=5
pkgdesc="Anonymous, decentralized and IP based overlay network for the internet."
arch=('x86_64' 'aarch64')
url="https://lokinet.org"
license=('GPL3')
depends=('libuv' 'libsodium' 'curl' 'zeromq' 'unbound' 'jemalloc' 'systemd-libs' 'spdlog' 'fmt')
makedepends=('cmake' 'git' 'python' 'systemd' 'nlohmann-json')
install='lokinet.install'
source=("https://github.com/oxen-io/lokinet/releases/download/v$pkgver/lokinet-v$pkgver.tar.xz"{,.sig}
'lokinet.conf'
'lokinet.service'
'lokinet-vpn@.service'
'lokinet-resume.service'
'lokinet.sysusers'
'lokinet.tmpfiles'
'lokinet.rules'
'fix-include.patch')
sha256sums=('c16c82c7528beae5ceca072eaf6e1a9eb4b85247f1d60352344b5ee53009391c'
'SKIP'
'ff5e7db4e65463e50978da0185487bd4a7f213f04bdb6256e221089f833c6ab6'
'ffd87df5d7a6d8b7416577a87e89f79c54930e0f14824c9831ad16f0ecfb6f42'
'1c90e7e362bf33d824af70fcf7da509dcc166f9d1f9c90111d25c28905b81857'
'bcf4bd7b38d2f054e25cc243353d3c9a56d1948b42ad07ee5c0260de06e8dd6c'
'137cf7eeebc8737d62f3ccfad2398fb1c442a91cb9db7d650429b218dd949a00'
'b0d87fd610bbc7ef56148590dbc6ed6a68f36ec88db783f408a66c815705fd75'
'6ea4d917ce2e46b2c31af31b8c8c28054c5f977bab5b050c44e2029ab3248713'
'87b563eb9941120dc9d9999345fa3aebb21884237c4226fe8419aac0c3caf9b6')
validpgpkeys=('2CE6F2743138825B7A7E521D025C02EE3A092F2D') # Jeff Becker (probably not evil) <jeff@lokinet.io> https://lokinet.io/jeff.asc
prepare() {
patch --directory="lokinet-v$pkgver" --forward --strip=1 --input="${srcdir}/fix-include.patch"
}
build() {
cd "lokinet-v$pkgver"
rm -rf build && mkdir build && cd build
# XXX cmake stuff overrides CFLAGS
cmake \
-DLOKINET_VERSIONTAG=release \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_C_FLAGS="$CFLAGS" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DNATIVE_BUILD=OFF \
-DUSE_AVX2=OFF \
-DWITH_TESTS=OFF \
-DDOWNLOAD_SODIUM=OFF \
-DSUBMODULE_CHECK=OFF \
-DWITH_SYSTEMD=ON \
-DWITH_SETCAP=OFF \
-DBUILD_LIBLOKINET=OFF \
-DFORCE_OXENMQ_SUBMODULE=ON \
-DFORCE_OXENC_SUBMODULE=ON \
-DWITH_PEERSTATS_BACKEND=OFF \
-DOXEN_LOGGING_FORCE_SUBMODULES=ON \
-DOXEN_LOGGING_FMT_HEADER_ONLY=ON \
-DOXEN_LOGGING_SPDLOG_HEADER_ONLY=ON \
-Wno-dev \
..
make
}
package() {
cd "lokinet-v$pkgver"
install -D -m 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
cd build
make DESTDIR="$pkgdir" install
install -D -m 644 "$srcdir/lokinet.service" "$pkgdir/usr/lib/systemd/system/lokinet.service"
install -D -m 644 "$srcdir/lokinet-vpn@.service" "$pkgdir/usr/lib/systemd/system/lokinet-vpn@.service"
install -D -m 644 "$srcdir/lokinet-resume.service" "$pkgdir/usr/lib/systemd/system/lokinet-resume.service"
install -D -m 644 "$srcdir/lokinet.sysusers" "$pkgdir/usr/lib/sysusers.d/lokinet.conf"
install -D -m 644 "$srcdir/lokinet.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/lokinet.conf"
install -D -m 750 -d "$pkgdir/usr/share/polkit-1/rules.d"
install -D -m 644 "$srcdir/lokinet.rules" "$pkgdir/usr/share/polkit-1/rules.d/lokinet.rules"
install -D -m 750 -d "$pkgdir/etc/loki"
}

1
lokinet/clean Normal file
View File

@ -0,0 +1 @@
rm -rf {src,pkg,lokinet*tar.xz*}

12
lokinet/deps Normal file
View File

@ -0,0 +1,12 @@
unbound
cmake
nlohmann-json
zeromq
jemalloc
spdlog
fmt
git
python

11
lokinet/fix-include.patch Normal file
View File

@ -0,0 +1,11 @@
diff -ur lokinet-v0.9.11.orig/llarp/util/thread/queue_manager.hpp lokinet-v0.9.11/llarp/util/thread/queue_manager.hpp
--- lokinet-v0.9.11.orig/llarp/util/thread/queue_manager.hpp 2022-11-27 20:25:58.052989500 +0200
+++ lokinet-v0.9.11/llarp/util/thread/queue_manager.hpp 2023-06-19 21:32:18.864777187 +0300
@@ -7,6 +7,7 @@
#include <limits>
#include <string>
#include <type_traits>
+#include <cstdint>
namespace llarp
{

1
lokinet/key Normal file
View File

@ -0,0 +1 @@
gpg --recv-key 025C02EE3A092F2D

View File

@ -0,0 +1,10 @@
[Unit]
Description=Restart lokinet on resume from sleep
After=sleep.target
[Service]
Type=oneshot
ExecStart=/bin/systemctl restart lokinet
[Install]
WantedBy=sleep.target

View File

@ -0,0 +1,14 @@
[Unit]
Description=Lokinet VPN tunnel: shove all traffic over lokinet
Requires=lokinet.service
After=lokinet.service
[Service]
User=lokinet
Type=oneshot
ExecStart=/usr/bin/lokinet-vpn --up --exit %i
ExecStop=/usr/bin/lokinet-vpn --down
RemainAfterExit=true
[Install]
WantedBy=multi-user.target

1
lokinet/lokinet.conf Normal file
View File

@ -0,0 +1 @@
LOKINET_VPN_EXIT="exit.loki"

56
lokinet/lokinet.install Normal file
View File

@ -0,0 +1,56 @@
migrate_config() {
if [ ! -e etc/loki/lokinet.ini ]
then
mkdir -p etc/loki
if [ -f var/lib/lokinet/lokinet.ini ]
then
cp -f var/lib/lokinet/lokinet.ini etc/loki/lokinet.ini.new
chmod 644 etc/loki/lokinet.ini.new
mv -f etc/loki/lokinet.ini{.new,}
ln -sf /etc/loki/lokinet.ini var/lib/lokinet/lokinet.ini.new && mv -f var/lib/lokinet/lokinet.ini{.new,}
else
pushd etc/loki/ >/dev/null
rm -f lokinet.ini.new
/usr/bin/lokinet -g ./lokinet.ini.new >/dev/null 2>&1
chmod 644 lokinet.ini.new
mv -f lokinet.ini{.new,}
popd >/dev/null
mkdir -p var/lib/lokinet
ln -sf /etc/loki/lokinet.ini var/lib/lokinet/lokinet.ini.new && mv -f var/lib/lokinet/lokinet.ini{.new,}
fi
else
chmod 644 etc/loki/lokinet.ini
if [ ! -e var/lib/lokinet/lokinet.ini ]
then
mkdir -p var/lib/lokinet
ln -sf /etc/loki/lokinet.ini var/lib/lokinet/lokinet.ini.new && mv -f var/lib/lokinet/lokinet.ini{.new,}
fi
fi
}
del_seed() {
rm -f var/lib/lokinet/bootstrap.signed
}
post_install() {
migrate_config
del_seed
cat <<-EOF
To adjust upstream DNS servers and other options, edit /etc/loki/lokinet.ini
To start lokinet:
systemctl start lokinet
To get .loki domains resolve, replace /etc/resolv.conf contents with:
nameserver 127.3.2.1
EOF
}
post_upgrade() {
migrate_config
del_seed
}

8
lokinet/lokinet.rules Normal file
View File

@ -0,0 +1,8 @@
/* Allow lokinet to set DNS settings */
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.resolve1.set-dns-servers" ||
action.id == "org.freedesktop.resolve1.set-domains") &&
subject.user == "lokinet") {
return polkit.Result.YES;
}
});

29
lokinet/lokinet.service Normal file
View File

@ -0,0 +1,29 @@
[Unit]
Description=Lokinet: Anonymous Network layer thingydoo
Wants=network-online.target
After=network-online.target
Wants=modprobe@tun.service
After=modprobe@tun.service
[Service]
Type=notify
WatchdogSec=30s
User=lokinet
SyslogIdentifier=lokinet
WorkingDirectory=/var/lib/lokinet
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
ExecStart=/usr/bin/lokinet ./lokinet.ini
Restart=always
RestartSec=5s
# Hardening
PrivateTmp=yes
ProtectHome=yes
ProtectSystem=strict
ProtectHostname=yes
ProtectKernelLogs=yes
ReadWritePaths=/var/lib/lokinet
[Install]
WantedBy=multi-user.target

1
lokinet/lokinet.sysusers Normal file
View File

@ -0,0 +1 @@
u lokinet - "Lokinet daemon user" /var/lib/lokinet

2
lokinet/lokinet.tmpfiles Normal file
View File

@ -0,0 +1,2 @@
d /var/lib/lokinet 0700 lokinet lokinet - -
z /etc/loki 0750 root lokinet - -

6
lokinet/time Normal file
View File

@ -0,0 +1,6 @@
real 23m1.914s
user 24m38.388s
sys 0m59.068s