Commit Graph

465 Commits

Author SHA1 Message Date
dr7ana
ac6255c736 Squashed commits for merge errors afer fixing client-refactor:
- Deprecate pathset, smashed into PathBuilder (renamed to PathHandler)
- Re-abstraction of sessions and PathHandlers
  - Renamed PathBuilder -> PathHandler to more accurately reflect purpose
  - {Service,Exit}Handler will remain as PathHandlers, though currently no path-sharing amongst sessions being managed is to be implemented. Handlers will maintain their own paths for both lookups and initiating sessions, while sessions will manage their paths independantly.
  - Session object handling necessitates the differentiation between outbound and inbound sessions. Initiators of sessions are entirely responsible for dictating the chosen path on which the session communicates, and must therefore continually build and manage paths for the negotiated session.
  - Outbound sessions are now {Service,Exit}Sessions
  - Inbound sessions are implemented with InboundSession, which is agnostic to the type of service being operated locally (service vs exit, client vs relay, etc). When the Session initiator signals a switch to a different path, it will be assigned to the InboundSession object by {Service,Exit}Endpoint, which manages local services and exits
2024-02-05 05:19:05 -08:00
dr7ana
b733415e68 formatting 2024-02-02 12:50:48 -08:00
dr7ana
5f8e1ada15 formatting 2024-02-01 04:48:55 -08:00
dr7ana
7970ad2d07 Simul-defer connections
- When two relays are repeatedly attempting connections to one another simultaneously, the connection initiated by the RouterID that appears first (in lexicographical order) is deferred to. The connection initiated by the other endpoint is marked to close quietly (w/o executing callbacks), and is rejected in the TLS verification hook
- Bypassing callback execution is critical, as it will clean-up the link::Connection object for the connection that is being deferred to; this results in BOTH connections being destroyed.
2024-01-31 07:54:12 -08:00
dr7ana
261fc6be83 REVERT: verbose close logging
- misc libquic fixes squashed into this
- thread-safe wrapping
2024-01-31 07:54:12 -08:00
dr7ana
c0b6277496 HAPPY NEW YEAR 2024-01-31 07:54:12 -08:00
Jason Rhinelander
6bb65ccf6f Fix SETCAP disabling
If you start without -DWITH_SETCAP=OFF, but then later re-run cmake,
SETCAP is still set (and so still gets tried).  This fixes it.
2024-01-31 07:54:12 -08:00
Jason Rhinelander
6231b4908e Remove release motto
This doesn't really have a purpose.
2024-01-31 07:54:12 -08:00
Jason Rhinelander
e43833ad32 Update logging in daemon.cpp
Some of these were wrong (trying to use formats that didn't work); this
updates them all to new-style logging.
2024-01-31 07:54:12 -08:00
dr7ana
6a32148402 address parsing
- straightened out setting of public addr and public port in config vs listen ("bind") addr
- fixed small bug in router contact writing and saving
2024-01-31 07:54:12 -08:00
dr7ana
ec887062e9 testnet prep
- disable reachability testing with config option; required to be done on testnet
- reachability testing pipeline through link_manager executes pings similar to storage server. connection established hook reports successful reachability, while connection closed callback (with non-default error code) reports unsuccessful testing
2024-01-31 07:54:12 -08:00
dr7ana
c149651d64 A soothing re-nomenclatura 2024-01-31 07:54:12 -08:00
dr7ana
632f4ee70b RC refactor layout
- Local and Remote RC's now implemented with discrete functionalities and uses
2024-01-31 07:54:12 -08:00
dr7ana
98583b8f58 Windows CI fixes
- some weird function call business
- string formatting
- etc
2024-01-31 07:54:12 -08:00
dr7ana
127ac2c9aa windows fixes 2024-01-31 07:54:12 -08:00
dr7ana
57393ea740 Review fixes
- cleaned up include-what-you-use errors (mostly quoted includes)
- misc fixes
2024-01-31 07:54:12 -08:00
dr7ana
f574cd798f Clang format include sorting + CMake
- includes are now sorted in consistent, logical order; first step in an attempt to fix the tomfoolery (no relation to Tom) brought in by include-what-you-use
- shuffled around some cmake linking to simplify dependency graph
- superfluous files removed
2024-01-31 07:54:12 -08:00
dr7ana
12a89328fe Cmake restructuring 2024-01-31 07:54:12 -08:00
dr7ana
c0b19de963 Review commit 2024-01-31 07:54:12 -08:00
dr7ana
206bd0b85e wawaweewa 2023-10-03 13:11:51 -07:00
dr7ana
9acac2c33e CI fixes
- oxen-logging updated to bump fmt version
- version bump oxen-logging to fix fmt version
- version bump oxen-mq to solve uniform distribution error
- misc errors introduced by above version bumps
- clang-format 14 -> 15
2023-08-11 14:01:07 -07:00
dan
9bfe881a35 OMQ_Request handling logic change 2023-02-01 15:52:37 -08:00
dan
b2e8cde64b working new endpoints
- added hotswap functionality
- map_exit and unmap_exit working
2023-02-01 15:52:37 -08:00
dan
0632e88de0 Make new header for json type conversions 2023-02-01 15:52:37 -08:00
dan
d3e69fe3c5 added unmapexit and listexit endpoints 2023-01-24 09:44:02 -08:00
drouhana
0edfe8ff83
IPC Socket Fixes (#2111)
* Updated RpcServer Initialization and Logic

-- Moved all RPCServer initialization logic to rpcserver constructor
-- Fixed config logic, fxn binding to rpc address, fxn adding rpc cats
-- router hive failed CI/CD resulting from outdated reference to rpcBindAddr
-- ipc socket as default hidden from windows (for now)
2023-01-20 14:15:18 -04:00
dan
b31a266be8 testnet fixes
-- add ability to pass .ini path without --config flag
-- -r flag runs lokinet in router mode
2023-01-10 14:03:41 -08:00
dan
ea740ffd79 options.overwrite and options.force are redundant given refactor. they are now combined 2023-01-10 06:35:41 -08:00
dan
26beebca97 logic fix, commit to be stashed 2023-01-09 11:43:25 -08:00
dan
b6991bb59a lokinet.cpp CLI and logic fixes
- added single dash to one letter flags to fix CLI incorrectconstruction error
- fixed generate file error
2023-01-09 11:28:25 -08:00
dan
dc7f3cee22 Replace cxxopts with CLI11
- Simiplifies CLI code for future modification
- filesystem library linked in cmake check_for_std_filesystem file
2023-01-06 15:04:14 -08:00
Jeff Becker
0cf637178d
prevent throwing on no error in lokinet-vpn 2022-11-02 15:42:49 -04:00
Jeff Becker
d911e26b1d
remove duplicate log statement 2022-11-01 19:09:17 -04:00
Jeff Becker
57b77fecb3
fix crash on shutdown
we were calling llarp::Context::HandleSignal from a non mainloop
thread when running as a win32 service. this caused issues with a non
clean destruction.

call our signal handler instead of llarp::Context::HandleSignal
2022-11-01 11:06:01 -04:00
Jason Rhinelander
95c0c8a707
Improve windows running-as-a-service detection works
Get rid of the --win32-daemon hack (which was removed from the service
itself earlier in this PR, by mistake) and replace it with detection of
the error code for "not running as a service" that windows gives us back
if we try to set up service controller dispatching but aren't a service.
2022-11-01 11:06:00 -04:00
Jason Rhinelander
5be7dbf8ec
Move log init even earlier 2022-11-01 11:06:00 -04:00
Jeff Becker
a16af792d2
simplify logic for disabling service manager on windows 2022-11-01 11:06:00 -04:00
Jason Rhinelander
64cf268457
Fix crashes in wintun and windivert stopping
Fixes windows shutdown crashes:

- windivert wasn't handling an ERROR_NO_DATA, which it gets when
  finished handling everything after a shutdown.
- wintun ReadPacket still gets invoked after end_session is called, but
  shouldn't be.  This adds an atomic<bool> to early return.
- fixes up some settings we send for windows service manager notify
2022-11-01 11:05:58 -04:00
Jason Rhinelander
879e678771
Remove dead/redundant code
- win32_platform.cpp is dead
- win32_platform.hpp is useless

Style changes from clang-tidy warnings:
- remove `virtual` from some definitions that already have `override`
- remove virtual destructor from NetworkInterface because it already has
  a virtual destructor via the base type (and clang-tiny warns about it)
2022-11-01 11:05:58 -04:00
Jeff Becker
4103908a8d
system layer manager (llarp::sys::service_manager)
the win32 and sd_notify components provided a disjointed set of
similar high level functionality so we consolidate these duplicate
code paths into one that has the same lifecycle regardless of platform
to reduce complexity of this feature.

this new component is responsible for reporting state changes to the
system layer and optionally propagating state change to lokinet
requested by the system layer (used by windows service).
2022-11-01 11:04:58 -04:00
Jeff Becker
a7f3c3595b
fix comment to reflect reality 2022-10-27 11:03:45 -04:00
Thomas Winget
7ddad87dbf some useful log statements 2022-10-27 11:00:40 -04:00
Jeff Becker
9cdfae2e42
correct windows service manager behavior.
report status to window service manager when we get and iterogate
message from the service manager.
update comments to reflect these changes.
2022-10-27 10:54:43 -04:00
Thomas Winget
fcc4f6050d
wait until actually stopped to tell windows we are
We should send STOP_PENDING rather than STOPPED while we aren't yet
actually stopped; STOPPED is already sent when we actually finish
stopping.

Also fixes some silly argc/argv shenanigans, I think.
2022-10-27 09:32:06 -04:00
Jason Rhinelander
d011f8fb4a
Bump clang-format to 14 2022-10-20 19:53:52 -03:00
Jason Rhinelander
bd8dffc730
Merge pull request #1991 from jagerman/lokinet-vpn-cleanups
Lokinet vpn cleanups
2022-10-06 16:09:56 -03:00
Jason Rhinelander
dc358a6eda
macos: Fix hanging --start when Lokinet already running
If you stop/start the GUI but it doesn't exit on start, the second
--start (when lokinet is already running) waits for a state change that
doesn't come (because lokinet is already running).  This add a check for
already-running so that we exit right away in such a case.
2022-10-06 11:56:07 -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
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