Commit Graph
100 Commits
Author SHA1 Message Date
Hamish Coleman 3cef9949c2 Remove the non-maintained CMake build system.
It is difficult to maintain one build system, let alone two - especially
if one build system is known to be better maintained and the other build
system continues to be used - with bug and feature requests raised
against it.

The maintainers are aware that there are people using the CMake system,
but believe that the extra maintainability of only having one build
system, combined with the knowledge that the current CI system
demonstrates that all supported architectures are working with the
Makefiles make the use of these Makefiles a more sustainable direction.
2023-04-19 17:06:45 +08:00
Hamish Coleman 24c1569c88 It appears that supernode_disconnect() might only be called in the original code in the TCP case, so add that test - even though the function appear to work in either caes 2023-02-01 12:39:37 +00:00
Hamish Coleman 9e98023a3f None of the callers of sendto_sock check the result, so make this clear in the function prototype 2023-02-01 12:39:37 +00:00
Hamish Coleman 9618512c8f Give up and cache the entire openwrt buildchain 2023-01-30 20:31:13 +00:00
Hamish Coleman 8e172d94ea Nothing needs to dep on the smoketest 2023-01-30 20:31:13 +00:00
Hamish Coleman 0867fd1a7c One more try to avoid building all the kmod packages 2023-01-30 20:31:13 +00:00
Hamish Coleman c3f5d69020 In fact, we can start more builds sooner 2023-01-30 20:31:13 +00:00
Hamish Coleman 4b9397a1b0 Fix the cache key. Also adjust the deps - the openwrt build is the longest, so start it sooner 2023-01-30 20:31:13 +00:00
Hamish Coleman 731be7e257 Use caching to try to speed up openwrt builds. Build openwrt statically 2023-01-30 20:31:13 +00:00
Hamish Coleman c824c5d2cd Name the openwrt builds the same as the expected package name 2023-01-30 20:31:13 +00:00
Hamish Coleman 780d1edfb8 Add a amd64 OpenWrt build for more testing 2023-01-30 20:31:13 +00:00
Hamish Coleman 40f4b04bb2 Add quicker OpenWrt build to regular builds.
Use the upstream build environment to speed up the compiling of OpenWrt
ipk packages.  (And minor doc updates after running this.
2023-01-30 20:31:13 +00:00
Hamish Coleman 99ae88c85b Address github linter concerns in openwrt CI 2023-01-30 20:31:13 +00:00
Hamish Coleman 4d89f048ad Merge pull request #1074 from hamishcoleman/upstream
Tidy up CI and address constantly failing test
2023-01-27 00:41:56 +00:00
Hamish Coleman 914c450641 Address more github workflow lint concerns 2023-01-27 00:23:52 +00:00
Hamish Coleman b104f4a72d Address lint concern 2023-01-27 00:21:14 +00:00
Hamish Coleman fadafabd66 Address github workflow lint concerns 2023-01-27 00:12:04 +00:00
Hamish Coleman b1d2396cb9 Disable faling test - unreproducible locally, appears to be a github issue 2023-01-27 00:08:32 +00:00
Hamish Coleman b9cf4cbe73 Provide ability to investigate build errors
Upload the test results so they can be examined outside of the CI system
2023-01-26 23:54:59 +00:00
Hamish Coleman 79bafc6790 Merge pull request #1064 from cjbrigato/patch-1
minor Typo
2022-12-20 10:05:46 +11:00
Hamish Coleman ec15ebb80c Merge pull request #1059 from billchenchina/fix-gitignore
Add more to gitignore
2022-11-15 10:34:54 +11:00
Hamish Coleman 06c489fd8a Merge pull request #1040 from hamishcoleman/dev
Guard against pointer overrun if sock is set negative
2022-07-09 13:58:19 +01:00
Hamish Coleman 3d9d881920 Guard against pointer overrun if sock is set negative 2022-07-09 13:11:42 +01:00
Hamish Coleman a94e56203d Merge pull request #1036 from 1715173329/cap
build(CMakeLists): dynamic link to libcap by default
2022-07-09 01:17:03 +01:00
Hamish Coleman a274818854 Merge pull request #998 from hamishcoleman/sendto_refactor
Refactor sendto_fd and friends in an attempt to find anything that co…
2022-05-17 23:42:53 +01:00
Hamish Coleman afd0020d16 Refactor sendto_fd and friends in an attempt to find anything that could segfault 2022-05-17 23:33:41 +01:00
Hamish Coleman 87431e2ef0 Merge pull request #992 from hamishcoleman/analysing
Add CI for Code Analysing
2022-05-17 22:21:37 +01:00
Hamish Coleman a00aa63dd7 We are not in python any more, Toto 2022-05-08 18:05:40 +01:00
Hamish Coleman 47768758d6 Fix use before null check 2022-05-08 17:51:00 +01:00
Hamish Coleman 038c244407 Fix supernode memory leak on exit path 2022-05-08 17:28:05 +01:00
Hamish Coleman 7a2075c456 Fix for address overrun 2022-05-08 16:46:00 +01:00
Hamish Coleman 188af371ba Fix leak 2022-05-08 15:48:29 +01:00
Hamish Coleman a2a8c3d4ee Add some analysis tools 2022-05-08 15:46:41 +01:00
Hamish Coleman 3fa0fa1bbe Merge pull request #983 from hamishcoleman/json_pubsub
Refactoring management code to increase sharing
2022-04-30 18:21:36 +01:00
Hamish Coleman 009311d016 Provide better details when sendto_fd fails (#981)
* Refactor traceEvent to allow variable log levels

* Refactor sendto failed for less repetition

* Refactor sendto_fd to make control flow clearer, also reduce repetition

* Tie size to the actual object not its class

* Show destination that had issues when sendto_fd fails

* Fix MSVC compile - it doesnt support the same variadic macros as gcc
2022-04-25 19:13:14 +02:00
Hamish Coleman ddf9bd894d Fiddle with windows headers 2022-04-17 00:50:59 +01:00
Hamish Coleman 26e3ad5377 Ah, standards, they are what windows lives to kill 2022-04-17 00:43:27 +01:00
Hamish Coleman 16f7f4dc59 Fiddle with windows headers 2022-04-17 00:37:02 +01:00
Hamish Coleman a3fcc15472 Fix escaped extra brace 2022-04-17 00:32:01 +01:00
Hamish Coleman b98fd8552d Address lint issues 2022-04-17 00:29:18 +01:00
Hamish Coleman 71dbaf0bdc Refactor as much as possible of sn_management to use shared code 2022-04-17 00:25:04 +01:00
Hamish Coleman d81908d6a2 Move as much as simply possible from edge_management into shared code 2022-04-17 00:25:04 +01:00
Hamish Coleman 9728a36a56 Increase includes reusability and consistency 2022-04-17 00:25:04 +01:00
Hamish Coleman 7590ed51d5 Factor out strbuf abstraction into its own header 2022-04-17 00:25:04 +01:00
Hamish Coleman 4b8aaa7f6e Merge pull request #947 from hamishcoleman/json_pubsub
Add JSON pubsub framework for edge
2022-02-12 10:59:52 +00:00
Hamish Coleman a271dc7039 Merge pull request #956 from hamishcoleman/dev
Ensure an error is generated when compiling with invalid options
2022-02-11 21:38:30 +00:00
Hamish Coleman aab0d508df Ensure an error is generated when compiling with invalid options 2022-02-11 21:23:34 +00:00
Hamish Coleman af39fa12d8 Merge pull request #953 from hamishcoleman/dev
Ensure definitions are included before ifdef
2022-02-10 07:52:59 +00:00
Hamish Coleman 30a5694cfe Ensure definitions are included before ifdef
Addresses issue raised in (#934)
2022-02-10 07:51:17 +00:00
Hamish Coleman 99d56a8a7b Improve build docs (#952) 2022-02-09 21:30:26 +00:00
Hamish Coleman 017f1cf60e Address lint issues 2022-02-05 20:06:31 +00:00
Hamish Coleman 860b27d97c Add event publishing for adding and removing P2P peers 2022-02-05 20:06:31 +00:00
Hamish Coleman a40ed15d93 Add pubsub system to edge, with one example TEST channel 2022-02-05 20:06:31 +00:00
Hamish Coleman 509a8bcd14 Add a buffer object with a known size field to replace multiple hardcoded N2N_PKT_BUF_SIZE 2022-02-05 20:06:31 +00:00
Hamish Coleman 598ce63981 Use getnameinfo to show the subscribed socket details 2022-02-05 20:06:31 +00:00
Hamish Coleman 9c77d0becd Address warning 2022-02-05 20:06:31 +00:00
Hamish Coleman 58fedeed95 Add a helper for simple 1 arg json replies 2022-02-05 20:06:31 +00:00
Hamish Coleman 64e5329bca Refactor command handler lookup into a macro for reuse in the topic lookup 2022-02-05 20:06:31 +00:00
Hamish Coleman e2a33b7571 Implement initial help command for subscription topics 2022-02-05 20:06:31 +00:00
Hamish Coleman 3fd1dc5fa8 keep private enum definition local to the management code 2022-02-05 20:06:31 +00:00
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
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
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