[RFC] Add custom configuration parameter handling layer #390
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.
This is a quick example of what I suggest in #381 and is put here for comment. At the very least, some minor cleanup will be needed before merge. In practice, I expect many other changes will be needed to make it safe.
The goal of this PR is to provide the "Additional Configuration" tab, which has only user defined fields.
The fields are defined in includes/config.php. A more appropriate location for these definitions may be found if editing includes/config.php is typically not user editable. The following are the new lines added to the config.php, for an example use case for providing proxy configuration options :
Of these lines, RASPI_CUSTOM_FIELDS would be empty in the default case. The user would be able to add any number of configuration blocks to these fields as shown for one block above.
These configuration parameters are saved to the ini file specified by RASPI_CUSTOM_CONFIG, which must also be created by the user and given appropriate permissions (tested to work with chmod www-data:www-data).
It will be left to the user of raspap to do with the custom.ini and its content what they want. In this example, for instance, proxy settings are not actually propagated anywhere by raspap. It will be upto the user application to read this configuration file, just as it was the user's decision to use this approach.
Assuming the general idea is acceptable, the following are left to be done or atleast considered :
My logs are currently full ofUndefined index: HTTP_X_CSRF_TOKEN
from this page, and I'm not sure why.'Network Proxy Host'
would becomearray('desc' =>'Network Proxy Host', 'validator' => $some_func)
.