openwisp / openwisp/openwisp-controller

[gsoc21] Setting management IP: validation and interactions with other parts

Open
#523 0 comments 0 reactions 1 assignee View on GitHub

@purhan is already working on this.

Since Aug 15, 2021.

enhancement
Dominant language
Python
Stars
773
Forks
315
Avg merge
2d 16h
Merged PRs (30d)
14

Description

Follow up to: https://github.com/openwisp/openwisp-controller/pull/496#pullrequestreview-730140216.

There are mainly two possible ways in which OpenWISP can be used:

A) every organization has its own management tunnel
B) all organizations share the same management tunnel

In case A) we have to ensure there cannot be 2 devices having the same management IP in an organization.
In case B) we have to ensure there cannot be 2 devices having the same management IP in the whole system.

The error message can be _('this management IP is already used by another device').

This behavior can be controlled with a setting (which has to be documented), which can default to use case B) which is the most common case for most users having small systems.

There's another important thing to take into account: the controller views already manage the management IP automatically, see the code below:

https://github.com/openwisp/openwisp-controller/blob/cd55ea427fedffffdc1e103bae948ab1b99a68da/openwisp_controller/config/controller/views.py#L73-L108

https://github.com/openwisp/openwisp-controller/blob/cd55ea427fedffffdc1e103bae948ab1b99a68da/openwisp_controller/config/utils.py#L64-L81

It looks to me that adding this validation would break that code. Maybe we can change the code to remove the duplicate before saving the new management IP to the device?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.