Commit Graph

285 Commits

Author SHA1 Message Date
Stephen Shelton
0aa43c6b07
Pass RuntimeOptions instead of 'bool isRelay' 2020-07-01 08:38:56 -06:00
Stephen Shelton
984015587d
"Rethrow" to promise using std::current_exception() 2020-07-01 08:38:33 -06:00
Stephen Shelton
a448cbab4f
Pass on exceptions to exit_code future in main 2020-07-01 08:21:53 -06:00
Stephen Shelton
eb2260179f
Pass opts by value since we're crossing threads 2020-07-01 08:04:29 -06:00
Stephen Shelton
ec4109ae60
Handle signals without C API 2020-06-29 14:09:59 -06:00
Stephen Shelton
b5d6a73ffd
Rip out most of C API 2020-06-29 13:55:59 -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
Jeff Becker
18b2ef3d1e
remove unneeded file 2020-05-29 12:33:16 -04:00
Jeff Becker
242ab3caba
rename lokinet-exit too to lokinet-vpn
install lokinet-vpn tool for use with debian packaging
2020-05-29 12:31:57 -04: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
14b134c42d
when we get an explicit config path respect it and the base dir 2020-05-26 10:06:38 -04:00
Jeff Becker
6af498092b
exit traffic via loki addresses 2020-05-23 16:07:19 -04:00
Jason Rhinelander
c5faa86926 cmake refactor
Refactors many things in cmake to improve and simplify:

- don't use variable indirection for target names; target names are
*already* a variable of sorts.  (e.g. ${UTIL_LIB} is now just
lokinet-util).  cmake/basic_definitions.cmake is now gone.

- fix LTO enabling to use the standard cmake (3.9+) LTO mechanism rather
than shoving a bunch of flag hacks through link_libraries and
add_compile_options.  This also now enables LTO when building a shared
library (because previously the -flto hacks were only turned on in the
static code for some reason).

- build liblokinet as *either* shared library or static library, but not
both.  Building both makes things more complicated because they had
different names (lokinet-shared or lokinet-static) and seems pointless:
you generally want one or the other.  Now there is just the liblokinet
target, which will be shared or static depending on the value of
BUILD_SHARED_LIBS.

- Simplify lokinet-cryptography AVX2 code: just build *one* library, and
add in the additional AVX2 files when possible, rather than building two
and needing to merge them.

- Compress STATIC_LINK and STATIC_LINK_RUNTIME into just STATIC_LINK.
It makes no sense to use one of these (_RUNTIME) on Windows and the
other on non-Windows when they appear to try to do the same thing.

- remove a bunch of annotations from `endif(FOO)` -> `endif()`.

- move all the tuntap compilation code (including OS-specific source
file selection) into vendor/CMakeLists.txt and build tuntap as an
intermediate OBJECT library rather than keeping a global variable in 5
different files.

- move release motto define to root cmake; it made no sense being
duplicated in both unix.cmake and win32.cmake

- fix add_log_tag to not stomp on any existing source compile flags with
its definition.  Also use proper compile definition property instead of
cramming it into compile flags.

- make optimization/linker flags less hacky.  There's no reason for us
to force particular optimization flags because the cmake build type
already does that (e.g. -DCMAKE_BUILD_TYPE=Release does -O3).  Not doing
that also silences a bunch of cmake warnings because it thinks "-O0 -g3"
etc.  are link libraries (which is reasonable: that's what the code was
telling cmake they are).

- sets the default build type to RelWithDebInfo which gives us `-O2 -g`
if you don't specify a build type.

- Move PIC up (so that the things loaded in unix.cmake, notably libuv,
have it set).

- Add a custom `curl` interface library that carries the correct link
target and include paths for curl (system or bundled).
2020-05-17 23:31:23 -03:00
Stephen Shelton
de8e44ba21
Re-apply clang-format rules after rebasing 2020-04-07 14:41:11 -06:00
Stephen Shelton
6909e20588
Fix logging initialization and flush at program exit 2020-04-07 14:27:30 -06:00
Stephen Shelton
e3cb4b2d60
Don't create conf dir in main()
ensureConfig() does this implicitly.
2020-04-07 14:25:18 -06:00
Stephen Shelton
1fc7c61d1f
Share common conf comments for client and relay 2020-04-07 14:24:50 -06:00
Stephen Shelton
176c1e3cbd
Remove --router option 2020-04-07 14:21:44 -06:00
Stephen Shelton
05257126fe
Make distinction between config dir and data dir 2020-04-07 14:18:14 -06:00
Stephen Shelton
9e7254f6fa
Rip out pass-through-to-curl functionality 2020-04-07 14:17:52 -06:00
Stephen Shelton
923e73f693
Plumb isRelay CLI arg through to config 2020-04-07 14:17:13 -06:00
Stephen Shelton
1653b73ee5
Clean up the logic around generating default confs 2020-04-07 14:11:57 -06:00
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.
2020-04-07 12:38:56 -06:00
Jeff Becker
9428689939
fix up cpack for macos 2020-04-03 10:14:19 -04:00
Jeff Becker
2922668e6b
initial lokinet-bootstrap in powershell for windows 2020-04-02 11:08:07 -04:00
Jeff Becker
2190da8c81
cpack win32 2020-04-02 11:08:07 -04:00
Rick V
db0920d921
use backport fork for release installer only
move all invariant assets to common repo

remove ded code, libuv patches can be swapped in at build time for debug/release builds
2020-03-05 12:47:46 -06:00
Stephen Shelton
182057e881
Remove 'clang-format off' and make format 2020-02-26 14:10:26 -07:00
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
2020-02-21 23:22:47 -04:00
Jeff Becker
0f13591802
does not work 2020-01-28 16:55:36 -05:00
Ryan Tharp
cd8aba4d4e daemon don't override the existing CURL 2019-12-23 07:16:13 +00:00
Rick V
fd6602bf05
fix versiontag 2019-12-16 11:32:42 -06:00
Rick V
9fa9209114
don't be aggressive
remove libcurl packaging rules. We still build it, but ship only the curl.exe
2019-12-16 11:28:47 -06:00
Rick V
6d49ffd60b
include all platform dependencies transitively 2019-12-16 11:28:46 -06:00
Rick V
e15c57c114
get ready for v0.6
bump version

don't ship the shared object
2019-12-16 11:28:21 -06:00
Jason Rhinelander
638fb25b47 Put version info into a compiled file
This rewrites the version info using lokid's approach of compiling it
into a .cpp file that gets generated as part of the build (*not* during
the configure stage).

Among other things, this means that changing the version no longer
invalidates ccache or cmake dependencies, and because it depends on
`.git/index` git commits will cause the version to be regenerated,
making the commit tag more reliable (currently if you rebuild without
running cmake your git commit tag doesn't update).
2019-12-11 22:40:07 -04:00
Jeff Becker
cec36b62b5 make logic and net thread one in the same 2019-12-10 11:49:32 -07:00
Jeff Becker
70771a2460
fix last commit 2019-12-07 14:58:52 -05:00
Jeff Becker
f56e543d75
add deadlock checker and revert bencode change from long ago 2019-12-07 14:58:19 -05:00
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
2019-12-01 19:01:40 -06:00
Jason Rhinelander
f54740fa85 Don't pointlessly set conffname back to itself 2019-11-20 18:00:10 -04:00
Jason Rhinelander
e0340e86b2 clang-format fixes 2019-11-20 17:45:56 -04:00
Jason Rhinelander
2bdde18558 Remove shell globbing of path
resolvePath was leaking memory (the returned char * from realpath was
never freed), but upon closer inspection resolvePath doesn't seem right:
shell/glob/~ expansion is the job of the shell, not the argument (but
worse, if you pass it something like '~' (quoted) it would expand, which
is wrong.

Also de-duplicate some code.
2019-11-20 17:22:07 -04:00
Rick V
83c5e9ace4
manually merge #859 2019-10-30 18:02:34 -05:00
jeff
869ab0b652 Merge remote-tracking branch 'upstream/dev' into vpn-api-2019-10-03 2019-10-21 08:01:29 -04:00
Michael
f6adacf936
Review fixes 2019-10-09 23:00:50 +01:00
Michael
3371da98cf
Use libcurl (optional dependency) to hit jsonrpc 2019-10-09 23:00:50 +01:00
jeff
c26b67c379 finish wiring up jni shizz 2019-10-08 10:52:01 -04:00