Have Plugins be able to update TR Config#1098
Conversation
|
I didn't see a function that will do a config write out. I was thinking something along the lines of:
Param: |
There's honestly nothing stopping a plugin from doing so already. As long as the user invoking t-r has write access to the config file, a plugin can read/write to it using basic file operations. I've been experimenting with this in the tr-web plugin to edit the config file over http and then send a signal to restart trunk-recorder. |
|
I was thinking there should be a canonical way of doing it from within the system. So that plugin devs don't have the implement this perhaps poorly (I'm talking about myself here) many times. Namely to make sure that it respects config file rules with not setting a value if it's default in the json file, or having plugins have their own config file settings preserved by the system having the full view of everything. |
|
good points @Dygear - it would be better to implement it once, correctly. It maybe a little tricky to not have the Default values trickle into the file. |
1b23616 to
41d935d
Compare
|
added in the ability for plugins to save the current configuration to a config.json file. it tracks the current JSON values so you do not get all of the default values saved to the file. |
|
This should make it in for the next version? |
There is probably a lot of fun that you could have with this. What do you think of the approach? Any setting missing?