Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor the config part #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

imichaelwong
Copy link

remove the defalut config file, use viper's default values;
add multiple locations for config file: /config/; CWD;
support ENV variables, the priority is ENV>config_file>defaults
now user don't need to start/update config/restart at the first time
they can customize it by providing config file or run it with ENV
variables
optimize the init procedure in main file, move config check logic to
config file, print config info during startup for better troubleshooting
and other small changes.

remove the defalut config file, use viper's default values;
add multiple locations for config file: /config/; CWD;
support ENV variables, the priority is ENV>config_file>defaults
now user don't need to start/update config/restart at the first time
they can customize it by providing config file or run it with ENV
variables
optimize the init procedure in main file, move config check logic to
config file, print config info during startup for better troubleshooting
and other small changes.
@allanpk716
Copy link
Collaborator

感谢提交代码。近期在大范围重构对接 Web,config 文件会被舍弃(可能),所以本功能应该不会合并。
Thanks for submitting the code. In the recent large-scale reconstruction of the interconnection Web, the config file will be discarded (possibly), so this function should not be merged.

如果你能够使用中文沟通,那么就更佳,毕竟这个项目的初衷(设计边界)的服务于中文用户。
If you can communicate in Chinese, so much the better, after all, the original purpose of the project (design boundaries) is to serve Chinese users.

@imichaelwong
Copy link
Author

谢谢,我对这个项目比较感兴趣,所以尝试着contribute一下。
其实在我的实现里,config文件已经不那么重要了,用户可以不提供config来运行应用,只是作为一个补充和向后兼容。
只是觉得目前首次运行比较麻烦,所以加入了环境变量来帮助配置,可以帮助用户很快上手。
其实这个和web配置也不冲突,个人觉得web配置更偏向于应用内部,比如哪些文件需要monitor.
anyway, 看你的需求决定嘛
其实对于web界面,我的需求不是那么大,bazarr的GUI我就开始的时候打开过一次,就让它后台默默无闻的下载字幕好了。

我再详细看看代码,看看啥时候合适了再来出把力吧。
btw, I like Doctor House very much!!!!

@allanpk716
Copy link
Collaborator

哈哈,House 最爱剧集。代码都是碎片时间写的,所以大部分都需要重构或者重新去构思。如果有什么觉得可以改进的,可以提出来,大家讨论下,因为很可能有隐藏的耦合问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants