Commit Graph

271 Commits (dev)

Author SHA1 Message Date
dan 0632e88de0 Make new header for json type conversions 1 year ago
dan 13b01c86a6 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)
refactored config endpoint
    - added rpc call script (contrib/omq-rpc.py)
    - added new fxns to .ini config stuff
    - added delete .ini file functionality to config endpoint
    - added edge case control for config endpoint

add commented out line in clang-form for header reorg later
1 year ago
dan dc7f3cee22 Replace cxxopts with CLI11
- Simiplifies CLI code for future modification
- filesystem library linked in cmake check_for_std_filesystem file
1 year ago
Jeff Becker 3b6cbec08e
fix typo in filename 2 years ago
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).
2 years ago
Jason Rhinelander 4bf80833f4
Add InterfaceInfo formatter 2 years ago
Jason Rhinelander 82e2e6fb10
bake in bootstrap fallbacks at build time
also change the defailt/fallback bootstrap file for testnet to be a list
of RCs (albeit of size 1) rather than just an RC dict.
2 years ago
Thomas Winget cc1bcf86fa
Fallback bootstrap router build parameter
Adds a fallback bootstrap file path parameter to CMake, specify
-DBOOTSTRAP_SYSTEM_PATH="/path/to/file" to use.

Adds a list of (currently 1) obsolete bootstrap RouterIDs to check
bootstrap RCs against.  Will not use bootstrap RCs if they're on that
list.

Log an error periodically if we appear to be an active service node but
have fewer than a set number (5) known peers.

Bumps oxen-logging version for literal _format.
2 years ago
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.
2 years ago
Jason Rhinelander bb85ec4595
De-inline vpn/win32.hpp 2 years ago
Jason Rhinelander 15443568db
Apply some lipstick to llarp_buffer_t
This class is cursed, but also broken under gcc-12.  Apply some lipstick
to get it moving again (but we really need to refactor this because it
is a mess).
2 years ago
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
2 years ago
Jeff baddad9564
remove compat wrapper 2 years ago
Jeff 253d22db4f
restucture dbus parts
* move dbus into llarp/linux/dbus.hpp and llarp/linux/dbus.cpp
* provide platform abstraction for setting dns in preparation for network manager
2 years ago
Jeff 74362149eb
refactor dns subsystem
we want to be able to have multiple locally bound dns sockets in lokinet so
i restructured most of the dns subsystem in order to make this easier.

specifically, we have a new structure to dns subsystem:

* dns::QueryJob_Base

base type for holding a dns query and response with virtual methods
in charge of sending a reply to whoever requested.

* dns::PacketSource_Base

base type for reading and writing dns messages to and from wherever they came from

* dns::Resolver_Base

base type for filtering and handling of dns messages asynchronously.

* dns::Server

contextualized per endpoint dns object, responsible for all dns related isms.

this change hides all impelementation details of all of the dns components.
adds some more helper functions for parsing dns and dealing with OwnedBuffer.

overall dns becomes less of a pain with this new structure. probably.
2 years ago
Jason Rhinelander 496c1d274c Stub out the peer stats sqlite_orm code
This avoids needing to build it and include it in static builds since we
aren't currently making use of it.
2 years ago
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.
2 years ago
Jeff 8cde7c7e7a
fix win32 and android builds 2 years ago
Jason Rhinelander eec8244a6c
Remote util::Printer and related cruft 2 years ago
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).
2 years ago
majestrate a9a9593128
Merge pull request #1938 from jagerman/no-empty-compilations
Don't build empty cpp files
2 years ago
Jason Rhinelander c37d6ea43b
Remove shadow testing framework
Bitrotten and apparently doesn't work with libuv event loop.
2 years ago
Jason Rhinelander 4a4f16e5c8
Remove dead code: netns, shell hooks
These haven't been activated in a long time and aren't worth
resuscitating.
2 years ago
Jason Rhinelander 8c3d1b3281
Don't build empty cpp files
We shouldn't be compiling these .cpp files at all on other platforms,
rather than compiling empty .cpp files (which later results in "... has
no symbols" warnings).
2 years ago
Jeff 9556741f6a
split up link order for oxenmq and oxenc
* lokinet uberlib needs oxenc and oxenmq
* lokinet-util only needs oxenc

fixes #1911
2 years ago
Jeff 64684d4dd4 dont require libcrypt for cross compiled builds 2 years ago
Jeff 7a8410b375 make more platforms ignore libcrypt 2 years ago
Jeff ee12ba51d5 disable hashed auth on windows 2 years ago
Jeff 5050cd0299 add hashed password capability to endpoint auth by file 2 years ago
majestrate 838183e36e
Merge pull request #1748 from majestrate/liblokinet-udp-api-2021-09-19
liblokinet updates
2 years ago
Jeff 95efe8f4e5 bump ngtcp2 to v0.1.0 tag 2 years ago
Jeff Becker ba57ab04aa wire up liblokient_udp_* 2 years ago
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
3 years ago
Jeff ed271de715
make lokinet-util library static
every other lokinet internal lib is static, but liblokinet-util was not, this fixes that.
3 years ago
Jason Rhinelander 3f0b34e860
Consolidate apple-specific bits into llarp/apple 3 years ago
jeff 7db2459469
macos sort of works now 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 64cd2990bc
remove old routing table maniuplation code 3 years ago
Jeff Becker 9ad90d029d
* use weak_ptr on core rpc
* use reachability testing code lifted storage server's code
3 years ago
Jeff Becker 209bcc39dd
make liblokinet target work on nsis cpack 3 years ago
Jeff Becker 8c0f448e12
add liblokinet option to nsis cpack installer 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 83b0f25075
cleanup after rebase 3 years ago
Jeff Becker fedc56e3f1
initial commit for #1595 3 years ago
Jeff Becker 25e338d621
srv records
* add srv records in RCs if we have any
* add mechanism to add SRV records for plainquic exposed ports
* resign and republish rc or introset on srv record changes
3 years ago
Jeff Becker 3977c12da6
dont try to build untracked file 3 years ago