-
Notifications
You must be signed in to change notification settings - Fork 390
zerotier: T6455: Add ZeroTier support #4752
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
base: current
Are you sure you want to change the base?
Conversation
👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 7 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
string_to_lines = [line for line in json_string.split('\n') if line.strip()] | ||
|
||
for line in range(len(string_to_lines) - 1): | ||
# Strip trailing spaces/tabs/newlines before checking | ||
if string_to_lines[line].rstrip().endswith(','): | ||
# If the next line (ignoring indentation) starts with } or ], | ||
# then the comma at the end of this line is invalid → remove it. | ||
if string_to_lines[line + 1].lstrip().startswith(('}', ']')): | ||
string_to_lines[line] = string_to_lines[line].rstrip().rstrip(',') |
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function removes empty lines from JSON, which could break formatting of JSON that intentionally includes empty lines. Consider preserving the original line structure and only removing trailing commas without filtering out empty lines.
string_to_lines = [line for line in json_string.split('\n') if line.strip()] | |
for line in range(len(string_to_lines) - 1): | |
# Strip trailing spaces/tabs/newlines before checking | |
if string_to_lines[line].rstrip().endswith(','): | |
# If the next line (ignoring indentation) starts with } or ], | |
# then the comma at the end of this line is invalid → remove it. | |
if string_to_lines[line + 1].lstrip().startswith(('}', ']')): | |
string_to_lines[line] = string_to_lines[line].rstrip().rstrip(',') | |
string_to_lines = json_string.split('\n') | |
for i in range(len(string_to_lines) - 1): | |
# Only check non-empty lines for trailing commas | |
if string_to_lines[i].rstrip().endswith(','): | |
# Find the next non-empty line | |
j = i + 1 | |
while j < len(string_to_lines) and string_to_lines[j].strip() == '': | |
j += 1 | |
if j < len(string_to_lines): | |
# If the next non-empty line (ignoring indentation) starts with } or ], | |
# then the comma at the end of this line is invalid → remove it. | |
if string_to_lines[j].lstrip().startswith(('}', ']')): | |
string_to_lines[i] = string_to_lines[i].rstrip().rstrip(',') |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty lines in a JSON are about human readability, but the render() pipeline is concerned about machine readable output. There's no benefit to preserving empty lines in this function IMO.
I realized due to the tagNode calling the script, the script was called per interface. I was configuring all interfaces for each run.
CI integration ❌ failed! Details
|
Change summary
This PR will add support for configuring ZeroTier from within the VyOS CLI. In addition to a simple ZeroTier interface, the ability to fully configure options within ZeroTier's
local.conf
has been added.The following command trees have been created:
Conf mode:
set interfaces zerotier
Op mode:
show interfaces zerotier
restart zerotier interface
import zerotier interface-config
delete zerotier interface-config
set zerotier interface
Types of changes
Related Task(s)
https://vyos.dev/T6455
Related PR(s)
vyos/vyos-build#1041
How to test / Smoketest result
peers-detail
to show more information for connected peers on the same controllerpeers-all
to see all peers on the controller:Smoketest results:
Checklist: