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
[feature] Added auth and ip assignment for ZeroTier member #799
Merged
nemesifier
merged 108 commits into
gsoc23
from
issue-606/zerotier-member-auth-ip-assign
Sep 26, 2023
Merged
[feature] Added auth and ip assignment for ZeroTier member #799
nemesifier
merged 108 commits into
gsoc23
from
issue-606/zerotier-member-auth-ip-assign
Sep 26, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Additionally, basic support has been added for managing ZeroTier networks through OpenWISP using the ZeroTier Service API Closes #604
- Removed Zerotier read-only fields from the schema and utilized only the 'network_id' as the system-defined variable for the Zerotier network. - Fixed the issue of unwanted execution of "unsaved-changes.js" caused by the different order of configuration received from the API and the configuration defined in the VPN backend. - Enabled OpenWISP to control IP assignment using the subnet and IP fields of the VPN model. - Moved API requests for delete and update operations for Zerotier to background celery tasks, while the create operation remains synchronous. - Implemented basic error handling for Zerotier service API calls (further improvements will be made in the next review). - Updated existing migrations to include updated help text. - Fixed JS to hide unnecessary fields.
#778 (comment) - Handled the scenario where an invalid hostname is provided in the ZeroTier /status call. - Improved user experience by overriding the clean() method, which now reports that the auth_token field is required when the user selects the ZeroTier VPN backend. - Moved the logic from the _update_zerotier_server() method to the update_vpn_server_configuration method for better code organization. - Removed redundant conditional checks and unnecessary log statement from the _update_zerotier_server method.
- Improved ZerotierService methods. - Improved host and auth_token field validation. - Added OpenwispApiTask for retry mechanism.
- Added a new notification type for background API tasks. - This notification type will be used in the zerotier backend to notify users about various events related to background API calls. - Currently, the new notification is used in the following scenarios: - Creating a new zerotier network. - Updating an existing zerotier network. - Modifying network member configurations such as authorization and IP assignments.
**ZerotierService class** - Added a timeout of '5' seconds to API request methods. **OpenwispApiTask class** - Changed the log level to `logger.warn` when the retry limit is not reached, and `logger.error` only when the retry limit is reached. - Modified the logic to send a recovery notification only when the API task encountered an error before. Otherwise, no recovery notification is generated. - Updated the cache key as suggested in the review. - Added a docstring and comments for the `handle_api_call` method. **vpn.py** - Disabled email notifications for background API tasks. - Utilized guard clause in the `_validate_host` method. - Moved Zerotier VPN `auth_token` validation back to `models.py`. - Simplified the subnet and IP values for Zerotier API tasks. - Updated translation string messages and used the `.format` method instead of f-strings. For more information, see: https://docs.djangoproject.com/en/4.2/topics/i18n/translation/#standard-translation
- Added TestZeroTier and TestZeroTierTransaction - Updated `_invalidate_peer_cache` method of the Vpn model to emit `vpn_peers_changed` signal for only for Wireguard or VXLAN VPN backends
…calls - Ensure that recovery notifications are triggered only when the VPN server has previously encountered an unrecoverable error (error notification)
- Added a test case for zerotier vpn deletion 404
Aryamanz29
force-pushed
the
issue-606/zerotier-member-auth-ip-assign
branch
3 times, most recently
from
July 28, 2023 14:55
3e75438
to
7b02aff
Compare
…pn server - (req-changes) Moved time import at the top of the file. - Subnet should be type cast after ip assignment evaluation. - Updated zt vpn deletion tests.
Aryamanz29
force-pushed
the
issue-604/add-zerotier-vpn-backend
branch
from
July 30, 2023 20:24
590a3ef
to
83bd932
Compare
- Fixed test vpn deletion notification mock. - Deleted ZT API tasks notification cache keys after vpn deletion.
Aryamanz29
force-pushed
the
issue-604/add-zerotier-vpn-backend
branch
from
July 30, 2023 21:39
83bd932
to
016248f
Compare
Aryamanz29
force-pushed
the
issue-606/zerotier-member-auth-ip-assign
branch
4 times, most recently
from
July 31, 2023 12:55
b037b39
to
ca5431a
Compare
2 tasks
nemesifier
requested changes
Aug 18, 2023
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.
Good progress, please see my comments below.
pandafy
reviewed
Aug 22, 2023
- Also included enabled bridge option for member auth ip assignment API call.
nemesifier
approved these changes
Aug 29, 2023
pandafy
requested changes
Sep 1, 2023
Aryamanz29
added a commit
to openwisp/netjsonconfig
that referenced
this pull request
Sep 10, 2023
nemesifier
approved these changes
Sep 22, 2023
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.
LGTM, @pandafy please confirm.
LGTM! 👍🏼 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on
Closes #606