-
Notifications
You must be signed in to change notification settings - Fork 220
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
Read database config from seafile.conf and env #713
Conversation
6d0c091
to
10f450b
Compare
b6f0137
to
33764d6
Compare
f4ba84e
to
c6ecfb1
Compare
c6ecfb1
to
0edea22
Compare
common/seaf-utils.c
Outdated
option->ccnet_db_name = g_strdup (env_ccnet_db); | ||
} else if (!option->ccnet_db_name) { | ||
option->ccnet_db_name = g_strdup ("ccnet_db"); | ||
seaf_message ("Failed to read SEAFILE_MYSQL_DB_CCNET_DB_NAME, use ccnet_db by default"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个缩进有点问题。
@@ -190,51 +185,6 @@ ccnet_user_manager_set_max_users (CcnetUserManager *manager, gint64 max_users) | |||
|
|||
static int try_load_ldap_settings (CcnetUserManager *manager) | |||
{ | |||
GKeyFile *config = manager->session->ccnet_config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ldap 相关的代码不用删除吧,现在默认是不会编译的。
// user is required. | ||
if key, err = section.GetKey("user"); err != nil { | ||
return dbOpt, fmt.Errorf("no database user in seafile.conf.") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些会通过环境变量获取的选项,如果配置文件没有,不应该报错吧。
if dbOpt.Host == "" && dbOpt.UnixSocket == "" { | ||
return nil, fmt.Errorf("no database host in seafile.conf.") | ||
} | ||
if dbOpt.User == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是否只有在没有配置 unix_socket 的情况下,才需要报错?
我觉得 unix_socket 这个选项可以去掉不再支持了,这样代码能简化不少。我们官方文档现在也没有这个配置选项的文档了。
No description provided.