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

Read database config from seafile.conf and env #713

Merged
merged 6 commits into from
Nov 5, 2024
Merged

Conversation

feiniks
Copy link
Contributor

@feiniks feiniks commented Nov 4, 2024

No description provided.

@feiniks feiniks force-pushed the del_ccnet_conf branch 2 times, most recently from f4ba84e to c6ecfb1 Compare November 5, 2024 07:13
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");
Copy link
Member

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;
Copy link
Member

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.")
}
Copy link
Member

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 == "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是否只有在没有配置 unix_socket 的情况下,才需要报错?

我觉得 unix_socket 这个选项可以去掉不再支持了,这样代码能简化不少。我们官方文档现在也没有这个配置选项的文档了。

@killing killing merged commit ed6a292 into master Nov 5, 2024
6 checks passed
@killing killing deleted the del_ccnet_conf branch November 5, 2024 09:42
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.

2 participants