Commit Graph

468 Commits (dev)

Author SHA1 Message Date
Jason Rhinelander 1dccbb5814 Update deb repo dns name 3 years ago
Jason Rhinelander ca9d979361 Docker image updates
- split debian sid into base/sid/clang images
- similarly for debian stable
- add jsonnet to lint
- add `--pull` to docker build so that we always pull the latest images
  (otherwise we were building on whatever local cache we have for
  `debian:sid`, etc., which made the base image update layer much
  larger).
- don't install Recommends by default
- add libzmq3-dev
- split android into android (base) and flutter
- hard-code registry.oxen.rocks into the dockerfile stuff because that
  seems to be the only way to properly depend on other docker builds.
- update a few CI builds that should have been using our images but
  weren't.
- Update a few CI images to bullseye instead of buster

Add openssh-client (for sftp to upload builds)
3 years ago
Jason Rhinelander 1526b2a2eb which => command -v; different format.sh exit codes
`which` is a debian tool that is being deprecated in favour of
posix-standard `command -v`, so which to that to avoid deprecation
warnings.

Change the exit codes of `contrib/format.sh verify` to be unique for
each formatting program.
3 years ago
Jason Rhinelander 9b0b9fe67b Add jsonnet formatting (if jsonnet is installed) 3 years ago
Jason Rhinelander 62d7192a50 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).
3 years ago
Jason Rhinelander 12e00b7a99 Remove advertising of big crappy company 3 years ago
Jason Rhinelander 92c7fb9872 LOKINET_VERSION -> built in lokinet_VERSION 3 years ago
Jason Rhinelander 8aef5d742d Re-enable LTO; target macos 10.12+ 3 years ago
Jason Rhinelander 3527c9cdb5
Remove more unused dns-proxy files 3 years ago
Jason Rhinelander e39c473c88
format.sh: support macports clang-format
macports names it clang-format-mp-N to avoid clashing with a
system-installed one.
3 years ago
Jason Rhinelander 329da951b7
Apple OS interface cleanup & refactoring
- Add a C callback interface (context_wrapper.h) between lokinet and the
  objective-C code so that:
  - we can use objective-C (rather than objective-C++), which seems more
    likely to be supported by Apple into the future;
  - we minimize the amount of code that needs to be aware of the Apple
    APIs.
  - this replaces apple logger objective c++ implementation with a plain
    c++ implementation that takes a very simple C callback (provided
    from the obj-c code) to actually make the call to NSLog.

- Add various documentation to the code of what is going on.

- Send all DNS traffic to the primary IP on the tun interface.  The
  match prefixes simply don't work as advertised, and have weird shit
  (like even if you get it working for some domains, "instagram.com"
  still doesn't because of god-knows-what Apple internal politics).

- Drop the dns proxy code as we don't need it anymore.

- Don't use 9.9.9.9 for default DNS.  (We might consider the unfiltered
  9.9.9.10 as an alternative default, but if we do it should be a global
  lokinet change rather than a Mac-specific change).

- Parse a lokinet.ini in the data directory, if it exists.  (Since we
  are sandboxed, it is an app-specific "home" directory so is probably
  buried god knows where, but at least the GUI ought to be able to get
  it to let users add things to it).

- This commit also adds a swift version of the PacketTunnelProvider
  glue, which ought to work in theory, but the *tooling* for cmake is so
  underdeveloped that I couldn't find any way to actually get the damn
  thing working.  So I'm committing it here anyway (and will revert it
  away in the next commit) in case we someday want to switch to it.

-
3 years ago
jeff 1272a4fbe1
add dummy sign target for ci when we don't have signing keys
remove static macos from ci pipeline
3 years ago
jeff 7db2459469
macos sort of works now 3 years ago
Jason Rhinelander 81d27c35c1
Default CODESIGN_APPEX to CODESIGN_APP
Sometimes (e.g. dev builds) these can apparently be the same; sometimes
it seems they need to be different, because Apple.
3 years ago
Jason Rhinelander 3ab117a03b
Switch extension from a framework to an appex 3 years ago
Jason Rhinelander faf8a699a6
Set version into Info.plist, don't manually configure
cmake already treats the info plist as a file to be configured (not
merely copied) so we don't need to configure_file ourselves to a temp
file.
3 years ago
Jason Rhinelander 0bb00baacf
Various cmake build cleanups/refactors
- Added contrib/macos/README.txt with description of the cancer
  happening here.
- Add provisioningprofiles that Apple wants to make things work properly
- Made the entitlements files match the provisioningprofiles
- Remove configured entitlements files; we *can't* change any of the
  things here because they are closedly tied to the provisioningprofiles
  -- which means if someone wants to build their own Lokinet, they have
  to replace a bunch of crap and change application IDs throughout.
  This is the hostile-to-open-source Apple way.
- Remove unused old lokinet binary, as we're no longer using it on macos
- Use a POST_BUILD rather than install to copy things around into the
  right places
- Convert all the configure_file's to consistently use @ONLY
- Misc cleanups
3 years ago
jeff 5edd045c9b
add swift version bullshit file and additional bullshittery 3 years ago
jeff 0708a0d897
initial network extension code for macos
probably does not work
3 years ago
Jeff Becker 63ed5c16ed
upload bare apk as ci artifact 3 years ago
Jeff Becker 92cfa8a558
dont bundle raw jni libs 3 years ago
Jeff Becker f65ec8e79f
make ci try building the flutter apk in the android apk pipeline 3 years ago
Jason Rhinelander 29418f7a7b bencode-dump.py: support reading from stdin
So that you can pipe bt-encoded output into it, e.g. from the
in-progress oxend bt-rpc interface.
3 years ago
Jeff Becker 8f4c23ef47
add option to invert regex filter results 3 years ago
Jeff Becker 3893a94e07
better time formatting for future times 3 years ago
Jeff Becker 6df1d6412d
unify introset-filter and path-filter 3 years ago
Jeff Becker 264616c8ba
fix unicode char 3 years ago
Jeff Becker 63c601b0c0
fixes for lokinetmon filters 3 years ago
Jeff Becker 91f6ca9869
typofix 3 years ago
Jeff Becker 383312a74d
make filters consistent for localhost.loki 3 years ago
Jeff Becker 30848165e7
add path filter in lokinetmon 3 years ago
Jeff Becker d918e1edda
add age to outbound contexts in lokinetmon
better time foratting in lokinetmon
3 years ago
Jeff Becker 32a94c73e2
update lokinetmon
* add --introset-filter option to filter results in introset inspection mode by regex
3 years ago
Jeff Becker a316f5f787
add wine as dependancy because god made windows so that man may suffer 3 years ago
Jeff Becker da985c4c44
add docker image for nodejs 3 years ago
Jeff 058e358b5c
Merge pull request #1669 from majestrate/inbound-convo-wrong-path-fix-2021-06-14
[bugfix] make inbound convotags reply on the correct path
3 years ago
Jason Rhinelander d2dc3b8c1b Fix program name in bencode-dump.py --help 3 years ago
Jason Rhinelander 4b0a10328a Add bencoded file dumper 3 years ago
Jeff Becker ae36fd42bb
remove badIntros from lokinetmon as rpc no longer has them in it 3 years ago
Jeff Becker 00d4942d85
more 3 years ago
Jeff Becker 71d17dc2c9
format and logging
ignore outbound session auth messages
3 years ago
Jeff Becker 5924ca5b3f
update android ci docker jizz 3 years ago
Jeff Becker ff796cd142
if git describe fails fall back to a placeholder 3 years ago
Jeff Becker 9e65f262f9
update docker ci jizz to include flutter on android 3 years ago
Jeff Becker 6f9f527f50
ccache android builds in ci 3 years ago
Jeff Becker 0a1cc0fc90
fix android ci output path name so that it does not conflict 3 years ago
Jeff Becker 300638163b
typofix 3 years ago
Jeff Becker 79d881689d
fix windows static ci upload for windows 3 years ago
Jeff Becker b7485b4b25
* make android ABIS list configurable
* fix android ci jizz, correct typo, upload generated assets
3 years ago
Jeff Becker d79b9bf59a
update android ci docker image definition to include cmake and exclude gradle 3 years ago
Jeff Becker e5bc34a7b1
[buildsystem] remove use of ninja entirely
* modify contrib/window.sh now uses makefiles
* create contrib/android.sh for building shared libs for android apk
* update drone ci jizz for android
* update cmake/StaticBuild.cmake to use $(MAKE) so that builds can parallelize (super epic)
* remove android directory as it is no longer needed
3 years ago
Jeff Becker 719dd38cf5
more shit 3 years ago
Jeff Becker 046e02ebe7
fixes for loopback testnet 3 years ago
Jeff Becker b1d30f9803
updates to lokinetmon
* add introset inspector mode
* add required parts for introset insecptor mode to rpc introspection
3 years ago
Jeff 307393f47e
Merge pull request #1640 from majestrate/format-verify-2021-05-12
add format verify option to contrib/format.sh
3 years ago
Jeff Becker 8c0f448e12
add liblokinet option to nsis cpack installer 3 years ago
Jeff Becker d066bf8576
check in pre-push git hook so I don't lose it 3 years ago
Jeff Becker 6e67f38408
add format verification to contrib/format.sh
run with ./contrib/format.sh verify
exits with 0 if we are good, exits non-zero if we are not formatted right
3 years ago
Jeff Becker 6b115913bc
lokinetmon updates
* add country flags to lokinetmon
* expose hop ip addresses via rpc introspection for geoip in lokinetmon
3 years ago
Jason Rhinelander 4ef25ef679 Add systemd-resolved dynamic DNS updating
Wires up systemd support to configure DNS on startup and when
enabling/disabling exit mode.

On startup (and when turning off an exit) we tell systemd-resolved to
direct .loki and .snode lookups to lokinet (leaving other DNS traffic
alone).

On exit enabling, we reconfigure it to resolve "." (i.e. the root DNS
domain) so that all lookups come into it.
3 years ago
Jeff Becker c4dad12f2e
libunbound patch no longer needed as fixes have been upstreamed 3 years ago
Jeff Becker ebdb9699c0
refactor: make lokinet-bootstrap a native executable
* pull in cpr
* tidy up windows.sh
* rename main.cpp to lokinet.cpp to satisfy my autism
* add llarp::GetDefaultBootstrap()
3 years ago
Jeff Becker 37b2f0f1e3
rebrand and bump version 3 years ago
Jeff Becker 8ae0808f97
add forgotten files 3 years ago
Jeff Becker bb7b46c43d
fixes for testnet 3 years ago
Jeff Becker 2ed0ab1ca1
liblokinet and lnproxy updates
* add lokinet_status function to get the current status of the context, aka are we ready to send or not.
* catch some exceptions in lnproxy
3 years ago
Jeff Becker 3f9e51e391
more liblokinet api functions
* get/set netid
* set log level
3 years ago
Jeff Becker 2a9d041644
add readme 3 years ago
Jeff Becker 2188b443e9
more liblokinet api stuff
* add lokinet_wait_for_ready to wait until we have published introsets and such
* optionally expose ports in lnproxy
* dont save profiles by default
3 years ago
Jeff Becker 95cd275cdd
liblokinet additions:
* add lokinet_add_bootstrap_rc function for adding an rc from memory
* prevent stack overflow on error closing connection in quic
* add in memory nodedb
* refactor how convotags are set as active
* add initial stubs for endpoint statistics
* refactor time stuff to be a bit cleaner
* update lnproxy script with more arguments
3 years ago
Jeff Becker 6306876904
proper shutdown 3 years ago
Jeff Becker 8bc60a59ac
fix up liblokinet api to be more friendly to ffi
add lnproxy exmaple of use of liblokinet
3 years ago
Jeff Becker 5b05d22bad
refactors
* add path sequence numbers on routing messages
* reduce log level in debug mode
* wire up loopback style sending to ourself
3 years ago
Jeff Becker 211a051444
add quic_tester.py script for hitting rpc endpoints to test quic 3 years ago
Jeff Becker 0c37cc7f60
lokinet-bootstrap native binary 3 years ago
Jeff Becker 9e05e245e0
rebrand and bump version 3 years ago
Thomas Winget 09ebe77860 let format.sh try system clang-format in case it is the correct version 3 years ago
Jason Rhinelander e5aa96ed7c Upgrade to clang-format 11
The formatting changes here are not too large and also nice: in
particular clang-format-11 appears to do better handling of `{...}`
constructor braces/arguments.
3 years ago
Jeff Becker 27685b1b6e
fix docker lines and dont install recommended packages 3 years ago
Jason Rhinelander 78a43e7163 Add oxen-core deps to docker images 3 years ago
Jeff Becker b9d439558f
dont include lokinet-bootstrap.ps1 in ci builds 3 years ago
Jeff f685d615bf
Merge pull request #1537 from majestrate/android-works-now-2021-02-11
Android
3 years ago
Thomas Winget 4c630e0437 Large collection of changes to make android work
- Previous android java and jni code updated to work, but with much love
  still needed to make it work nicely, e.g. handling when the VPN is
  turned off.

- DNS handling refactored to allow android to intercept and handle DNS
  requests as we can't set the system DNS to use a high port
  (and apparently Chrome ignores system DNS settings anyway)

- add packet router structure to allow separate handling of specific
  intercepted traffic, e.g. UDP traffic to port 53 gets handled by our
  DNS handler rather than being naively forwarded as exit traffic.

- For now, android lokinet is exit-only and hard-coded to use exit.loki
  as its exit.  The exit will be configurable before release, but
  allowing to not use exit-only mode is more of a challenge.

- some old gitignore remnants which were matching to things we don't
  want them to (and are no longer relevant) removed

- some minor changes to CI configuration
3 years ago
Jeff Becker 2655a64da0
redo ci pipeline:
* make cached docker containers for ci
* remove old docker files from root of repo
* use cached docker containers for ci
3 years ago
Jeff Becker 6d00c3ecd2
update windows parts
* document need for ninja-build package
* update contrib/windows.sh, remove -DCROSS_COMPILE option, set -e and set +x
3 years ago
Anton Nesterov da2c979936 update apparmor profile:
add nameservice abstraction
give profile a name
allow to read conf, tmp files, etc.
remove /lib/@{multiarch}/ld-*.so mr, already covered by abstractions/base
allow local additions
3 years ago
Jeff Becker df4ea34a56
nodedb refactor
* bump zmq static dep
* lokimq -> oxenmq
* llarp_nodedb -> llarp::NodeDB
* remove all crufty api parts of NodeDB
* make NodeDB rc selection api not suck
* make path builder api not suck
* propagate all above changes so that unit tests work and it all compiles
3 years ago
Jason Rhinelander 231674e5a5 Remove CMAKE_CROSSCOMPILE
We set CMAKE_CROSSCOMPILE in a few places, but that is just a typo for
CMAKE_CROSSCOMPILING.  However we don't need to set it at all: cmake
does so automatically whenever CMAKE_SYSTEM_NAME is set (which is why
our cross compiling actually works currently.)
3 years ago
Jason Rhinelander b3d2177e73
Fix build server name & path (#1516)
builds.lokinet.dev -> oxen.rocks
/loki-project/ -> /oxen-io/
3 years ago
Jeff 0ed8942dc6
libuv cmake fixups (#1511)
* fix up cmake parts for libuv
* make libuv use external project via StaticBuild.cmake
* remove libuv submodule
3 years ago
Jeff 49b9ad7197
tun code refactor (#1495)
* partial tun code refactor

* take out the trash

* move vpn platform code into llarp/vpn/platform.cpp

* fix hive build

* fix win32

* fix memory leak on win32

* reduce cpu use

* make macos compile

* win32 patches:

* use wepoll for zmq
* use all cores on windows iocp read loop

* fix zmq patch for windows

* clean up cmake for win32

* add uninstall before reinstall option to win32 installer

* more ipv6 stuff

* make it compile

* fix up route poker

* remove an unneeded code block in macos wtf

* always use call to system

* fix route poker behavior on macos

* disable ipv6 on windows for now

* cpu perf improvement:

* colease calls to Router::PumpLL to 1 per event loop wakeup

* set up THEN add addresses

* emulate proactor event loop on win32

* remove excessively verbose error message

* fix issue #1499

* exclude uv_poll from win32 so that it can start up

* update logtag to include directory

* create minidump on windows if there was a crash

* make windows happy

* use dmp suffix on minidump files

* typo fix

* address feedback from jason
* use PROJECT_SOURCE_DIR instead of CMAKE_SOURCE_DIR
* quote $@ in apply-patches in case path has spaces in it

* address feedback from tom

* remove llarp/ev/pipe
* add comments for clairification
* make event loop queue size constant named
3 years ago
Jason Rhinelander 7ad1030736
Add full-static-deps armhf build (+upload) (#1505)
* Add armhf static build + upload

* openssl build fix for static armhf build

Without this it tries building for arm64.

* Disable LTO for armhf static build

* Fix static lib check for arm
3 years ago
Jeff 6407733c8e
* make llarp.halt rpc call actually return a reply (#1488)
* add --kill flag to lokinet-vpn that calls llarp.halt
* make macos uninstaller kill lokinet via lokinet-vpn --kill
4 years ago
Jason Rhinelander f1b074bb95
Merge pull request #1487 from jagerman/revert-uninstaller-subdir
Revert "Build mac uninstaller as subproject instead of externalprojec…
4 years ago
Jeff b18546086a
make macos uninstaller actually kill and uninstall lokinet (#1484)
* macos fluff

* make uninstaller work, the uninstall script needs to be called with /usr/bin/sudo to work because god know why it needs that even though it's already root.
* add logrotation
* make the uninstall script kill all the things

* revert

* use correct regular expression

* remove logrotate configs rename logrotate config file name to be more descriptive
4 years ago
Jason Rhinelander bc62e9dd2d Revert "Build mac uninstaller as subproject instead of externalproject (#1485)"
This reverts commit e62f04c601.
4 years ago
Jason Rhinelander e62f04c601
Build mac uninstaller as subproject instead of externalproject (#1485)
This makes it easier to build/rebuild via a target, and is a bit
cleaner.
4 years ago
Jason Rhinelander a753e96d8d
Version bump (#1483)
* Bump version to 0.8.2

* Let cmake set PROJECT_NAME

`project(x ...)` already sets PROJECT_NAME (and CMAKE_PROKECT_NAME if
this is the top-level build) to `x`; the logic here seemed sort of
backwards.

* Get rid of uninstaller entitlement

We don't seem to need it anymore with Qt 5.15.1.

* Bump windows lokinet-gui build
4 years ago
Jason Rhinelander 1c0e4dc4e7 Move all patches into contrib/patches 4 years ago
Jason Rhinelander f9144a7bb3 Patch to avoid IP_DONTFRAG bug in latest xcode with broken Big Sur SDK 4 years ago
Jeff Becker 876f292efb use /var/log/ for log files 4 years ago
Jeff Becker 300ce89278 kill the gui 4 years ago
Jeff Becker 452cf13841 delete lokinet applications directory 4 years ago
Jeff Becker b8a1c69a3e remove old path too 4 years ago
Jeff Becker 42b979b266 remove line from uninstaller 4 years ago
Jeff Becker c4e983da3f update icon 4 years ago
Jeff Becker f3989c0f9a add entitlements 4 years ago
Jeff Becker 3a950aa950 change icon 4 years ago
Jeff Becker 4d089db3cd change tool name 4 years ago
Jeff Becker 36fa3f347a fix icon path 4 years ago
Jeff Becker d2a68f8323 add install target 4 years ago
Jeff Becker bb1f9c4dc0 ugh 4 years ago
Jeff Becker d268ef1246 security.h 4 years ago
Jeff Becker ee3489744e more fixes for macos 4 years ago
Jeff Becker 6e6bff5e1d fix header 4 years ago
Jeff Becker e835ad6347 chmod +x 4 years ago
Jeff Becker e183bf9673 fix typo 4 years ago
Jeff Becker ca5df6436a add initial uninstaller code that is horrible 4 years ago
Jeff Becker 580f005f50 revert 4 years ago
Jeff Becker 3b3374fa4c try watching trash for lokinet-gui.app and delete ourself if we see it 4 years ago
Jeff Becker 0afe9f0138 update packaging for macos add preinstall script that nukes any existing lokinet make uninstaller revert dns to "empty" make cpack use preinstall script in pkg file 4 years ago
Jeff f18f18372a
stop lokinet before uninstalling service (#1469)
* stop lokinet before uninstalling service

* kill gui in uninstaller

* add helper script for building windows installers because i forgot how to most of the time.
4 years ago
Jason Rhinelander 4eb275324d
Fix deb snapshot builds + misc other CI updates (#1462)
* Remove unneeded libcurl-dev build dep

* Make apt-get operations quieter

* apt repo updates

- store the apt repo gpg pubkey in the repo rather than having to fetch
it every time
- add the apt repo for all the deb builds
- update apt repo URL to deb.loki.network instead of
deb.imaginary.stream

* Use http so that we don't need ca-certificates

The repo packages are already signed so using https really isn't
important.

* Add hack to ignore jsonnet conflicts in deb builds

* Add build machine name to build output

* We don't install any shared libs currently
4 years ago
Jason Rhinelander eea0929077
Move resolvconf from deb branches to contrib/ (#1439)
* Move resolvconf from deb branches to contrib/

This script gets invoked by the systemd service after startup to update
resolvconf with the lokinet dns server.

It was previously living in debian/lokinet-resolvconf in the
debian/ubuntu branches, but really belongs in contrib/ instead.

* Disable LTO on sid gcc/clang-11
4 years ago
Jeff e731eab4b6
bugfixes for lokinetmon (#1426)
* bugfixes for lokinetmon

* move call to fetch version to before mainloop
4 years ago
Jeff a01a622fce
make drone ci use debian testing (#1413) 4 years ago
Jeff 53598ec0e9
dont serialize ephemeral members of service identity (#1370)
* prepare for keytool script

* dont serialize ephemeral members in service key file
* regnerate ephemeral members in service identity on load

* add keygen script

* use nacl for generating keys

* format
4 years ago
Jeff a9d23d3ac3
use absolute path for route command (#1354)
* ignore tun interfaces on windows for mitigating foot cannons

* add flag for git add -p when using format verifier as git hook

* use explicit path for route command on windows

* fix typo

* fix typo

* remove hunk for win32 route exclusion based off being a tun interface

* add metric to win32 route command

* * refactor win32 route poking to use a common function for iterating over routes

* put interface in route poking for default route

* mnake it compile

* use correct route command on windows

* use fs::path for service::Identity::EnsureKeys
4 years ago
Jason Rhinelander f5e5066bd5
Update deps (#1348)
* Update submodules/static deps to latest versions

* Add mingw zmq build patch

* Drop support for Windows 2000
4 years ago
cathugger 838d28c6ed
contrib: NetworkManager dnsmasq config (#1335) 4 years ago
cathugger 412821ed77
contrib: systemd-resolved config (#1334) 4 years ago
Jeff Becker 9494315bc6
add lokinet-vpn to ci upload artifacts 4 years ago
Rick V 5c34665fce
move win32 lokimq patch 4 years ago
Jeff Becker eb0f29223a
add docs to gdb-filter.py
turn off thread logging in gdb
make sure everything runs in gdb when running test
add note in contrib/format.sh about a GNU-ism
4 years ago
Jeff Becker 0d6e3bcd89
fix crashing tests 4 years ago
Jeff Becker 1ac7da294f
use bt full 4 years ago
Jeff Becker 52bc2facc2
add gdb to ci runners on debian to catch backtraces if they happen 4 years ago
Jeff Becker 5c039233db
remove the dreaded makefile and update docs 4 years ago
Jeff Becker c5dbb670ca
set sane defaults for config, implement lmq rpc server, update lokinetmon 4 years ago
Jeff Becker b1259e25c5
set sane defaults for config, implement lmq rpc server, update lokinetmon 4 years ago
Jason Rhinelander e2ad0e8f09 DRY out ci upload script 4 years ago
Jeff Becker d096f5375f
pass in WINDOWS_BUILD_NAME to uploader to mark 64bit and 32bit builds distinctly 4 years ago
Jeff Becker c323025722
set windows ci build output to include arch 4 years ago
Jeff Becker 809198636b
chmod +x the script 4 years ago
Jeff Becker 1b10e69b10
update ci to use zip for windows 4 years ago
Jeff Becker fdfdd2a1d2
turn off lto, add patches 4 years ago
Jeff Becker ba1265d94f
set ARCH_TRIPLET to CROSS_TARGET to please the cmake cross compile god 4 years ago
Jeff Becker 48c7d6fbe5
consolidate windows ci drone jizz 4 years ago
Jeff Becker 2e806cc145
set CMAKE_CROSSCOMPILE to on so we are cross compiling in ci 4 years ago
Rick V e43869d9a2
FUWAS 4 years ago