Repository navigation
feat(web, server): Ability to use config file instead of admin UI - #3836
Conversation
…is set, copy existing config to clipboard
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
|
This looks really good. Looking at it now, I'm wondering if maybe it would be better to move the read config file method to the config repository instead of the storage repository, since that would reduce a lot of unnecessary changes in this PR. |
|
Yeah, that was quite an adventure... :D So, if you'd say that it would make more sense in the config repository, I sure can change it! This would make this PR a lot slimmer and simpler ;) |
|
At least I got to know the code base a bit by this ^^ |
|
Yeah, I don't think there are strong preferences either way. I'm probably the primary developer in this area of the codebase and I'm good either way. I think it would be simpler myself and thought of it after posting my comment yesterday. Usually it is nice to keep related functions together, so reading a file naturally could belong with all the other file operations in the storage repository, but in this case that makes that change quite unwieldy and I don't see much benefit requiring it to be there. I usually prefer simplicity and moving it to the config repository would make it considerably simpler. |
|
On the other hand, now that I've refactored the method to read files in general, if there should be some other use case at some time where reading files would be needed again, the logic would then already be in the right place. So, it would make the life of future devs easier :) |
|
True although, it is trivial to add that again if needed 😛 |
|
Sure, but this would result in duplicate code unless you streamline the config file process then, at which point you would have a bit more to do. |
bo0tzz
left a comment
There was a problem hiding this comment.
Thanks for picking this up!
I wasn't sure where to put the documentation for the config file.
This would probably suit a new page under docs/docs/install, after the env vars page.
|
As for the file reading discussion: Reading a file from disk is a relatively trivial event, so I don't think we need to anticipate much future need there. It's probably best to just take the simplest approach/with the least changes needed. |
mertalev
left a comment
There was a problem hiding this comment.
I think it's good once isConfigFile and validation are sorted out.
|
Hello, can you please include a screenshot of the UI elements? |
|
Why did the intl version change just from running |
|
Not sure, but your openapi-generator version might be different than what's on main. I'd run |
|
I think this is actually pinned in a patch file that probably isn't getting applied properly. |
That unfortunately did not do the trick. |
Sorry, but I can't seem to find any patch file that would be related to this. Also, they are generated and should not be touched either, right? |
|
Added a few things:
|
|
Thanks a lot! :) |
|
Thank you for the PR! |
) * implement method to read config file * getConfig returns config file if present * return isConfigFile for http requests * disable elements if config file is used, show message if config file is set, copy existing config to clipboard * fix allowing partial configuration files * add new env variable to docs * fix tests * minor refactoring, address review * adapt config type in frontend * remove unnecessary imports * move config file reading to system-config repo * add documentation * fix code formatting in system settings page * add validator for config file * fix formatting in docs * update generated files * throw error when trying to update config. e.g. via cli or api * switch to feature flags for isConfigFile * refactoring * refactor: config file * chore: open api * feat: always show copy/export buttons * fix: default flags * refactor: copy to clipboard --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This PR closes #3774, providing the ability to use a JSON config file instead of the admin UI.
Currently, the admin UI and the config file are mutually exclusive while the config file always takes precedence. So, if a config file is specified, changes in the admin UI are not possible anymore.
To get people started with this quickly, there is a new copy to clipboard button that allows to copy the entire config as a formatted JSON string.
If also added documentation for the new env variable, but I wasn't sure where to put the documentation for the config file.