Commit Graph

8036 Commits

Author SHA1 Message Date
Jason Rhinelander c4c5d128c3
Add ring buffer sink to macos build 2022-10-06 11:56:06 -03:00
Thomas Winget eaf30de1fd
omq rpc log subscription
respects whether RPC is enabled, removes the log sink otherwise

bumps oxen-mq and oxen-logging
2022-10-06 11:56:04 -03:00
Jason Rhinelander fc07b8a10e
Merge pull request #2005 from jagerman/profiling-bencode-refactor
file slurp/dump and profiling refactor
2022-10-06 11:55:19 -03:00
Jason Rhinelander 006394315d
Add local mirror to most jobs; build script cleanups 2022-10-05 19:29:47 -03:00
Jason Rhinelander fae527517d
Try to appease android's crappy toolchain 2022-10-05 17:34:55 -03:00
Jason Rhinelander 75e382604b
Bump required oxenc version 2022-10-05 16:48:59 -03:00
Jason Rhinelander f641c08e80
llarp/profiling: refactor to use oxenc producer/consumer
No more llarp_buffer_t here!

(I was tracking down a segfault which led me in here and it was easier
to rewrite this to use bt_dict_{consumer,producer} than to decipher all
the cursed llarp_buffer_t and bencode callback nest).
2022-10-05 16:35:16 -03:00
Jason Rhinelander d335527a70
Add binary file slurp/dump utility functions
We have basically this same bit of code in tons of places; consolidate
it into llarp::util::slurp_file/llarp::util::dump_file.

Also renames all the extra junk that crept into llarp/util/fs.hpp out of
there into llarp/util/file.hpp instead.
2022-10-05 16:34:32 -03:00
Jason Rhinelander 3891141755
Merge pull request #2004 from jagerman/mac-icon-rework
Rewrite and tweak the macos icon
2022-10-05 12:53:38 -03:00
Jason Rhinelander ca26b20b2f
Scale down the inner part of the logo a bit 2022-10-04 20:51:29 -03:00
Jason Rhinelander 6b352c7fd8
Rewrite and tweak the macos icon
The old one was way too big on mac relative to other icons.  This scales
the background down, while keeping the black logo parts the same, and
changes the rounding of the corners to match native macos apps.

This also rewrites it from scratch to use a useful coordinate system
which allows drawing all the fundamentals in much more useful units.
2022-10-04 13:57:59 -03:00
Jason Rhinelander 66c79b232a
Fix log warning 2022-09-22 13:22:43 -03:00
Jason Rhinelander ab11a8128d
lokinet-vpn: misc cleanups
- Add a function to extract a value from parsed options, to DRY out the
  code a little bit.
- Add a exit_error function to format a message to stdout and then
  return the code, to simplify the repeated print-and-return code used
  when errors occur.
- Use fmt for output formatting
- Add an error if multiple modes are specified at once
  (--up/--down/--status/--exit)
- Add error printing around unmap
2022-09-21 13:38:18 -03:00
Jason Rhinelander f8f7f20666
Rename LMQ -> OMQ 2022-09-21 13:38:18 -03:00
Jason Rhinelander 71ea4f4fa2
RPC: Relax token/range argument handling
- Accept empty string or `null` for token to mean "no token."
- Accept `null` for range to mean "default range."
- Don't use a default range (::0/0) in lokinet-vpn because this will
  fail if IPv6 ranges aren't supported on the platform (e.g. on
  Windows), and isn't necessary: if we omit it then the rpc code already
  uses ::0/0 or 0.0.0.0/0 by default, as needed.
2022-09-21 13:38:17 -03:00
Jason Rhinelander 8b321612da
Merge pull request #1969 from majestrate/wintun-windivert-2022-08-02
use wintun and windivert for windows platform bits
2022-09-21 13:37:41 -03:00
majestrate f777075893
Merge pull request #1986 from majestrate/docs-2022-09-04
restructure readme and docs
2022-09-20 11:48:07 -04:00
Jason Rhinelander 90be75d04e
Disable mips cross compile build on ci 2022-09-19 21:54:36 -03:00
Jason Rhinelander 9529553cf6
Add oxen build mirror to linux static builds 2022-09-19 20:42:45 -03:00
Jason Rhinelander 83f7e8193c
Disable installer path modification
This is not likely to be usable to many people, and people who it *is*
useful for are knowledgeable enough to modify it themselves.  Most users
get no use at all and it most likely just confuses them instead.
2022-09-19 20:26:41 -03:00
Jason Rhinelander 2709ec1930
Android build fixes for openssl 3.0.5
- ANDROID_NDK_ROOT must be set in env
- cmake should be setting `-DANDROID_API=23`
- specify the correct android API via a define when building openssl; it
  has to be in CPPFLAGS (not CFLAGS) because otherwise openssl's
  configure script doesn't notice and overrides our define with the
  latest API version.
- openssl configure puts $(ANDROID_NDK_ROOT) in the makefile, so we have
  to be sure that we put it in the environment for the build command,
  too.
2022-09-19 20:26:41 -03:00
Jason Rhinelander 616f559761
macos CI fixes
- Split up mac.sh into a configure + build scripts (like Windows).
- Don't attempt to build the 'package' target in CI: apparently you have
  to have a logged in user at the GUI in order to build a .dmg because
  being obtuse is the Apple way.
- Upload the raw Lokinet unsigned app in a .tar.xz, rather than dmg,
  because of the above.
- make mac.sh respect JOBS (pun not intended (but still good))
2022-09-19 20:26:41 -03:00
Jason Rhinelander 1f9779cdcd
Windows compilation fix 2022-09-19 20:26:41 -03:00
Jason Rhinelander b2cd9a9eec
openssl 3 build fixes
SYSTEM/MACHINE apparently doesn't work anymore and you have to pass the
system-machine value into the (cursed nasty hacky perl) configure
script.
2022-09-19 20:26:40 -03:00
Jason Rhinelander 7078ab06bc
compiler warnings cmake 3.13 compatibility fix 2022-09-19 20:26:40 -03:00
Jason Rhinelander 93c01623b0
Format fixes & fix warning in format script
- Don't escape '#' in the greps in format.sh: they warn about a spurious
  `\` in the latest grep.
- reformat
2022-09-19 20:26:40 -03:00
Jason Rhinelander ec91a6db05
ReconfigureDNS fixes, fixes macos exit mode
- ReconfigureDNS wasn't returning the old servers; made it void instead
  (the Apple code can just store a copy of the original upstream
  servers instead).
- Reconfiguring DNS reset the unbound context but didn't replace it, so
  a Down()/Up() would crash.
- Simplify Resolver() destructor to just call Down(), and make it final
  just so that no one tries to inherit from us (so that calling a
  virtual function from the destructor is safe).
- Rename CancelPendingQueries() to Down(); the former cancelled but also
  shut down the object, so the name seemed a bit misleading.
- Rename SetInternalState in Resolver_Base to ResetResolver, so that we
  aren't conflicting with ResetInternalState from Endpoint (which was a
  problem because TunEndpoint inherited from both; it could be resolved
  through the different argument type if we removed the default, but
  that seems gross).
- Make Resolver use a bare unbound context pointer rather than a
  shared_ptr; since Resolver (now) entirely manages it already we don't
  need an extra management layer, and it saves a bunch of `.get()`s.
2022-09-19 20:26:40 -03:00
Jason Rhinelander 2ccc518849
Fix apple dns, part 817 2022-09-19 20:26:40 -03:00
Jeff Becker bd09f7716d
override method 2022-09-19 20:26:40 -03:00
Jeff Becker 13d1301e08
rewire up dns reconfiguration for macos 2022-09-19 20:26:40 -03:00
Jason Rhinelander 52c6cd497f
Apple DNS fix WIP 2022-09-19 20:26:40 -03:00
Jason Rhinelander 2aae56b0e0
Apple DNS configuration fix: don't obliterate trampoline
On Apple, the network extension is outside the tunnel routing, so we
cannot have libunbound talk directly to upstream (it would leak DNS when
exit mode is enabled).  Instead unbound *always* talks to a localhost
port where we have a "dns trampoline" that takes UDP packets and shoves
them through the tunnel.

We were doing that already, but recent changes here were overwriting the
libunbound settings with.

This also moves the upstream DNS configuration part of `Up()` into its
own method.
2022-09-19 20:26:40 -03:00
Jason Rhinelander 4d920bb2e2
Fix macos
We don't have a resolver on macos, so we were running through this loop
with fails == 0 == m_Impls.size() and throwing, crashing the process.

Early return to avoid the failure and fix macos crash.
2022-09-19 20:26:39 -03:00
Jeff Becker b81ae95246
remove hunk of win32 specific code, it is dead in this codepath 2022-09-19 20:26:39 -03:00
Jason Rhinelander 27d58044c7
macos compilation fixes 2022-09-19 20:26:39 -03:00
Jason Rhinelander a82907bc6c
Set various -W flags on apple
Apple supports anything here that Clang supports and should have them
set the same as everywhere else.

Most importantly this gives apple the -Wno-deprecated-declarations flag
which has been driving me nuts on macos.

This also version-gates the -Wno-deprecated-declarations so that it
will turn on again when we bump the version beyond .10.
2022-09-19 20:26:39 -03:00
Jason Rhinelander c7597c1abd
OpenSSL 1.1.1 -> 3.0.5 2022-09-19 20:26:39 -03:00
Jeff Becker 379ac755ec
make unit tests pass
changes to how config defaults, specifically allowing defaults to be a
vector, broke unit test compilation. this makes them compile again.
2022-09-19 20:26:39 -03:00
Jason Rhinelander 291f311259
Fix linked list iteration for windows ip/gateways
We were requiring `->Next` be true, which means we skipped the last (and
often only) entry of the linked lists and so never properly found the
gateway.
2022-09-19 20:26:39 -03:00
Jason Rhinelander 9097435f64
Refactor/fix GetAdaptersAddresses
- We need to pass a flag to get Windows to include gateway info.
- Refactor it to use microsoft's recommended magic default 15000 buffer
  size and repeat in a loop a few times until it works.  Developers,
  developers, developers, developers!
2022-09-19 20:26:39 -03:00
Jason Rhinelander d1e997177d
Add missing != operator to nuint_t 2022-09-19 20:26:38 -03:00
Jason Rhinelander 613459401d
Linux route poker fixes
- don't add routes when not in exit mode
- don't call Up() from rpc code (the RouterPoker itself decides when to
  call Up())
2022-09-19 20:26:38 -03:00
Jason Rhinelander e9554c7c5e
Don't do route poking when disabled
IsEnabled() is a bit broader than just IsServiceNode, so use it instead.
2022-09-19 20:26:38 -03:00
Jason Rhinelander 45b3365002
Simplifications
- a `static` is less verbose and otherwise identical to an empty
  namespace for a single declaration like this.
- operator== on two optionals already does exactly what the `is_equal`
  lambda here is doing.
- formatting
2022-09-19 20:26:38 -03:00
Jason Rhinelander 517911b499
Fix crash on shutdown
For some (wrong) reason this chunk of code was here.  Removed it to stop
a crash on shutdown.
2022-09-19 20:26:38 -03:00
Jeff Becker 0fb639db53
idempotent dns 2022-09-19 20:26:38 -03:00
Jeff Becker 26c1336517
limit route poker 2022-09-19 20:26:38 -03:00
Jeff Becker 61f66ac1ec
fix up win32 route poker a bit 2022-09-19 20:26:38 -03:00
Jason Rhinelander 15144f193c
cleanups/simplifications 2022-09-19 20:26:38 -03:00
Jason Rhinelander 9ddf7413af
Windows DNS fixes
- windivert was being set up *before* DNS is set up, so the DNS port was
  nullopt and thus we couldn't properly identify upstream DNS traffic.
- close() doesn't close a socket on Windows, so the socket-bind-close
  approach to get a free UDP port wasn't actually closing, and thus
  unbound upstream constrained to the given port were completely
  failing.
- The unbound thread was accessing the same shared_ptr instance as the
  outer code, which isn't thread-safe; changed it to copy a weak_ptr
  into the lambda instead.
- Exclude upstream DNS traffic in the filter rather than capturing and
  reinjecting it.
2022-09-19 20:26:37 -03:00