Commit Graph

1414 Commits

Author SHA1 Message Date
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
Hamish Coleman
a4910ddc77 Debian Standards-Version variable is the packaging standard, nothing to do with our version 2021-11-01 19:15:23 +00:00
Hamish Coleman
9cbf4ca80a RPM Release variable is the number of patches applied to the upstream source, since we are the upstream source, there are no patches 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
f7d6be51cf Remove the correct files during autogen 2021-11-01 19:15:23 +00:00
Hamish Coleman
72a53325c5 The docker build steps are bitrotted since 2019
The `DOCKER_IMAGE_VERSION=` line was modified in commit 4d36f9f613 in
2019 and has been wrong ever since.  It is using the shell variable
syntax, which does not work in Makefiles.

Add a warning message for anyone trying to use it.
2021-11-01 19:15:23 +00:00
Hamish Coleman
8dc9437870 Remove configure.ac from the distclean list 2021-11-01 19:15:23 +00:00
Hamish Coleman
c0cfe93726 How many commits to fetch? Github says 'meh'
The right number of commits to fetch is enough to be able to create
a `git describe` result - basically back until the most recent parent
annotated tag.

However, the github action/checkout@v2 only allows a simple number,
which is basically the answer to "how long is a piece of string"
2021-11-01 19:15:23 +00:00
Hamish Coleman
6c3ccadde1 Try to make debug workflow demand triggerable
The docs claim that by adding the right `on:` event, the job can be
manually triggered from the github UI.

https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#workflow_dispatch

Tests show that it doesnt work, but I can leave it here for reference.
2021-11-01 19:15:23 +00:00
Hamish Coleman
dfc1c85bce Get the repo history 2021-11-01 19:15:23 +00:00
Hamish Coleman
d22f74bf69 Add a build job to dump details about the repository 2021-11-01 19:15:23 +00:00
Hamish Coleman
142f23bd50 Apply tags fix from https://github.com/actions/checkout/issues/290 to all checkouts 2021-11-01 19:15:23 +00:00
Hamish Coleman
06cc8ae64b Apply tags fix from https://github.com/actions/checkout/issues/290 2021-11-01 19:15:23 +00:00
Hamish Coleman
e538e55ed7 The cmake github action is clearly not just for linux 2021-11-01 19:15:23 +00:00
Hamish Coleman
5b06254a8b Remove unused makefile variable 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
d57ac3c6a1 Clearly separate documented scripts into user and build categories 2021-11-01 19:15:23 +00:00
Hamish Coleman
0d04b40926 Make distclean more clean 2021-11-01 19:15:23 +00:00
Hamish Coleman
00a2bdc307 Remove all use of N2N_VERSION_SHORT in favor of PACKAGE_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
430b0cb77d Fix CMakeFile version number embedded NL 2021-11-01 19:15:23 +00:00
Hamish Coleman
ff88803f6d Use one common file for the version number in both build systems 2021-11-01 19:15:23 +00:00
Logan oos Even
81bd79a82a
assured correct supernode MAC address properties (#888) 2021-11-02 00:01:44 +05:45
Logan oos Even
e0a9bb95fc
differentiated between 'active' and 'standby' in sn-selection-by-mac mode (#887) 2021-11-01 23:31:03 +05:45
Logan oos Even
3d0c618d99
updated Federation.md 2021-11-01 17:20:09 +05:45
Logan oos Even
89571292f4
allowed supernode MAC address to be set manually (-m) (#886) 2021-11-01 17:19:46 +05:45
Logan oos Even
f4e7e513a8
added MAC address based supernode selection (#885) 2021-11-01 16:35:05 +05:45
Hamish Coleman
03ce1e2b84
Merge pull request #883 from hamishcoleman/release
Only trigger automatic release process on annotated tags - Take two
2021-10-31 20:40:46 +00:00
Hamish Coleman
9f7ea89229 Remove debugging outputs 2021-10-31 20:28:30 +00:00
Hamish Coleman
5055259171 Output correct debug data... 2021-10-31 20:16:06 +00:00
Hamish Coleman
02f341df87 Add a debugging job to show the get tagtype data quicker in the workflow 2021-10-31 20:14:22 +00:00
Hamish Coleman
3c3a848dc2 Re-add much of the debug output 2021-10-31 19:51:22 +00:00
Hamish Coleman
5b5fe587ae Attempt to fix github tags in each job
See https://github.com/actions/checkout/issues/290 for some discussion.
2021-10-31 19:37:11 +00:00
Hamish Coleman
f2f49111b7 Add reference to a ticket for this problem 2021-10-31 19:28:42 +00:00
Hamish Coleman
88bd8e566f Fix clone command, removing the half removed old fetch-based command 2021-10-31 19:16:47 +00:00
Hamish Coleman
d8fa2ef9da Return the tags check to the releases, use our own clone and remove all the debug output 2021-10-31 19:04:35 +00:00