Commit Graph

213 Commits

Author SHA1 Message Date
Stephen Shelton
2a30e7dac2
Add PeerDb to Router 2020-07-02 10:13:21 -06:00
Jeff Becker
d85c7bc628
remove wrapper and just use a lambda that throws on non empty value 2020-07-02 11:13:32 -04:00
Jeff Becker
a0dc2e795c
add a wrapper that always throws with a custom error message
use that wrapper for lokid.jsonrpc
2020-07-02 11:13:32 -04:00
Jeff Becker
a9109aa91b
* deprecate old unused lokid rpc options
* use lokimq::address in config and in lokid rpc
* bump lokimq submodule
2020-07-02 11:13:31 -04:00
Jeff Becker
80919a3b76
address feedback.
* use exceptions when fetching identity key instead of std::optional, will throw on fail
* fix up config options for endpoint auth and add better docs
* add llarp::serive::AuthType enum for controlling what kind of endpoint auth to use
2020-07-02 11:13:31 -04:00
Jeff Becker
0f21eeccb0
* rework exit codepath to allow multiple exits
* rework net code for ip ranges to be cleaner
* clean up endpoint auth code
* refactor config to validate network configs before setting up endpoints
* remove buildone from path/pathbuilder.cpp so we don't spam connection attempts
2020-07-02 11:13:30 -04:00
Jeff Becker
0d6e3bcd89
fix crashing tests 2020-07-02 11:13:30 -04:00
Jeff Becker
e95b9d530e
fix unit tests, make them pass 2020-07-02 11:10:06 -04:00
Jeff Becker
5abf111159
endpoint auth whitelist 2020-07-02 11:07:33 -04:00
Jeff Becker
a42d3d51c3
more 2020-07-02 11:07:33 -04:00
Jeff Becker
749c5a813c
require at least 2 hops because otherwise stuff wont publish 2020-07-02 11:07:32 -04:00
Jeff Becker
ad882d0d70
initial working code 2020-07-02 11:07:31 -04:00
Stephen Shelton
daecd6eda5
Remove llarp_config and llarp_main 2020-06-29 14:51:13 -06:00
Jeff Becker
800668348a
add regression test for key backup bug 2020-06-08 08:42:10 -04:00
Stephen Shelton
cecafb3215
Undo unintentional revert? 2020-06-04 13:32:38 -06:00
Stephen Shelton
d8b12ce764
Let KeyManager assemble key filenames 2020-06-04 12:38:35 -06:00
Stephen Shelton
1497b829bd
Ignore our self.signed file if we're a client 2020-06-04 11:05:23 -06:00
Jeff
45cda241f0
Merge pull request #1272 from majestrate/exit-nodes-2020-05-16
exit traffic via snapps
2020-06-01 14:42:43 -04:00
Rick V
1340cd0dce remove some string conversions entirely 2020-05-26 23:09:16 -05:00
Rick V
5529371637 RouterContact::[Read|Write] now take a fs::path const ref 2020-05-26 22:39:01 -05:00
Rick V
f62214cf8c
first pass fix wstring path conversions 2020-05-26 20:48:07 -05:00
Jeff Becker
3a776b3ed1
bounds checks and such 2020-05-23 16:07:20 -04:00
Jeff Becker
6af498092b
exit traffic via loki addresses 2020-05-23 16:07:19 -04:00
Jason Rhinelander
854619f04f Workaround for ghc::filesystem (mac) compatibility 2020-05-21 17:21:04 -03:00
Jason Rhinelander
d05e6716cb Remove llarp::str(string_view)
It was a workaround for pre-C++17 std::string which didn't support
passing a string_view to various functions/operators.  There's only one
place left that needs an explicit conversion, and that's where it is
used as a map key; so just be explicit there and remove llarp::str()
everywhere else.
2020-05-21 17:05:30 -03:00
Jason Rhinelander
ebd2142114 Don't use std::optional::value() because f u macos
This replaces all use of std::optional's `opt.value()` with `*opt`
because macOS is great and the ghost of Steve Jobs says that actually
supporting std::optional's value() method is not for chumps before macOS
10.14.  So don't use it because Apple is great.

Pretty much all of our use of it actually is done better with operator*
anyway (since operator* doesn't do a check that the optional has a
value).

Also replaced *most* of the `has_value()` calls with direct bool
context, except for one in the config section which looked really
confusing at a glance without a has_value().
2020-05-20 19:18:28 -03:00
Jason Rhinelander
be9ddf2ae1 Bring back ghc::filesystem for broke AF macos
macOS doesn't provide `<filesystem>` support when targetting anything
earlier than 10.15.
2020-05-20 19:18:27 -03:00
Stephen Shelton
ffdeca5378
Initialize all primitive values in Config 2020-05-20 15:54:23 -06:00
Stephen Shelton
ac225eb65e
Testing: explicitly initialize variable 2020-05-20 15:54:22 -06:00
Jason Rhinelander
28362fd6a6 Clean up curl define
It doesn't have to be win32-specific, we could (for example) use this on
mac as well to build without curl/SN support.
2020-05-18 15:35:13 -03:00
Jason Rhinelander
26ecf23ad8 Silence various warnings 2020-05-17 21:28:17 -03:00
Jeff
ad9edc4ecf
Merge pull request #1266 from majestrate/issue-1264-fix-setting-upstream-dns-2020-05-14
default to port 53 in dns section entries
2020-05-14 13:58:30 -04:00
Stephen Shelton
ed31cdaacf
Cosmetic fixes 2020-05-14 11:51:27 -06:00
Jeff Becker
09a356a8a4
dont use static local lambda 2020-05-14 13:30:23 -04:00
Jeff Becker
ebed21c392
DRY 2020-05-14 12:33:37 -04:00
Jeff Becker
3753dfbddb
IpAddresses in dns section config were not defaulting to port 53 when no port was provided.
Fixes #1264
2020-05-14 08:14:19 -04:00
Jeff
a5b09c47e1
Merge pull request #1262 from notlesh/bandaids-for-sockaddr-refactor-2020-05-11
Bandaids for sockaddr refactor 2020 05 11
2020-05-12 12:04:59 -04:00
Stephen Shelton
aee96e53a3
Refactor Addr -> IpAddress/SockAddr 2020-05-06 14:38:44 -06:00
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
2020-05-06 10:45:30 -04:00
Jeff Becker
f1edca9fa1
additional cleanup of cruft 2020-05-04 14:39:14 -04:00
Jeff Becker
c4b5b641bb
default to default data dir given by params instead 2020-05-04 13:14:46 -04:00
Jeff Becker
e33a1a2e0f
proper autodetect of ifname and ifaddr 2020-05-04 12:51:57 -04:00
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.
2020-05-04 13:02:28 -03:00
Jason Rhinelander
1d98632fd3
Merge pull request #1254 from majestrate/network-ifaddr-ifname-2020-05-04
add ifname and ifaddr to network config parsing
2020-05-04 12:52:37 -03:00
Jeff Becker
96a6d81380
add ifname and ifaddr to network config parsing 2020-05-04 11:44:56 -04:00
Jason Rhinelander
4be7b2c8a5
Merge pull request #1253 from notlesh/better-config-error-messages-2020-05-04
Use more user-friendly error messages in config
2020-05-04 12:44:32 -03:00
Stephen Shelton
f96fded525
Use more user-friendly error messages in config 2020-05-04 09:42:38 -06:00
Stephen Shelton
78eb0d976d
nonstd::optional -> std::optional 2020-05-04 09:21:26 -06:00
Jeff Becker
7c12347e80
upstream-dns -> upstream 2020-05-04 11:08:25 -04:00
Stephen Shelton
42a7bcd434
Less invasive fix for Addr 2020-05-04 11:08:25 -04:00