mirror of https://github.com/oxen-io/lokinet
Merge remote-tracking branch 'origin/stable' into debian/sid
commit
c42b12b042
@ -1,9 +1,38 @@
|
|||||||
|
set(GUI_ZIP_URL "https://builds.lokinet.dev/loki-project/loki-network-control-panel/master/lokinet-gui-windows-32bit-20201106T142720Z-b92e5fd10.zip")
|
||||||
|
set(GUI_ZIP_HASH SHA256=52868f7bf6d1f4fc7ca587cc79449fefd8000a485bb7917acbc29fdefdd55839)
|
||||||
set(TUNTAP_URL "https://build.openvpn.net/downloads/releases/latest/tap-windows-latest-stable.exe")
|
set(TUNTAP_URL "https://build.openvpn.net/downloads/releases/latest/tap-windows-latest-stable.exe")
|
||||||
set(TUNTAP_EXE "${CMAKE_BINARY_DIR}/tuntap-install.exe")
|
set(TUNTAP_EXE "${CMAKE_BINARY_DIR}/tuntap-install.exe")
|
||||||
|
set(BOOTSTRAP_URL "https://seed.lokinet.org/lokinet.signed")
|
||||||
|
set(BOOTSTRAP_FILE "${CMAKE_BINARY_DIR}/bootstrap.signed")
|
||||||
|
|
||||||
file(DOWNLOAD
|
file(DOWNLOAD
|
||||||
${TUNTAP_URL}
|
${TUNTAP_URL}
|
||||||
${TUNTAP_EXE})
|
${TUNTAP_EXE})
|
||||||
|
|
||||||
|
file(DOWNLOAD
|
||||||
|
${BOOTSTRAP_URL}
|
||||||
|
${BOOTSTRAP_FILE})
|
||||||
|
|
||||||
|
file(DOWNLOAD
|
||||||
|
${GUI_ZIP_URL}
|
||||||
|
${CMAKE_BINARY_DIR}/lokinet-gui.zip
|
||||||
|
EXPECTED_HASH ${GUI_ZIP_HASH})
|
||||||
|
|
||||||
|
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ${CMAKE_BINARY_DIR}/lokinet-gui.zip
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
|
install(DIRECTORY ${CMAKE_BINARY_DIR}/gui DESTINATION share COMPONENT gui)
|
||||||
install(PROGRAMS ${TUNTAP_EXE} DESTINATION bin)
|
install(PROGRAMS ${TUNTAP_EXE} DESTINATION bin)
|
||||||
|
install(FILES ${BOOTSTRAP_FILE} DESTINATION share)
|
||||||
|
|
||||||
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Lokinet")
|
||||||
|
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/win32-setup/lokinet.ico")
|
||||||
set(CPACK_NSIS_DEFINES "RequestExecutionLevel admin")
|
set(CPACK_NSIS_DEFINES "RequestExecutionLevel admin")
|
||||||
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '$INSTDIR\\\\bin\\\\tuntap-install.exe /S'")
|
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '$INSTDIR\\\\bin\\\\tuntap-install.exe /S'\\nExecWait '$INSTDIR\\\\bin\\\\lokinet.exe --install'\\nExecWait '$INSTDIR\\\\bin\\\\lokinet.exe -g C:\\\\ProgramData\\\\lokinet\\\\lokinet.ini'\\nCopyFiles '$INSTDIR\\\\share\\\\bootstrap.signed' C:\\\\ProgramData\\\\lokinet\\\\bootstrap.signed")
|
||||||
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "ExecWait 'C:\\\\Program Files\\\\TAP-Windows\\\\Uninstall.exe /S'")
|
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "ExecWait '$INSTDIR\\\\bin\\\\lokinet.exe --remove'\\nRMDir /r /REBOOTOK C:\\\\ProgramData\\\\lokinet")
|
||||||
|
set(CPACK_NSIS_CREATE_ICONS_EXTRA
|
||||||
|
"CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Lokinet.lnk' '$INSTDIR\\\\share\\\\gui\\\\lokinet-gui.exe' '-platform windows:dpiawareness=0'"
|
||||||
|
)
|
||||||
|
set(CPACK_NSIS_DELETE_ICONS_EXTRA
|
||||||
|
"Delete '$SMPROGRAMS\\\\$START_MENU\\\\Lokinet.lnk'"
|
||||||
|
)
|
||||||
|
@ -0,0 +1,54 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Script to invoke resolvconf (if installed) to add/remove lokinet into/from the resolvconf DNS
|
||||||
|
# server list. This script does not add if any of these are true:
|
||||||
|
#
|
||||||
|
# - /sbin/resolvconf does not exist
|
||||||
|
# - the systemd-resolved service is active
|
||||||
|
# - a `no-resolvconf=1` item is present in the [dns] section of lokinet.ini
|
||||||
|
#
|
||||||
|
# It always attempts to remove if resolvconf is installed (so that commenting out while running,
|
||||||
|
# then stopping still removes the added entry).
|
||||||
|
#
|
||||||
|
# Usage: lokinet-resolvconf {add|remove} /etc/loki/lokinet.ini
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
action="$1"
|
||||||
|
conf="$2"
|
||||||
|
|
||||||
|
if [[ ! ("$action" == "add" || "$action" == "remove") || ! -f "$conf" ]]; then
|
||||||
|
echo "Usage: $0 {add|remove} /path/to/lokinet.ini" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! [ -x /sbin/resolvconf ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -x /bin/systemctl ] && /bin/systemctl --quiet is-active systemd-resolved.service; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$action" == "add" ]; then
|
||||||
|
if ! [ -x /sbin/resolvconf ]; then exit 0; fi
|
||||||
|
|
||||||
|
lokinet_ns=$(perl -e '
|
||||||
|
$ns = "127.3.2.1"; # default if none found in .ini
|
||||||
|
while (<>) {
|
||||||
|
if ((/^\[dns\]/ ... /^\[/)) {
|
||||||
|
if (/^bind\s*=\s*([\d.]+)(?::53)?\s*$/) {
|
||||||
|
$ns=$1;
|
||||||
|
} elsif (/^no-resolvconf\s*=\s*1\s*/) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print $ns' "$conf")
|
||||||
|
|
||||||
|
if [ -n "$lokinet_ns" ]; then
|
||||||
|
echo "nameserver $lokinet_ns" | /sbin/resolvconf -a lo.000lokinet
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
/sbin/resolvconf -d lo.000lokinet
|
||||||
|
fi
|
@ -1 +1 @@
|
|||||||
Subproject commit 25f4b8b8a3c0f934158cd37a37b0525d75ca488e
|
Subproject commit 4e69e333252693bd82d6338d6124f0416538dbfc
|
@ -1 +1 @@
|
|||||||
Subproject commit 53481cdfa9b0dc8d6dbbf04803401298754d7f44
|
Subproject commit ea484729c7bb7b430259a422df373e86bdd95b55
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue