Commit Graph

58 Commits

Author SHA1 Message Date
Hamish Coleman
c552db6443 Fix last seen edge case 2023-10-24 11:20:13 +01:00
Hamish Coleman
e9659e3b9a Add a last_seen column to n2n-ctl with human readable values 2023-10-24 11:20:13 +01:00
Hamish Coleman
59ecadcab2 Move the special windows lib config into the configure script 2023-07-03 02:51:20 +08:00
Hamish Coleman
8dcc879ca0 Simplify config and build process for libpcap tool 2023-07-02 22:18:09 +08:00
Hamish Coleman
afbc5344e0 Move some generic appending out of the config.mak 2023-06-25 22:40:46 +08:00
Hamish Coleman
ce3ed1fb90 Expand the freebsd hacky fix to encompas edge tests as well 2023-06-25 22:19:36 +08:00
Hamish Coleman
ccd33dc8cc Hacky fix for tests running on freebsd 2023-06-25 21:08:36 +08:00
Hamish Coleman
169d3a8cc7 Fix use with older autoconf
Some versions of autoconf (eg, the one included with Ubuntu 20.04 -
which is GNU Autoconf 2.69) will produce a configure script that
requires finding the install-sh script in either a short list of parent
directories or the defined AUX_DIR (This new requirement was probably
triggered by the use of the cross-compile features in configure.ac)

Newer versions flexibly identify which of the support scripts are
actually needed (from the list of config.guess, config.sub, install-sh)
and only check for those ones that are needed.

When the `./autogen.sh` runs `autoreconf -i`, it should have copied the
required aux scripts, but for some reason this is not happening.

Once we are not supporting the older autoconf, we should revisit this
config option as these auxiliary scripts should normally not be checked
into a version control system, for the same reasons that configure
shouldn’t be.  For now, we ensure that all three scripts are available
and we have set the AC_CONFIG_AUX_DIR() to point to them

If the older autoconf is used, it will report the error:

    configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../.."

Which is included here for search engines.
2023-06-25 17:56:09 +08:00
Hamish Coleman
4c0c173221 Check if we have been configured before running most of Make 2023-06-25 17:56:09 +08:00
Hamish Coleman
87c20d750e Add rules to run autogen/configure and use them in some of the simpler CI builds 2023-06-25 02:07:49 +08:00
Hamish Coleman
1581b74027 Update everything to reference the simpler tool autodetection 2023-06-25 02:07:49 +08:00
Hamish Coleman
1b83e0e0e9 Remove some config items that are just wrong with cross compilation 2023-06-25 02:07:49 +08:00
Hamish Coleman
7b77950352 Address lint concerns 2023-06-24 23:31:20 +08:00
Hamish Coleman
267b297150 Switch build date to use the last commit time
This reduces binary changes if the same commit version is re-built
2023-05-08 16:46:01 +01:00
Tony
789ba52541 Break down print line 2023-05-08 16:43:28 +01:00
Tony
bfe42e3cc8 Fix SIGNPIPE doesn't exist on windows 2023-05-08 16:43:28 +01:00
Hamish Coleman
5fee024ad5 Fix copypasta mistake in the windows fake autoconf 2023-05-06 08:48:04 +08:00
Hamish Coleman
1accc76ad3 Fix the building the win32 subdir.
It looks like the github windows build environment is not correctly
inheriting environment variables.  Which is strange, as that has not
been changed with the recent updates.  Include the vars directly as a
workaround (and plan to refactor later)
2023-04-30 20:40:50 -05:00
Hamish Coleman
bd4418fdec Convert the tools dir makefile similarly to the topdir 2023-04-30 18:10:39 -05:00
Hamish Coleman
bee517a753 Update windows build for new config.mak 2023-04-30 14:50:10 -05:00
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
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
99d56a8a7b
Improve build docs (#952) 2022-02-09 21:30:26 +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
5bcc6fe67a Tracebacks contain full paths and cannot be part of the expected test data 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
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
6bc08b8e0b Add more ways to get help from the indent.sh script 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
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
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
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
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
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
Hamish Coleman
0e8de87e38 Add a sort option to the CLI n2n-ctl tool 2021-11-05 09:33:34 +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
Hamish Coleman
a0cdda6fa9 Add more features to the version script 2021-11-01 19:15:23 +00:00
Hamish Coleman
aafca3813a Use script to calculate the build version 2021-11-01 19:15:23 +00:00
Hamish Coleman
4575154e1b Shrink autogen by reading VERSION file directly in configure.ac 2021-11-01 19:15:23 +00:00
Hamish Coleman
a9216f1097 Remove GIT_RELEASE variable and use the semantically identical N2N_VERSION instead 2021-11-01 19:15:23 +00:00
Hamish Coleman
999b3ffbf3
fixed python JSON clients so they don't hang if the daemon does not respond (or is not even running) (#876) 2021-10-25 18:36:47 +05:45
Hamish Coleman
e727304681
fixed support for python versions prior to 3.6 ... (#870)
... which do not support a context manager in the socketserver
2021-10-24 17:16:48 +05:45
Hamish Coleman
7eb3f2cd7f
Rename scripts for better consistancy (#866)
* Address shellcheck concerns with n2n_gateway.sh script

* Rename n2n_gateway.sh to live with all the other scripts (and update docs)

* Rename hack_fakeautoconf to make it clearly a shell script

* Address shellcheck concerns with hack_fakeautoconf.sh

* Rename python scripts to match other n2n tools

* Fix windows compile - when streamlining the use of hack_fakeautoconf.sh, I forgot to update all uses of this script
2021-10-24 03:58:01 +05:45
Hamish Coleman
80b33cd1a9
Basic C Code lint checker and shell checker (#859)
* Factor build packages out into a more maintainable list

* Create a location for scripts to live

* Provide a make target to return the source dir as close as reasonable to the original distributed state

* Add a code lint step, checking the coding style

* Change test harness as recommended by shellcheck

* Ensure we actually have the linter tool installed

* Use the correct directory for cmake to run the tests

* Adjust for the older uncrustify in the current github ubuntu-latest

* Make one file pass the linter

* Integrate the lint with the existing test workflow

* Add files with minimal changes needed to the linter

* Add more files with minimal changes needed to the linter

* Dont build binaries if we fail the lint test

* Update the phony targets with the lint steps

* Ensure the flake8 package is installed in the new lint workflow job

* Use the makefile to drive the packages needed to install for linting

* No need to add dependancies on lint, just rely on the workflow status to show failure

* Update the scripts dir README to reflect current assumptions

* Rename and briefly document the indent.sh script

* Fix the ignore to ignore the right Makefile

* Rename the test_harness script to make it clear it is a shell script

* Provide a master lint make target and add a shell script lint tool

* Elminate stray tabs

* Drop include/auth.h from linter - there are inconsistant results with function definitions when using the current uncrustify rules
2021-10-24 01:21:18 +05:45