Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ EXUNIT_OPTS=$(subst $(comma),$(space),$(tests))
#ignore javascript tests
ignore_js_suites=

TEST_OPTS="-c 'startup_jitter=0' -c 'default_security=admin_local'"

################################################################################
# Main commands
################################################################################
Expand Down Expand Up @@ -221,7 +223,7 @@ python-black: .venv/bin/black
@python3 -c "import sys; exit(1 if sys.version_info >= (3,6) else 0)" || \
LC_ALL=C.UTF-8 LANG=C.UTF-8 .venv/bin/black --check \
--exclude="build/|buck-out/|dist/|_build/|\.git/|\.hg/|\.mypy_cache/|\.nox/|\.tox/|\.venv/|src/rebar/pr2relnotes.py|src/fauxton" \
. dev/run rel/overlay/bin/couchup test/javascript/run
. dev/run "$(TEST_OPTS)" rel/overlay/bin/couchup test/javascript/run

python-black-update: .venv/bin/black
@python3 -c "import sys; exit(1 if sys.version_info < (3,6) else 0)" || \
Expand All @@ -234,7 +236,7 @@ python-black-update: .venv/bin/black
.PHONY: elixir
elixir: export MIX_ENV=integration
elixir: elixir-init elixir-check-formatted elixir-credo devclean
@dev/run -a adm:pass -n 1 --no-eval 'mix test --trace --exclude without_quorum_test --exclude with_quorum_test $(EXUNIT_OPTS)'
@dev/run "$(TEST_OPTS)" -a adm:pass -n 1 --no-eval 'mix test --trace --exclude without_quorum_test --exclude with_quorum_test $(EXUNIT_OPTS)'

.PHONY: elixir-init
elixir-init: MIX_ENV=test
Expand Down Expand Up @@ -277,7 +279,7 @@ else
endif
@dev/run -n 1 -q --with-admin-party-please \
--enable-erlang-views \
-c 'startup_jitter=0' \
"$(TEST_OPTS)" \
'test/javascript/run --suites "$(suites)" \
--ignore "$(ignore_js_suites)"'

Expand All @@ -292,7 +294,7 @@ else
endif
@dev/run -n 3 -q --with-admin-party-please \
--enable-erlang-views --degrade-cluster 1 \
-c 'startup_jitter=0' \
"$(TEST_OPTS)" \
'test/javascript/run --suites "$(suites)" \
--ignore "$(ignore_js_suites)" \
--path test/javascript/tests-cluster/with-quorum'
Expand All @@ -308,7 +310,7 @@ else
endif
@dev/run -n 3 -q --with-admin-party-please \
--enable-erlang-views --degrade-cluster 2 \
-c 'startup_jitter=0' \
"$(TEST_OPTS)" \
'test/javascript/run --suites "$(suites)" \
--ignore "$(ignore_js_suites)" \
--path test/javascript/tests-cluster/without-quorum'
Expand All @@ -325,7 +327,7 @@ endif
@rm -rf dev/lib
while [ $$? -eq 0 ]; do \
dev/run -n 1 -q --with-admin-party-please \
-c 'startup_jitter=0' \
"$(TEST_OPTS)" \
'test/javascript/run --suites "$(suites)" \
--ignore "$(ignore_js_suites)"' \
done
Expand Down Expand Up @@ -372,7 +374,7 @@ mango-test: devclean all
@cd src/mango && \
python3 -m venv .venv && \
.venv/bin/python3 -m pip install -r requirements.txt
@cd src/mango && ../../dev/run -n 1 --admin=testuser:testpass '.venv/bin/python3 -m nose --with-xunit'
@cd src/mango && ../../dev/run "$(TEST_OPTS)" -n 1 --admin=testuser:testpass '.venv/bin/python3 -m nose --with-xunit'

################################################################################
# Developing
Expand Down
2 changes: 1 addition & 1 deletion rel/overlay/etc/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ attachment_stream_buffer_size = 4096
; admin_only - only admins can read/write
; admin_local - sharded dbs on :5984 are read/write for everyone,
; local dbs on :5986 are read/write for admins only
default_security = admin_local
default_security = admin_only
; btree_chunk_size = 1279
; maintenance_mode = false
; stem_interactive_updates = true
Expand Down
4 changes: 2 additions & 2 deletions src/couch/src/couch_db_updater.erl
Original file line number Diff line number Diff line change
Expand Up @@ -851,15 +851,15 @@ get_meta_body_size(Meta) ->


default_security_object(<<"shards/", _/binary>>) ->
case config:get("couchdb", "default_security", "everyone") of
case config:get("couchdb", "default_security", "admin_only") of
"admin_only" ->
[{<<"members">>,{[{<<"roles">>,[<<"_admin">>]}]}},
{<<"admins">>,{[{<<"roles">>,[<<"_admin">>]}]}}];
Everyone when Everyone == "everyone"; Everyone == "admin_local" ->
[]
end;
default_security_object(_DbName) ->
case config:get("couchdb", "default_security", "everyone") of
case config:get("couchdb", "default_security", "admin_only") of
Admin when Admin == "admin_only"; Admin == "admin_local" ->
[{<<"members">>,{[{<<"roles">>,[<<"_admin">>]}]}},
{<<"admins">>,{[{<<"roles">>,[<<"_admin">>]}]}}];
Expand Down