From 7e1236503c7b16051a5e00a714df8fe92705d80d Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Fri, 10 Sep 2021 10:41:42 -0400 Subject: [PATCH 1/3] make lokinet-bootstrap target toggleable add cmake option to disable building lokinet-bootstrap binary --- cmake/StaticBuild.cmake | 1 + daemon/CMakeLists.txt | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cmake/StaticBuild.cmake b/cmake/StaticBuild.cmake index adf00bc0f..6b000a8ef 100644 --- a/cmake/StaticBuild.cmake +++ b/cmake/StaticBuild.cmake @@ -388,6 +388,7 @@ foreach(curl_arch ${curl_arches}) --disable-progress-meter --without-brotli --with-zlib=${DEPS_DESTDIR} ${curl_ssl_opts} --without-libmetalink --without-librtmp --disable-versioned-symbols --enable-hidden-symbols --without-zsh-functions-dir --without-fish-functions-dir + --without-nghttp3 --without-zstd "CC=${deps_cc}" "CFLAGS=${deps_noarch_CFLAGS}${cflags_extra}" ${curl_extra} BUILD_COMMAND true INSTALL_COMMAND ${_make} -C lib install && ${_make} -C include install diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index e2e725d74..8c0f0058b 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -1,3 +1,8 @@ +if(APPLE) + set(WITH_BOOTSTRAP OFF) +else() + option(WITH_BOOTSTRAP "build lokinet-bootstrap tool" ON) +endif() add_executable(lokinet-vpn lokinet-vpn.cpp) if(APPLE) @@ -5,8 +10,12 @@ if(APPLE) enable_lto(lokinet) else() add_executable(lokinet lokinet.cpp) - add_executable(lokinet-bootstrap lokinet-bootstrap.cpp) - enable_lto(lokinet lokinet-vpn lokinet-bootstrap) + if(WITH_BOOTSTRAP) + add_executable(lokinet-bootstrap lokinet-bootstrap.cpp) + enable_lto(lokinet lokinet-vpn lokinet-bootstrap) + else() + enable_lto(lokinet lokinet-vpn) + endif() endif() @@ -30,7 +39,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") endif() endif() -if(NOT APPLE) +if(WITH_BOOTSTRAP) target_link_libraries(lokinet-bootstrap PUBLIC cpr::cpr) if(NOT WIN32) find_package(OpenSSL REQUIRED) @@ -40,7 +49,7 @@ if(NOT APPLE) endif() set(exetargets lokinet lokinet-vpn) -if(NOT APPLE) +if(WITH_BOOTSTRAP) list(APPEND exetargets lokinet-bootstrap) endif() From 8df5005f549152a575b21bb91b048f2021a5ce96 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Fri, 10 Sep 2021 19:22:22 -0300 Subject: [PATCH 2/3] Apply suggestions from code review --- daemon/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 8c0f0058b..877887b81 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -1,8 +1,8 @@ +set(DEFAULT_WITH_BOOTSTRAP ON) if(APPLE) - set(WITH_BOOTSTRAP OFF) -else() - option(WITH_BOOTSTRAP "build lokinet-bootstrap tool" ON) + set(DEFAULT_WITH_BOOTSTRAP OFF) endif() +option(WITH_BOOTSTRAP "build lokinet-bootstrap tool" ${DEFAULT_WITH_BOOTSTRAP}) add_executable(lokinet-vpn lokinet-vpn.cpp) if(APPLE) @@ -10,11 +10,11 @@ if(APPLE) enable_lto(lokinet) else() add_executable(lokinet lokinet.cpp) + enable_lto(lokinet lokinet-vpn) + if(WITH_BOOTSTRAP) add_executable(lokinet-bootstrap lokinet-bootstrap.cpp) - enable_lto(lokinet lokinet-vpn lokinet-bootstrap) - else() - enable_lto(lokinet lokinet-vpn) + enable_lto(lokinet-bootstrap) endif() endif() From 62d7192a5059626396d6f0aa6b65380fde79db69 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Fri, 10 Sep 2021 19:38:32 -0300 Subject: [PATCH 3/3] Add mainnet/testnet bootstrap files into repo We use them everywhere now (include the debs) so it makes sense to have them bundled here rather than needing a download during package build (in particular for debs that's considered a bad thing). --- .gitattributes | 1 + .gitignore | 2 ++ cmake/win32_installer_deps.cmake | 9 ++------- contrib/bootstrap/mainnet.signed | Bin 0 -> 923 bytes contrib/bootstrap/testnet.signed | 1 + daemon/CMakeLists.txt | 3 +-- 6 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 contrib/bootstrap/mainnet.signed create mode 100644 contrib/bootstrap/testnet.signed diff --git a/.gitattributes b/.gitattributes index 9a5991388..40b418198 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,4 @@ external/date/test export-ignore external/nlohmann/doc export-ignore external/nlohmann/test export-ignore external/nlohmann/benchmarks/data export-ignore +*.signed binary diff --git a/.gitignore b/.gitignore index 27e57ba86..d0dfc9844 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,8 @@ callgrind.* *.sig *.signed +!/contrib/bootstrap/mainnet.signed +!/contrib/bootstrap/testnet.signed *.key shadow.data diff --git a/cmake/win32_installer_deps.cmake b/cmake/win32_installer_deps.cmake index f928a5e60..95ea1aedf 100644 --- a/cmake/win32_installer_deps.cmake +++ b/cmake/win32_installer_deps.cmake @@ -5,17 +5,12 @@ endif() 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(BOOTSTRAP_URL "https://seed.lokinet.org/lokinet.signed") -set(BOOTSTRAP_FILE "${CMAKE_BINARY_DIR}/bootstrap.signed") +set(BOOTSTRAP_FILE "${PROJECT_SOURCE_DIR}/contrib/bootstrap/mainnet.signed") file(DOWNLOAD ${TUNTAP_URL} ${TUNTAP_EXE}) -file(DOWNLOAD - ${BOOTSTRAP_URL} - ${BOOTSTRAP_FILE}) - file(DOWNLOAD ${GUI_ZIP_URL} ${CMAKE_BINARY_DIR}/lokinet-gui.zip @@ -26,7 +21,7 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf ${CMAKE_BINARY_DIR}/lokinet-g install(DIRECTORY ${CMAKE_BINARY_DIR}/gui DESTINATION share COMPONENT gui) install(PROGRAMS ${TUNTAP_EXE} DESTINATION bin COMPONENT tuntap) -install(FILES ${BOOTSTRAP_FILE} DESTINATION share COMPONENT lokinet) +install(FILES ${BOOTSTRAP_FILE} DESTINATION share COMPONENT lokinet RENAME bootstrap.signed) set(CPACK_PACKAGE_INSTALL_DIRECTORY "Lokinet") set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/win32-setup/lokinet.ico") diff --git a/contrib/bootstrap/mainnet.signed b/contrib/bootstrap/mainnet.signed new file mode 100644 index 0000000000000000000000000000000000000000..4dabc8e935a4f3af369132bd655b91e44f6e5119 GIT binary patch literal 923 zcmc~vF|ajnHuUD85!xB80i@qni*OZWEvV+8W;f8lw}&Erh?R( zTjk_uXXd4r7+PfmO_x{T_pp!s`Ss6C&UJi=Zf*1DMmKJcIlXZ6>|Lwp@^)MSngLX$ zaEecB)As3lQ`bDY5U<`6k@liu!hGRA(M55k{*qfx3mRG#bS(uv`8bh66XjPE|WLBA(Smn*!ecF(<<>f&${q83ZOit?`5?}x2$#FiDg<_NM zKlT2YQ1Z==-^6{E+7TK3Kjq=P-}iIpy#Ah+eWTKD&%sH5SW-$-;)`Eb8JWP8d)^B*+DEK?)mi&82n4OmXq`U3fwKsH(R0&)mZ?8)K5ftbu>!-)&=MYImX>;kM&^2E271J$vH*VZ z>ot-^7rMB9AC3;~*0EGiiddVj;H7SESDVFm77}9WQ~Ay@UMqb4M5Z;9seMCg@7g$_ z`MYegL~cw|Te=}u3N^$~Qkk)-xv7PLC1!}FU)Q^v=_B)zMeml8VE?<4D~}90G+(NA w#r`-iVyi_@% literal 0 HcmV?d00001 diff --git a/contrib/bootstrap/testnet.signed b/contrib/bootstrap/testnet.signed new file mode 100644 index 000000000..9ad107115 --- /dev/null +++ b/contrib/bootstrap/testnet.signed @@ -0,0 +1 @@ +d1:ald1:ci2e1:d3:iwp1:e32:9ãxÚsX«l%ìû€ê<,sØ›”•©÷ïå_1:i21:::ffff:144.76.164.2021:pi1666e1:vi0eee1:i5:gamma1:k32:ÞÊðòm=o›„ZÐ1ÿßmcŒ%»¸ÿû¾™SĹ1:p32:!EÏâéz˜ý:Š‹úý… /0¡Ú„ Ãݪ„µNçB1:rli0ei0ei8ei3ee1:ui1614788310454e1:vi0e1:xle1:z64:Œ¤u G¿”D“=Œxµ¢{ïÌ51þ`í߀ùEâw m)q2Øg¯±˜øš ï³À)˜TÑP•´ò³ö—Á1e \ No newline at end of file diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 877887b81..1eea3132a 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -88,10 +88,9 @@ if(APPLE) DEPENDS ${PROJECT_SOURCE_DIR}/contrib/lokinet.svg ${PROJECT_SOURCE_DIR}/contrib/macos/mk-icns.sh) add_custom_target(icons DEPENDS ${mac_icon}) add_dependencies(lokinet icons lokinet-extension) - file(DOWNLOAD "https://seed.lokinet.org/lokinet.signed" ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.signed) add_custom_command(TARGET lokinet POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.signed + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/contrib/bootstrap/mainnet.signed $/Contents/Resources/bootstrap.signed COMMAND mkdir -p $/Contents/PlugIns COMMAND cp -a $ $/Contents/PlugIns/