openwisp / openwisp/netjsonconfig

[change] Make it easier to work with files

Open
#220 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
388
Forks
87
Avg merge
1h 26m
Merged PRs (30d)
4

Description

Reseved for future releases. Leaving it here just as an idea for now.

I like the solutionwe adopted in #217 for the TLS auth key of OpenVPN.

In many cases, configuration keys point to files.
However, the current way of defining files in this library is cumbersome for users.
Ideally users can simply paste the contents of the files, without having to define the paths.

I think the approach could be something like: if a key expects a file and the string contains any new line we can infer it's the contents of the file and we can generate the file automatically for the user.
Or something along these lines.

That way we maintain backward comaptibility.

The only issue is how to decide the path where to store the file, which we have to decide whether the user could be able to hint this in any way.

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.

Research direction

Start by reviewing the solution adopted in issue #217 and the library's current way of defining file-based configuration keys. The issue is done only after the content-versus-path behavior, generated-file location or user hint, and backward compatibility have been agreed and implemented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.