1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00
Commit graph

390 commits

Author SHA1 Message Date
Jeff Becker 5c457ff486
refactor logging to use std::source_location
* use std::source_location instead of godawful macros in logging
* remove unused/absolutely haram af json logstream
* fix bug in android logger where it doesn't respect eLogNone
2021-10-06 11:10:48 -04:00
Jason Rhinelander 488ed47cda Remove duplicate handling of jemalloc
We were linking/loading it in different ways, one with cmake option
`USE_JELLOC` and the other, older version `WITH_JEMALLOC`.  This removes
the latter (which was default OFF) and keeps the former (which was added
and has been default ON since 0.9.4 or so).

Also removes the `ifdef`ed JEMALLOC code in lokinet.cpp because we don't
need it; just linking to jemalloc is enough to get the malloc/free
replacements.
2021-09-13 13:26:12 -03:00
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).
2021-09-10 19:38:32 -03:00
Jason Rhinelander 8df5005f54
Apply suggestions from code review 2021-09-10 19:22:22 -03:00
Jeff Becker 7e1236503c
make lokinet-bootstrap target toggleable
add cmake option to disable building lokinet-bootstrap binary
2021-09-10 10:41:42 -04:00
Jason Rhinelander dbea1f98e7
Merge pull request #1651 from majestrate/lokinet-bootstrap-help-messages-2021-05-18
add --help and -h flags to lokinet-bootstrap to show help message
2021-09-08 19:56:32 -03:00
Jason Rhinelander 6c3c523404 Update wording and wrap help message 2021-09-08 19:48:25 -03:00
Jeff Becker 979488830e
remove unused import
lokinet.swift no longer touches internals of lokinet network extension so we remove the import for it
2021-09-03 07:49:29 -04:00
Jason Rhinelander 831cc23de1 Remove obsolete bigs
Removes stuff we didn't end up needing/using:
- Lokinet.modulemap
- apple bits from lokinet.cpp (we don't use lokinet.cpp at all on macos
  anymore).
- dnsproxy/extension C++ headers
- apple-specific network extension config in llarp::config::Config
2021-09-02 19:19:54 -03:00
Jason Rhinelander 92c7fb9872 LOKINET_VERSION -> built in lokinet_VERSION 2021-09-02 19:11:41 -03:00
Jason Rhinelander 8aef5d742d Re-enable LTO; target macos 10.12+ 2021-09-02 19:07:40 -03:00
Jason Rhinelander 067fcf71d3
Remove dead code 2021-09-02 14:17:10 -04:00
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.

-
2021-09-02 14:17:09 -04:00
Jason Rhinelander 712b5a5608
Tweak icns generation to only run when necessary 2021-09-02 14:17:09 -04:00
jeff deb0a982be
it works 2021-09-02 14:17:09 -04:00
jeff 1272a4fbe1
add dummy sign target for ci when we don't have signing keys
remove static macos from ci pipeline
2021-09-02 14:17:09 -04:00
jeff 7db2459469
macos sort of works now 2021-09-02 14:17:09 -04:00
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.
2021-09-02 14:17:08 -04:00
Jason Rhinelander 3ab117a03b
Switch extension from a framework to an appex 2021-09-02 14:17:08 -04:00
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.
2021-09-02 14:17:08 -04:00
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
2021-09-02 14:17:08 -04:00
jeff 5edd045c9b
add swift version bullshit file and additional bullshittery 2021-09-02 14:17:08 -04:00
jeff 0708a0d897
initial network extension code for macos
probably does not work
2021-09-02 14:17:08 -04:00
Jeff Becker 37a9bd768e
fix linking on win32 for lokinet.dll
only apply static link flags for executables
2021-06-08 08:32:44 -04:00
Jeff Becker 7ba15f91f3
add --help and -h flags to lokinet-bootstrap to show help message 2021-05-25 06:41:59 -04:00
Jason Rhinelander 73a29d3b07 Link lokinet-bootstrap against libssl as well
Just crypto apparently isn't enough, at least on some arches/distros.
2021-04-19 23:45:36 -03:00
Jeff Becker c547cd0118
fixes for lokinet-bootstrap
* use schannel on windows platforms
* load ca bundle for non windows platforms
* use geteuid for detecting root user when finding default data dir
2021-04-19 07:08:23 -04:00
Jeff Becker 3d87dbff91
bullshit for windows and openssl with CPR
* windows static cross compile is wonky af so we add some hacks to make it work
2021-04-19 07:08:03 -04:00
Jason Rhinelander 2ca7ef7f5f
Rename isRouter -> isSNode
The isRouter wording was quite confusing, especially in a call such as:

    router->Configure(config, opts.isRouter, nodedb)
2021-04-19 06:58:36 -04:00
Jason Rhinelander 1d6ad7284c
Fix cursed formatting 2021-04-19 06:58:36 -04:00
Jeff Becker c92894804c
Merge remote-tracking branch 'origin/stable' into dev 2021-04-17 09:18:37 -04:00
Jeff Becker 68826f10bb use binary mode for writing files 2021-04-16 18:52:18 -03:00
Jeff Becker 4daebc0141
catch exception and print out error 2021-04-16 15:01:00 -04:00
Jeff Becker a0d3ab125a
throw on failed writing and port fs namespace changes from oxen-core 2021-04-16 14:47:17 -04:00
Jeff Becker a80d8b95b3
update lokinet-bootstrap
* compat with old shell script curl wrapper's arguments
* do lazy validation of fetched data
2021-04-16 14:16:16 -04:00
Jeff Becker 77de60af91
require openssl explicitly for lokinet-bootstrap 2021-04-16 09:40:36 -04:00
Jeff Becker 27c80a2638
add include directory for daemon directory so llarp/* includes work 2021-04-16 05:51:34 -04:00
Jeff Becker e8178a032e
lokinet-bootstrap native binary 2021-04-15 20:06:15 -04:00
Jeff Becker 0c37cc7f60
lokinet-bootstrap native binary 2021-04-15 13:39:45 -04:00
Jeff Becker 54c56a6d28
remove references to lokimq namespace
these were not found during the first passes and now that lokimq is gone from my machine this failed to compile
2021-03-15 08:46:19 -04:00
Thomas Winget 7caa87862e standardize include format and pragma once
All #ifndef guards on headers have been removed, I think,
in favor of #pragma once

Headers are now included as `#include "filename"` if the included file
resides in the same directory as the file including it, or any
subdirectory therein.  Otherwise they are included as
`#include <project/top/dir/relative/path/filename>`

The above does not include system/os headers.
2021-03-09 19:01:41 -05:00
Jason Rhinelander 91d6698a9d Reformat with clang-format-11 2021-03-05 13:36:31 -04:00
Jason Rhinelander ccc7b5c9e9 Merge Logic functions into EventLoop
loop->call(...) is similar to the old logic->Call(...), but is smart
about the current thread: if called from within the event loop it simply
runs the argument directly, otherwise it queues it.

Similarly most of the other event loop calls are also now thread-aware:
for example, `call_later(...)` can queue the job directly when called if
in the event loop rather than having to double-queue through the even
loop (once to call, then inside the call to initiate the time).
2021-03-04 16:51:18 -04:00
Jeff Becker 4540c964f5
rework cmake install targets
* redo setcap on linux so that it's required to do install targets on linux
* add -DWITH_SETCAP=OFF option to bypass setcap requirement on linux
* remove lokinet-bootstrap.ps1 as we bundle the bootstrap in the win32 installer now
* remove references to lokinet-bootstrap.ps1 in cmake
2021-03-04 14:02:53 -05:00
Jeff Becker d4112b157c
add explicit check for setcap binary when doing setcap so when it's missing it's not a nop / silent failure 2021-03-02 07:22:31 -05:00
Jeff Becker ffef3bc48f
wire up sigusr1 to reset libunbound dns resolver 2021-02-17 13:32:55 -05:00
Jeff Becker bd93a8f828
initial v6 exits 2021-02-16 10:59:57 -05:00
Jeff Becker d112a50096
minidump fix 2021-02-02 13:16:18 -05:00
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
2021-02-02 09:35:40 -05:00
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
2021-01-11 18:13:22 -05:00