Commit Graph

1200 Commits

Author SHA1 Message Date
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
Hamish Coleman
e7ad089d24
Change when version.sh chooses a fallback vresion (#896)
We aim to always build with the full version number from the git
checkout, however if the current build is not being made from a git
repository, we need to fallback to using the version number from
the "VERSION" file.

This patch changes the choice of the fallback path from just assuming
that any git repo is our git repo to explicitly looking for a `.git` dir
in the top of our checkout.

Some integrated build systems end up doing a tar extract of the n2n
source code inside their build-system git repo, and the old fallback
check was failing in that case.

We still need to identify these build systems and work out a way to
provide them with the full and correct version number for their build,
but this patch should make things more reliable until then.
2021-11-09 13:50:06 +00:00
Logan oos Even
c5f9e8198b
had the edge output supernode version to log on incoming PONG (#894) 2021-11-07 16:53:01 +05:45
Hamish Coleman
f5e2f3086e
Add munin monitoring plugin (#892)
* Add munin monitoring plugin

* Ensure stable field ordering for munin
2021-11-05 11:14:47 +00:00
Hamish Coleman
0e8de87e38 Add a sort option to the CLI n2n-ctl tool 2021-11-05 09:33:34 +00:00
Hamish Coleman
9c3a2c3301
Merge pull request #889 from hamishcoleman/version_nr
Revamp version number handling
2021-11-05 09:14:54 +00:00
Hamish Coleman
109b6e2fa5 Remove one remaining use of N2N_OSNAME and cleanup 2021-11-02 09:35:03 +00:00
Hamish Coleman
8504b7c268 Minor lint cleanup 2021-11-02 09:29:01 +00:00
Hamish Coleman
108c9436d5 Add robustness to the version calculations 2021-11-02 09:28:48 +00:00
Hamish Coleman
a38ec0f033 Update windows cmake build docs to match current process 2021-11-02 09:13:12 +00:00
Hamish Coleman
ff72ed8190 Make all version calculations come from scripts/version.sh and remove resulting redundant substitutions 2021-11-01 19:15:23 +00:00