Commit Graph

41 Commits

Author SHA1 Message Date
Jason Rhinelander
329da951b7
Apple OS interface cleanup & refactoring
- Add a C callback interface (context_wrapper.h) between lokinet and the
  objective-C code so that:
  - we can use objective-C (rather than objective-C++), which seems more
    likely to be supported by Apple into the future;
  - we minimize the amount of code that needs to be aware of the Apple
    APIs.
  - this replaces apple logger objective c++ implementation with a plain
    c++ implementation that takes a very simple C callback (provided
    from the obj-c code) to actually make the call to NSLog.

- Add various documentation to the code of what is going on.

- Send all DNS traffic to the primary IP on the tun interface.  The
  match prefixes simply don't work as advertised, and have weird shit
  (like even if you get it working for some domains, "instagram.com"
  still doesn't because of god-knows-what Apple internal politics).

- Drop the dns proxy code as we don't need it anymore.

- Don't use 9.9.9.9 for default DNS.  (We might consider the unfiltered
  9.9.9.10 as an alternative default, but if we do it should be a global
  lokinet change rather than a Mac-specific change).

- Parse a lokinet.ini in the data directory, if it exists.  (Since we
  are sandboxed, it is an app-specific "home" directory so is probably
  buried god knows where, but at least the GUI ought to be able to get
  it to let users add things to it).

- This commit also adds a swift version of the PacketTunnelProvider
  glue, which ought to work in theory, but the *tooling* for cmake is so
  underdeveloped that I couldn't find any way to actually get the damn
  thing working.  So I'm committing it here anyway (and will revert it
  away in the next commit) in case we someday want to switch to it.

-
2021-09-02 14:17:09 -04:00
Jason Rhinelander
712b5a5608
Tweak icns generation to only run when necessary 2021-09-02 14:17:09 -04:00
jeff
1272a4fbe1
add dummy sign target for ci when we don't have signing keys
remove static macos from ci pipeline
2021-09-02 14:17:09 -04:00
jeff
7db2459469
macos sort of works now 2021-09-02 14:17:09 -04:00
Jason Rhinelander
81d27c35c1
Default CODESIGN_APPEX to CODESIGN_APP
Sometimes (e.g. dev builds) these can apparently be the same; sometimes
it seems they need to be different, because Apple.
2021-09-02 14:17:08 -04:00
Jason Rhinelander
3ab117a03b
Switch extension from a framework to an appex 2021-09-02 14:17:08 -04:00
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.
2021-09-02 14:17:08 -04:00
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
2021-09-02 14:17:08 -04:00
jeff
5edd045c9b
add swift version bullshit file and additional bullshittery 2021-09-02 14:17:08 -04:00
jeff
0708a0d897
initial network extension code for macos
probably does not work
2021-09-02 14:17:08 -04:00
Jeff Becker
37a9bd768e
fix linking on win32 for lokinet.dll
only apply static link flags for executables
2021-06-08 08:32:44 -04:00
Jason Rhinelander
73a29d3b07 Link lokinet-bootstrap against libssl as well
Just crypto apparently isn't enough, at least on some arches/distros.
2021-04-19 23:45:36 -03:00
Jeff Becker
77de60af91
require openssl explicitly for lokinet-bootstrap 2021-04-16 09:40:36 -04:00
Jeff Becker
27c80a2638
add include directory for daemon directory so llarp/* includes work 2021-04-16 05:51:34 -04:00
Jeff Becker
e8178a032e
lokinet-bootstrap native binary 2021-04-15 20:06:15 -04:00
Jeff Becker
4540c964f5
rework cmake install targets
* redo setcap on linux so that it's required to do install targets on linux
* add -DWITH_SETCAP=OFF option to bypass setcap requirement on linux
* remove lokinet-bootstrap.ps1 as we bundle the bootstrap in the win32 installer now
* remove references to lokinet-bootstrap.ps1 in cmake
2021-03-04 14:02:53 -05:00
Jeff Becker
d4112b157c
add explicit check for setcap binary when doing setcap so when it's missing it's not a nop / silent failure 2021-03-02 07:22:31 -05:00
Jason Rhinelander
63a876cc78
Allow -DWITH_SETCAP=OFF to disable setcap during make install (#1363)
The debs don't want it (and so this will save needing to patch it out),
nor do you need it if running via a systemd service file that sets the
capabilities.
2020-09-22 17:45:42 -04:00
Jeff
dfd8df5e7f
add uninstall target (#1340)
* add uninstall target

* * redo cmake uninstall
* remove lokinet-vpn python script
* don't install lokinet-vpn twice
2020-09-09 12:06:57 -04:00
Jeff Becker
9e24a5bfca
add check for no default route on down
fix macos bits for down
install lokinet-vpn with cmake
2020-08-24 20:19:49 -04:00
Jeff Becker
a8239af73a
initial lokinet-vpn tool rewrite 2020-08-24 20:19:48 -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
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
9e7254f6fa
Rip out pass-through-to-curl functionality 2020-04-07 14:17:52 -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
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
Rick V
83c5e9ace4
manually merge #859 2019-10-30 18:02:34 -05: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
7d7c6bf38c Merge remote-tracking branch 'upstream/dev' into multithreaded-cryptography 2019-10-07 06:08:47 -04:00
michael-loki
4b6dab5651
Fixup 2019-10-05 17:06:35 +01:00
Michael
abc527ca35
Split cmake files for executables into src dirs 2019-10-05 16:08:12 +01:00