Commit Graph

1310 Commits

Author SHA1 Message Date
Hamish Coleman
e3899d1b76 Give a magic number a better name 2022-02-05 20:06:31 +00:00
Hamish Coleman
06b8f1a08f Refactor management command list to allow it to be declared const with no warnings 2022-02-05 20:06:31 +00:00
Hamish Coleman
3e2c2d63bc Add basic structures to be used for pubsub 2022-02-05 20:06:31 +00:00
Hamish Coleman
40773b4e4d Ensure we have a local copy of the tag in our request structure - which will be useful for the event framework 2022-02-05 20:06:31 +00:00
Hamish Coleman
5bcc6fe67a Tracebacks contain full paths and cannot be part of the expected test data 2022-02-05 20:06:31 +00:00
Hamish Coleman
35c83a0825 Simplify edge mgmt handling by building a request structure and using it for replies 2022-02-05 20:06:31 +00:00
Hamish Coleman
9278e15896 Add at least one test that should cause a failed auth 2022-02-05 20:06:31 +00:00
Hamish Coleman
6e4cf85915 As we are in our own namespace, we can ditch the n2n_ prefix to some definitions 2022-02-05 20:06:31 +00:00
Hamish Coleman
ace3dbc44f Move all supernode management handling into one source file 2022-02-05 20:06:31 +00:00
Hamish Coleman
a8e2704b41 Move all management packet handling for edge into the one source file 2022-02-05 20:06:31 +00:00
Hamish Coleman
f0d883fde8 of course, tuntap drivers are needed to run edge, so we cannot test that on darwin without writing a dummy tuntap driver 2022-02-05 20:06:31 +00:00
Hamish Coleman
91d325b73a actions/upload-artifact@v2 with path does not take a list 2022-02-05 20:06:31 +00:00
Hamish Coleman
662e17afd6 Keep the tests output on failure for a cmake build too 2022-02-05 20:06:31 +00:00
Hamish Coleman
75a205ec69 Only need to keep the tests output if there has been a failure 2022-02-05 20:06:31 +00:00
Hamish Coleman
004ef6eaaf Add quick Json API test for edge 2022-02-05 20:06:31 +00:00
Hamish Coleman
ecaba980ba Attempt to simplify adding new tests 2022-02-05 20:06:31 +00:00
Hamish Coleman
1f501c70ac Include more known good style-guide files to the linter 2022-02-05 20:06:31 +00:00
Hamish Coleman
6bc08b8e0b Add more ways to get help from the indent.sh script 2022-02-05 20:06:31 +00:00
Hamish Coleman
e0ce73f684 Add management source code as known good for styleguide 2022-02-05 20:06:31 +00:00
Hamish Coleman
e22e453d2c Add an integration test and a bunch of framework to support tests on multiple build systems 2022-02-05 20:06:31 +00:00
Hamish Coleman
3713d357c8 Document the tricky code - TODO, make it less tricky 2022-02-05 20:06:31 +00:00
Hamish Coleman
954547a9c1 Remove the only obstacle that stopped running the supernode as a normal user 2022-02-05 20:06:31 +00:00
Hamish Coleman
84f69623e1 Dont forget to update the other build system 2022-02-05 20:06:31 +00:00
Hamish Coleman
9cc04d6b28 Limit code coverage to unit tests - any integration tests should not be considered as coverage 2022-02-05 20:06:31 +00:00
Hamish Coleman
351f7628d0 Separate testing out into types, just unit tests for the moment, allowing for integration tests 2022-02-05 20:06:31 +00:00
Hamish Coleman
150c32562d Refactor the PHONY make targets to be near their target definitions 2022-02-05 20:06:31 +00:00
Hamish Coleman
bcb3c223d9 Address lint concern 2022-02-05 20:06:31 +00:00
Hamish Coleman
fbad36705e Unify the python API class 2022-02-05 20:06:31 +00:00
Hamish Coleman
7f163858cf
Update to Compiling documentation (#945) 2022-01-30 17:39:10 +00:00
Hamish Coleman
e9fccd9932
Fix Cmake libpcap detection logic (#943)
* Fix cmake informational log messages

* If the correct library name is used find_library works better

* Re-enable remaining find_library users

* Reorder cmake to make libpcap detection work
2022-01-28 10:03:20 +00:00
Hamish Coleman
670aadcf1b
Address CMake config ordering requirements (#942)
For a moment there, I was starting to think that I might have found
a good feature in cmake, but then it turned out that it had specific
ordering requirements and strange cryptic functions that error out
in mysterious ways.

If I am going to have an antique build engine with special quirks that
I must learn in order to use it, I may as well choose the one that is
not also trying to be clever and hiding its internal magic from me.
Which means that I still prefer Makefiles - they are more debuggable.
2022-01-27 09:46:47 +00:00
Hamish Coleman
3856d62e8f
Fix bug in CMake conditional (Fixes #939) (#940) 2022-01-26 22:03:40 +00:00
Hamish Coleman
028d6f9b07
Harmonise configuration defaults (#937)
* Ensure all options start off for cmake too

* Attempt to make the build time config logic in the cmake process match the makefile process

* Add a simple muscle memory helper for cmake

* Ask them what they are smoking, then tell them to put it out

* Avoid occasional stale package cache errors
2022-01-25 20:11:02 +00:00
Hamish Coleman
45520f3d24
Move Build config docs into its own document (#928) 2022-01-10 22:23:37 +00:00
Hamish Coleman
4f568b03c1
Autoconf simplification (#927)
* Convert zstd feature to default disable

* All autoconf test use one standard template

To simplify the testing, cross-compilation and repeatable build process,
no configure options are automatically probed for - they all default to
off and are all using the same template.

The --with-x options should be deprecated and replaced with --enable-x
because there is no syntax checking for --with options in autoconf.

There are still some differences between the config options, but this
should provide a starting point.

* Remove unused code from the autoconf

* Remove warnings from default build

* Avoid calling port mapping functions if none are enabled

* Start with all builds in neutral config

* Add more missing code guards

* Adjust code guard location to placate cmake
2022-01-10 19:58:15 +00:00
Hamish Coleman
da9ba27b0a
Minor build document improvments (#926)
* Improve some build documentation

* Address build failure
2022-01-09 18:07:29 +00:00
Logan oos Even
bca9968c91
re-enabled libnatpmp with CMake on Windows (#918) 2021-12-30 09:49:39 +01:00
skyformat99
dcfa27e9e2
updated CMakeLists.txt (#917)
fix  build error with CMake #916
2021-12-29 14:20:39 +01:00
Logan oos Even
5d0c395194
enabled cmake runner on pull request event (#915) 2021-12-25 18:05:31 +01:00
Logan oos Even
e6919050d3
conditionally disabled libnatpmp support with CMake on Windows (#914) 2021-12-25 14:09:21 +01:00
fengdaolong
2378ea0be2
simplified the path in the log (#910) 2021-12-24 20:56:35 +01:00
skyformat99
bc4789ae0e
updated building documentation (#911)
* Update README.md

update readme.md

* moved detailed content to doc folder

Co-authored-by: Logan oos Even <Logan.00sEven@gmail.com>
2021-12-24 20:33:39 +01:00
Logan oos Even
b657881a92
differentiated miniupnp includes (#912) 2021-12-24 10:32:22 +01:00
Logan oos Even
310c6b900e
fixed indention 2021-12-24 10:22:18 +01:00
Logan oos Even
87f0a7edc4
added "submodules: true" to CMake runner 2021-12-23 16:19:49 +01:00
Logan oos Even
7f01cfaed0
Revert "made github cmake runner fetch submodules (#906)" (#907)
This reverts commit 68cd16c696.
2021-12-23 15:02:23 +01:00
Logan oos Even
68cd16c696
made github cmake runner fetch submodules (#906) 2021-12-23 14:54:06 +01:00
Logan oos Even
e6e8cb038a
added port forwarding (upnp and natpmp) (#905)
* UPnP port redirection is supported.

* compile fixes

* compile fix

* optimize reconnection code

* prepared upnp threadification to counter main loop stall at supernode change

* NAT-PMP port forwarding support, temporarily merge codes to resolve conflicts.

* make compile fix

* prepared threadification in more detail

* adopted threadification to new file setup

* cleaned up

* renamed functions and data structures

* fixes

* differentiated between miniupnp and natpmp and added corresponding lib support to makefile

* name

* commented unused header includes

* comments

* license

* fixes

* fixes

* fixes

* NAT-PMP is already available.

* added CLI parameter to disable port forwarding if required

* preliminary made use of multithreading

* adjusted log level

* added man page documentation

* def'ed conf

* made pmpnat adjustments

Co-authored-by: fengdaolong <fengdaolong@gmail.com>
2021-12-23 12:27:55 +01:00
Hamish Coleman
a1facf0f3f
Update Openwrt process (#900)
* First attempt at a openwrt CI

* Fix action - helps if I dont forget the syntax half way through writing it

* Try building /this/ branch for the openwrt CI

* Try a build with openssl configured

* Dont enable the n2n package until we have built the environment - makes errors easier to see and clearly related to n2n

* Attempt to speed up the openwrt build

* Upload any created ipkg packages

* Dont test with openssl for the moment

* Attempt to speed up openwrt build using a cache of the build dir

* The make defconfig run turns all the built binaries stale, so stop caching them.  Also use a real ref for the cache key

* Minor text name changes

* Address yamllint concerns

* Attempt to simplify and document missing parts of the openwrt makefile

* Attempt to fix mystery openwrt make error

* Rename build job name

* Avoid nested checkouts, use two separate dirs for the two checkouts in this build

* Move the n2n checkout to earler, allowing us to skip one defconfig run

* We are going to need working tags from the n2n repo, so ensure we unbreak the github checkout braindamage

* Calculate and save the n2n version string

* Prepare the way to pass the correct external vars into the openwrt build

* Hook calculated build variables into the openwrt package definition

* Update artifacts source to match moved checkout dir

* Pass env vars in to the make

* Allow version script to be influenced by external vars

* It will help if I use the same variable names everywhere

* Add more version variable calculation overrides

* Configure openwrt to use the external git checkout instead of their create-tar-then-extract dance

* Using the correct syntax for ifdef will help significantly

* Use as many jobs as we have cpus

* As the USE_SOURCE_DIR option allows us to use a full git checkout, we do not need to hack the version.sh to allow overrides

* Ensure scripts/version.sh works from anywhere

* Remove unneeded variables

* Update openwrt build documentation to match the new build process

* Catch failure to cd as per shellcheck suggestion

* Limit lengthy openwrt builds to manual triggers or on a release

* Also run on specially named branches

* Break list into separate lines for easier future editing
2021-11-18 21:28:50 +00:00
Hamish Coleman
e4e2aba420
Increase code Coverage (#897)
* Make it clear which hash we are testing

* Coverage for all pearson hash variants

* Initial coverage for auth.c

* Add some more auth.c coverage

* Ensure new bins are added to both build systems

* Ensure new source files are fully linted
2021-11-10 06:02:05 +00:00