Jeff Becker
3753dfbddb
IpAddresses in dns section config were not defaulting to port 53 when no port was provided.
...
Fixes #1264
4 years ago
Jeff
a5b09c47e1
Merge pull request #1262 from notlesh/bandaids-for-sockaddr-refactor-2020-05-11
...
Bandaids for sockaddr refactor 2020 05 11
4 years ago
Stephen Shelton
aee96e53a3
Refactor Addr -> IpAddress/SockAddr
5 years ago
Jeff Becker
635dc4fe13
unbreak router hive
...
llarp/config/config.cpp:
respect [network]:type option
llarp/handlers/exit.cpp:
when [network]:type is null dont init tun interface
llarp/service/context.cpp:
respect [network]:type option
change endpoint name back to "default"
llarp/tooling/router_hive.cpp:
dont use LogicCall for obtaining RCs from underlying relays, it crashes the mainloop and it's probably safe to readonly access RCs.
pybind/common.hpp:
remove typecasters as we use C++17 now
pybind/llarp/config.cpp:
remove SnappConfig
wire up NetworkConfig
pybind/llarp/handlers/pyhandler.hpp:
remove SnappConfig from constructor
pybind/llarp/handlers/pyhandler.cpp:
update constructor implementation to match header
test/hive/hive.py:
remove broke endpoint related code
wire up null endpoint option using NetworkConfig
use index at 0 for relays and clients instead of 1
dont add a python endpoint to all clients
5 years ago
Jeff Becker
f1edca9fa1
additional cleanup of cruft
5 years ago
Jeff Becker
c4b5b641bb
default to default data dir given by params instead
5 years ago
Jeff Becker
e33a1a2e0f
proper autodetect of ifname and ifaddr
5 years ago
Jason Rhinelander
4f09090c58
Add [network]:enabled to ignored settings list
...
No one knows what this option does or did, but it is in some generated
config files.
5 years ago
Jason Rhinelander
1d98632fd3
Merge pull request #1254 from majestrate/network-ifaddr-ifname-2020-05-04
...
add ifname and ifaddr to network config parsing
5 years ago
Jeff Becker
96a6d81380
add ifname and ifaddr to network config parsing
5 years ago
Jason Rhinelander
4be7b2c8a5
Merge pull request #1253 from notlesh/better-config-error-messages-2020-05-04
...
Use more user-friendly error messages in config
5 years ago
Stephen Shelton
f96fded525
Use more user-friendly error messages in config
5 years ago
Stephen Shelton
78eb0d976d
nonstd::optional -> std::optional
5 years ago
Jeff Becker
7c12347e80
upstream-dns -> upstream
5 years ago
Stephen Shelton
42a7bcd434
Less invasive fix for Addr
5 years ago
Stephen Shelton
15918ff1c9
log--
5 years ago
Stephen Shelton
f2a26adcaa
Move all [endpoint] options to [network]
5 years ago
Stephen Shelton
559610ec94
Properly handle empty config default values
5 years ago
Stephen Shelton
dd9ab0f1d5
Remove ability to have multiple endpoints/snodes from config
5 years ago
Stephen Shelton
b7451b7632
Rip out tag, prefetch tags/addrs from Endpoint
5 years ago
Stephen Shelton
1d12e9d14e
Lokinet_INIT() is already checked in main(), so remove from config
5 years ago
Stephen Shelton
3198a8b139
Handle blacklist-snode validation in config
5 years ago
Stephen Shelton
2730491641
Remove NetworkConfig's freehand options
5 years ago
Stephen Shelton
2bc908cd40
Remove [dns]:local-dns in favor of [dns]:bind
5 years ago
Stephen Shelton
779658edd0
Refactor ExitEndpoint's config, mv dns ops from [network] to [dns]
5 years ago
Stephen Shelton
21ad442b55
Remove NetConfig_t
5 years ago
Stephen Shelton
df01770466
Rename SnappConfig -> EndpointConfig
5 years ago
Stephen Shelton
93b35c92a7
Eradicate service::Config
5 years ago
Stephen Shelton
cbd93fcb09
Find "-snapp" conf sections, add more snapp conf options
5 years ago
Jason Rhinelander
3efaf9ff76
Add string header (reportedly needed for libc++)
5 years ago
Jason Rhinelander
5cf2126bb9
make format
5 years ago
Jason Rhinelander
1697bf90fe
C++17
...
Compiles with C++17, replaces ghc::filesystem with std::filesystem,
nonstd::optional with std::optional, and llarp::string_view with
std::string_view.
5 years ago
Stephen Shelton
f0f9b1abdd
Allow 0 as outbound port
5 years ago
Stephen Shelton
f8439dab61
Misc aesthetic tweaks
5 years ago
Stephen Shelton
7d83611a0a
Default outbound port to 0, not 1090
5 years ago
Stephen Shelton
c4de0f8493
Add more ignored config options
5 years ago
Stephen Shelton
517922e4c3
Reintroduce support for configurable key files
5 years ago
Stephen Shelton
320564d792
Specialize ConfigOption for bool to accept "truthy" / "falsy" values
5 years ago
Stephen Shelton
331770b348
Add ability to tolerate (ignore) old config options
...
This allows us to explicitly ignore (with a warning) old options
that are no longer supported.
5 years ago
Stephen Shelton
cdd4439cff
Temporary fix for [dns]bind and [dns]local-dns
5 years ago
Stephen Shelton
936fbb2424
Fix config not falling back to undeclared handler for missing option
5 years ago
Stephen Shelton
526b1320b7
Some maybe-fixes for RouterHive post config cleanup
5 years ago
Stephen Shelton
dfcf8fb62e
Update RouterHive to reflect config changes
5 years ago
Stephen Shelton
de8e44ba21
Re-apply clang-format rules after rebasing
5 years ago
Stephen Shelton
a66f502ed6
Remove [netdb] conf and place it under data-dir
...
This does three things:
1) Remove the [netdb] conf section,
2) Rename the subdir 'netdb' -> 'nodedb'
3) Place 'nodedb' under 'data-dir'
5 years ago
Stephen Shelton
be014175e9
Consolidate logging initialization logic
5 years ago
Stephen Shelton
6909e20588
Fix logging initialization and flush at program exit
5 years ago
Stephen Shelton
d3bcc05aa6
Organize some constants and default values
5 years ago
Stephen Shelton
da6bda15a1
Where did rc.signed come from?!
5 years ago
Stephen Shelton
7ea8d62640
Use fs::path over std::string for files
5 years ago
Stephen Shelton
7ce256d846
Prefer fs::path over std::string @ KeyManager
5 years ago
Stephen Shelton
0a9515a94a
Proper support for multiple values @ ConfigDefinition
5 years ago
Stephen Shelton
28c1ca9c7a
Handle missing IP address in conf properly
5 years ago
Stephen Shelton
0697d57190
Important TODO
5 years ago
Stephen Shelton
0e5e9a1222
Silently ignore config file if it exists already
5 years ago
Stephen Shelton
1fc7c61d1f
Share common conf comments for client and relay
5 years ago
Stephen Shelton
3739fc1d70
Reinstate multi-valued option
5 years ago
Stephen Shelton
a6787657be
Refactor config comments to take list of strings
5 years ago
Stephen Shelton
a8671cf9c7
Rename config classes for clarity
...
ConfigDefinition -> OptionDefiniton
Configuration -> ConfigDefinition
5 years ago
Stephen Shelton
f250b7adcb
Remove pidfile support
5 years ago
Stephen Shelton
4f77080f75
Remove optional<> from block-bogons
5 years ago
Stephen Shelton
4d053231d3
Define config defaults as constexpr
5 years ago
Stephen Shelton
adfcbd1d0b
Slight cleanup of k:v option maps
5 years ago
Stephen Shelton
e06c2e4502
Check that [router]min-connections <= [router]max
5 years ago
Stephen Shelton
6fd270ba09
Rip out link type spec and factory
...
We only support IWP now, so this is all effectively dead code.
5 years ago
Stephen Shelton
9e850705b4
Add 'AssignmentAcceptor' convenience for simple config acceptors
5 years ago
Stephen Shelton
f2a8dd10ce
Modernize Snapp config
5 years ago
Stephen Shelton
733efbab40
Reflect removal of accessors on config structs
5 years ago
Stephen Shelton
c8c940b0f5
Replace individual file locations with dataDir
5 years ago
Stephen Shelton
5d0b53e1be
Remove environment variable support in config
5 years ago
Stephen Shelton
05257126fe
Make distinction between config dir and data dir
5 years ago
Stephen Shelton
923e73f693
Plumb isRelay CLI arg through to config
5 years ago
Stephen Shelton
028e55e997
Remove pre-refactor config test
5 years ago
Stephen Shelton
6301fefd43
Add router-specific config comments
5 years ago
Stephen Shelton
5b520a4dff
Simplify connection limit constants
5 years ago
Stephen Shelton
14e7789847
Add padding to config file generated output
5 years ago
Stephen Shelton
1273f11ce8
First pass at updating comments to lokinet config
5 years ago
Stephen Shelton
18ee23c2a3
Support for comments in config definition
5 years ago
Stephen Shelton
1653b73ee5
Clean up the logic around generating default confs
5 years ago
Stephen Shelton
c5ff672c79
Use 'undeclared handler' for multi-valued 'add-node' config option
5 years ago
Stephen Shelton
feacde7864
Hook up 'undeclared handlers' to mop up loosely-structured INI values
5 years ago
Stephen Shelton
9a1b7b20de
Add "undeclared value" handler to Configuration
5 years ago
Stephen Shelton
ffc58fcedb
Remove dead code (serverOptions)
5 years ago
Stephen Shelton
2e47262350
Demystify LinksConfig
5 years ago
Stephen Shelton
cd1e7713de
Clean up / consolidate config logging logic
5 years ago
Stephen Shelton
4c00c6238e
Join config definition and config parser
5 years ago
Stephen Shelton
653a650cf9
Fix typo
5 years ago
Stephen Shelton
9f0ae43149
Remove dead code
5 years ago
Stephen Shelton
d82f5e6b93
First pass at replacing config value logic
5 years ago
Stephen Shelton
69331f1571
Remove multiValued as an argument to ConfigDefinition
5 years ago
Stephen Shelton
f6d000838f
Clarity and convenience for defining config options
5 years ago
Stephen Shelton
02e31f3867
Introduce acceptor function in ConfigDefinition
5 years ago
Stephen Shelton
60d0bf2a9b
Rename function for clarity
5 years ago
Stephen Shelton
8160c13458
More documentation around Configuration/ConfigDefinition
5 years ago
Stephen Shelton
8352de7bd4
Config documentation, clarity
5 years ago
Stephen Shelton
d9340a873e
Consolidate Configuration generate INI functions
5 years ago
Stephen Shelton
1b19314278
Implement Configuration::generateDefaultConfig(), maintain insertion order
5 years ago
Stephen Shelton
7dacc30862
Conveience and clarity around config definiton maps
5 years ago
Stephen Shelton
105dd30fd9
More ConfigDefinition unit tests, fixes, support std::string as type
5 years ago
Stephen Shelton
25212b929c
Add ConfigDefinition unit tests, fixes
5 years ago
Stephen Shelton
a856e772c8
Stylistic clean up
5 years ago
Stephen Shelton
0fb888890f
First pass at Configuration definition classes
5 years ago
Stephen Shelton
9d71228e74
Replace config visit pattern with explicit lookups
...
This is an initial pass at doing explicit value checks when handling
config parsing, as opposed to using a visiting pattern. The latter
made it difficult to check for conditions such as missing required
values, multiple values, etc.
It was also generally less readable (think declarative) which further
made it difficult to get a grasp for what our actual configuration file
requirements were.
5 years ago
Stephen Shelton
ca67c12928
Why template when we only use one type??
5 years ago
Stephen Shelton
273270916e
The Great Wall of Blame
...
This commit reflects changes to clang-format rules. Unfortunately,
these rule changes create a massive change to the codebase, which
causes an apparent rewrite of git history.
Git blame's --ignore-rev flag can be used to ignore this commit when
attempting to `git blame` some code.
5 years ago
Jeff
d3091cf9fc
Merge pull request #1167 from tewinget/tooling
...
RouterHive initial PR
5 years ago
Jeff
bf82740c08
only try fetching identity key once so we can interrupt lokinet ( #1178 )
5 years ago
Thomas Winget
84a1d7dbcc
clang format.......
5 years ago
Thomas Winget
0f34a950a9
pybind config object, working
5 years ago
Jeff Becker
a5dc41b049
OMG IT DOES STUFF :DDDDDD
5 years ago
Jason Rhinelander
04c618ddae
gcc 5 compatibility workaround
5 years ago
Jason Rhinelander
3bd400f6fe
Fix string_view C++17 compatibility
...
string_view was implicitly convertible to std::string, but
std::string_view is only explicitly convertible. This makes the
`operator std::string` explicit to be more compatible, and re-adds a
bunch of explicit string casts to the code where needed.
(This also fixes the build if changing the standard to c++17)
5 years ago
Jason Rhinelander
46242ba69b
TrimWhiteSpace -> TrimWhitespace
...
Fix my dumb initial capitalization choice.
5 years ago
Jason Rhinelander
74d4afad51
Remove metric config parsing
5 years ago
Jason Rhinelander
54186c4a89
Replace absl string_view with string_view from lokimq
...
When we add loki-mq has a dependency we can just alias it, but for now
it's easier to copy the header than add the whole submodule library.
5 years ago
Jason Rhinelander
089056ca5b
Remove all ABSL_ATTRIBUTE_UNUSED uses
5 years ago
Jason Rhinelander
5efcd49a3b
Deabseil: remove absl::StrCat, de-templatize fromEnv
...
fromEnv here wasn't usefully templatized (the base template basically
couldn't be used for anything except a string anyway), so just replaced
it with the overloads we need and moved the implementations out of the
header.
5 years ago
Jason Rhinelander
98c34d995b
De-abseil: Add our own llarp::TrimWhiteSpace
...
Adds a TrimWhiteSpace instead of using abseil's.
Adds Catch2 tests for it, and also converts the existing str tests to
catch (which look much, much nicer than the gtest ones).
5 years ago
Jason Rhinelander
b4440094b0
De-abseil, part 2: mutex, locks, (most) time
...
- util::Mutex is now a std::shared_timed_mutex, which is capable of
exclusive and shared locks.
- util::Lock is still present as a std::lock_guard<util::Mutex>.
- the locking annotations are preserved, but updated to the latest
supported by clang rather than using abseil's older/deprecated ones.
- ACQUIRE_LOCK macro is gone since we don't pass mutexes by pointer into
locks anymore (WTF abseil).
- ReleasableLock is gone. Instead there are now some llarp::util helper
methods to obtain unique and/or shared locks:
- `auto lock = util::unique_lock(mutex);` gets an RAII-but-also
unlockable object (std::unique_lock<T>, with T inferred from
`mutex`).
- `auto lock = util::shared_lock(mutex);` gets an RAII shared (i.e.
"reader") lock of the mutex.
- `auto lock = util::unique_locks(mutex1, mutex2, mutex3);` can be
used to atomically lock multiple mutexes at once (returning a
tuple of the locks).
This are templated on the mutex which makes them a bit more flexible
than using a concrete type: they can be used for any type of lockable
mutex, not only util::Mutex. (Some of the code here uses them for
getting locks around a std::mutex). Until C++17, using the RAII types
is painfully verbose:
```C++
// pre-C++17 - needing to figure out the mutex type here is annoying:
std::unique_lock<util::Mutex> lock(mutex);
// pre-C++17 and even more verbose (but at least the type isn't needed):
std::unique_lock<decltype(mutex)> lock(mutex);
// our compromise:
auto lock = util::unique_lock(mutex);
// C++17:
std::unique_lock lock(mutex);
```
All of these functions will also warn (under gcc or clang) if you
discard the return value. You can also do fancy things like
`auto l = util::unique_lock(mutex, std::adopt_lock)` (which lets a
lock take over an already-locked mutex).
- metrics code is gone, which also removes a big pile of code that was
only used by metrics:
- llarp::util::Scheduler
- llarp:🧵 :TimerQueue
- llarp::util::Stopwatch
5 years ago
Jason Rhinelander
ac1486d0be
Replace absl::optional with optional-lite
...
Step 1 of removing abseil from lokinet.
For the most part this is a drop-in replacement, but there are also a
few changes here to the JSONRPC layer that were needed to work around
current gcc 10 dev snapshot:
- JSONRPC returns a json now instead of an optional<json>. It doesn't
make any sense to have a json rpc call that just closes the connection
with returning anything. Invoked functions can return a null (default
constructed) result now if they don't have anything to return (such a
null value won't be added as "result").
5 years ago
Jeff Becker
40876a6e3f
configurable log level
5 years ago
Stephen Shelton
1300de2387
Enable the JSON RPC API by default
5 years ago
Jeff Becker
c4f08e5145
finish remaining changes
5 years ago
Jeff Becker
e90cb2929e
disable metrics by default
5 years ago
Stephen Shelton
2c6226f54a
Backup SNApp keys when migrating to new ed25519 crypto
5 years ago
Stephen Shelton
11410a2748
Avoid trivial getters/setters in KeyManager
5 years ago
Stephen Shelton
66a058a2af
Make format
5 years ago
Stephen Shelton
eb5184ee09
Reinstate link test / update to use KeyManager
5 years ago
Stephen Shelton
23fc2ad042
Init key manager before InitOutboundLinks are configured
5 years ago
Stephen Shelton
af2259db5f
Move lokid key API request to KeyManager
5 years ago
Stephen Shelton
93b8832026
Merge branch 'dev' into private-keys-backup-support
5 years ago
Stephen Shelton
521ef9b5bb
Handle link transport key in KeyManager
5 years ago
Rick V
cf3469e11a
crash on wine, we support linux, ucb_unix, svr4
...
natively ffs. i tested this patch on wine 4.4 on fuckin
Solaris 11 snv_151
5 years ago
Stephen Shelton
a0699ad229
Undo adding of crypto version to RouterContact, other fixes
5 years ago
Stephen Shelton
e8e2e21fa2
Reorganize priv key file loading a bit and hook KeyManager into Router
5 years ago
Jeff Becker
dd48b149ca
make job queue size configurable
5 years ago
Stephen Shelton
7084dae79a
Implement code to move old key files out of the way
5 years ago
Stephen Shelton
fd02e3e149
Stub out KeyManager class
5 years ago
Michael
f6adacf936
Review fixes
5 years ago
Michael
3371da98cf
Use libcurl (optional dependency) to hit jsonrpc
5 years ago
Michael
86a07e2a80
Enable more sanitisers
5 years ago
Michael
4d8fe2a8a8
Move meta programming to subdirectory
5 years ago
Michael
1aec0dfa2b
Move logging to subdirectory
5 years ago
Jeff Becker
b5402dc6c3
Merge remote-tracking branch 'origin/master' into iwp-redux
5 years ago
Jeff Becker
0241851b72
add likn layer delivery timeout notification for iwp
5 years ago
Michael
70937ab503
Fix docker-compose isolated network
5 years ago
Jeff Becker
94f8531776
more fixups
5 years ago
Jeff Becker
6a48a3b402
code review fixes:
...
* use std::unordered_set
* use default for ctor/dtor
* don't crash on short packet with nack
5 years ago
Jeff Becker
4ac07ea9fb
use std::make_tuple
5 years ago
Jeff Becker
ba316f85ba
default to iwp
5 years ago
Jeff Becker
3c3338e801
Merge remote-tracking branch 'origin/master' into memlink
5 years ago
Michael
cd27f96832
replace endl with '\n in config.cpp
5 years ago
Jeff
ecf3c37d2e
Merge pull request #768 from majestrate/sane-limits
...
Sane limits
5 years ago
Michael
16cdfbd5f0
clang-tidy modernize pass
5 years ago
Jeff Becker
2345dd3239
try adding proper limits
5 years ago
Jeff Becker
c1f33bb1ac
initial mempipe implementation
5 years ago
Michael
91c1ba87cc
Change ConfigParser too
5 years ago
Michael
8fd4ceb55b
Don't use LoadFromString
5 years ago
Michael
71c6aca820
include cctype
5 years ago
Michael
5300568da5
Fix config builds
5 years ago
Jeff Becker
9a2ffb85e6
Merge remote-tracking branch 'origin/master' into ipv6-tun
5 years ago
Jeff Becker
750397d085
use std::string instead of fs::path
5 years ago
Jeff
b9cdfd116e
correct worker threads amounts
5 years ago
Jeff Becker
8dab4b87bb
more logging
5 years ago
Jeff Becker
1fd6b5ae74
Merge remote-tracking branch 'origin/master' into ipv6-tun
5 years ago
Jeff Becker
fcc3c05124
Merge remote-tracking branch 'origin/master' into ipv6-tun
5 years ago
Michael
488695047f
Remove redundant else blocks
5 years ago
Michael
3ce90b678e
Allow override of the rest of the config
5 years ago
Michael
fbb83704a0
Allow override of some config via env variables
5 years ago
Michael
08d306f6e9
Have fromSection return void
5 years ago
Michael
937f28f75d
Move router config to be encapsulated
5 years ago
Jeff Becker
0eb6431eb1
initialize tun with 0 and set defaults in correct places
5 years ago
Michael
f310160065
Fixup and add tests
5 years ago
Michael
a2326efa37
Revert "Merge pull request #679 from tewinget/revert-config-refactor"
...
This reverts commit 2996a7f29c
, reversing
changes made to 10df3bd4b3
.
5 years ago
Thomas Winget
d044d60101
Reverts #678 #677 and #669 with hashes:
...
10df3bd
766ece8
979f095
See those commits for further details
5 years ago
Michael
b51f7d8015
Convert to load config in config loader
5 years ago
Michael
bd78471dae
Move ini parser as well
5 years ago
Michael
00c237dc6d
Move config class to its own dir
5 years ago