This is an automated email from the ASF dual-hosted git repository.

jaydoane pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/3.x by this push:
     new 8ac1978  Fix custodian default system dbs
8ac1978 is described below

commit 8ac1978d78af2fc288bed1a99c092c44632ac35a
Author: Jay Doane <[email protected]>
AuthorDate: Mon Jun 14 17:19:21 2021 -0700

    Fix custodian default system dbs
    
    These system db defaults were left unchanged when this code was
    imported from Cloudant. This updates them to CouchDB defaults, by
    using existing functions in the appropriate application and module.
    
    h/t @chewbranca for discovering the issue, and also suggesting
    a better way to obtain these config values.
---
 src/chttpd/src/chttpd_auth_cache.erl       | 2 +-
 src/custodian/src/custodian_db_checker.erl | 2 +-
 src/custodian/src/custodian_util.erl       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/chttpd/src/chttpd_auth_cache.erl 
b/src/chttpd/src/chttpd_auth_cache.erl
index fdae27b..17a31bf 100644
--- a/src/chttpd/src/chttpd_auth_cache.erl
+++ b/src/chttpd/src/chttpd_auth_cache.erl
@@ -13,7 +13,7 @@
 -module(chttpd_auth_cache).
 -behaviour(gen_server).
 
--export([start_link/0, get_user_creds/2, update_user_creds/3]).
+-export([start_link/0, get_user_creds/2, update_user_creds/3, dbname/0]).
 -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2,
     code_change/3]).
 -export([listen_for_changes/1, changes_callback/2]).
diff --git a/src/custodian/src/custodian_db_checker.erl 
b/src/custodian/src/custodian_db_checker.erl
index 10502dd..f9ab8c8 100644
--- a/src/custodian/src/custodian_db_checker.erl
+++ b/src/custodian/src/custodian_db_checker.erl
@@ -132,7 +132,7 @@ get_dbs() ->
 
 
 get_users_db() ->
-    UsersDb = config:get("couch_httpd_auth", "authentication_db", "users"),
+    UsersDb = chttpd_auth_cache:dbname(),
     [list_to_binary(UsersDb)].
 
 
diff --git a/src/custodian/src/custodian_util.erl 
b/src/custodian/src/custodian_util.erl
index 785bbd3..df095bd 100644
--- a/src/custodian/src/custodian_util.erl
+++ b/src/custodian/src/custodian_util.erl
@@ -43,7 +43,7 @@ report() ->
     fold_dbs([], Fun).
 
 ensure_dbs_exists() ->
-    DbName = config:get("mem3", "shards_db", "dbs"),
+    DbName = mem3_sync:shards_db(),
     {ok, Db} = mem3_util:ensure_exists(DbName),
     ensure_custodian_ddoc_exists(Db),
     {ok, Db}.

Reply via email to