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

413 commits

Author SHA1 Message Date
Jeff Becker
7f27760c97
disable lokinet-bootstrap on windows builds 2022-09-08 14:25:00 -04:00
Jeff
871c3e3281
changeset for windows port
* wintun vpn platform for windows
* bundle config snippets into nsis installer for exit node, keyfile persisting, reduced hops mode.
* use wintun for vpn platform
* isolate all windows platform specific code into their own compilation units and libraries
* split up internal libraries into more specific components
* rename liblokinet.a target to liblokinet-amalgum.a to elimiate ambiguity with liblokinet.so
* DNS platform for win32
* rename llarp/ev/ev_libuv.{c,h}pp to llarp/ev/libuv.{c,h}pp as the old name was idiotic
* split up net platform into win32 and posix specific compilation units
* rename lokinet_init.c to easter_eggs.cpp as that is what they are for and it does not need to be a c compilation target
* add cmake option STRIP_SYMBOLS for seperating out debug symbols for windows builds
* intercept dns traffic on all interfaces on windows using windivert and feed it into lokinet
2022-09-08 14:24:59 -04:00
majestrate
a8c0f76e1c
Merge pull request #1971 from majestrate/docs-and-such-2022-08-06
more docs
2022-09-03 08:03:28 -04:00
Jason Rhinelander
f5376e98c2 Lower minimum version for swift binary
CMake apparently doesn't do anything with CMAKE_OSX_DEPLOYMENT_TARGET
for swift, which results in a 12+ minimum version.  This fixes it
(albeit in a hacky way since the only apple-sanctioned way to properly
set this appears to be "use xcode").

Shame on Apple, as usual.
2022-08-29 15:53:16 -03:00
Jeff
4c897f583c
fix up log statements
* make socket bind errors have a distinct message reported when caught using their own exception type
* omit printing banner in setup when we run from the lokinet executable (but not the liblokinet.so entry point)
2022-08-22 16:50:46 -04:00
Jeff
badf72838e
move all code directory readmes into docs/project-structure.md 2022-08-21 12:18:09 -04:00
Jason Rhinelander
2b7b1fcc79 Working signed macOS GUI build 2022-08-12 21:13:39 -03:00
jeff
181de210cd Build apple/macos GUI from lokinet project
This adds the gui as a submodule, and consolidates the GUI handling a
bit between the two platforms.
2022-08-12 21:13:39 -03:00
jeff
b8896740de build gui and assemble app bundles into one singular app bundle 2022-08-12 21:13:38 -03:00
Jason Rhinelander
09372994bb macOS system extension support
Adds support for building Lokinet as a system extension, and fixes
various problems in the macos implementation found during development of
the system extension support.
2022-08-12 21:13:38 -03:00
Jason Rhinelander
49b2878209 Require explicit disabling of codesigning
Make the mac build require passing either an explicit -DCODESIGN=OFF or
the code signing identities.
2022-08-12 20:23:00 -03:00
Jeff
5dd71995c4 add lokinet.swift cli args
* add --start flag to start lokinet
* add --stop flag to stop
* by default lokinet on macos needs a flag or it will be a nop
2022-08-12 20:23:00 -03:00
Jeff
23fd46c0db
add directory specific readmes 2022-07-26 09:26:28 -04:00
Jeff
8cde7c7e7a
fix win32 and android builds 2022-07-19 11:31:14 -04:00
Jason Rhinelander
b81f7025c9
Replace logging with oxen-logger
Replaces custom logging system with spdlog-based oxen logging.  This
commit mainly replaces the backend logging with the spdlog-based system,
but doesn't (yet) convert all the existing LogWarn, etc. to use the new
format-based logging.

New logging statements will look like:

    llarp::log::warning(cat, "blah: {}", val);

where `cat` should be set up in each .cpp or cluster of .cpp files, as
described in the oxen-logging README.

As part of spdlog we get fmt, which gives us nice format strings, where
are applied generously in this commit.

Making types printable now requires two steps:
- add a ToString() method
- add this specialization:

      template <>
      constexpr inline bool llarp::IsToStringFormattable<llarp::Whatever> = true;

This will then allow the type to be printed as a "{}" value in a
fmt::format string.  This is applied to all our printable types here,
and all of the `operator<<` are removed.

This commit also:
- replaces various uses of `operator<<` to ToString()
- replaces various uses of std::stringstream with either fmt::format or
  plain std::string
- Rename some to_string and toString() methods to ToString() for
  consistency (and to work with fmt)
- Replace `stringify(...)` and `make_exception` usage with fmt::format
  (and remove stringify/make_exception from util/str.hpp).
2022-07-15 22:17:59 -03:00
Jeff
e480e36f3d
generate windows rc for each executable target so we can set the executable name right for each one 2022-05-30 09:06:48 -04:00
Jeff
f05c2ebc71
macro removals
clean up version cmake stuff

clean up generated cpp version stuff

make all the windows rc stuff get generated by cmake

bump release motto message

properly inject release motto into version
2022-05-30 09:06:48 -04:00
majestrate
838183e36e
Merge pull request #1748 from majestrate/liblokinet-udp-api-2021-09-19
liblokinet updates
2022-02-06 13:19:08 -05:00
Jeff
97966976d0 Update CMakeLists.txt
dont depend on lokinet-shared target for sign target as we disabled it by default.
2022-01-31 10:53:48 -05:00
Jeff Becker
1feaec1169 build liblokinet on macos 2022-01-31 10:53:48 -05:00
Jeff Becker
f38bf2770d move WITH_BOOTSTRAP option to root project CMakeLists.txt 2022-01-31 10:53:48 -05:00
Jeff
2772a32907
* fix up lokinet cli help opts
* document doxygen
2021-12-10 10:40:18 -05:00
Jeff Becker
4c5b90fb03
handle exceptions on setup and config load without aborting 2021-10-06 15:36:29 -04:00
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