Commit Graph

7691 Commits

Author SHA1 Message Date
Jeff
23fd46c0db
add directory specific readmes 2022-07-26 09:26:28 -04:00
majestrate
769bc1e8df
Merge pull request #1962 from jagerman/dns-parsing-fixes
DNS message parsing fixes and cleanup
2022-07-24 11:16:39 -04:00
Jason Rhinelander
874221db70
Merge pull request #1965 from jagerman/fix-double-logging
Remove the initial sink before reconfiguring logging
2022-07-22 12:20:18 -03:00
Jason Rhinelander
884c5052a0
Merge pull request #1964 from jagerman/inbound-default-ip
Fix inbound IP handling; update [bind] docs
2022-07-22 12:20:00 -03:00
Jason Rhinelander
841abffaf5
Make outbound wildcard default to inbound IP
outbound=:1234
    outbound=0.0.0.0:1234
    outbound=
    outbound=0.0.0.0

now all default to use the inbound= IP.  (If multiple inbound= IPs are
given, we raise an exception to abort startup).

Only applies to routers (since clients don't have inbound IPs), and
eliminates potential weird edge cases with local system IP and routing
shenanigans.
2022-07-21 17:53:25 -03:00
Jason Rhinelander
f0590a9672
Remove the initial sink before reconfiguring logging
Without this, the original sink set up very early in daemon/lokinet.cpp
(which goes to stderr) is still around, and so we get double logging.
2022-07-21 15:02:23 -03:00
Jason Rhinelander
2be422fcc0
Reorganize [bind] comments
The general section comments contained all the descriptions for the
inbound/outbound settings, while inbound/outbound had no comment at all.
This moves the comments around to the individual settings, plus updates
some of the wording in the section.
2022-07-21 14:55:57 -03:00
Jason Rhinelander
c9f492d85a
Fix [bind]inbound IP-omitted handling
We were failing when using `inbound=:1234`, rather than looking for a
default IP.  This fixes it to still use the default IP, and change only
the default port.

Outbound behaviour should remain unchanged: i.e. `outbound=:2345` means
bind-to-wildcard-IP with a specific port.
2022-07-21 14:55:57 -03:00
Jason Rhinelander
6df83b613d
Fix log level being forced to warning
This code shouldn't be here; the log level was already set to its proper
default value via the earlier FromConfig call.
2022-07-21 11:34:11 -03:00
Jeff
3a97acfb51
this code needs to detect the first non-existing interface by name, not the first existing one. this remidies this. sorry testnet for breaking you 2022-07-21 07:19:43 -04:00
Jeff
83f648fd87
reword message 2022-07-20 17:04:14 -04:00
Jason Rhinelander
9ea82edc07
DNS message parsing fixes and cleanup
Fixes:

- tighten reserved name detection to not match fooloki.loki, but instead
  only match "foo.loki.loki" and "loki.loki" (and similar for reserved
  name "snode.loki").
- IPv6 PTR parsing was completely broken.
- Added tests for the above two issues.

Cleanups:

- Eliminate llarp::dns::Name_t typedef for std::string
- Use optional return instead of bool + output param
- Use string_views; we were doing a *lot* of string substr's during
  parsing, each of which allocates a new string.
- Use fmt instead of stringstream
- Simplify IPv4 PTR parsing
2022-07-20 16:50:38 -03:00
Jeff
f222aecc79
actually use correct variable in iteration 2022-07-20 15:46:45 -04:00
majestrate
6ea97ccaf4
Merge pull request #1930 from majestrate/issue-1929-06-02-2022
redo bind section of config
2022-07-20 15:02:19 -04:00
Jeff
a7cfa3ea87
use info as default log level on clients as most users have continously been confused by lack of log output with warn level as default, which i predicted would happen 2022-07-20 14:47:53 -04:00
Jeff
b819ed21d2
clean up build helper scripts:
* cleanup of android build shims
* cleanup of windows build shims
2022-07-20 13:36:04 -04:00
Jeff
68148e098f
* add mockable network functions
* add unit tests with ability to pretend to be different network setups
2022-07-20 13:36:03 -04:00
majestrate
12653d4ac2
Merge pull request #1955 from jagerman/spdlog
Logging overhaul, fmt::format, and related
2022-07-19 18:27:05 -04:00
Jason Rhinelander
f9371233ee
hive fmt/spdlog updates 2022-07-19 15:27:31 -03:00
Jason Rhinelander
f6019210c3
oxen-logging update to handle level/type parsing exceptions 2022-07-19 13:39:00 -03:00
Jason Rhinelander
9bf1d5837a
Update oxen-logging for macos compilation 2022-07-19 12:40:07 -03:00
Jeff
8cde7c7e7a
fix win32 and android builds 2022-07-19 11:31:14 -04:00
Jason Rhinelander
e094125000
gcc 8/9 fix 2022-07-18 17:38:04 -03:00
Jason Rhinelander
86fd77733e
Add missing header to fix libc++ build 2022-07-18 17:23:35 -03:00
Jason Rhinelander
784f2938f1
Use more fmt 2022-07-18 17:13:04 -03:00
Jason Rhinelander
eec8244a6c
Remote util::Printer and related cruft 2022-07-18 14:56:09 -03:00
Jason Rhinelander
2f9e182b20
Avoid ctor inheritance to make diagnostics better
Using constructor inheritance DRYs the code, but unfortunately confuses
GCC as to where the proper "required from here" location is, which makes
debugging formatting errors very difficult.  Avoid it (and update
oxen-logging to avoid it there as well).
2022-07-18 13:07:33 -03:00
Jason Rhinelander
c82ade2d81
Make test code work with new logging 2022-07-18 12:59:13 -03: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
Jason Rhinelander
43191ec100
Add missing header
Needed for uint_least32_t.
2022-07-15 21:51:32 -03:00
majestrate
a9a9593128
Merge pull request #1938 from jagerman/no-empty-compilations
Don't build empty cpp files
2022-06-22 17:06:09 -04:00
majestrate
193ab47372
Merge pull request #1941 from jagerman/no-shellhooks
Remove dead code, cmake cleanups
2022-06-22 16:49:57 -04:00
Jason Rhinelander
81f05d63c1
Move destructor back to .cpp file
Having it there (even defaulted, like this) means endpoint.hpp doesn't
have to include endpoint_state.hpp (which it otherwise would need,
because of the std::unique_ptr<EndpointState> default deleter
requirements).
2022-06-22 14:48:45 -03:00
Jason Rhinelander
c37d6ea43b
Remove shadow testing framework
Bitrotten and apparently doesn't work with libuv event loop.
2022-06-22 11:08:07 -03:00
Jason Rhinelander
0edb4435d4
Cmake cleanup: remove unneeded =1 from definitions
We only check for definedness, not truth, in the code so make the cmake
definitions agree with that.

This also avoids warnings when building on macos (because swift only
allowed defined/undefined but not values)
2022-06-21 18:57:36 -03:00
Jason Rhinelander
4a4f16e5c8
Remove dead code: netns, shell hooks
These haven't been activated in a long time and aren't worth
resuscitating.
2022-06-21 18:56:25 -03:00
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).
2022-06-16 13:17:13 -03:00
majestrate
2e0822889a
Merge pull request #1937 from jagerman/print-snode-addr-on-startup
Show router pubkey at startup
2022-06-15 21:07:34 -04:00
Jason Rhinelander
3cd699fa7f
Show router pubkey at startup 2022-06-15 21:23:15 -03:00
majestrate
85cf2dad10
Merge pull request #1926 from jagerman/tag-override
Add -DLOKINET_VERSIONTAG to override version tag
2022-06-14 07:43:18 -04:00
Jason Rhinelander
1de7b070d1
Add -DLOKINET_VERSIONTAG to override version tag
Currently I maintain a patch in the debs to do the same thing here, but
it fails to apply often enough; this change makes the behaviour
consistent with oxen-core/oxen-ss and will let me drop that patch and
just pass in the cmake option.

(Recommend ignore-whitespace for viewing the diff)
2022-06-13 20:00:35 -03:00
majestrate
10db0a0d2d
link to french readme 2022-06-07 16:45:56 -04:00
majestrate
83fe986749
add french readme
this translation was provided from a session user
2022-06-07 16:45:35 -04:00
majestrate
3ef13bab7f
Merge pull request #1931 from pebu1337/patch-1
Update error message
2022-06-06 11:45:15 -04:00
Pebu
9db192079b
Update error message
Message is paths must be >= 2 but condition is checking for < 3
2022-06-06 10:00:20 -04:00
majestrate
f2d7d5eabf
Merge pull request #1925 from jagerman/system-or-submodule
Clean up system-or-submodule handling
2022-06-03 18:53:55 -04:00
Jason Rhinelander
523a8a74ca
Clean up system-or-submodule handling
Fixes a bug on older cmake linking against oxenmq (older cmake hates the
direct oxenmq::oxenmq -> PkgConfig::OXENMQ alias), and also makes it
easier to handle things like nlohmann::json (which we can use from the
system *or* submodule).

Borrowed from oxen-ss/oxen-core.
2022-05-31 19:51:29 -03:00
Jeff
4a10868f85
add additional fallback case 2022-05-31 15:23:36 -04:00
majestrate
229e1277fd
Merge pull request #1923 from majestrate/replace-llarp-proto-verison-macros-2022-05-26
final fixups before 0.9.9 tag
2022-05-30 17:49:49 -04:00
Jeff
2576b87c5d
version bump to 0.9.9 2022-05-30 17:08:41 -03:00