Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonRPC support replaces the old API #11

Merged
merged 154 commits into from
Feb 1, 2024
Merged

Conversation

hamishcoleman
Copy link
Contributor

Some of the tools still need porting to the new API, but all server features are present, working and documented. There is still plenty of room for improvements, but this branch contains the framework and expected minimum features.

One nice feature is that there is now a built in HTTP webpage that allows tool-free access to the running status on any system where there is a web browser (specifically, Windows, where you cannot expect people to run a python script)

Also:

  • Old management API completely removed
  • All old edge CLI options removed in favor of the generic config options
  • Man pages updated with current options and (hopefully) clearer examples
  • Two tools (keygen and hash tests) merged into the main edge binary
  • the supernode and edge main runtime config structure has been merged, removing some code duplication
  • build system improvements for easier static library inclusion (will help compiling PMP on Windows)
  • More teasing apart of monolithic headers to try and reduce the size of needed includes for any given object file

Since the number of options being given to each compile is probably only
going to increase, the ability to read and understand the compile output
is only going to become harder.

Address this by outputing the generic CC line once and then just show
the name of each file that is being compiled.

Note that we deliberately do not do this for the apps/ directory as we
want that to stay as simple as possible so that people can easily use it
as a template to write their own app.
This restores the load_dump back to its function as part of the test
suite, but renames it reflect its actual function of testing roundtrip
load/dump of a config file.

The debug menu is the place to put random internal debug output.
Windows mangled the command line arg "/dev/null" into something that the
find config files function turned into a session name of "nul", so just
output it for the operator to see - and dont include it in the expected
data.
None of the signal handling features are linux specific, nor is the term
handler only going to work on linux and windows, so just use the same
one everywhere.
Previously, the windows code would wait for an unknown amount of time
until the tun_read_thread exited.  That thread is constantly performing
infinite length waits for new packets to be ready to read from the tap
interface - so until a packet arrives, it will stall the daemon exit.

Having looked through the wintap overlapped read handling, it seems like
there could be some general improvements possible, so I will use this
simple terminate thread option until that refactoring can change the way
things work.
@hamishcoleman hamishcoleman self-assigned this Feb 1, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 1, 2024

Codecov Report

Attention: 591 lines in your changes are missing coverage. Please review.

Comparison is base (5249d46) 43.79% compared to head (a803884) 38.23%.

Files Patch % Lines
src/management.c 31.95% 247 Missing ⚠️
src/conffile.c 10.71% 100 Missing ⚠️
src/sn_utils.c 43.51% 74 Missing ⚠️
src/edge_utils.c 64.49% 49 Missing ⚠️
src/resolve.c 53.19% 44 Missing ⚠️
apps/supernode.c 0.00% 31 Missing ⚠️
apps/edge.c 56.52% 20 Missing ⚠️
src/base64.c 61.76% 13 Missing ⚠️
src/sn_selection.c 14.28% 6 Missing ⚠️
src/auth.c 0.00% 2 Missing ⚠️
... and 4 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #11      +/-   ##
==========================================
- Coverage   43.79%   38.23%   -5.57%     
==========================================
  Files          38       51      +13     
  Lines        5754     8898    +3144     
==========================================
+ Hits         2520     3402     +882     
- Misses       3234     5496    +2262     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hamishcoleman hamishcoleman merged commit 37e4ff4 into n42n:main Feb 1, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants