├── .asf.yaml ├── .credo.exs ├── .devcontainer ├── Dockerfile └── devcontainer.json ├── .formatter.exs ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── enhancement.md │ └── rfc.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .mailmap ├── .readthedocs.yaml ├── BUGS.md ├── COMMITTERS.md ├── CONTRIBUTING.md ├── CONTRIBUTORS.in ├── INSTALL.Unix.md ├── INSTALL.Windows.md ├── LICENSE ├── Makefile ├── Makefile.win ├── NOTICE ├── README-DEV.rst ├── README.rst ├── bin └── erlang-version.escript ├── build-aux ├── Jenkinsfile.full ├── Jenkinsfile.pr ├── README.md ├── couchdb-build-release.sh ├── logfile-uploader.py ├── print-committerlist.sh ├── show-test-results.py └── xref-helper.sh ├── config ├── config.exs ├── dev.exs ├── integration.exs ├── prod.exs └── test.exs ├── configure ├── configure.ps1 ├── dev ├── format_all.py ├── format_check.py ├── format_lib.py ├── make_boot_script ├── monitor_parent.erl ├── pbkdf2.py ├── remsh ├── remsh-tls ├── run └── run.cmd ├── erlang_ls.config ├── make.cmd ├── mix.exs ├── nouveau ├── .gitignore ├── LICENSE ├── README.md ├── TODO ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── couchdb │ │ │ └── nouveau │ │ │ ├── NouveauApplication.java │ │ │ ├── NouveauApplicationConfiguration.java │ │ │ ├── api │ │ │ ├── AnalyzeRequest.java │ │ │ ├── AnalyzeResponse.java │ │ │ ├── DocumentDeleteRequest.java │ │ │ ├── DocumentUpdateRequest.java │ │ │ ├── DoubleField.java │ │ │ ├── DoubleRange.java │ │ │ ├── Field.java │ │ │ ├── IndexDefinition.java │ │ │ ├── IndexInfo.java │ │ │ ├── IndexInfoRequest.java │ │ │ ├── Range.java │ │ │ ├── SearchHit.java │ │ │ ├── SearchRequest.java │ │ │ ├── SearchResults.java │ │ │ ├── StoredField.java │ │ │ ├── StringField.java │ │ │ └── TextField.java │ │ │ ├── core │ │ │ ├── IOUtils.java │ │ │ ├── Index.java │ │ │ ├── IndexFunction.java │ │ │ ├── IndexManager.java │ │ │ ├── StaleIndexException.java │ │ │ ├── StripedLock.java │ │ │ ├── UpdatesOutOfOrderException.java │ │ │ ├── UserAgentFilter.java │ │ │ └── ser │ │ │ │ ├── ByteArrayWrapper.java │ │ │ │ ├── DoubleWrapper.java │ │ │ │ ├── FloatWrapper.java │ │ │ │ ├── IntWrapper.java │ │ │ │ ├── LongWrapper.java │ │ │ │ ├── NullWrapper.java │ │ │ │ ├── PrimitiveWrapper.java │ │ │ │ └── StringWrapper.java │ │ │ ├── health │ │ │ ├── AnalyzeHealthCheck.java │ │ │ └── IndexHealthCheck.java │ │ │ ├── lucene9 │ │ │ ├── Lucene9AnalyzerFactory.java │ │ │ ├── Lucene9Index.java │ │ │ ├── Lucene9IndexSchema.java │ │ │ ├── Lucene9Module.java │ │ │ ├── NouveauQueryParser.java │ │ │ ├── ParallelSearcherFactory.java │ │ │ ├── QueryDeserializer.java │ │ │ ├── QuerySerializer.java │ │ │ └── SimpleAsciiFoldingAnalyzer.java │ │ │ ├── resources │ │ │ ├── AnalyzeResource.java │ │ │ └── IndexResource.java │ │ │ └── tasks │ │ │ └── CloseAllIndexesTask.java │ └── resources │ │ ├── banner.txt │ │ └── openapi.yaml │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── couchdb │ │ └── nouveau │ │ ├── api │ │ └── SearchRequestTest.java │ │ ├── core │ │ └── IndexManagerTest.java │ │ ├── health │ │ ├── AnalyzeHealthCheckTest.java │ │ └── IndexHealthCheckTest.java │ │ └── lucene9 │ │ ├── Lucene9AnalyzerFactoryTest.java │ │ ├── Lucene9IndexTest.java │ │ ├── NouveauQueryParserTest.java │ │ └── QuerySerializationTest.java │ └── resources │ └── fixtures │ ├── DocumentUpdateRequest.json │ └── SearchRequest.json ├── rebar.config.script ├── rel ├── apps │ ├── config.config │ └── couch_epi.config ├── files │ ├── README │ ├── couchdb.cmd.in │ ├── couchdb.in │ ├── eunit.config │ ├── eunit.ini │ ├── sys.config │ └── vm.args ├── haproxy.cfg ├── nouveau.yaml ├── overlay │ ├── bin │ │ └── remsh │ └── etc │ │ ├── default.d │ │ └── README │ │ ├── default.ini │ │ ├── local.d │ │ └── README │ │ ├── local.ini │ │ └── vm.args ├── plugins │ └── eunit_plugin.erl ├── reltool.config └── reltool.config.script ├── setup_eunit.template ├── share └── server │ ├── 60 │ ├── escodegen.js │ ├── esprima.js │ ├── rewrite_fun.js │ └── rewrite_fun_ast_bypass.js │ ├── coffee-script.js │ ├── dispatch-quickjs.js │ ├── dreyfus.js │ ├── filter.js │ ├── loop.js │ ├── mimeparse.js │ ├── nouveau.js │ ├── render.js │ ├── rewrite_fun.js │ ├── state.js │ ├── util.js │ ├── validate.js │ └── views.js ├── src ├── b64url │ ├── .gitignore │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── c_src │ │ └── b64url.c │ ├── rebar.config │ ├── src │ │ ├── b64url.app.src │ │ └── b64url.erl │ └── test │ │ ├── b64url_tests.erl │ │ └── benchmark.escript ├── chttpd │ ├── LICENSE │ ├── include │ │ ├── chttpd.hrl │ │ └── chttpd_cors.hrl │ ├── priv │ │ └── stats_descriptions.cfg │ ├── src │ │ ├── chttpd.app.src │ │ ├── chttpd.erl │ │ ├── chttpd_app.erl │ │ ├── chttpd_auth.erl │ │ ├── chttpd_auth_cache.erl │ │ ├── chttpd_auth_request.erl │ │ ├── chttpd_cors.erl │ │ ├── chttpd_db.erl │ │ ├── chttpd_epi.erl │ │ ├── chttpd_external.erl │ │ ├── chttpd_handlers.erl │ │ ├── chttpd_httpd_handlers.erl │ │ ├── chttpd_misc.erl │ │ ├── chttpd_node.erl │ │ ├── chttpd_plugin.erl │ │ ├── chttpd_prefer_header.erl │ │ ├── chttpd_rewrite.erl │ │ ├── chttpd_show.erl │ │ ├── chttpd_stats.erl │ │ ├── chttpd_sup.erl │ │ ├── chttpd_test_util.erl │ │ ├── chttpd_util.erl │ │ ├── chttpd_view.erl │ │ └── chttpd_xframe_options.erl │ └── test │ │ └── eunit │ │ ├── chttpd_auth_hash_algorithms_tests.erl │ │ ├── chttpd_auth_tests.erl │ │ ├── chttpd_bulk_get_test.erl │ │ ├── chttpd_changes_test.erl │ │ ├── chttpd_cors_test.erl │ │ ├── chttpd_csp_tests.erl │ │ ├── chttpd_db_attachment_size_tests.erl │ │ ├── chttpd_db_doc_get_tests.erl │ │ ├── chttpd_db_doc_size_tests.erl │ │ ├── chttpd_db_test.erl │ │ ├── chttpd_dbs_info_test.erl │ │ ├── chttpd_delayed_test.erl │ │ ├── chttpd_error_info_tests.erl │ │ ├── chttpd_external_test.erl │ │ ├── chttpd_handlers_tests.erl │ │ ├── chttpd_invalid_path_test.erl │ │ ├── chttpd_local_docs_tests.erl │ │ ├── chttpd_misc_test.erl │ │ ├── chttpd_open_revs_error_test.erl │ │ ├── chttpd_plugin_tests.erl │ │ ├── chttpd_prefer_header_test.erl │ │ ├── chttpd_purge_tests.erl │ │ ├── chttpd_revs_diff_tests.erl │ │ ├── chttpd_security_tests.erl │ │ ├── chttpd_session_tests.erl │ │ ├── chttpd_socket_buffer_size_test.erl │ │ ├── chttpd_util_test.erl │ │ ├── chttpd_view_test.erl │ │ └── chttpd_xframe_test.erl ├── config │ ├── LICENSE │ ├── src │ │ ├── config.app.src.script │ │ ├── config.erl │ │ ├── config.hrl │ │ ├── config_app.erl │ │ ├── config_listener.erl │ │ ├── config_listener_mon.erl │ │ ├── config_notifier.erl │ │ ├── config_sup.erl │ │ ├── config_util.erl │ │ └── config_writer.erl │ └── test │ │ ├── config_tests.erl │ │ └── fixtures │ │ ├── config_default_test.ini │ │ ├── config_tests_1.ini │ │ ├── config_tests_2.ini │ │ ├── default.d │ │ └── extra.ini │ │ └── local.d │ │ └── extra.ini ├── couch │ ├── .gitignore │ ├── LICENSE │ ├── include │ │ ├── couch_db.hrl │ │ ├── couch_eunit.hrl │ │ ├── couch_eunit_proper.hrl │ │ └── couch_js_functions.hrl │ ├── priv │ │ ├── couch_cfile │ │ │ └── couch_cfile.c │ │ ├── couch_ejson_compare │ │ │ └── couch_ejson_compare.c │ │ ├── couch_js │ │ │ ├── 60 │ │ │ │ ├── help.h │ │ │ │ ├── main.cpp │ │ │ │ ├── util.cpp │ │ │ │ └── util.h │ │ │ ├── 68 │ │ │ │ ├── help.h │ │ │ │ ├── main.cpp │ │ │ │ ├── util.cpp │ │ │ │ └── util.h │ │ │ ├── 86 │ │ │ │ ├── help.h │ │ │ │ ├── main.cpp │ │ │ │ ├── util.cpp │ │ │ │ └── util.h │ │ │ ├── 102 │ │ │ │ ├── help.h │ │ │ │ ├── main.cpp │ │ │ │ ├── util.cpp │ │ │ │ └── util.h │ │ │ └── 1.8.5 │ │ │ │ ├── help.h │ │ │ │ ├── main.c │ │ │ │ ├── utf8.c │ │ │ │ ├── utf8.h │ │ │ │ ├── util.c │ │ │ │ └── util.h │ │ └── stats_descriptions.cfg │ ├── rebar.config.script │ ├── src │ │ ├── couch.app.src │ │ ├── couch.erl │ │ ├── couch_app.erl │ │ ├── couch_att.erl │ │ ├── couch_auth_cache.erl │ │ ├── couch_auth_lockout.erl │ │ ├── couch_base32.erl │ │ ├── couch_bt_engine.erl │ │ ├── couch_bt_engine.hrl │ │ ├── couch_bt_engine_compactor.erl │ │ ├── couch_bt_engine_header.erl │ │ ├── couch_bt_engine_stream.erl │ │ ├── couch_btree.erl │ │ ├── couch_cfile.erl │ │ ├── couch_changes.erl │ │ ├── couch_compress.erl │ │ ├── couch_db.erl │ │ ├── couch_db_engine.erl │ │ ├── couch_db_epi.erl │ │ ├── couch_db_int.hrl │ │ ├── couch_db_plugin.erl │ │ ├── couch_db_split.erl │ │ ├── couch_db_updater.erl │ │ ├── couch_debug.erl │ │ ├── couch_disk_monitor.erl │ │ ├── couch_doc.erl │ │ ├── couch_ejson_compare.erl │ │ ├── couch_ejson_size.erl │ │ ├── couch_emsort.erl │ │ ├── couch_event_sup.erl │ │ ├── couch_file.erl │ │ ├── couch_flags.erl │ │ ├── couch_flags_config.erl │ │ ├── couch_hash.erl │ │ ├── couch_hotp.erl │ │ ├── couch_httpd.erl │ │ ├── couch_httpd_auth.erl │ │ ├── couch_httpd_db.erl │ │ ├── couch_httpd_handlers.erl │ │ ├── couch_httpd_misc_handlers.erl │ │ ├── couch_httpd_multipart.erl │ │ ├── couch_httpd_rewrite.erl │ │ ├── couch_httpd_vhost.erl │ │ ├── couch_hyper.erl │ │ ├── couch_key_tree.erl │ │ ├── couch_lru.erl │ │ ├── couch_multidb_changes.erl │ │ ├── couch_native_process.erl │ │ ├── couch_os_process.erl │ │ ├── couch_partition.erl │ │ ├── couch_password_hasher.erl │ │ ├── couch_passwords.erl │ │ ├── couch_passwords_cache.erl │ │ ├── couch_primary_sup.erl │ │ ├── couch_proc_manager.erl │ │ ├── couch_query_servers.erl │ │ ├── couch_secondary_sup.erl │ │ ├── couch_server.erl │ │ ├── couch_server_int.hrl │ │ ├── couch_stream.erl │ │ ├── couch_sup.erl │ │ ├── couch_task_status.erl │ │ ├── couch_totp.erl │ │ ├── couch_users_db.erl │ │ ├── couch_util.erl │ │ ├── couch_uuids.erl │ │ ├── couch_work_queue.erl │ │ ├── test_request.erl │ │ └── test_util.erl │ └── test │ │ └── eunit │ │ ├── chttpd_endpoints_tests.erl │ │ ├── couch_auth_cache_tests.erl │ │ ├── couch_base32_tests.erl │ │ ├── couch_bt_engine_compactor_ev.erl │ │ ├── couch_bt_engine_compactor_ev_tests.erl │ │ ├── couch_bt_engine_compactor_tests.erl │ │ ├── couch_bt_engine_tests.erl │ │ ├── couch_bt_engine_upgrade_tests.erl │ │ ├── couch_btree_tests.erl │ │ ├── couch_cfile_prop_tests.erl │ │ ├── couch_cfile_tests.erl │ │ ├── couch_changes_tests.erl │ │ ├── couch_compress_tests.erl │ │ ├── couch_db_doc_tests.erl │ │ ├── couch_db_mpr_tests.erl │ │ ├── couch_db_plugin_tests.erl │ │ ├── couch_db_props_upgrade_tests.erl │ │ ├── couch_db_split_tests.erl │ │ ├── couch_db_tests.erl │ │ ├── couch_doc_json_tests.erl │ │ ├── couch_doc_tests.erl │ │ ├── couch_ejson_compare_tests.erl │ │ ├── couch_ejson_size_tests.erl │ │ ├── couch_etag_tests.erl │ │ ├── couch_file_tests.erl │ │ ├── couch_flags_config_tests.erl │ │ ├── couch_flags_tests.erl │ │ ├── couch_hash_test.erl │ │ ├── couch_hotp_tests.erl │ │ ├── couch_index_tests.erl │ │ ├── couch_js_tests.erl │ │ ├── couch_key_tree_prop_tests.erl │ │ ├── couch_key_tree_tests.erl │ │ ├── couch_passwords_tests.erl │ │ ├── couch_query_servers_tests.erl │ │ ├── couch_server_tests.erl │ │ ├── couch_stream_tests.erl │ │ ├── couch_task_status_tests.erl │ │ ├── couch_totp_tests.erl │ │ ├── couch_util_tests.erl │ │ ├── couch_uuids_tests.erl │ │ ├── couch_work_queue_tests.erl │ │ ├── couchdb_attachments_tests.erl │ │ ├── couchdb_auth_tests.erl │ │ ├── couchdb_cookie_domain_tests.erl │ │ ├── couchdb_cors_tests.erl │ │ ├── couchdb_db_tests.erl │ │ ├── couchdb_design_doc_tests.erl │ │ ├── couchdb_file_compression_tests.erl │ │ ├── couchdb_location_header_tests.erl │ │ ├── couchdb_mrview_cors_tests.erl │ │ ├── couchdb_mrview_tests.erl │ │ ├── couchdb_open_doc_revs_tests.erl │ │ ├── couchdb_os_proc_pool.erl │ │ ├── couchdb_update_conflicts_tests.erl │ │ ├── couchdb_vhosts_tests.erl │ │ ├── couchdb_views_tests.erl │ │ ├── fixtures │ │ ├── 15a5cb17365a99cd9ddc7327c82bbd0d.view │ │ ├── 1f2c24bc334d701c2048f85e7438eef1.view │ │ ├── 6cf2c2f766f87b618edf6630b00f8736.view │ │ ├── colltest1.couch │ │ ├── couch_stats_aggregates.cfg │ │ ├── couch_stats_aggregates.ini │ │ ├── db321.couch │ │ ├── db_non_partitioned.couch │ │ ├── db_v6_with_1_purge_req.couch │ │ ├── db_v6_with_1_purge_req_for_2_docs.couch │ │ ├── db_v6_with_2_purge_req.couch │ │ ├── db_v6_without_purge_req.couch │ │ ├── db_v7_with_1_purge_req.couch │ │ ├── db_v7_with_1_purge_req_for_2_docs.couch │ │ ├── db_v7_with_2_purge_req.couch │ │ ├── db_v7_without_purge_req.couch │ │ ├── logo.png │ │ ├── multipart.http │ │ ├── os_daemon_bad_perm.sh │ │ ├── os_daemon_can_reboot.sh │ │ ├── os_daemon_configer.escript │ │ ├── os_daemon_die_on_boot.sh │ │ ├── os_daemon_die_quickly.sh │ │ ├── os_daemon_looper.escript │ │ └── test.couch │ │ ├── global_changes_tests.erl │ │ ├── json_stream_parse_tests.erl │ │ ├── same_site_cookie_tests.erl │ │ └── test_web.erl ├── couch_dist │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── certs │ │ ├── certs │ │ ├── certs.exs │ │ └── parse_cert.escript │ ├── gen_certs │ ├── src │ │ ├── couch_dist.app.src │ │ └── couch_dist.erl │ └── test │ │ └── eunit │ │ └── couch_dist_tests.erl ├── couch_epi │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── rebar.config │ ├── src │ │ ├── couch_epi.app.src.script │ │ ├── couch_epi.erl │ │ ├── couch_epi.hrl │ │ ├── couch_epi_app.erl │ │ ├── couch_epi_codechange_monitor.erl │ │ ├── couch_epi_codegen.erl │ │ ├── couch_epi_data.erl │ │ ├── couch_epi_data_gen.erl │ │ ├── couch_epi_functions.erl │ │ ├── couch_epi_functions_gen.erl │ │ ├── couch_epi_module_keeper.erl │ │ ├── couch_epi_plugin.erl │ │ ├── couch_epi_sup.erl │ │ └── couch_epi_util.erl │ └── test │ │ └── eunit │ │ ├── couch_epi_basic_test.erl │ │ ├── couch_epi_tests.erl │ │ └── fixtures │ │ ├── app_data1.cfg │ │ └── app_data2.cfg ├── couch_event │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── rebar.config │ └── src │ │ ├── couch_event.app.src │ │ ├── couch_event.erl │ │ ├── couch_event_app.erl │ │ ├── couch_event_int.hrl │ │ ├── couch_event_listener.erl │ │ ├── couch_event_listener_mfa.erl │ │ ├── couch_event_server.erl │ │ └── couch_event_sup2.erl ├── couch_index │ ├── .gitignore │ ├── LICENSE │ ├── src │ │ ├── couch_index.app.src │ │ ├── couch_index.erl │ │ ├── couch_index_app.erl │ │ ├── couch_index_compactor.erl │ │ ├── couch_index_debug.erl │ │ ├── couch_index_epi.erl │ │ ├── couch_index_plugin.erl │ │ ├── couch_index_plugin_couch_db.erl │ │ ├── couch_index_server.erl │ │ ├── couch_index_sup.erl │ │ ├── couch_index_updater.erl │ │ └── couch_index_util.erl │ └── test │ │ └── eunit │ │ ├── couch_index_compaction_tests.erl │ │ ├── couch_index_crash_tests.erl │ │ └── couch_index_ddoc_updated_tests.erl ├── couch_log │ ├── .gitignore │ ├── LICENSE │ ├── include │ │ └── couch_log.hrl │ ├── priv │ │ └── stats_descriptions.cfg │ ├── src │ │ ├── couch_log.app.src │ │ ├── couch_log.erl │ │ ├── couch_log_app.erl │ │ ├── couch_log_config.erl │ │ ├── couch_log_config_dyn.erl │ │ ├── couch_log_error_logger_h.erl │ │ ├── couch_log_formatter.erl │ │ ├── couch_log_monitor.erl │ │ ├── couch_log_server.erl │ │ ├── couch_log_sup.erl │ │ ├── couch_log_trunc_io.erl │ │ ├── couch_log_trunc_io_fmt.erl │ │ ├── couch_log_util.erl │ │ ├── couch_log_writer.erl │ │ ├── couch_log_writer_file.erl │ │ ├── couch_log_writer_journald.erl │ │ ├── couch_log_writer_stderr.erl │ │ └── couch_log_writer_syslog.erl │ └── test │ │ └── eunit │ │ ├── couch_log_config_listener_test.erl │ │ ├── couch_log_config_test.erl │ │ ├── couch_log_error_logger_h_test.erl │ │ ├── couch_log_formatter_test.erl │ │ ├── couch_log_monitor_test.erl │ │ ├── couch_log_server_test.erl │ │ ├── couch_log_test.erl │ │ ├── couch_log_test_util.erl │ │ ├── couch_log_trunc_io_fmt_test.erl │ │ ├── couch_log_util_test.erl │ │ ├── couch_log_writer_ets.erl │ │ ├── couch_log_writer_file_test.erl │ │ ├── couch_log_writer_stderr_test.erl │ │ ├── couch_log_writer_syslog_test.erl │ │ └── couch_log_writer_test.erl ├── couch_mrview │ ├── LICENSE │ ├── include │ │ └── couch_mrview.hrl │ ├── priv │ │ └── stats_descriptions.cfg │ ├── src │ │ ├── couch_mrview.app.src │ │ ├── couch_mrview.erl │ │ ├── couch_mrview_cleanup.erl │ │ ├── couch_mrview_compactor.erl │ │ ├── couch_mrview_debug.erl │ │ ├── couch_mrview_http.erl │ │ ├── couch_mrview_index.erl │ │ ├── couch_mrview_show.erl │ │ ├── couch_mrview_test_util.erl │ │ ├── couch_mrview_update_notifier.erl │ │ ├── couch_mrview_updater.erl │ │ └── couch_mrview_util.erl │ └── test │ │ └── eunit │ │ ├── couch_mrview_all_docs_tests.erl │ │ ├── couch_mrview_collation_tests.erl │ │ ├── couch_mrview_compact_tests.erl │ │ ├── couch_mrview_ddoc_updated_tests.erl │ │ ├── couch_mrview_ddoc_validation_tests.erl │ │ ├── couch_mrview_design_docs_tests.erl │ │ ├── couch_mrview_http_tests.erl │ │ ├── couch_mrview_index_info_tests.erl │ │ ├── couch_mrview_local_docs_tests.erl │ │ ├── couch_mrview_map_views_tests.erl │ │ ├── couch_mrview_purge_docs_fabric_tests.erl │ │ ├── couch_mrview_purge_docs_tests.erl │ │ ├── couch_mrview_red_views_tests.erl │ │ ├── couch_mrview_show_list_tests.erl │ │ └── couch_mrview_util_tests.erl ├── couch_peruser │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── src │ │ ├── couch_peruser.app.src │ │ ├── couch_peruser.erl │ │ ├── couch_peruser_app.erl │ │ └── couch_peruser_sup.erl │ └── test │ │ └── eunit │ │ └── couch_peruser_test.erl ├── couch_prometheus │ ├── src │ │ ├── couch_prometheus.app.src │ │ ├── couch_prometheus.erl │ │ ├── couch_prometheus_app.erl │ │ ├── couch_prometheus_http.erl │ │ ├── couch_prometheus_sup.erl │ │ └── couch_prometheus_util.erl │ └── test │ │ └── eunit │ │ └── couch_prometheus_e2e_tests.erl ├── couch_pse_tests │ └── src │ │ ├── couch_pse_tests.app.src │ │ ├── cpse_gather.erl │ │ ├── cpse_test_attachments.erl │ │ ├── cpse_test_compaction.erl │ │ ├── cpse_test_copy_purge_infos.erl │ │ ├── cpse_test_fold_changes.erl │ │ ├── cpse_test_fold_docs.erl │ │ ├── cpse_test_fold_purge_infos.erl │ │ ├── cpse_test_get_set_props.erl │ │ ├── cpse_test_open_close_delete.erl │ │ ├── cpse_test_purge_bad_checkpoints.erl │ │ ├── cpse_test_purge_docs.erl │ │ ├── cpse_test_purge_replication.erl │ │ ├── cpse_test_purge_seqs.erl │ │ ├── cpse_test_read_write_docs.erl │ │ ├── cpse_test_ref_counting.erl │ │ └── cpse_util.erl ├── couch_quickjs │ ├── .gitignore │ ├── build_js.escript │ ├── c_src │ │ ├── .gitignore │ │ └── couchjs.c │ ├── patches │ │ └── 01-spidermonkey-185-mode.patch │ ├── quickjs │ │ ├── Changelog │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── VERSION │ │ ├── cutils.c │ │ ├── cutils.h │ │ ├── dtoa.c │ │ ├── dtoa.h │ │ ├── libregexp-opcode.h │ │ ├── libregexp.c │ │ ├── libregexp.h │ │ ├── libunicode-table.h │ │ ├── libunicode.c │ │ ├── libunicode.h │ │ ├── list.h │ │ ├── qjsc.c │ │ ├── quickjs-atom.h │ │ ├── quickjs-libc.c │ │ ├── quickjs-libc.h │ │ ├── quickjs-opcode.h │ │ ├── quickjs.c │ │ ├── quickjs.h │ │ ├── run-test262.c │ │ ├── test262.conf │ │ ├── test262_errors.txt │ │ └── tests │ │ │ └── test262.patch │ ├── rebar.config.script │ ├── src │ │ ├── couch_quickjs.app.src │ │ ├── couch_quickjs.erl │ │ └── couch_quickjs_scanner_plugin.erl │ ├── test │ │ ├── couch_quickjs_scanner_plugin_tests.erl │ │ └── couch_quickjs_tests.erl │ └── update_and_apply_patches.sh ├── couch_replicator │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── include │ │ └── couch_replicator_api_wrap.hrl │ ├── priv │ │ └── stats_descriptions.cfg │ ├── src │ │ ├── couch_replicator.app.src │ │ ├── couch_replicator.erl │ │ ├── couch_replicator.hrl │ │ ├── couch_replicator_api_wrap.erl │ │ ├── couch_replicator_app.erl │ │ ├── couch_replicator_auth.erl │ │ ├── couch_replicator_auth_noop.erl │ │ ├── couch_replicator_auth_session.erl │ │ ├── couch_replicator_changes_reader.erl │ │ ├── couch_replicator_connection.erl │ │ ├── couch_replicator_doc_processor.erl │ │ ├── couch_replicator_doc_processor_worker.erl │ │ ├── couch_replicator_docs.erl │ │ ├── couch_replicator_fabric.erl │ │ ├── couch_replicator_fabric_rpc.erl │ │ ├── couch_replicator_filters.erl │ │ ├── couch_replicator_httpc.erl │ │ ├── couch_replicator_httpc_pool.erl │ │ ├── couch_replicator_httpd.erl │ │ ├── couch_replicator_httpd_util.erl │ │ ├── couch_replicator_ids.erl │ │ ├── couch_replicator_notifier.erl │ │ ├── couch_replicator_parse.erl │ │ ├── couch_replicator_pg.erl │ │ ├── couch_replicator_rate_limiter.erl │ │ ├── couch_replicator_rate_limiter_tables.erl │ │ ├── couch_replicator_scheduler.erl │ │ ├── couch_replicator_scheduler_job.erl │ │ ├── couch_replicator_share.erl │ │ ├── couch_replicator_stats.erl │ │ ├── couch_replicator_sup.erl │ │ ├── couch_replicator_utils.erl │ │ ├── couch_replicator_worker.erl │ │ └── json_stream_parse.erl │ └── test │ │ └── eunit │ │ ├── couch_replicator_attachments_too_large.erl │ │ ├── couch_replicator_bulk_get_tests.erl │ │ ├── couch_replicator_compact_tests.erl │ │ ├── couch_replicator_connection_tests.erl │ │ ├── couch_replicator_create_target_with_options_tests.erl │ │ ├── couch_replicator_doc_ids_tests.erl │ │ ├── couch_replicator_error_reporting_tests.erl │ │ ├── couch_replicator_filtered_tests.erl │ │ ├── couch_replicator_httpc_pool_tests.erl │ │ ├── couch_replicator_id_too_long_tests.erl │ │ ├── couch_replicator_large_atts_tests.erl │ │ ├── couch_replicator_many_leaves_tests.erl │ │ ├── couch_replicator_missing_stubs_tests.erl │ │ ├── couch_replicator_proxy_tests.erl │ │ ├── couch_replicator_rate_limiter_tests.erl │ │ ├── couch_replicator_retain_stats_between_job_runs.erl │ │ ├── couch_replicator_revs_diff_tests.erl │ │ ├── couch_replicator_scheduler_docs_tests.erl │ │ ├── couch_replicator_selector_tests.erl │ │ ├── couch_replicator_small_max_request_size_target.erl │ │ ├── couch_replicator_test_helper.erl │ │ └── couch_replicator_use_checkpoints_tests.erl ├── couch_scanner │ ├── README.md │ ├── include │ │ └── couch_scanner_plugin.hrl │ ├── src │ │ ├── couch_scanner.app.src │ │ ├── couch_scanner.erl │ │ ├── couch_scanner_app.erl │ │ ├── couch_scanner_checkpoint.erl │ │ ├── couch_scanner_plugin.erl │ │ ├── couch_scanner_plugin_conflict_finder.erl │ │ ├── couch_scanner_plugin_ddoc_features.erl │ │ ├── couch_scanner_plugin_find.erl │ │ ├── couch_scanner_rate_limiter.erl │ │ ├── couch_scanner_server.erl │ │ ├── couch_scanner_sup.erl │ │ └── couch_scanner_util.erl │ └── test │ │ └── eunit │ │ └── couch_scanner_test.erl ├── couch_stats │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── priv │ │ └── sample_descriptions.cfg │ └── src │ │ ├── couch_stats.app.src │ │ ├── couch_stats.erl │ │ ├── couch_stats_app.erl │ │ ├── couch_stats_counter.erl │ │ ├── couch_stats_gauge.erl │ │ ├── couch_stats_histogram.erl │ │ ├── couch_stats_httpd.erl │ │ ├── couch_stats_math.erl │ │ ├── couch_stats_process_tracker.erl │ │ ├── couch_stats_server.erl │ │ ├── couch_stats_sup.erl │ │ └── couch_stats_util.erl ├── couch_tests │ ├── .gitignore │ ├── include │ │ └── couch_tests.hrl │ ├── rebar.config │ ├── setups │ │ └── couch_epi_dispatch.erl │ ├── src │ │ ├── couch_tests.app.src │ │ ├── couch_tests.erl │ │ └── couch_tests_combinatorics.erl │ └── test │ │ └── couch_tests_app_tests.erl ├── custodian │ ├── README │ ├── rebar.config.script │ └── src │ │ ├── custodian.app.src.script │ │ ├── custodian.erl │ │ ├── custodian_app.erl │ │ ├── custodian_db_checker.erl │ │ ├── custodian_monitor.erl │ │ ├── custodian_noop_monitor.erl │ │ ├── custodian_server.erl │ │ ├── custodian_sup.erl │ │ └── custodian_util.erl ├── ddoc_cache │ ├── LICENSE │ ├── README.md │ ├── priv │ │ └── stats_descriptions.cfg │ ├── src │ │ ├── ddoc_cache.app.src │ │ ├── ddoc_cache.erl │ │ ├── ddoc_cache.hrl │ │ ├── ddoc_cache_app.erl │ │ ├── ddoc_cache_entry.erl │ │ ├── ddoc_cache_entry_custom.erl │ │ ├── ddoc_cache_entry_ddocid.erl │ │ ├── ddoc_cache_entry_ddocid_rev.erl │ │ ├── ddoc_cache_entry_validation_funs.erl │ │ ├── ddoc_cache_lru.erl │ │ ├── ddoc_cache_sup.erl │ │ └── ddoc_cache_value.erl │ └── test │ │ └── eunit │ │ ├── ddoc_cache_basic_test.erl │ │ ├── ddoc_cache_coverage_test.erl │ │ ├── ddoc_cache_disabled_test.erl │ │ ├── ddoc_cache_entry_test.erl │ │ ├── ddoc_cache_ev.erl │ │ ├── ddoc_cache_eviction_test.erl │ │ ├── ddoc_cache_lru_test.erl │ │ ├── ddoc_cache_no_cache_test.erl │ │ ├── ddoc_cache_open_error_test.erl │ │ ├── ddoc_cache_open_test.erl │ │ ├── ddoc_cache_refresh_test.erl │ │ ├── ddoc_cache_remove_test.erl │ │ ├── ddoc_cache_test.hrl │ │ └── ddoc_cache_tutil.erl ├── docs │ ├── .gitignore │ ├── LICENSE │ ├── Makefile │ ├── NOTICE │ ├── README.md │ ├── ext │ │ ├── configdomain.py │ │ └── linter.py │ ├── images │ │ ├── 23379351593_0c480537de_q.jpg │ │ ├── TLS-Handshake.png │ │ ├── epub-icon.png │ │ ├── fair-enough.png │ │ ├── favicon.ico │ │ ├── futon-createdb.png │ │ ├── futon-editdoc.png │ │ ├── futon-editeddoc.png │ │ ├── futon-overview.png │ │ ├── futon-replform.png │ │ ├── gf-gnome-rainbows.png │ │ ├── index-selection-steps.svg │ │ ├── intro-consistency-01.png │ │ ├── intro-consistency-02.png │ │ ├── intro-consistency-03.png │ │ ├── intro-consistency-04.png │ │ ├── intro-consistency-05.png │ │ ├── intro-consistency-06.png │ │ ├── intro-consistency-07.png │ │ ├── intro-tour-01.png │ │ ├── intro-tour-03.png │ │ ├── intro-tour-04.png │ │ ├── intro-tour-05.png │ │ ├── intro-tour-06.png │ │ ├── intro-tour-07.png │ │ ├── intro-tour-08.png │ │ ├── intro-tour-09.png │ │ ├── intro-tour-10.png │ │ ├── intro-why-01.png │ │ ├── intro-why-02.png │ │ ├── intro-why-03.png │ │ ├── logo.png │ │ ├── purge-checkpoint-docs.png │ │ ├── replication-state-diagram.svg │ │ ├── rev-tree1.png │ │ ├── rev-tree2.png │ │ ├── rev-tree3.png │ │ ├── tea-erl-grey-hot-replicator.png │ │ ├── views-intro-01.png │ │ ├── views-intro-02.png │ │ ├── views-intro-03.png │ │ └── views-intro-04.png │ ├── make.bat │ ├── rebar.config │ ├── requirements.txt │ ├── rfcs │ │ ├── 001-fdb-revision-metadata-model.md │ │ ├── 002-shard-splitting.md │ │ ├── 003-fdb-seq-index.md │ │ ├── 004-document-storage.md │ │ ├── 005-all-docs-index.md │ │ ├── 006-mango-fdb.md │ │ ├── 007-background-jobs.md │ │ ├── 008-map-indexes.md │ │ ├── 009-exunit.md │ │ ├── 011-opentracing.md │ │ ├── 012-fdb-reduce.md │ │ ├── 013-node-types.md │ │ ├── 014-pagination.md │ │ ├── 015-background-index-building.md │ │ ├── 016-fdb-replicator.md │ │ ├── 017-fair-share-scheduling.md │ │ ├── images │ │ │ ├── SkExample1.png │ │ │ ├── SkExample2.png │ │ │ └── SkExample3.png │ │ └── template.md │ ├── setup.bat │ ├── setup.sh │ ├── src │ │ ├── about.rst │ │ ├── api │ │ │ ├── basics.rst │ │ │ ├── database │ │ │ │ ├── bulk-api.rst │ │ │ │ ├── changes.rst │ │ │ │ ├── cleanup.rst │ │ │ │ ├── common.rst │ │ │ │ ├── compact.rst │ │ │ │ ├── find.rst │ │ │ │ ├── index.rst │ │ │ │ ├── misc.rst │ │ │ │ ├── security.rst │ │ │ │ └── shard.rst │ │ │ ├── ddoc │ │ │ │ ├── common.rst │ │ │ │ ├── index.rst │ │ │ │ ├── nouveau.rst │ │ │ │ ├── render.rst │ │ │ │ ├── rewrites.rst │ │ │ │ ├── search.rst │ │ │ │ └── views.rst │ │ │ ├── document │ │ │ │ ├── attachments.rst │ │ │ │ ├── common.rst │ │ │ │ └── index.rst │ │ │ ├── index.rst │ │ │ ├── local.rst │ │ │ ├── partitioned-dbs.rst │ │ │ └── server │ │ │ │ ├── authn.rst │ │ │ │ ├── common.rst │ │ │ │ ├── configuration.rst │ │ │ │ └── index.rst │ │ ├── best-practices │ │ │ ├── documents.rst │ │ │ ├── forms.rst │ │ │ ├── index.rst │ │ │ ├── iso-date.rst │ │ │ ├── jsdevel.rst │ │ │ ├── reverse-proxies.rst │ │ │ └── views.rst │ │ ├── cluster │ │ │ ├── databases.rst │ │ │ ├── index.rst │ │ │ ├── nodes.rst │ │ │ ├── purging.rst │ │ │ ├── sharding.rst │ │ │ ├── theory.rst │ │ │ ├── tls_erlang_distribution.rst │ │ │ └── troubleshooting.rst │ │ ├── conf.py │ │ ├── config │ │ │ ├── auth.rst │ │ │ ├── cluster.rst │ │ │ ├── compaction.rst │ │ │ ├── couch-peruser.rst │ │ │ ├── couchdb.rst │ │ │ ├── disk-monitor.rst │ │ │ ├── http.rst │ │ │ ├── index.rst │ │ │ ├── indexbuilds.rst │ │ │ ├── intro.rst │ │ │ ├── ioq.rst │ │ │ ├── logging.rst │ │ │ ├── misc.rst │ │ │ ├── query-servers.rst │ │ │ ├── quickjs.rst │ │ │ ├── replicator.rst │ │ │ ├── resharding.rst │ │ │ └── scanner.rst │ │ ├── contributing.rst │ │ ├── cve │ │ │ ├── 2010-0009.rst │ │ │ ├── 2010-2234.rst │ │ │ ├── 2010-3854.rst │ │ │ ├── 2012-5641.rst │ │ │ ├── 2012-5649.rst │ │ │ ├── 2012-5650.rst │ │ │ ├── 2014-2668.rst │ │ │ ├── 2017-12635.rst │ │ │ ├── 2017-12636.rst │ │ │ ├── 2018-11769.rst │ │ │ ├── 2018-17188.rst │ │ │ ├── 2018-8007.rst │ │ │ ├── 2020-1955.rst │ │ │ ├── 2021-38295.rst │ │ │ ├── 2022-24706.rst │ │ │ ├── 2023-26268.rst │ │ │ ├── 2023-45725.rst │ │ │ └── index.rst │ │ ├── ddocs │ │ │ ├── ddocs.rst │ │ │ ├── index.rst │ │ │ ├── mango.rst │ │ │ ├── nouveau.rst │ │ │ ├── search.rst │ │ │ └── views │ │ │ │ ├── collation.rst │ │ │ │ ├── index.rst │ │ │ │ ├── intro.rst │ │ │ │ ├── joins.rst │ │ │ │ ├── nosql.rst │ │ │ │ └── pagination.rst │ │ ├── docs.app.src │ │ ├── experimental.rst │ │ ├── fauxton │ │ │ ├── index.rst │ │ │ └── install.rst │ │ ├── index.rst │ │ ├── install │ │ │ ├── docker.rst │ │ │ ├── freebsd.rst │ │ │ ├── index.rst │ │ │ ├── kubernetes.rst │ │ │ ├── mac.rst │ │ │ ├── nouveau.rst │ │ │ ├── search.rst │ │ │ ├── snap.rst │ │ │ ├── troubleshooting.rst │ │ │ ├── unix.rst │ │ │ ├── upgrading.rst │ │ │ └── windows.rst │ │ ├── intro │ │ │ ├── api.rst │ │ │ ├── consistency.rst │ │ │ ├── curl.rst │ │ │ ├── index.rst │ │ │ ├── overview.rst │ │ │ ├── security.rst │ │ │ ├── tour.rst │ │ │ └── why.rst │ │ ├── json-structure.rst │ │ ├── maintenance │ │ │ ├── backups.rst │ │ │ ├── compaction.rst │ │ │ ├── index.rst │ │ │ └── performance.rst │ │ ├── partitioned-dbs │ │ │ └── index.rst │ │ ├── query-server │ │ │ ├── erlang.rst │ │ │ ├── index.rst │ │ │ ├── javascript.rst │ │ │ └── protocol.rst │ │ ├── replication │ │ │ ├── conflicts.rst │ │ │ ├── index.rst │ │ │ ├── intro.rst │ │ │ ├── protocol.rst │ │ │ └── replicator.rst │ │ ├── setup │ │ │ ├── cluster.rst │ │ │ ├── index.rst │ │ │ └── single-node.rst │ │ └── whatsnew │ │ │ ├── 0.10.rst │ │ │ ├── 0.11.rst │ │ │ ├── 0.8.rst │ │ │ ├── 0.9.rst │ │ │ ├── 1.0.rst │ │ │ ├── 1.1.rst │ │ │ ├── 1.2.rst │ │ │ ├── 1.3.rst │ │ │ ├── 1.4.rst │ │ │ ├── 1.5.rst │ │ │ ├── 1.6.rst │ │ │ ├── 1.7.rst │ │ │ ├── 2.0.rst │ │ │ ├── 2.1.rst │ │ │ ├── 2.2.rst │ │ │ ├── 2.3.rst │ │ │ ├── 3.0.rst │ │ │ ├── 3.1.rst │ │ │ ├── 3.2.rst │ │ │ ├── 3.3.rst │ │ │ ├── 3.4.rst │ │ │ ├── 3.5.rst │ │ │ └── index.rst │ ├── static │ │ └── css │ │ │ ├── rtd_theme.css │ │ │ └── tablefix.css │ └── templates │ │ ├── breadcrumbs.html │ │ ├── layout.html │ │ └── pages │ │ ├── download.html │ │ └── index.html ├── dreyfus │ ├── .gitignore │ ├── LICENSE.txt │ ├── README.md │ ├── include │ │ └── dreyfus.hrl │ ├── priv │ │ └── stats_descriptions.cfg │ ├── src │ │ ├── clouseau_rpc.erl │ │ ├── dreyfus.app.src │ │ ├── dreyfus.erl │ │ ├── dreyfus_app.erl │ │ ├── dreyfus_bookmark.erl │ │ ├── dreyfus_config.erl │ │ ├── dreyfus_epi.erl │ │ ├── dreyfus_fabric.erl │ │ ├── dreyfus_fabric_cleanup.erl │ │ ├── dreyfus_fabric_group1.erl │ │ ├── dreyfus_fabric_group2.erl │ │ ├── dreyfus_fabric_info.erl │ │ ├── dreyfus_fabric_search.erl │ │ ├── dreyfus_httpd.erl │ │ ├── dreyfus_httpd_handlers.erl │ │ ├── dreyfus_index.erl │ │ ├── dreyfus_index_manager.erl │ │ ├── dreyfus_index_updater.erl │ │ ├── dreyfus_plugin_couch_db.erl │ │ ├── dreyfus_rpc.erl │ │ ├── dreyfus_sup.erl │ │ └── dreyfus_util.erl │ └── test │ │ └── eunit │ │ ├── dreyfus_blacklist_await_test.erl │ │ ├── dreyfus_blacklist_request_test.erl │ │ ├── dreyfus_config_test.erl │ │ ├── dreyfus_purge_test.erl │ │ └── dreyfus_test_util.erl ├── ets_lru │ ├── .gitignore │ ├── LICENSE │ ├── Makefile │ ├── src │ │ ├── ets_lru.app.src │ │ └── ets_lru.erl │ └── test │ │ └── ets_lru_test.erl ├── exxhash │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── c_src │ │ ├── exxhash.c │ │ ├── xxhash.c │ │ └── xxhash.h │ ├── rebar.config │ ├── src │ │ ├── exxhash.app.src │ │ └── exxhash.erl │ └── test │ │ └── exxhash_tests.erl ├── fabric │ ├── LICENSE │ ├── README.md │ ├── include │ │ └── fabric.hrl │ ├── priv │ │ └── stats_descriptions.cfg │ ├── src │ │ ├── fabric.app.src │ │ ├── fabric.erl │ │ ├── fabric_bench.erl │ │ ├── fabric_db_create.erl │ │ ├── fabric_db_delete.erl │ │ ├── fabric_db_doc_count.erl │ │ ├── fabric_db_info.erl │ │ ├── fabric_db_meta.erl │ │ ├── fabric_db_partition_info.erl │ │ ├── fabric_db_purged_infos.erl │ │ ├── fabric_db_update_listener.erl │ │ ├── fabric_db_uuids.erl │ │ ├── fabric_design_doc_count.erl │ │ ├── fabric_dict.erl │ │ ├── fabric_doc_atts.erl │ │ ├── fabric_doc_missing_revs.erl │ │ ├── fabric_doc_open.erl │ │ ├── fabric_doc_open_revs.erl │ │ ├── fabric_doc_purge.erl │ │ ├── fabric_doc_update.erl │ │ ├── fabric_group_info.erl │ │ ├── fabric_open_revs.erl │ │ ├── fabric_ring.erl │ │ ├── fabric_rpc.erl │ │ ├── fabric_streams.erl │ │ ├── fabric_util.erl │ │ ├── fabric_view.erl │ │ ├── fabric_view_all_docs.erl │ │ ├── fabric_view_changes.erl │ │ ├── fabric_view_map.erl │ │ ├── fabric_view_reduce.erl │ │ └── fabric_view_row.erl │ └── test │ │ └── eunit │ │ ├── fabric_bench_test.erl │ │ ├── fabric_changes_test.erl │ │ ├── fabric_db_create_tests.erl │ │ ├── fabric_db_info_tests.erl │ │ ├── fabric_db_uuids_tests.erl │ │ ├── fabric_moved_shards_seq_tests.erl │ │ ├── fabric_open_revs_test.erl │ │ ├── fabric_rpc_purge_tests.erl │ │ ├── fabric_rpc_tests.erl │ │ └── fabric_tests.erl ├── global_changes │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── priv │ │ └── stats_descriptions.cfg │ ├── src │ │ ├── global_changes.app.src │ │ ├── global_changes_app.erl │ │ ├── global_changes_epi.erl │ │ ├── global_changes_httpd.erl │ │ ├── global_changes_httpd_handlers.erl │ │ ├── global_changes_listener.erl │ │ ├── global_changes_plugin.erl │ │ ├── global_changes_server.erl │ │ ├── global_changes_sup.erl │ │ └── global_changes_util.erl │ └── test │ │ └── eunit │ │ └── global_changes_hooks_tests.erl ├── ioq │ ├── .gitignore │ └── src │ │ ├── ioq.app.src │ │ ├── ioq.erl │ │ ├── ioq_app.erl │ │ └── ioq_sup.erl ├── jwtf │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── rebar.config │ ├── src │ │ ├── jwtf.app.src │ │ ├── jwtf.erl │ │ ├── jwtf_app.erl │ │ ├── jwtf_keystore.erl │ │ └── jwtf_sup.erl │ └── test │ │ ├── jwtf_keystore_tests.erl │ │ └── jwtf_tests.erl ├── ken │ ├── README.md │ ├── rebar.config.script │ ├── src │ │ ├── ken.app.src.script │ │ ├── ken.erl │ │ ├── ken_app.erl │ │ ├── ken_event_handler.erl │ │ ├── ken_server.erl │ │ └── ken_sup.erl │ └── test │ │ ├── config.ini │ │ └── ken_server_test.erl ├── mango │ ├── .gitignore │ ├── LICENSE.txt │ ├── README.md │ ├── TODO.md │ ├── rebar.config.script │ ├── requirements.txt │ ├── src │ │ ├── mango.app.src │ │ ├── mango.hrl │ │ ├── mango_app.erl │ │ ├── mango_crud.erl │ │ ├── mango_cursor.erl │ │ ├── mango_cursor.hrl │ │ ├── mango_cursor_nouveau.erl │ │ ├── mango_cursor_special.erl │ │ ├── mango_cursor_text.erl │ │ ├── mango_cursor_view.erl │ │ ├── mango_doc.erl │ │ ├── mango_epi.erl │ │ ├── mango_error.erl │ │ ├── mango_execution_stats.erl │ │ ├── mango_execution_stats.hrl │ │ ├── mango_fields.erl │ │ ├── mango_httpd.erl │ │ ├── mango_httpd_handlers.erl │ │ ├── mango_idx.erl │ │ ├── mango_idx_nouveau.erl │ │ ├── mango_idx_special.erl │ │ ├── mango_idx_text.erl │ │ ├── mango_idx_view.erl │ │ ├── mango_idx_view.hrl │ │ ├── mango_json.erl │ │ ├── mango_json_bookmark.erl │ │ ├── mango_native_proc.erl │ │ ├── mango_opts.erl │ │ ├── mango_selector.erl │ │ ├── mango_selector_text.erl │ │ ├── mango_sort.erl │ │ ├── mango_sup.erl │ │ └── mango_util.erl │ ├── test │ │ ├── 01-index-crud-test.py │ │ ├── 02-basic-find-test.py │ │ ├── 03-operator-test.py │ │ ├── 04-key-tests.py │ │ ├── 05-index-selection-test.py │ │ ├── 06-basic-text-test.py │ │ ├── 06-text-default-field-test.py │ │ ├── 07-text-custom-field-list-test.py │ │ ├── 08-text-limit-test.py │ │ ├── 09-text-sort-test.py │ │ ├── 10-disable-array-length-field-test.py │ │ ├── 11-ignore-design-docs-test.py │ │ ├── 12-use-correct-index-test.py │ │ ├── 13-stable-update-test.py │ │ ├── 13-users-db-find-test.py │ │ ├── 14-json-pagination-test.py │ │ ├── 15-execution-stats-test.py │ │ ├── 16-index-selectors-test.py │ │ ├── 17-multi-type-value-test.py │ │ ├── 18-json-sort.py │ │ ├── 19-find-conflicts.py │ │ ├── 20-no-timeout-test.py │ │ ├── 21-empty-selector-tests.py │ │ ├── 22-covering-index-test.py │ │ ├── 23-explain-indexes-test.py │ │ ├── 24-text-paginated-test.py │ │ ├── 25-beginswith-test.py │ │ ├── friend_docs.py │ │ ├── limit_docs.py │ │ ├── mango.py │ │ └── user_docs.py │ └── unittest.cfg ├── mem3 │ ├── LICENSE │ ├── README.md │ ├── README_reshard.md │ ├── include │ │ └── mem3.hrl │ ├── priv │ │ └── stats_descriptions.cfg │ ├── rebar.config.script │ ├── src │ │ ├── mem3.app.src │ │ ├── mem3.erl │ │ ├── mem3_app.erl │ │ ├── mem3_bdu.erl │ │ ├── mem3_cluster.erl │ │ ├── mem3_distribution.erl │ │ ├── mem3_epi.erl │ │ ├── mem3_hash.erl │ │ ├── mem3_httpd.erl │ │ ├── mem3_httpd_handlers.erl │ │ ├── mem3_nodes.erl │ │ ├── mem3_plugin_couch_db.erl │ │ ├── mem3_rep.erl │ │ ├── mem3_reshard.erl │ │ ├── mem3_reshard.hrl │ │ ├── mem3_reshard_api.erl │ │ ├── mem3_reshard_dbdoc.erl │ │ ├── mem3_reshard_httpd.erl │ │ ├── mem3_reshard_index.erl │ │ ├── mem3_reshard_job.erl │ │ ├── mem3_reshard_job_sup.erl │ │ ├── mem3_reshard_store.erl │ │ ├── mem3_reshard_sup.erl │ │ ├── mem3_reshard_validate.erl │ │ ├── mem3_rpc.erl │ │ ├── mem3_seeds.erl │ │ ├── mem3_shards.erl │ │ ├── mem3_sup.erl │ │ ├── mem3_sync.erl │ │ ├── mem3_sync_event.erl │ │ ├── mem3_sync_event_listener.erl │ │ ├── mem3_sync_nodes.erl │ │ ├── mem3_sync_security.erl │ │ └── mem3_util.erl │ └── test │ │ └── eunit │ │ ├── mem3_bdu_test.erl │ │ ├── mem3_cluster_test.erl │ │ ├── mem3_distribution_test.erl │ │ ├── mem3_hash_test.erl │ │ ├── mem3_rep_test.erl │ │ ├── mem3_reshard_api_test.erl │ │ ├── mem3_reshard_changes_feed_test.erl │ │ ├── mem3_reshard_test.erl │ │ ├── mem3_ring_prop_tests.erl │ │ ├── mem3_seeds_test.erl │ │ ├── mem3_shards_test.erl │ │ ├── mem3_sync_security_test.erl │ │ └── mem3_util_test.erl ├── nouveau │ ├── include │ │ └── nouveau.hrl │ ├── priv │ │ └── stats_descriptions.cfg │ └── src │ │ ├── nouveau.app.src │ │ ├── nouveau.erl │ │ ├── nouveau_api.erl │ │ ├── nouveau_app.erl │ │ ├── nouveau_bookmark.erl │ │ ├── nouveau_epi.erl │ │ ├── nouveau_fabric.erl │ │ ├── nouveau_fabric_cleanup.erl │ │ ├── nouveau_fabric_info.erl │ │ ├── nouveau_fabric_search.erl │ │ ├── nouveau_httpd.erl │ │ ├── nouveau_httpd_handlers.erl │ │ ├── nouveau_index_manager.erl │ │ ├── nouveau_index_updater.erl │ │ ├── nouveau_int.hrl │ │ ├── nouveau_plugin_couch_db.erl │ │ ├── nouveau_rpc.erl │ │ ├── nouveau_sup.erl │ │ └── nouveau_util.erl ├── rexi │ ├── README.md │ ├── include │ │ └── rexi.hrl │ ├── priv │ │ └── stats_descriptions.cfg │ ├── src │ │ ├── rexi.app.src │ │ ├── rexi.erl │ │ ├── rexi_app.erl │ │ ├── rexi_buffer.erl │ │ ├── rexi_monitor.erl │ │ ├── rexi_server.erl │ │ ├── rexi_server_mon.erl │ │ ├── rexi_server_sup.erl │ │ ├── rexi_sup.erl │ │ └── rexi_utils.erl │ └── test │ │ ├── rexi_buffer_tests.erl │ │ └── rexi_tests.erl ├── setup │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── src │ │ ├── setup.app.src │ │ ├── setup.erl │ │ ├── setup_app.erl │ │ ├── setup_epi.erl │ │ ├── setup_httpd.erl │ │ ├── setup_httpd_handlers.erl │ │ └── setup_sup.erl │ └── test │ │ ├── t-frontend-setup.sh │ │ ├── t-single-node-auto-setup.sh │ │ ├── t-single-node.sh │ │ └── t.sh ├── smoosh │ ├── README.md │ ├── operator_guide.md │ ├── src │ │ ├── smoosh.app.src │ │ ├── smoosh.erl │ │ ├── smoosh_app.erl │ │ ├── smoosh_channel.erl │ │ ├── smoosh_persist.erl │ │ ├── smoosh_priority_queue.erl │ │ ├── smoosh_server.erl │ │ ├── smoosh_sup.erl │ │ └── smoosh_utils.erl │ └── test │ │ └── smoosh_tests.erl └── weatherreport │ ├── .gitignore │ ├── .manifest │ ├── LICENSE │ ├── README.md │ ├── how_to_add_a_check.md │ ├── rebar.config │ └── src │ ├── weatherreport.app.src │ ├── weatherreport.erl │ ├── weatherreport_check.erl │ ├── weatherreport_check_custodian.erl │ ├── weatherreport_check_disk.erl │ ├── weatherreport_check_internal_replication.erl │ ├── weatherreport_check_ioq.erl │ ├── weatherreport_check_mem3_sync.erl │ ├── weatherreport_check_membership.erl │ ├── weatherreport_check_memory_use.erl │ ├── weatherreport_check_message_queues.erl │ ├── weatherreport_check_node_stats.erl │ ├── weatherreport_check_nodes_connected.erl │ ├── weatherreport_check_process_calls.erl │ ├── weatherreport_check_process_memory.erl │ ├── weatherreport_check_safe_to_rebuild.erl │ ├── weatherreport_check_search.erl │ ├── weatherreport_check_tcp_queues.erl │ ├── weatherreport_config.erl │ ├── weatherreport_getopt.erl │ ├── weatherreport_log.erl │ ├── weatherreport_node.erl │ ├── weatherreport_runner.erl │ └── weatherreport_util.erl ├── support └── build_js.escript ├── test ├── bench │ └── benchbulk.sh ├── build │ ├── test-configure-distclean.sh │ ├── test-configure.sh │ └── test-make-clean.sh ├── elixir │ ├── .formatter.exs │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── config │ │ ├── config.exs │ │ └── test.exs │ ├── lib │ │ ├── couch.ex │ │ ├── couch │ │ │ └── dbtest.ex │ │ ├── couch_raw.ex │ │ ├── ex_unit.ex │ │ ├── setup.ex │ │ ├── setup │ │ │ └── common.ex │ │ ├── step.ex │ │ ├── step │ │ │ ├── config.ex │ │ │ ├── create_db.ex │ │ │ ├── start.ex │ │ │ └── user.ex │ │ ├── suite.ex │ │ └── utils.ex │ ├── run.cmd │ └── test │ │ ├── all_docs_test.exs │ │ ├── attachment_names_test.exs │ │ ├── attachment_paths_test.exs │ │ ├── attachment_ranges_test.exs │ │ ├── attachment_views_test.exs │ │ ├── attachments_multipart_test.exs │ │ ├── attachments_test.exs │ │ ├── auth_cache_test.exs │ │ ├── auth_lockout_test.exs │ │ ├── basics_test.exs │ │ ├── batch_save_test.exs │ │ ├── bulk_docs_test.exs │ │ ├── changes_async_test.exs │ │ ├── changes_test.exs │ │ ├── cluster_with_quorum_test.exs │ │ ├── cluster_without_quorum_test.exs │ │ ├── coffee_test.exs │ │ ├── compact_test.exs │ │ ├── config │ │ ├── nouveau.elixir │ │ ├── search.elixir │ │ ├── skip.elixir │ │ ├── suite.elixir │ │ └── test-config.ini │ │ ├── config_test.exs │ │ ├── conflicts_test.exs │ │ ├── cookie_auth_test.exs │ │ ├── copy_doc_test.exs │ │ ├── data │ │ ├── lorem.txt │ │ └── lorem_b64.txt │ │ ├── design_docs_query_test.exs │ │ ├── design_docs_test.exs │ │ ├── design_options_test.exs │ │ ├── design_paths_test.exs │ │ ├── disk_monitor.exs │ │ ├── erlang_views_test.exs │ │ ├── etags_head_test.exs │ │ ├── form_submit_test.exs │ │ ├── helper_test.exs │ │ ├── http_test.exs │ │ ├── invalid_docids_test.exs │ │ ├── jsonp_test.exs │ │ ├── jwt_roles_claim_test.exs │ │ ├── jwtauth_test.exs │ │ ├── large_docs_text.exs │ │ ├── list_views_test.exs │ │ ├── local_docs_test.exs │ │ ├── lots_of_docs_test.exs │ │ ├── method_override_test.exs │ │ ├── multiple_rows_test.exs │ │ ├── nouveau_test.exs │ │ ├── partition_all_docs_test.exs │ │ ├── partition_crud_test.exs │ │ ├── partition_ddoc_test.exs │ │ ├── partition_design_docs_test.exs │ │ ├── partition_helpers.exs │ │ ├── partition_mango_test.exs │ │ ├── partition_search_test.exs │ │ ├── partition_size_limit_test.exs │ │ ├── partition_size_test.exs │ │ ├── partition_view_test.exs │ │ ├── partition_view_update_test.exs │ │ ├── password_cache_test.exs │ │ ├── proxyauth_test.exs │ │ ├── purge_test.exs │ │ ├── reader_acl_test.exs │ │ ├── recreate_doc_test.exs │ │ ├── reduce_builtin_test.exs │ │ ├── reduce_false_test.exs │ │ ├── reduce_test.exs │ │ ├── replication_test.exs │ │ ├── reshard_all_docs_test.exs │ │ ├── reshard_basic_test.exs │ │ ├── reshard_changes_feed.exs │ │ ├── reshard_helpers.exs │ │ ├── rev_stemming_test.exs │ │ ├── rewrite_js_test.exs │ │ ├── rewrite_test.exs │ │ ├── search_test.exs │ │ ├── security_validation_test.exs │ │ ├── show_documents_test.exs │ │ ├── support │ │ └── couch_test_case.ex │ │ ├── test_helper.exs │ │ ├── update_documents_test.exs │ │ ├── users_db_security_test.exs │ │ ├── users_db_test.exs │ │ ├── utf8_test.exs │ │ ├── uuids_test.exs │ │ ├── view_collation_raw_test.exs │ │ ├── view_collation_test.exs │ │ ├── view_compaction_test.exs │ │ ├── view_conflicts_test.exs │ │ ├── view_errors_test.exs │ │ ├── view_include_docs_test.exs │ │ ├── view_multi_key_all_docs_test.exs │ │ ├── view_multi_key_design_test.exs │ │ ├── view_offsets_test.exs │ │ ├── view_pagination_test.exs │ │ ├── view_sandboxing_test.exs │ │ ├── view_test.exs │ │ └── view_update_seq_test.exs ├── fixtures │ └── allowed-xref.txt ├── random_port.ini └── view_server │ ├── query_server_spec.rb │ └── run_native_process.es └── version.mk /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG COUCHDB_IMAGE 2 | FROM ${COUCHDB_IMAGE} 3 | 4 | # Install SpiderMonkey 78 and tell CouchDB to use it in configure 5 | ENV SM_VSN=78 6 | 7 | USER root 8 | 9 | # These lines are necessary if the user has cloned the repo to their local machine 10 | # and clicked the "Reopen in container button" 11 | RUN mkdir -p /workspaces/couchdb 12 | WORKDIR /workspaces/couchdb 13 | COPY . . 14 | -------------------------------------------------------------------------------- /.formatter.exs: -------------------------------------------------------------------------------- 1 | # Used by "mix format" 2 | [ 3 | inputs: [ 4 | "{mix,.formatter}.exs", 5 | "{config,src}/*/test/exunit/*.{ex,exs}" 6 | ], 7 | line_length: 90, 8 | rename_deprecated_at: "1.5.0" 9 | ] 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | nouveau/**/* text eol=lf 2 | nouveau/**/*.bat text eol=crlf 3 | nouveau/**/*.jar binary 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Describe a scenario in which CouchDB behaves unexpectedly 4 | title: '' 5 | labels: bug, needs-triage 6 | assignees: '' 7 | 8 | --- 9 | 10 | [NOTE]: # ( ^^ Provide a general summary of the issue in the title above. ^^ ) 11 | 12 | ## Description 13 | 14 | [NOTE]: # ( Describe the problem you're encountering. ) 15 | [TIP]: # ( Do NOT give us access or passwords to your actual CouchDB! ) 16 | 17 | ## Steps to Reproduce 18 | 19 | [NOTE]: # ( Include commands to reproduce, if possible. curl is preferred. ) 20 | 21 | ## Expected Behaviour 22 | 23 | [NOTE]: # ( Tell us what you expected to happen. ) 24 | 25 | ## Your Environment 26 | 27 | [TIP]: # ( Include as many relevant details about your environment as possible. ) 28 | [TIP]: # ( You can paste the output of curl http://YOUR-COUCHDB:5984/ here. ) 29 | 30 | * CouchDB version used: 31 | * Browser name and version: 32 | * Operating system and version: 33 | 34 | ## Additional Context 35 | 36 | [TIP]: # ( Add any other context about the problem here. ) 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Enhancement request 3 | about: Suggest an idea for a future version of CouchDB 4 | title: '' 5 | labels: enhancement, needs-triage 6 | assignees: '' 7 | 8 | --- 9 | 10 | [NOTE]: # ( ^^ Provide a general summary of the request in the title above. ^^ ) 11 | 12 | ## Summary 13 | 14 | [NOTE]: # ( Provide a brief overview of what the new feature is all about. ) 15 | 16 | ## Desired Behaviour 17 | 18 | [NOTE]: # ( Tell us how the new feature should work. Be specific. ) 19 | [TIP]: # ( Do NOT give us access or passwords to your actual CouchDB! ) 20 | 21 | ## Possible Solution 22 | 23 | [NOTE]: # ( Not required. Suggest how to implement the addition or change. ) 24 | 25 | ## Additional context 26 | 27 | [TIP]: # ( Why does this feature matter to you? What unique circumstances do you have? ) 28 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Benoit Chesneau 2 | Benoit Chesneau benoitc 3 | 4 | Jason Smith Jason Smith (air) 5 | Jason Smith Jason Smith (air) 6 | 7 | Filipe David Borba Manana 8 | 9 | Randall Leeds 10 | 11 | Paul Joseph Davis Paul J. Davis 12 | 13 | Bob Dionne bitdiddle 14 | -------------------------------------------------------------------------------- /BUGS.md: -------------------------------------------------------------------------------- 1 | Apache CouchDB BUGS 2 | =================== 3 | 4 | Visit our issue tracker: 5 | 6 | https://github.com/apache/couchdb/issues 7 | 8 | You can use this to report bugs, request features, or suggest enhancements. 9 | 10 | Our JIRA system no longer accepts new issues, but may have important historical 11 | information: 12 | 13 | https://issues.apache.org/jira/browse/CouchDB 14 | -------------------------------------------------------------------------------- /COMMITTERS.md: -------------------------------------------------------------------------------- 1 | Apache CouchDB COMMITTERS 2 | ========================= 3 | 4 | Committers are given a binding vote in certain project decisions, as well as 5 | write access to public project infrastructure. Committers are elected to the 6 | project in recognition of their committment to Apache CouchDB. We mean this in 7 | the sense of being loyal to the project and its interests. 8 | 9 | A full list of committers elected to the project is available at: 10 | 11 | https://people.apache.org/committers-by-project.html#couchdb 12 | -------------------------------------------------------------------------------- /INSTALL.Windows.md: -------------------------------------------------------------------------------- 1 | Apache CouchDB INSTALL.Windows 2 | ============================== 3 | 4 | Due to the complexity of building CouchDB on the Windows platform, 5 | full build documentation and all necessary support files are in 6 | the couchdb-glazier repository. 7 | 8 | Be sure to find the branch that matches the release you are building, for 9 | example `couchdb_2.0`. 10 | 11 | Build & Test 12 | ------------ 13 | Once all dependencies are built and installed per the documentation in 14 | couchdb-glazier, these commands will configure and build CouchDB: 15 | 16 | powershell -ExecutionPolicy Bypass .\configure.ps1 17 | make -f Makefile.win check 18 | 19 | This will build couchdb, as well as run the eunit and javascript tests. 20 | 21 | As of CouchDB 2.0 RC1, all tests should pass. 22 | -------------------------------------------------------------------------------- /bin/erlang-version.escript: -------------------------------------------------------------------------------- 1 | 2 | main(_) -> 3 | io:format("~s~n", [erlang:system_info(otp_release)]). 4 | -------------------------------------------------------------------------------- /build-aux/xref-helper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | REBAR=$1 3 | DIALYZE_OPTS=$2 4 | 5 | mkdir -p ./tmp 6 | 7 | # run rebar xref, grep out rebar meta output (==> and WARN) 8 | # pipe the rest into a file 9 | $REBAR --keep-going --recursive xref $DIALYZE_OPTS | \ 10 | grep -v '==>' | \ 11 | grep -v 'WARN' | \ 12 | grep -v hastings | \ 13 | sort > ./tmp/xref-output.txt 14 | 15 | # compare result against known allowed output 16 | DIFF=`diff -u ./tmp/xref-output.txt ./test/fixtures/allowed-xref.txt` 17 | 18 | # if the actual output differs from the allowed output 19 | # print the difference and exit with 1 20 | if [ -n "$DIFF" ]; then 21 | echo "$DIFF" 22 | exit 1 23 | else 24 | exit 0 25 | fi 26 | -------------------------------------------------------------------------------- /config/dev.exs: -------------------------------------------------------------------------------- 1 | import Config 2 | -------------------------------------------------------------------------------- /config/integration.exs: -------------------------------------------------------------------------------- 1 | import Config 2 | 3 | config :logger, 4 | backends: [:console], 5 | compile_time_purge_matching: [ 6 | [level_lower_than: :debug] 7 | ], 8 | level: :debug 9 | 10 | config :sasl, 11 | sasl_error_logger: false 12 | -------------------------------------------------------------------------------- /config/prod.exs: -------------------------------------------------------------------------------- 1 | import Config 2 | -------------------------------------------------------------------------------- /config/test.exs: -------------------------------------------------------------------------------- 1 | import Config 2 | 3 | config :logger, 4 | backends: [:console], 5 | compile_time_purge_matching: [ 6 | [level_lower_than: :debug] 7 | ], 8 | level: :debug 9 | 10 | config :kernel, 11 | error_logger: false 12 | 13 | config :sasl, 14 | sasl_error_logger: false 15 | -------------------------------------------------------------------------------- /dev/make_boot_script: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env escript 2 | 3 | main(_) -> 4 | {ok, Server} = reltool:start_server([ 5 | {config, "../rel/reltool.config"} 6 | ]), 7 | {ok, Release} = reltool:get_rel(Server, "couchdb"), 8 | ok = file:write_file("devnode.rel", io_lib:format("~p.~n", [Release])), 9 | ok = systools:make_script("devnode", [local]). 10 | -------------------------------------------------------------------------------- /dev/remsh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 3 | # use this file except in compliance with the License. You may obtain a copy of 4 | # the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations under 12 | # the License. 13 | 14 | if [ -z $NODE ]; then 15 | if [ -z $1 ]; then 16 | NODE=1 17 | else 18 | NODE=$1 19 | fi 20 | fi 21 | 22 | if [ -z $HOST ]; then 23 | HOST="127.0.0.1" 24 | fi 25 | 26 | NAME="remsh$$@$HOST" 27 | NODE="node$NODE@$HOST" 28 | erl -name $NAME -remsh $NODE -hidden 29 | -------------------------------------------------------------------------------- /dev/remsh-tls: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 3 | # use this file except in compliance with the License. You may obtain a copy of 4 | # the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations under 12 | # the License. 13 | 14 | if [ -z $NODE ]; then 15 | if [ -z $1 ]; then 16 | NODE=1 17 | else 18 | NODE=$1 19 | fi 20 | fi 21 | 22 | if [ -z $HOST ]; then 23 | HOST="127.0.0.1" 24 | fi 25 | 26 | if [ -z $OPTFILE ]; then 27 | rootdir=`dirname "$(cd "${0%/*}" 2>/dev/null; echo "$PWD")"` 28 | OPTFILE="$rootdir/src/couch_dist/certs/out/couch_dist.conf" 29 | fi 30 | 31 | NAME="remsh$$@$HOST" 32 | NODE="node$NODE@$HOST" 33 | erl -name $NAME -remsh $NODE -hidden -proto_dist inet_tls -ssl_dist_optfile $OPTFILE 34 | -------------------------------------------------------------------------------- /dev/run.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | :: Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | :: use this file except in compliance with the License. You may obtain a copy of 5 | :: the License at 6 | :: 7 | :: http://www.apache.org/licenses/LICENSE-2.0 8 | :: 9 | :: Unless required by applicable law or agreed to in writing, software 10 | :: distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | :: WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | :: License for the specific language governing permissions and limitations under 13 | :: the License. 14 | 15 | python %~dp0\run %* 16 | -------------------------------------------------------------------------------- /erlang_ls.config: -------------------------------------------------------------------------------- 1 | apps_dirs: 2 | - "src/*" 3 | include_dirs: 4 | - "src" 5 | - "src/*/include" 6 | -------------------------------------------------------------------------------- /make.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | make.exe -f Makefile.win %* 4 | -------------------------------------------------------------------------------- /nouveau/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .classpath 3 | .project 4 | .settings/ 5 | .vscode/ 6 | .gradle/ 7 | build/ 8 | target/ 9 | -------------------------------------------------------------------------------- /nouveau/TODO: -------------------------------------------------------------------------------- 1 | targeted dreyfus feature parity 2 | 3 | * partitioned db support (partially done) 4 | 5 | not targeted 6 | 7 | * highlighting 8 | * drilldown 9 | -------------------------------------------------------------------------------- /nouveau/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/nouveau/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /nouveau/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /nouveau/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | */ 4 | 5 | rootProject.name = 'nouveau' 6 | -------------------------------------------------------------------------------- /nouveau/src/main/java/org/apache/couchdb/nouveau/core/IndexFunction.java: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package org.apache.couchdb.nouveau.core; 15 | 16 | import java.io.IOException; 17 | 18 | @FunctionalInterface 19 | public interface IndexFunction { 20 | 21 | T with(final Index index) throws IOException; 22 | } 23 | -------------------------------------------------------------------------------- /nouveau/src/main/java/org/apache/couchdb/nouveau/core/ser/ByteArrayWrapper.java: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package org.apache.couchdb.nouveau.core.ser; 15 | 16 | import com.fasterxml.jackson.annotation.JsonProperty; 17 | 18 | public class ByteArrayWrapper extends PrimitiveWrapper { 19 | 20 | public ByteArrayWrapper(@JsonProperty("value") byte[] value) { 21 | super(value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /nouveau/src/main/java/org/apache/couchdb/nouveau/core/ser/DoubleWrapper.java: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package org.apache.couchdb.nouveau.core.ser; 15 | 16 | import com.fasterxml.jackson.annotation.JsonProperty; 17 | 18 | public class DoubleWrapper extends PrimitiveWrapper { 19 | 20 | public DoubleWrapper(@JsonProperty("value") Double value) { 21 | super(value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /nouveau/src/main/java/org/apache/couchdb/nouveau/core/ser/FloatWrapper.java: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package org.apache.couchdb.nouveau.core.ser; 15 | 16 | import com.fasterxml.jackson.annotation.JsonProperty; 17 | 18 | public class FloatWrapper extends PrimitiveWrapper { 19 | 20 | public FloatWrapper(@JsonProperty("value") float value) { 21 | super(value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /nouveau/src/main/java/org/apache/couchdb/nouveau/core/ser/IntWrapper.java: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package org.apache.couchdb.nouveau.core.ser; 15 | 16 | import com.fasterxml.jackson.annotation.JsonProperty; 17 | 18 | public class IntWrapper extends PrimitiveWrapper { 19 | 20 | public IntWrapper(@JsonProperty("value") Integer value) { 21 | super(value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /nouveau/src/main/java/org/apache/couchdb/nouveau/core/ser/LongWrapper.java: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package org.apache.couchdb.nouveau.core.ser; 15 | 16 | import com.fasterxml.jackson.annotation.JsonProperty; 17 | 18 | public class LongWrapper extends PrimitiveWrapper { 19 | 20 | public LongWrapper(@JsonProperty("value") Long value) { 21 | super(value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /nouveau/src/main/java/org/apache/couchdb/nouveau/core/ser/NullWrapper.java: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package org.apache.couchdb.nouveau.core.ser; 15 | 16 | public class NullWrapper extends PrimitiveWrapper { 17 | 18 | public NullWrapper() { 19 | super(null); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /nouveau/src/main/java/org/apache/couchdb/nouveau/core/ser/StringWrapper.java: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package org.apache.couchdb.nouveau.core.ser; 15 | 16 | import com.fasterxml.jackson.annotation.JsonProperty; 17 | 18 | public class StringWrapper extends PrimitiveWrapper { 19 | 20 | public StringWrapper(@JsonProperty("value") String value) { 21 | super(value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /nouveau/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | .-. 2 | / | 3 | /\ | .-._.) ( ) .-..-. .-. ) ( 4 | / \ |( )( )( / ./.-'_( | ( ) 5 | .-' / \| `-' `--': \_/ (__.' `-'-'`--': 6 | (__.' `. 7 | 8 | -------------------------------------------------------------------------------- /nouveau/src/main/resources/openapi.yaml: -------------------------------------------------------------------------------- 1 | resourcePackages: 2 | - org.apache.couchdb.nouveau.resources 3 | 4 | openAPI: 5 | info: 6 | version: '1.0' 7 | license: 8 | name: Apache 2.0 9 | url: http://www.apache.org/licenses/LICENSE-2.0.html 10 | -------------------------------------------------------------------------------- /nouveau/src/test/resources/fixtures/DocumentUpdateRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "seq": 12, 3 | "fields": [ 4 | { 5 | "@type": "string", 6 | "name": "stringfoo", 7 | "value": "bar", 8 | "store": true 9 | }, 10 | { 11 | "@type": "text", 12 | "name": "textfoo", 13 | "value": "hello there", 14 | "store": true 15 | }, 16 | { 17 | "@type": "double", 18 | "name": "doublefoo", 19 | "value": 12 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /nouveau/src/test/resources/fixtures/SearchRequest.json: -------------------------------------------------------------------------------- 1 | { 2 | "query": "*:*", 3 | "limit": 10, 4 | "sort": null, 5 | "counts": [ 6 | "bar" 7 | ], 8 | "top_n": 5, 9 | "ranges": { 10 | "foo": [ 11 | { 12 | "label": "0 to 100 inc", 13 | "min": 0.0, 14 | "max": 100.0 15 | } 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /rel/apps/config.config: -------------------------------------------------------------------------------- 1 | {sensitive, #{ 2 | "admins" => all, 3 | "replicator" => ["password"] 4 | }}. 5 | -------------------------------------------------------------------------------- /rel/apps/couch_epi.config: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {plugins, [ 14 | couch_db_epi, 15 | chttpd_epi, 16 | couch_index_epi, 17 | dreyfus_epi, 18 | global_changes_epi, 19 | mango_epi, 20 | mem3_epi, 21 | nouveau_epi, 22 | setup_epi 23 | ]}. 24 | -------------------------------------------------------------------------------- /rel/files/README: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | # use this file except in compliance with the License. You may obtain a copy of 3 | # the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations under 11 | # the License. 12 | 13 | Ignore these files for now. 14 | 15 | This is to pacify newer rebar that insists on having a sys.config and 16 | a vm.args in releases/$VSN/. 17 | 18 | eunit.ini is only for local testing so it is not copied into release 19 | -------------------------------------------------------------------------------- /rel/files/eunit.config: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | [ 14 | {kernel, [{logger_level, error}, {error_logger, silent}]}, 15 | {sasl, [{sasl_error_logger, false}]} 16 | ]. 17 | -------------------------------------------------------------------------------- /rel/files/sys.config: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | []. 14 | -------------------------------------------------------------------------------- /rel/files/vm.args: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | # use this file except in compliance with the License. You may obtain a copy of 3 | # the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations under 11 | # the License. 12 | -------------------------------------------------------------------------------- /rel/nouveau.yaml: -------------------------------------------------------------------------------- 1 | maxIndexesOpen: 3000 2 | commitIntervalSeconds: 30 3 | idleSeconds: 60 4 | rootDir: {{nouveau_index_dir}} 5 | 6 | logging: 7 | level: INFO 8 | 9 | server: 10 | applicationConnectors: 11 | - type: http 12 | bindHost: 127.0.0.1 13 | port: {{nouveau_port}} 14 | useDateHeader: false 15 | adminConnectors: 16 | - type: http 17 | bindHost: 127.0.0.1 18 | port: {{nouveau_admin_port}} 19 | useDateHeader: false 20 | gzip: 21 | includedMethods: 22 | - GET 23 | - POST 24 | requestLog: 25 | appenders: 26 | - type: console 27 | target: stderr 28 | -------------------------------------------------------------------------------- /rel/overlay/etc/default.d/README: -------------------------------------------------------------------------------- 1 | CouchDB default configuration files 2 | 3 | Files found under the etc/default.d directory that end with .ini are 4 | parsed within couchdb(1) at startup. 5 | 6 | This directory is intended for distribution-specific overrides of 7 | CouchDB defaults. Package maintainers should be placing overrides in 8 | this directory. 9 | 10 | System administrator should place overrides in the etc/local.d directory 11 | instead. 12 | -------------------------------------------------------------------------------- /rel/overlay/etc/local.d/README: -------------------------------------------------------------------------------- 1 | CouchDB local configuration files 2 | 3 | Files found under the etc/local.d directory that end with .ini are parsed 4 | within couchdb(1) at startup. 5 | 6 | This directory is intended for system administrator overrides of CouchDB 7 | defaults. Package maintainers should be placing overrides in the 8 | etc/default.d directory instead. 9 | -------------------------------------------------------------------------------- /setup_eunit.template: -------------------------------------------------------------------------------- 1 | {variables, [ 2 | {package_author_name, "The Apache Software Foundation"}, 3 | {cluster_port, 5984}, 4 | {backend_port, 5986}, 5 | {prometheus_port, 17986}, 6 | {node_name, "-name couchdbtest@127.0.0.1"}, 7 | 8 | {data_dir, "/tmp"}, 9 | {prefix, "/tmp"}, 10 | {view_index_dir, "/tmp"}, 11 | {state_dir, "/tmp"}, 12 | {log_dir, "/tmp"} 13 | ]}. 14 | {dir, "tmp"}. 15 | {dir, "tmp/etc"}. 16 | {dir, "tmp/data"}. 17 | {dir, "tmp/tmp_data"}. 18 | {template, "rel/overlay/etc/default.ini", "tmp/etc/default_eunit.ini"}. 19 | {template, "rel/overlay/etc/local.ini", "tmp/etc/local_eunit.ini"}. 20 | {template, "rel/files/eunit.ini", "tmp/etc/eunit.ini"}. 21 | {template, "rel/overlay/etc/vm.args", "tmp/etc/vm.args"}. 22 | -------------------------------------------------------------------------------- /share/server/rewrite_fun.js: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | // use this file except in compliance with the License. You may obtain a copy of 3 | // the License at 4 | // 5 | // http://www.apache.org/licenses/LICENSE-2.0 6 | // 7 | // Unless required by applicable law or agreed to in writing, software 8 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | // License for the specific language governing permissions and limitations under 11 | // the License. 12 | // 13 | // Based on the normalizeFunction which can be 14 | // found here: 15 | // 16 | // https://github.com/dmunch/couch-chakra/blob/master/js/normalizeFunction.js 17 | 18 | function rewriteFunInt(source) { 19 | return source; 20 | } 21 | -------------------------------------------------------------------------------- /share/server/validate.js: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | // use this file except in compliance with the License. You may obtain a copy of 3 | // the License at 4 | // 5 | // http://www.apache.org/licenses/LICENSE-2.0 6 | // 7 | // Unless required by applicable law or agreed to in writing, software 8 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | // License for the specific language governing permissions and limitations under 11 | // the License. 12 | 13 | var Validate = { 14 | validate : function(fun, ddoc, args) { 15 | try { 16 | fun.apply(ddoc, args); 17 | respond(1); 18 | } catch (error) { 19 | if (error.name && error.stack) { 20 | throw error; 21 | } 22 | respond(error); 23 | } 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /src/b64url/.gitignore: -------------------------------------------------------------------------------- 1 | .eunit/ 2 | c_src/*.o 3 | ebin/ 4 | priv/ 5 | .rebar/ 6 | vc110.pdb 7 | compile_commands.json 8 | 9 | _build/ 10 | c_src/*.d -------------------------------------------------------------------------------- /src/b64url/Makefile: -------------------------------------------------------------------------------- 1 | REBAR?=rebar 2 | 3 | 4 | .PHONY: all 5 | # target: all - Makes everything 6 | all: build 7 | 8 | 9 | .PHONY: build 10 | # target: build - Builds the project 11 | build: 12 | $(REBAR) compile 13 | 14 | 15 | .PHONY: check 16 | # target: check - Checks if project builds and passes all the tests 17 | check: build eunit 18 | 19 | 20 | .PHONY: clean 21 | # target: clean - Removes build artifacts 22 | clean: 23 | $(REBAR) clean 24 | rm -f test/*.beam 25 | 26 | 27 | .PHONY: distclean 28 | # target: distclean - Removes all unversioned files 29 | distclean: clean 30 | git clean -fxd 31 | 32 | 33 | .PHONY: eunit 34 | # target: eunit - Runs eunit test suite 35 | eunit: 36 | $(REBAR) eunit 37 | 38 | 39 | .PHONY: help 40 | # target: help - Prints this help 41 | help: 42 | @egrep "^# target:" Makefile | sed -e 's/^# target: //g' | sort 43 | 44 | 45 | %.beam: %.erl 46 | erlc -o test/ $< 47 | -------------------------------------------------------------------------------- /src/b64url/rebar.config: -------------------------------------------------------------------------------- 1 | {plugins, [ 2 | pc 3 | ]}. 4 | 5 | {project_plugins, [ 6 | erlfmt 7 | ]}. 8 | 9 | {provider_hooks, [ 10 | {pre, [ 11 | {compile, {pc, compile}}, 12 | {clean, {pc, clean}} 13 | ]} 14 | ]}. 15 | 16 | {port_specs, [ 17 | {"priv/b64url.so", ["c_src/*.c"]} 18 | ]}. 19 | 20 | {port_env, [ 21 | % Development compilation 22 | % {".*", "CFLAGS", "$CFLAGS -g -Wall -Werror -fPIC"} 23 | 24 | % Production compilation 25 | {"(linux|solaris|darwin|freebsd)", "CFLAGS", "$CFLAGS -Wall -Werror -DNDEBUG -O3"}, 26 | {"win32", "CFLAGS", "$CFLAGS /O2 /DNDEBUG /Wall"} 27 | ]}. 28 | 29 | {eunit_opts, [ 30 | debug_info, 31 | verbose 32 | ]}. 33 | -------------------------------------------------------------------------------- /src/b64url/src/b64url.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, b64url, [ 14 | {description, "A small NIF for encoding Base64 URL encoding/decoding."}, 15 | {vsn, git}, 16 | {registered, []}, 17 | {applications, [kernel, stdlib]} 18 | ]}. 19 | -------------------------------------------------------------------------------- /src/chttpd/include/chttpd.hrl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | 14 | -record(httpd_resp, { 15 | end_ts, 16 | code, 17 | response, 18 | status, 19 | nonce, 20 | should_log = true, 21 | reason 22 | }). 23 | 24 | -define(is_hex(C), ( 25 | (C >= $0 andalso C =< $9) orelse 26 | (C >= $a andalso C =< $f) orelse 27 | (C >= $A andalso C =< $F) 28 | )). 29 | -------------------------------------------------------------------------------- /src/chttpd/src/chttpd.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, chttpd, [ 14 | {description, "HTTP interface for CouchDB cluster"}, 15 | {vsn, git}, 16 | {registered, [ 17 | chttpd_sup, 18 | chttpd, 19 | chttpd_auth_cache, 20 | chttpd_auth_cache_lru 21 | ]}, 22 | {applications, [ 23 | kernel, 24 | stdlib, 25 | couch_log, 26 | couch_stats, 27 | config, 28 | couch, 29 | ets_lru, 30 | fabric, 31 | ioq 32 | ]}, 33 | {mod, {chttpd_app, []}} 34 | ]}. 35 | -------------------------------------------------------------------------------- /src/chttpd/src/chttpd_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(chttpd_app). 14 | -behaviour(application). 15 | -export([start/2, stop/1]). 16 | 17 | start(_Type, StartArgs) -> 18 | chttpd_sup:start_link(StartArgs). 19 | 20 | stop(_State) -> 21 | ok. 22 | -------------------------------------------------------------------------------- /src/chttpd/src/chttpd_test_util.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(chttpd_test_util). 14 | 15 | -export([start_couch/0, start_couch/1, stop_couch/1]). 16 | 17 | -include_lib("couch/include/couch_eunit.hrl"). 18 | 19 | start_couch() -> 20 | start_couch(?CONFIG_CHAIN). 21 | 22 | start_couch(IniFiles) -> 23 | test_util:start_couch(IniFiles, [chttpd]). 24 | 25 | stop_couch(Ctx) -> 26 | test_util:stop_couch(Ctx). 27 | -------------------------------------------------------------------------------- /src/config/src/config.hrl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -define(DELETE, delete). 14 | -------------------------------------------------------------------------------- /src/config/test/fixtures/config_default_test.ini: -------------------------------------------------------------------------------- 1 | ; Licensed to the Apache Software Foundation (ASF) under one 2 | ; or more contributor license agreements. See the NOTICE file 3 | ; distributed with this work for additional information 4 | ; regarding copyright ownership. The ASF licenses this file 5 | ; to you under the Apache License, Version 2.0 (the 6 | ; "License"); you may not use this file except in compliance 7 | ; with the License. You may obtain a copy of the License at 8 | ; 9 | ; http://www.apache.org/licenses/LICENSE-2.0 10 | ; 11 | ; Unless required by applicable law or agreed to in writing, 12 | ; software distributed under the License is distributed on an 13 | ; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ; KIND, either express or implied. See the License for the 15 | ; specific language governing permissions and limitations 16 | ; under the License. 17 | 18 | [couchdb] 19 | max_dbs_open = 500 20 | 21 | [httpd] 22 | port = 5986 23 | bind_address = 127.0.0.1 24 | -------------------------------------------------------------------------------- /src/config/test/fixtures/config_tests_1.ini: -------------------------------------------------------------------------------- 1 | ; Licensed to the Apache Software Foundation (ASF) under one 2 | ; or more contributor license agreements. See the NOTICE file 3 | ; distributed with this work for additional information 4 | ; regarding copyright ownership. The ASF licenses this file 5 | ; to you under the Apache License, Version 2.0 (the 6 | ; "License"); you may not use this file except in compliance 7 | ; with the License. You may obtain a copy of the License at 8 | ; 9 | ; http://www.apache.org/licenses/LICENSE-2.0 10 | ; 11 | ; Unless required by applicable law or agreed to in writing, 12 | ; software distributed under the License is distributed on an 13 | ; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ; KIND, either express or implied. See the License for the 15 | ; specific language governing permissions and limitations 16 | ; under the License. 17 | 18 | [couchdb] 19 | max_dbs_open=10 20 | 21 | [httpd] 22 | port=4895 23 | -------------------------------------------------------------------------------- /src/config/test/fixtures/config_tests_2.ini: -------------------------------------------------------------------------------- 1 | ; Licensed to the Apache Software Foundation (ASF) under one 2 | ; or more contributor license agreements. See the NOTICE file 3 | ; distributed with this work for additional information 4 | ; regarding copyright ownership. The ASF licenses this file 5 | ; to you under the Apache License, Version 2.0 (the 6 | ; "License"); you may not use this file except in compliance 7 | ; with the License. You may obtain a copy of the License at 8 | ; 9 | ; http://www.apache.org/licenses/LICENSE-2.0 10 | ; 11 | ; Unless required by applicable law or agreed to in writing, 12 | ; software distributed under the License is distributed on an 13 | ; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ; KIND, either express or implied. See the License for the 15 | ; specific language governing permissions and limitations 16 | ; under the License. 17 | 18 | [httpd] 19 | port = 80 20 | 21 | [fizbang] 22 | unicode = normalized 23 | -------------------------------------------------------------------------------- /src/config/test/fixtures/default.d/extra.ini: -------------------------------------------------------------------------------- 1 | ; Licensed to the Apache Software Foundation (ASF) under one 2 | ; or more contributor license agreements. See the NOTICE file 3 | ; distributed with this work for additional information 4 | ; regarding copyright ownership. The ASF licenses this file 5 | ; to you under the Apache License, Version 2.0 (the 6 | ; "License"); you may not use this file except in compliance 7 | ; with the License. You may obtain a copy of the License at 8 | ; 9 | ; http://www.apache.org/licenses/LICENSE-2.0 10 | ; 11 | ; Unless required by applicable law or agreed to in writing, 12 | ; software distributed under the License is distributed on an 13 | ; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ; KIND, either express or implied. See the License for the 15 | ; specific language governing permissions and limitations 16 | ; under the License. 17 | 18 | [couchdb] 19 | max_dbs_open=11 20 | -------------------------------------------------------------------------------- /src/config/test/fixtures/local.d/extra.ini: -------------------------------------------------------------------------------- 1 | ; Licensed to the Apache Software Foundation (ASF) under one 2 | ; or more contributor license agreements. See the NOTICE file 3 | ; distributed with this work for additional information 4 | ; regarding copyright ownership. The ASF licenses this file 5 | ; to you under the Apache License, Version 2.0 (the 6 | ; "License"); you may not use this file except in compliance 7 | ; with the License. You may obtain a copy of the License at 8 | ; 9 | ; http://www.apache.org/licenses/LICENSE-2.0 10 | ; 11 | ; Unless required by applicable law or agreed to in writing, 12 | ; software distributed under the License is distributed on an 13 | ; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ; KIND, either express or implied. See the License for the 15 | ; specific language governing permissions and limitations 16 | ; under the License. 17 | 18 | [couchdb] 19 | max_dbs_open=12 20 | -------------------------------------------------------------------------------- /src/couch/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.so 3 | ebin/ 4 | 5 | priv/couch_js/config.h 6 | priv/couchjs 7 | priv/couchspawnkillable 8 | priv/couch_cfile/*.d 9 | priv/*.exp 10 | priv/*.lib 11 | priv/*.dll 12 | priv/*.exe 13 | vc120.pdb 14 | compile_commands.json 15 | 16 | test/engines/coverage/ 17 | test/engines/data/ 18 | test/engines/etc/ 19 | test/engines/log/ 20 | 21 | .rebar/ 22 | .eunit 23 | 24 | rebar.config 25 | -------------------------------------------------------------------------------- /src/couch/priv/couch_js/1.8.5/utf8.h: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | // use this file except in compliance with the License. You may obtain a copy of 3 | // the License at 4 | // 5 | // http://www.apache.org/licenses/LICENSE-2.0 6 | // 7 | // Unless required by applicable law or agreed to in writing, software 8 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | // License for the specific language governing permissions and limitations under 11 | // the License. 12 | 13 | #ifndef COUCH_JS_UTF_8_H 14 | #define COUCH_JS_UTF_8_H 15 | 16 | char* enc_string(JSContext* cx, jsval arg, size_t* buflen); 17 | JSString* dec_string(JSContext* cx, const char* buf, size_t buflen); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/couch/src/couch_bt_engine.hrl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -record(st, { 14 | filepath, 15 | fd, 16 | fd_monitor, 17 | % deprecated but keeping it here to avoid altering the record size 18 | fsync_options_deprecated, 19 | header, 20 | needs_commit, 21 | id_tree, 22 | seq_tree, 23 | local_tree, 24 | compression, 25 | purge_tree, 26 | purge_seq_tree 27 | }). 28 | -------------------------------------------------------------------------------- /src/couch/src/couch_httpd_handlers.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(couch_httpd_handlers). 14 | 15 | -export([url_handler/1, db_handler/1, design_handler/1]). 16 | 17 | url_handler(_) -> no_match. 18 | 19 | db_handler(_) -> no_match. 20 | 21 | design_handler(_) -> no_match. 22 | -------------------------------------------------------------------------------- /src/couch/src/couch_server_int.hrl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | 14 | -record(entry, { 15 | name, 16 | db, 17 | pid, 18 | lock, 19 | waiters, 20 | req_type, 21 | db_options, 22 | start_time 23 | }). 24 | -------------------------------------------------------------------------------- /src/couch/src/couch_totp.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(couch_totp). 14 | 15 | -export([generate/5]). 16 | 17 | generate(Alg, Key, CounterSecs, StepSecs, OutputLen) when 18 | is_atom(Alg), 19 | is_binary(Key), 20 | is_integer(CounterSecs), 21 | is_integer(StepSecs), 22 | is_integer(OutputLen) 23 | -> 24 | couch_hotp:generate(Alg, Key, CounterSecs div StepSecs, OutputLen). 25 | -------------------------------------------------------------------------------- /src/couch/test/eunit/couch_bt_engine_tests.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(couch_bt_engine_tests). 14 | 15 | -include_lib("eunit/include/eunit.hrl"). 16 | 17 | couch_bt_engine_test_() -> 18 | cpse_util:create_tests(couch, couch_bt_engine, "couch"). 19 | -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/15a5cb17365a99cd9ddc7327c82bbd0d.view: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/15a5cb17365a99cd9ddc7327c82bbd0d.view -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/1f2c24bc334d701c2048f85e7438eef1.view: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/1f2c24bc334d701c2048f85e7438eef1.view -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/6cf2c2f766f87b618edf6630b00f8736.view: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/6cf2c2f766f87b618edf6630b00f8736.view -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/colltest1.couch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/colltest1.couch -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/couch_stats_aggregates.cfg: -------------------------------------------------------------------------------- 1 | % Licensed to the Apache Software Foundation (ASF) under one 2 | % or more contributor license agreements. See the NOTICE file 3 | % distributed with this work for additional information 4 | % regarding copyright ownership. The ASF licenses this file 5 | % to you under the Apache License, Version 2.0 (the 6 | % "License"); you may not use this file except in compliance 7 | % with the License. You may obtain a copy of the License at 8 | % 9 | % http://www.apache.org/licenses/LICENSE-2.0 10 | % 11 | % Unless required by applicable law or agreed to in writing, 12 | % software distributed under the License is distributed on an 13 | % "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | % KIND, either express or implied. See the License for the 15 | % specific language governing permissions and limitations 16 | % under the License. 17 | 18 | {testing, stuff, "yay description"}. 19 | {number, '11', "randomosity"}. 20 | -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/couch_stats_aggregates.ini: -------------------------------------------------------------------------------- 1 | ; Licensed to the Apache Software Foundation (ASF) under one 2 | ; or more contributor license agreements. See the NOTICE file 3 | ; distributed with this work for additional information 4 | ; regarding copyright ownership. The ASF licenses this file 5 | ; to you under the Apache License, Version 2.0 (the 6 | ; "License"); you may not use this file except in compliance 7 | ; with the License. You may obtain a copy of the License at 8 | ; 9 | ; http://www.apache.org/licenses/LICENSE-2.0 10 | ; 11 | ; Unless required by applicable law or agreed to in writing, 12 | ; software distributed under the License is distributed on an 13 | ; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ; KIND, either express or implied. See the License for the 15 | ; specific language governing permissions and limitations 16 | ; under the License. 17 | 18 | [stats] 19 | rate = 10000000 ; We call collect_sample in testing 20 | samples = [0, 1] 21 | -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/db321.couch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/db321.couch -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/db_non_partitioned.couch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/db_non_partitioned.couch -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/db_v6_with_1_purge_req.couch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/db_v6_with_1_purge_req.couch -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/db_v6_with_1_purge_req_for_2_docs.couch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/db_v6_with_1_purge_req_for_2_docs.couch -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/db_v6_with_2_purge_req.couch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/db_v6_with_2_purge_req.couch -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/db_v6_without_purge_req.couch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/db_v6_without_purge_req.couch -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/db_v7_with_1_purge_req.couch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/db_v7_with_1_purge_req.couch -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/db_v7_with_1_purge_req_for_2_docs.couch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/db_v7_with_1_purge_req_for_2_docs.couch -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/db_v7_with_2_purge_req.couch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/db_v7_with_2_purge_req.couch -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/db_v7_without_purge_req.couch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/db_v7_without_purge_req.couch -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/logo.png -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/multipart.http: -------------------------------------------------------------------------------- 1 | { 2 | "_id": "our document goes here" 3 | } 4 | 5 | --multipart_related_boundary~~~~~~~~~~~~~~~~~~~~ 6 | Content-Type: application/json 7 | 8 | {"value":0,"_id":"doc0","_rev":"1-7e97409c987eac3a99385a17ad4cbabe","_attachments":{"plus1":{"stub":false,"follows":true,"content_type":"application/json","length":14}},".cache":{"plus1":{"timestamp":"2012-08-13T13:59:27.826Z"}}} 9 | --multipart_related_boundary~~~~~~~~~~~~~~~~~~~~ 10 | 11 | {"value":"01"} 12 | --multipart_related_boundary~~~~~~~~~~~~~~~~~~~~-- 13 | 14 | -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/os_daemon_bad_perm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | # use this file except in compliance with the License. You may obtain a copy of 5 | # the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations under 13 | # the License. 14 | # 15 | # Please do not make this file executable as that's the error being tested. 16 | 17 | sleep 5 18 | -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/os_daemon_can_reboot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | # use this file except in compliance with the License. You may obtain a copy of 5 | # the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations under 13 | # the License. 14 | 15 | sleep 2 16 | -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/os_daemon_die_on_boot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | # use this file except in compliance with the License. You may obtain a copy of 5 | # the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations under 13 | # the License. 14 | 15 | exit 1 16 | -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/os_daemon_die_quickly.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | # use this file except in compliance with the License. You may obtain a copy of 5 | # the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations under 13 | # the License. 14 | 15 | sleep 1 16 | -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/os_daemon_looper.escript: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env escript 2 | 3 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | % use this file except in compliance with the License. You may obtain a copy of 5 | % the License at 6 | % 7 | % http://www.apache.org/licenses/LICENSE-2.0 8 | % 9 | % Unless required by applicable law or agreed to in writing, software 10 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | % License for the specific language governing permissions and limitations under 13 | % the License. 14 | 15 | loop() -> 16 | loop(io:read("")). 17 | 18 | loop({ok, _}) -> 19 | loop(io:read("")); 20 | loop(eof) -> 21 | stop; 22 | loop({error, Reason}) -> 23 | throw({error, Reason}). 24 | 25 | main([]) -> 26 | loop(). 27 | -------------------------------------------------------------------------------- /src/couch/test/eunit/fixtures/test.couch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/couch/test/eunit/fixtures/test.couch -------------------------------------------------------------------------------- /src/couch_dist/.gitignore: -------------------------------------------------------------------------------- 1 | .rebar/ 2 | certs/*.pem 3 | certs/out/ 4 | ebin/ 5 | -------------------------------------------------------------------------------- /src/couch_dist/certs/certs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Source code: https://github.com/rnewson/elixir-certs/ 4 | # We want the keys to be u=rw,go=, but there's no way to do that in 5 | # Elixir without race conditions, afaict, so we use umask: 6 | umask 077 7 | 8 | SCRIPT=$(readlink -f "$0") 9 | SCRIPTPATH=$(dirname "$SCRIPT") 10 | 11 | exec elixir "$SCRIPTPATH/certs.exs" "$@" 12 | -------------------------------------------------------------------------------- /src/couch_dist/certs/parse_cert.escript: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env escript 2 | -mode(compile). 3 | 4 | main(File) -> 5 | {ok, PemBin} = file:read_file(File), 6 | [{_, DerCert, _}] = public_key:pem_decode(PemBin), 7 | OTPCert = public_key:pkix_decode_cert(DerCert, otp), 8 | io:format("~p~n", [inet_tls_dist:cert_nodes(OTPCert)]). 9 | -------------------------------------------------------------------------------- /src/couch_dist/src/couch_dist.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, couch_dist, 14 | [{description, "A Custom Erlang network protocol for CouchDB"}, 15 | {vsn, git}, 16 | {modules, [couch_dist]}, 17 | {registered, [couch_dist]}, 18 | {applications, [kernel, stdlib, ssl]} 19 | ]}. 20 | -------------------------------------------------------------------------------- /src/couch_epi/.gitignore: -------------------------------------------------------------------------------- 1 | .rebar 2 | ebin 3 | erl_crash.dump 4 | .eunit 5 | -------------------------------------------------------------------------------- /src/couch_epi/rebar.config: -------------------------------------------------------------------------------- 1 | % vim: set ft=erlang : -*- erlang -*- % Magic lines for code editors 2 | 3 | {erl_opts, [ 4 | {platform_define, "^R16", 'pre18'}, 5 | {platform_define, "^17", 'pre18'}]}. 6 | -------------------------------------------------------------------------------- /src/couch_epi/src/couch_epi.app.src.script: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | ConfigFile = filename:join([os:getenv("COUCHDB_APPS_CONFIG_DIR"), "couch_epi.config"]). 14 | {ok, AppConfig} = file:consult(ConfigFile). 15 | 16 | {application, couch_epi, [ 17 | {description, "extensible plugin interface"}, 18 | {vsn, git}, 19 | {registered, [couch_epi_sup, couch_epi_server]}, 20 | {applications, [ 21 | kernel, 22 | stdlib 23 | ]}, 24 | {mod, {couch_epi_app, []}}, 25 | {env, AppConfig} 26 | ]}. 27 | -------------------------------------------------------------------------------- /src/couch_epi/src/couch_epi.hrl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -record(couch_epi_spec, { 14 | behaviour, app, kind, options, key, value, codegen, type 15 | }). 16 | 17 | % Copied from `couch_db.hrl` which cannot be included in this application 18 | -define(term_to_bin(T), term_to_binary(T, [{minor_version, 1}])). 19 | -------------------------------------------------------------------------------- /src/couch_epi/src/couch_epi_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(couch_epi_app). 14 | 15 | -behaviour(application). 16 | 17 | -export([start/2, stop/1]). 18 | 19 | start(_Type, _Args) -> 20 | couch_epi_sup:start_link(). 21 | 22 | stop(_State) -> 23 | ok. 24 | -------------------------------------------------------------------------------- /src/couch_epi/test/eunit/fixtures/app_data1.cfg: -------------------------------------------------------------------------------- 1 | {[complex, key, 1], [ 2 | {type, counter}, 3 | {desc, foo} 4 | ]}. 5 | -------------------------------------------------------------------------------- /src/couch_epi/test/eunit/fixtures/app_data2.cfg: -------------------------------------------------------------------------------- 1 | {[complex, key, 2], [ 2 | {type, counter}, 3 | {desc, bar} 4 | ]}. 5 | {[complex, key, 1], [ 6 | {type, counter}, 7 | {desc, updated_foo} 8 | ]}. 9 | -------------------------------------------------------------------------------- /src/couch_event/.gitignore: -------------------------------------------------------------------------------- 1 | deps/ 2 | ebin/ 3 | -------------------------------------------------------------------------------- /src/couch_event/README.md: -------------------------------------------------------------------------------- 1 | # Couch Event Notifications 2 | 3 | The replacement for couch\_db\_update and related code. 4 | -------------------------------------------------------------------------------- /src/couch_event/rebar.config: -------------------------------------------------------------------------------- 1 | % vim: set ft=erlang : -*- erlang -*- % Magic lines for code editors 2 | 3 | {erl_first_files, ["src/couch_event_listener.erl"]}. 4 | -------------------------------------------------------------------------------- /src/couch_event/src/couch_event.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, couch_event, [ 14 | {description, "Event notification system for Apache CouchDB"}, 15 | {vsn, git}, 16 | {registered, [ 17 | couch_event_sup, 18 | couch_event_server 19 | ]}, 20 | {applications, [kernel, stdlib, couch_log, config]}, 21 | {mod, {couch_event_app, []}} 22 | ]}. 23 | -------------------------------------------------------------------------------- /src/couch_event/src/couch_event_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(couch_event_app). 14 | -behavior(application). 15 | 16 | -export([ 17 | start/2, 18 | stop/1 19 | ]). 20 | 21 | start(_StartType, _StartArgs) -> 22 | couch_event_sup2:start_link(). 23 | 24 | stop(_State) -> 25 | ok. 26 | -------------------------------------------------------------------------------- /src/couch_event/src/couch_event_int.hrl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -define(REGISTRY_TABLE, couch_event_registry). 14 | -define(MONITOR_TABLE, couch_event_registry_monitors). 15 | 16 | -record(client, { 17 | dbname, 18 | pid 19 | }). 20 | -------------------------------------------------------------------------------- /src/couch_index/.gitignore: -------------------------------------------------------------------------------- 1 | /ebin 2 | .eunit 3 | .rebar 4 | -------------------------------------------------------------------------------- /src/couch_index/src/couch_index.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, couch_index, [ 14 | {description, "CouchDB Secondary Index Manager"}, 15 | {vsn, git}, 16 | {registered, []}, 17 | {applications, [kernel, stdlib, couch_epi, ioq]}, 18 | {mod, {couch_index_app, []}} 19 | ]}. 20 | -------------------------------------------------------------------------------- /src/couch_index/src/couch_index_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(couch_index_app). 14 | -behaviour(application). 15 | -export([start/2, stop/1]). 16 | 17 | start(_Type, StartArgs) -> 18 | couch_index_sup:start_link(StartArgs). 19 | 20 | stop(_State) -> 21 | ok. 22 | -------------------------------------------------------------------------------- /src/couch_index/src/couch_index_plugin_couch_db.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(couch_index_plugin_couch_db). 14 | 15 | -export([ 16 | is_valid_purge_client/2, 17 | on_compact/2 18 | ]). 19 | 20 | is_valid_purge_client(DbName, Props) -> 21 | couch_mrview_index:verify_index_exists(DbName, Props). 22 | 23 | on_compact(DbName, DDocs) -> 24 | couch_mrview_index:ensure_local_purge_docs(DbName, DDocs). 25 | -------------------------------------------------------------------------------- /src/couch_index/src/couch_index_sup.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(couch_index_sup). 14 | -behaviour(supervisor). 15 | -export([init/1]). 16 | 17 | -export([start_link/1]). 18 | 19 | start_link(Args) -> 20 | supervisor:start_link({local, ?MODULE}, ?MODULE, Args). 21 | 22 | init([]) -> 23 | {ok, {{one_for_one, 3, 10}, couch_epi:register_service(couch_index_epi, [])}}. 24 | -------------------------------------------------------------------------------- /src/couch_log/.gitignore: -------------------------------------------------------------------------------- 1 | /ebin 2 | .eunit 3 | .rebar 4 | -------------------------------------------------------------------------------- /src/couch_log/include/couch_log.hrl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -record(log_entry, { 14 | level, 15 | pid, 16 | msg, 17 | msg_id, 18 | time_stamp, 19 | type 20 | }). 21 | 22 | 23 | -define(COUCH_LOG_TEST_TABLE, couch_log_test_table). 24 | -------------------------------------------------------------------------------- /src/couch_log/src/couch_log.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, couch_log, [ 14 | {description, "CouchDB Log API"}, 15 | {vsn, git}, 16 | {registered, [couch_log_sup]}, 17 | {applications, [kernel, stdlib, config]}, 18 | {mod, {couch_log_app, []}} 19 | ]}. 20 | -------------------------------------------------------------------------------- /src/couch_log/src/couch_log_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(couch_log_app). 14 | 15 | -behaviour(application). 16 | 17 | -export([start/2, stop/1]). 18 | 19 | start(_Type, _StartArgs) -> 20 | couch_log_sup:start_link(). 21 | 22 | stop(_State) -> 23 | ok. 24 | -------------------------------------------------------------------------------- /src/couch_mrview/priv/stats_descriptions.cfg: -------------------------------------------------------------------------------- 1 | %% Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | %% use this file except in compliance with the License. You may obtain a copy of 3 | %% the License at 4 | %% 5 | %% http://www.apache.org/licenses/LICENSE-2.0 6 | %% 7 | %% Unless required by applicable law or agreed to in writing, software 8 | %% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | %% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | %% License for the specific language governing permissions and limitations under 11 | %% the License. 12 | 13 | % Style guide for descriptions: Start with a lowercase letter & do not add 14 | % a trailing full-stop / period 15 | % Please keep this in alphabetical order 16 | 17 | {[couchdb, mrview, map_doc], [ 18 | {type, counter}, 19 | {desc, <<"number of documents mapped in the view server">>} 20 | ]}. 21 | {[couchdb, mrview, emits], [ 22 | {type, counter}, 23 | {desc, <<"number of invocations of `emit' in map functions in the view server">>} 24 | ]}. 25 | -------------------------------------------------------------------------------- /src/couch_mrview/src/couch_mrview.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, couch_mrview, [ 14 | {description, "CouchDB Map/Reduce Views"}, 15 | {vsn, git}, 16 | {registered, []}, 17 | {applications, [kernel, stdlib, couch_index, couch_stats, ioq]} 18 | ]}. 19 | -------------------------------------------------------------------------------- /src/couch_peruser/.gitignore: -------------------------------------------------------------------------------- 1 | /.eunit 2 | /doc 3 | /ebin 4 | /deps 5 | /.rebar 6 | /couchperuser-* 7 | erl_crash.dump 8 | TEST-*.xml 9 | *.beam 10 | -------------------------------------------------------------------------------- /src/couch_peruser/src/couch_peruser.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, couch_peruser, [ 14 | {description, "couch_peruser - maintains per-user databases in CouchDB"}, 15 | {vsn, git}, 16 | {registered, [couch_peruser, couch_peruser_sup]}, 17 | {applications, [kernel, stdlib, config, couch, fabric, mem3, ioq]}, 18 | {mod, {couch_peruser_app, []}}, 19 | {env, []} 20 | ]}. 21 | -------------------------------------------------------------------------------- /src/couch_peruser/src/couch_peruser_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(couch_peruser_app). 14 | 15 | -behaviour(application). 16 | 17 | -export([start/2, stop/1]). 18 | 19 | start(_Type, _StartArgs) -> 20 | couch_peruser_sup:start_link(). 21 | 22 | stop(_State) -> 23 | ok. 24 | -------------------------------------------------------------------------------- /src/couch_peruser/src/couch_peruser_sup.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(couch_peruser_sup). 14 | 15 | -behaviour(supervisor). 16 | 17 | -export([start_link/0, init/1]). 18 | 19 | %% Helper macro for declaring children of supervisor 20 | -define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}). 21 | 22 | start_link() -> 23 | supervisor:start_link({local, ?MODULE}, ?MODULE, []). 24 | 25 | init([]) -> 26 | {ok, {{one_for_one, 5, 10}, [?CHILD(couch_peruser, worker)]}}. 27 | -------------------------------------------------------------------------------- /src/couch_prometheus/src/couch_prometheus.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, couch_prometheus, [ 14 | {description, "Aggregated metrics info for Prometheus consumption"}, 15 | {vsn, git}, 16 | {registered, []}, 17 | {applications, [kernel, stdlib, couch_stats, couch_log, mem3, couch]}, 18 | {mod, {couch_prometheus_app, []}}, 19 | {env, []} 20 | ]}. 21 | -------------------------------------------------------------------------------- /src/couch_prometheus/src/couch_prometheus_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(couch_prometheus_app). 14 | 15 | -behaviour(application). 16 | 17 | -export([start/2, stop/1]). 18 | 19 | start(_StartType, _StartArgs) -> 20 | couch_prometheus_sup:start_link(). 21 | 22 | stop(_State) -> 23 | ok. 24 | -------------------------------------------------------------------------------- /src/couch_pse_tests/src/couch_pse_tests.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, couch_pse_tests, [ 14 | {description, "Apache CouchDB Pluggable Storage Engine Test Suite"}, 15 | {vsn, git}, 16 | {applications, [ 17 | kernel, 18 | stdlib 19 | ]} 20 | ]}. 21 | -------------------------------------------------------------------------------- /src/couch_quickjs/.gitignore: -------------------------------------------------------------------------------- 1 | /quickjs/examples/hello 2 | /quickjs/examples/hello_module 3 | /quickjs/examples/test_fib 4 | /quickjs/compat/ 5 | /quickjs/fuzz/ 6 | /quickjs/quickjs.c.orig 7 | /quickjs/hello.c 8 | /quickjs/libquickjs.a 9 | /quickjs/libquickjs.lto.a 10 | /quickjs/qjs 11 | /quickjs/qjsc 12 | /quickjs/qjscalc 13 | /quickjs/qjs.exe 14 | /quickjs/qjsc.exe 15 | /quickjs/qjscalc.exe 16 | /quickjs/qjscalc.c 17 | /quickjs/repl.c 18 | /quickjs/run-test262 19 | /quickjs/test_fib.c 20 | /quickjs/.github 21 | compile_commands.json 22 | priv/bundle_*.js 23 | priv/couchjs_* 24 | -------------------------------------------------------------------------------- /src/couch_quickjs/c_src/.gitignore: -------------------------------------------------------------------------------- 1 | /couchjs_mainjs*.c 2 | /couchjs_coffee*.c 3 | /couchjs_mainjs*.d 4 | /couchjs_coffee*.d 5 | 6 | -------------------------------------------------------------------------------- /src/couch_quickjs/quickjs/VERSION: -------------------------------------------------------------------------------- 1 | 2025-04-26 2 | -------------------------------------------------------------------------------- /src/couch_quickjs/src/couch_quickjs.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, couch_quickjs, [ 14 | {description, "QuickJS"}, 15 | {vsn, git}, 16 | {registered, []}, 17 | {applications, [kernel, stdlib, config]} 18 | ]}. 19 | -------------------------------------------------------------------------------- /src/couch_replicator/.gitignore: -------------------------------------------------------------------------------- 1 | *.beam 2 | .eunit 3 | ebin/replicator.app 4 | .DS_Store -------------------------------------------------------------------------------- /src/couch_replicator/src/couch_replicator_app.erl: -------------------------------------------------------------------------------- 1 | % http://www.apache.org/licenses/LICENSE-2.0 2 | % 3 | % Unless required by applicable law or agreed to in writing, software 4 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 5 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 6 | % License for the specific language governing permissions and limitations under 7 | % the License. 8 | 9 | -module(couch_replicator_app). 10 | -behaviour(application). 11 | -export([start/2, stop/1]). 12 | 13 | start(_Type, []) -> 14 | couch_replicator_sup:start_link(). 15 | 16 | stop([]) -> 17 | ok. 18 | -------------------------------------------------------------------------------- /src/couch_scanner/src/couch_scanner.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, couch_scanner, [ 14 | {description, "CouchDB Scanner"}, 15 | {vsn, git}, 16 | {registered, [ 17 | couch_scanner_server 18 | ]}, 19 | {applications, [ 20 | kernel, 21 | stdlib, 22 | crypto, 23 | config, 24 | couch_log, 25 | couch_stats, 26 | fabric 27 | ]}, 28 | {mod, {couch_scanner_app, []}} 29 | ]}. 30 | -------------------------------------------------------------------------------- /src/couch_scanner/src/couch_scanner_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(couch_scanner_app). 14 | 15 | -behaviour(application). 16 | 17 | -export([start/2, stop/1]). 18 | 19 | start(_StartType, _StartArgs) -> 20 | couch_scanner_sup:start_link(). 21 | 22 | stop(_State) -> 23 | ok. 24 | -------------------------------------------------------------------------------- /src/couch_stats/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.beam 3 | deps 4 | ebin 5 | doc 6 | .project 7 | -------------------------------------------------------------------------------- /src/couch_stats/README.md: -------------------------------------------------------------------------------- 1 | # couch_stats 2 | 3 | couch_stats is a simple statistics collection app for Erlang applications. It 4 | uses https://www.erlang.org/doc/man/counters.html to implement counters, 5 | gauges and histograms. By default histograms record 10 seconds worth of data, 6 | with a granularity of 1 second. 7 | 8 | Stats can be fetched with `couch_stats:fetch()`. That returns the current 9 | values of all the counters and gauges as well as the histogram statistics for 10 | the last 10 seconds. 11 | 12 | ## Adding a metric 13 | 14 | 1. Write a stat description file. See `priv/descriptions.cfg for an example. 15 | * The metric name should be of type `[atom()]`. 16 | * The type should be one of `counter`, `gauge`, or `histogram`. 17 | 18 | If you don't add your metric to a description file, your metric will be 19 | accessible via `couch_stats:sample/1`, but it won't be read by the stats 20 | collector and therefore won't be available to HTTP `_stats` requests, etc. 21 | 22 | 2. Tell couch_stats to use your description file via application configuration. 23 | 24 | 3. Instrument your code with the helper functions in `couch_stats.erl`. 25 | -------------------------------------------------------------------------------- /src/couch_stats/priv/sample_descriptions.cfg: -------------------------------------------------------------------------------- 1 | %% -*- mode: erlang -*- 2 | 3 | %% Example stat descriptions. 4 | {[couch_stats, sample_counter], [ 5 | {type, counter}, 6 | {desc, <<"counters counted by couch_stats">>} 7 | ]}. 8 | {[couch_stats, sample_histogram], [ 9 | {type, histogram}, 10 | {desc, <<"histograms histogrammed by couch_stats">>} 11 | ]}. 12 | {[couch_stats, sample_gauge], [ 13 | {type, gauge}, 14 | {desc, <<"gauges gauged by couch_stats">>} 15 | ]}. 16 | -------------------------------------------------------------------------------- /src/couch_stats/src/couch_stats.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, couch_stats, [ 14 | {description, "Simple statistics collection"}, 15 | {vsn, git}, 16 | {registered, [couch_stats_aggregator, couch_stats_process_tracker]}, 17 | {applications, [kernel, stdlib]}, 18 | {mod, {couch_stats_app, []}}, 19 | {env, []} 20 | ]}. 21 | -------------------------------------------------------------------------------- /src/couch_stats/src/couch_stats_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(couch_stats_app). 14 | 15 | -behaviour(application). 16 | 17 | -export([start/2, stop/1]). 18 | 19 | start(_StartType, _StartArgs) -> 20 | couch_stats_sup:start_link(). 21 | 22 | stop(_State) -> 23 | ok. 24 | -------------------------------------------------------------------------------- /src/couch_tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.so 3 | ebin/ 4 | 5 | .rebar/ 6 | .eunit 7 | -------------------------------------------------------------------------------- /src/couch_tests/include/couch_tests.hrl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -record(couch_tests_ctx, { 14 | chain = [], 15 | args = [], 16 | opts = [], 17 | started_apps = [], 18 | stopped_apps = [], 19 | dict = dict:new() 20 | }). 21 | 22 | -record(couch_tests_fixture, { 23 | module, 24 | id, 25 | setup, 26 | teardown, 27 | apps = [] 28 | }). 29 | -------------------------------------------------------------------------------- /src/couch_tests/rebar.config: -------------------------------------------------------------------------------- 1 | % vim: set ft=erlang : -*- erlang -*- % Magic lines for code editors 2 | 3 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | % use this file except in compliance with the License. You may obtain a copy of 5 | % the License at 6 | % 7 | % http://www.apache.org/licenses/LICENSE-2.0 8 | % 9 | % Unless required by applicable law or agreed to in writing, software 10 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | % License for the specific language governing permissions and limitations under 13 | % the License. 14 | 15 | {erl_opts, [debug_info, 16 | {src_dirs, ["src", "setups"]}]}. 17 | 18 | {eunit_opts, [verbose]}. 19 | -------------------------------------------------------------------------------- /src/couch_tests/src/couch_tests.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, couch_tests, [ 14 | {description, "Testing infrastructure for Apache CouchDB"}, 15 | {vsn, git}, 16 | {registered, []}, 17 | {applications, [kernel, stdlib]} 18 | ]}. 19 | -------------------------------------------------------------------------------- /src/custodian/README: -------------------------------------------------------------------------------- 1 | Custodian is responsible for the data stored in CouchDB databases. 2 | 3 | Custodian scans the shards database, which details the location of 4 | every shard of every database and ensures that operators are aware of 5 | any shard that is under-replicated (has less than N copies). 6 | 7 | Custodian accounts for data in transit (as indicated by the 8 | mem3.redirects section) as well as nodes not recently known to be up. 9 | -------------------------------------------------------------------------------- /src/custodian/src/custodian.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(custodian). 14 | 15 | -export([report/0, summary/0]). 16 | 17 | report() -> 18 | custodian_util:report(). 19 | 20 | summary() -> 21 | custodian_util:summary(). 22 | -------------------------------------------------------------------------------- /src/custodian/src/custodian_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(custodian_app). 14 | 15 | -behaviour(application). 16 | 17 | %% Application callbacks 18 | -export([start/2, stop/1]). 19 | 20 | %% =================================================================== 21 | %% Application callbacks 22 | %% =================================================================== 23 | 24 | start(_StartType, _StartArgs) -> 25 | custodian_sup:start_link(). 26 | 27 | stop(_State) -> 28 | ok. 29 | -------------------------------------------------------------------------------- /src/custodian/src/custodian_monitor.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(custodian_monitor). 14 | 15 | % N.B. that callback return values are ignored 16 | 17 | -callback send_missing_db_alert(DbName :: binary()) -> 18 | Ignored :: any(). 19 | 20 | -callback clear_missing_dbs_alert() -> 21 | Ignored :: any(). 22 | 23 | -callback send_event( 24 | Name :: string(), Count :: non_neg_integer(), Description :: string() 25 | ) -> 26 | Ignored :: any(). 27 | -------------------------------------------------------------------------------- /src/custodian/src/custodian_noop_monitor.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(custodian_noop_monitor). 14 | 15 | -behaviour(custodian_monitor). 16 | 17 | -export([ 18 | send_missing_db_alert/1, 19 | clear_missing_dbs_alert/0, 20 | send_event/3 21 | ]). 22 | 23 | send_missing_db_alert(_DbName) -> 24 | false. 25 | 26 | clear_missing_dbs_alert() -> 27 | false. 28 | 29 | send_event(_Name, _Count, _Description) -> 30 | false. 31 | -------------------------------------------------------------------------------- /src/ddoc_cache/README.md: -------------------------------------------------------------------------------- 1 | Design Doc Cache 2 | ================ 3 | 4 | Pretty much covers it. 5 | -------------------------------------------------------------------------------- /src/ddoc_cache/priv/stats_descriptions.cfg: -------------------------------------------------------------------------------- 1 | {[ddoc_cache, hit], [ 2 | {type, counter}, 3 | {desc, <<"number of design doc cache hits">>} 4 | ]}. 5 | {[ddoc_cache, miss], [ 6 | {type, counter}, 7 | {desc, <<"number of design doc cache misses">>} 8 | ]}. 9 | {[ddoc_cache, recovery], [ 10 | {type, counter}, 11 | {desc, <<"number of design doc cache recoveries">>} 12 | ]}. 13 | -------------------------------------------------------------------------------- /src/ddoc_cache/src/ddoc_cache.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, ddoc_cache, [ 14 | {description, "Design Document Cache"}, 15 | {vsn, git}, 16 | {registered, [ 17 | ddoc_cache_lru 18 | ]}, 19 | {applications, [ 20 | kernel, 21 | stdlib, 22 | crypto, 23 | config, 24 | couch_event, 25 | couch_log, 26 | couch_stats, 27 | mem3, 28 | fabric 29 | ]}, 30 | {mod, {ddoc_cache_app, []}} 31 | ]}. 32 | -------------------------------------------------------------------------------- /src/ddoc_cache/src/ddoc_cache_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(ddoc_cache_app). 14 | -behaviour(application). 15 | 16 | -export([start/2, stop/1]). 17 | 18 | start(_StartType, _StartArgs) -> 19 | ddoc_cache_sup:start_link(). 20 | 21 | stop(_State) -> 22 | ok. 23 | -------------------------------------------------------------------------------- /src/ddoc_cache/src/ddoc_cache_entry_custom.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(ddoc_cache_entry_custom). 14 | 15 | -export([ 16 | dbname/1, 17 | ddocid/1, 18 | recover/1, 19 | insert/2 20 | ]). 21 | 22 | dbname({DbName, _}) -> 23 | DbName. 24 | 25 | ddocid(_) -> 26 | no_ddocid. 27 | 28 | recover({DbName, Mod}) -> 29 | Mod:recover(DbName). 30 | 31 | insert(_, _) -> 32 | ok. 33 | -------------------------------------------------------------------------------- /src/ddoc_cache/src/ddoc_cache_sup.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(ddoc_cache_sup). 14 | -behaviour(supervisor). 15 | 16 | -export([ 17 | start_link/0, 18 | init/1 19 | ]). 20 | 21 | start_link() -> 22 | supervisor:start_link({local, ?MODULE}, ?MODULE, []). 23 | 24 | init([]) -> 25 | Children = [ 26 | { 27 | ddoc_cache_lru, 28 | {ddoc_cache_lru, start_link, []}, 29 | permanent, 30 | 5000, 31 | worker, 32 | [ddoc_cache_lru] 33 | } 34 | ], 35 | {ok, {{one_for_one, 25, 1}, Children}}. 36 | -------------------------------------------------------------------------------- /src/ddoc_cache/src/ddoc_cache_value.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(ddoc_cache_value). 14 | 15 | -export([ 16 | wrap/1, 17 | unwrap/1 18 | ]). 19 | 20 | -include_lib("couch/include/couch_db.hrl"). 21 | 22 | wrap(Value) -> 23 | {?MODULE, ?term_to_bin(Value)}. 24 | 25 | unwrap({?MODULE, Bin}) when is_binary(Bin) -> 26 | binary_to_term(Bin). 27 | -------------------------------------------------------------------------------- /src/ddoc_cache/test/eunit/ddoc_cache_ev.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(ddoc_cache_ev). 14 | 15 | -export([ 16 | event/2 17 | ]). 18 | 19 | event(Name, Arg) -> 20 | couch_log:error("~s :: ~s :: ~p", [?MODULE, Name, Arg]). 21 | -------------------------------------------------------------------------------- /src/ddoc_cache/test/eunit/ddoc_cache_test.hrl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | 14 | -define(CACHE, ddoc_cache_entries). 15 | -define(LRU, ddoc_cache_lru). 16 | -define(OPENERS, ddoc_cache_openers). 17 | 18 | -define(FOOBAR, <<"_design/foobar">>). 19 | -define(VDU, <<"_design/vdu">>). 20 | -define(CUSTOM, <<"_design/custom">>). 21 | 22 | -record(entry, { 23 | key, 24 | val, 25 | pid 26 | }). 27 | -------------------------------------------------------------------------------- /src/docs/.gitignore: -------------------------------------------------------------------------------- 1 | ext/*.pyc 2 | ext/__pycache__/ 3 | build/ 4 | venv 5 | .venv 6 | Pipfile 7 | Pipfile.lock 8 | .DS_Store 9 | *~ 10 | *.swp 11 | *.bak 12 | -------------------------------------------------------------------------------- /src/docs/NOTICE: -------------------------------------------------------------------------------- 1 | Apache CouchDB 2 | Copyright 2009-2014 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | 7 | This product also includes the following third-party components: 8 | 9 | * Sphinx (http://sphinx-doc.org/) 10 | 11 | Copyright 2011, the Sphinx team 12 | 13 | * httpdomain.py (https://bitbucket.org/birkenfeld/sphinx-contrib/src/6a3a8ca714cfce957530890d0431d9a7b88c930f/httpdomain/sphinxcontrib/httpdomain.py?at=httpdomain-1.1.9) 14 | 15 | Copyright (c) 2010, Hong Minhee 16 | 17 | * src/externals.rst (http://davispj.com/2010/09/26/new-couchdb-externals-api.html) 18 | 19 | Copyright 2008-2010, Paul Joseph Davis 20 | 21 | * src/ddocs/views/intro.rst src/ddocs/views/nosql.rst src/ddocs/views/pagination.rst 22 | 23 | Copyright 2013, Creative Commons Attribution license 24 | 25 | * src/ddocs/views/joins.rst (Using View Collation) 26 | 27 | Copyright 2007, Christopher Lenz 28 | 29 | * templates/couchdb/domainindex.html 30 | 31 | Copyright 2007-2011 by the Sphinx team 32 | -------------------------------------------------------------------------------- /src/docs/README.md: -------------------------------------------------------------------------------- 1 | # CouchDB Documentation 2 | 3 | This directory contains the Sphinx source for Apache CouchDB's documentation. 4 | You can view the latest rendered build of this content at: 5 | 6 | http://docs.couchdb.org/en/latest 7 | 8 | # Building the docs 9 | 10 | Install Python 3 and pip. Then: 11 | 12 | ```sh 13 | $ python3 -m venv .venv 14 | $ source .venv/bin/activate 15 | $ pip3 install -r requirements.txt 16 | $ make html # builds the docs 17 | $ make check # syntax checks the docs 18 | ``` 19 | 20 | # Feedback, Issues, Contributing 21 | 22 | General feedback is welcome at our [user][1] or [developer][2] mailing lists. 23 | 24 | Apache CouchDB has a [CONTRIBUTING][3] file with details on how to get started 25 | with issue reporting or contributing to the upkeep of this project. 26 | 27 | [1]: http://mail-archives.apache.org/mod_mbox/couchdb-user/ 28 | [2]: http://mail-archives.apache.org/mod_mbox/couchdb-dev/ 29 | [3]: https://github.com/apache/couchdb/blob/main/CONTRIBUTING.md 30 | -------------------------------------------------------------------------------- /src/docs/images/23379351593_0c480537de_q.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/23379351593_0c480537de_q.jpg -------------------------------------------------------------------------------- /src/docs/images/TLS-Handshake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/TLS-Handshake.png -------------------------------------------------------------------------------- /src/docs/images/epub-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/epub-icon.png -------------------------------------------------------------------------------- /src/docs/images/fair-enough.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/fair-enough.png -------------------------------------------------------------------------------- /src/docs/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/favicon.ico -------------------------------------------------------------------------------- /src/docs/images/futon-createdb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/futon-createdb.png -------------------------------------------------------------------------------- /src/docs/images/futon-editdoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/futon-editdoc.png -------------------------------------------------------------------------------- /src/docs/images/futon-editeddoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/futon-editeddoc.png -------------------------------------------------------------------------------- /src/docs/images/futon-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/futon-overview.png -------------------------------------------------------------------------------- /src/docs/images/futon-replform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/futon-replform.png -------------------------------------------------------------------------------- /src/docs/images/gf-gnome-rainbows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/gf-gnome-rainbows.png -------------------------------------------------------------------------------- /src/docs/images/intro-consistency-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-consistency-01.png -------------------------------------------------------------------------------- /src/docs/images/intro-consistency-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-consistency-02.png -------------------------------------------------------------------------------- /src/docs/images/intro-consistency-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-consistency-03.png -------------------------------------------------------------------------------- /src/docs/images/intro-consistency-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-consistency-04.png -------------------------------------------------------------------------------- /src/docs/images/intro-consistency-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-consistency-05.png -------------------------------------------------------------------------------- /src/docs/images/intro-consistency-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-consistency-06.png -------------------------------------------------------------------------------- /src/docs/images/intro-consistency-07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-consistency-07.png -------------------------------------------------------------------------------- /src/docs/images/intro-tour-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-tour-01.png -------------------------------------------------------------------------------- /src/docs/images/intro-tour-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-tour-03.png -------------------------------------------------------------------------------- /src/docs/images/intro-tour-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-tour-04.png -------------------------------------------------------------------------------- /src/docs/images/intro-tour-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-tour-05.png -------------------------------------------------------------------------------- /src/docs/images/intro-tour-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-tour-06.png -------------------------------------------------------------------------------- /src/docs/images/intro-tour-07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-tour-07.png -------------------------------------------------------------------------------- /src/docs/images/intro-tour-08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-tour-08.png -------------------------------------------------------------------------------- /src/docs/images/intro-tour-09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-tour-09.png -------------------------------------------------------------------------------- /src/docs/images/intro-tour-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-tour-10.png -------------------------------------------------------------------------------- /src/docs/images/intro-why-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-why-01.png -------------------------------------------------------------------------------- /src/docs/images/intro-why-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-why-02.png -------------------------------------------------------------------------------- /src/docs/images/intro-why-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/intro-why-03.png -------------------------------------------------------------------------------- /src/docs/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/logo.png -------------------------------------------------------------------------------- /src/docs/images/purge-checkpoint-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/purge-checkpoint-docs.png -------------------------------------------------------------------------------- /src/docs/images/rev-tree1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/rev-tree1.png -------------------------------------------------------------------------------- /src/docs/images/rev-tree2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/rev-tree2.png -------------------------------------------------------------------------------- /src/docs/images/rev-tree3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/rev-tree3.png -------------------------------------------------------------------------------- /src/docs/images/tea-erl-grey-hot-replicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/tea-erl-grey-hot-replicator.png -------------------------------------------------------------------------------- /src/docs/images/views-intro-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/views-intro-01.png -------------------------------------------------------------------------------- /src/docs/images/views-intro-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/views-intro-02.png -------------------------------------------------------------------------------- /src/docs/images/views-intro-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/views-intro-03.png -------------------------------------------------------------------------------- /src/docs/images/views-intro-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/images/views-intro-04.png -------------------------------------------------------------------------------- /src/docs/rebar.config: -------------------------------------------------------------------------------- 1 | % -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- 2 | % ex: ts=4 sw=4 ft=erlang et 3 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | % use this file except in compliance with the License. You may obtain a copy of 5 | % the License at 6 | % 7 | % http://www.apache.org/licenses/LICENSE-2.0 8 | % 9 | % Unless required by applicable law or agreed to in writing, software 10 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | % License for the specific language governing permissions and limitations under 13 | % the License. 14 | 15 | {pre_hooks, [{compile, "make"}]}. 16 | {post_hooks, [{clean, "make clean"}]}. 17 | -------------------------------------------------------------------------------- /src/docs/requirements.txt: -------------------------------------------------------------------------------- 1 | Sphinx==8.1.3 2 | sphinx-rtd-theme==3.0.2 3 | sphinxcontrib-httpdomain==1.8.1 4 | sphinxcontrib-jquery==4.1 5 | sphinx-copybutton==0.5.2 6 | -------------------------------------------------------------------------------- /src/docs/rfcs/images/SkExample1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/rfcs/images/SkExample1.png -------------------------------------------------------------------------------- /src/docs/rfcs/images/SkExample2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/rfcs/images/SkExample2.png -------------------------------------------------------------------------------- /src/docs/rfcs/images/SkExample3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/couchdb/8b01166db1e7a36a60ada101492c77b99d85b0aa/src/docs/rfcs/images/SkExample3.png -------------------------------------------------------------------------------- /src/docs/setup.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | IF NOT EXIST "%CD%\.venv\Scripts\activate" ( 4 | DEL /S "%CD%\.venv" 5 | python "-m" "venv" ".venv" 6 | "%CD%\.venv\Scripts\activate.bat" 7 | pip "install" "--upgrade" "pip" 8 | pip "install" "-r" "requirements.txt" 9 | ) ELSE ( 10 | "%CD%\.venv\Scripts\activate.bat" 11 | ) 12 | -------------------------------------------------------------------------------- /src/docs/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | if [ ! -f ./.venv/bin/activate ]; then 6 | rm -rf ./.venv 7 | python3 -m venv .venv 8 | . ./.venv/bin/activate 9 | pip3 install --upgrade pip 10 | pip3 install -r requirements.txt 11 | else 12 | . ./.venv/bin/activate 13 | fi 14 | -------------------------------------------------------------------------------- /src/docs/src/about.rst: -------------------------------------------------------------------------------- 1 | .. Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | .. use this file except in compliance with the License. You may obtain a copy of 3 | .. the License at 4 | .. 5 | .. http://www.apache.org/licenses/LICENSE-2.0 6 | .. 7 | .. Unless required by applicable law or agreed to in writing, software 8 | .. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | .. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | .. License for the specific language governing permissions and limitations under 11 | .. the License. 12 | 13 | .. _about: 14 | 15 | =========================== 16 | About CouchDB Documentation 17 | =========================== 18 | 19 | License 20 | ======= 21 | 22 | .. literalinclude:: ../LICENSE 23 | :language: none 24 | :lines: 1-202 25 | -------------------------------------------------------------------------------- /src/docs/src/api/document/index.rst: -------------------------------------------------------------------------------- 1 | .. Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | .. use this file except in compliance with the License. You may obtain a copy of 3 | .. the License at 4 | .. 5 | .. http://www.apache.org/licenses/LICENSE-2.0 6 | .. 7 | .. Unless required by applicable law or agreed to in writing, software 8 | .. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | .. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | .. License for the specific language governing permissions and limitations under 11 | .. the License. 12 | 13 | .. _api/document: 14 | 15 | ========= 16 | Documents 17 | ========= 18 | 19 | Details on how to create, read, update and delete documents within a database. 20 | 21 | .. toctree:: 22 | common 23 | attachments 24 | -------------------------------------------------------------------------------- /src/docs/src/api/server/index.rst: -------------------------------------------------------------------------------- 1 | .. Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | .. use this file except in compliance with the License. You may obtain a copy of 3 | .. the License at 4 | .. 5 | .. http://www.apache.org/licenses/LICENSE-2.0 6 | .. 7 | .. Unless required by applicable law or agreed to in writing, software 8 | .. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | .. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | .. License for the specific language governing permissions and limitations under 11 | .. the License. 12 | 13 | .. _api/server: 14 | 15 | ====== 16 | Server 17 | ====== 18 | 19 | The CouchDB server interface provides the basic interface to a 20 | CouchDB server for obtaining CouchDB information and getting and setting 21 | configuration information. 22 | 23 | .. toctree:: 24 | common 25 | authn 26 | configuration 27 | -------------------------------------------------------------------------------- /src/docs/src/best-practices/index.rst: -------------------------------------------------------------------------------- 1 | .. Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | .. use this file except in compliance with the License. You may obtain a copy of 3 | .. the License at 4 | .. 5 | .. http://www.apache.org/licenses/LICENSE-2.0 6 | .. 7 | .. Unless required by applicable law or agreed to in writing, software 8 | .. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | .. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | .. License for the specific language governing permissions and limitations under 11 | .. the License. 12 | 13 | .. _best-practices: 14 | 15 | ============== 16 | Best Practices 17 | ============== 18 | 19 | In this chapter, we present some of the best ways to use Apache CouchDB. These 20 | usage patterns reflect many years of real-world use. We hope that these will 21 | jump-start your next project, or improve the performance of your current 22 | system. 23 | 24 | .. toctree:: 25 | :maxdepth: 2 26 | 27 | documents 28 | forms 29 | iso-date 30 | jsdevel 31 | views 32 | reverse-proxies 33 | -------------------------------------------------------------------------------- /src/docs/src/config/index.rst: -------------------------------------------------------------------------------- 1 | .. Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | .. use this file except in compliance with the License. You may obtain a copy of 3 | .. the License at 4 | .. 5 | .. http://www.apache.org/licenses/LICENSE-2.0 6 | .. 7 | .. Unless required by applicable law or agreed to in writing, software 8 | .. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | .. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | .. License for the specific language governing permissions and limitations under 11 | .. the License. 12 | 13 | .. _config: 14 | 15 | ============= 16 | Configuration 17 | ============= 18 | 19 | .. toctree:: 20 | :maxdepth: 2 21 | 22 | intro 23 | couchdb 24 | cluster 25 | couch-peruser 26 | disk-monitor 27 | scanner 28 | quickjs 29 | http 30 | auth 31 | compaction 32 | indexbuilds 33 | ioq 34 | logging 35 | replicator 36 | query-servers 37 | misc 38 | resharding 39 | -------------------------------------------------------------------------------- /src/docs/src/ddocs/views/index.rst: -------------------------------------------------------------------------------- 1 | .. Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | .. use this file except in compliance with the License. You may obtain a copy of 3 | .. the License at 4 | .. 5 | .. http://www.apache.org/licenses/LICENSE-2.0 6 | .. 7 | .. Unless required by applicable law or agreed to in writing, software 8 | .. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | .. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | .. License for the specific language governing permissions and limitations under 11 | .. the License. 12 | 13 | .. _views: 14 | 15 | ============== 16 | Guide to Views 17 | ============== 18 | 19 | Views are the primary tool used for querying and reporting on CouchDB documents. 20 | There you'll learn how they work and how to use them to build effective 21 | applications with CouchDB. 22 | 23 | .. toctree:: 24 | 25 | intro 26 | collation 27 | joins 28 | nosql 29 | pagination 30 | -------------------------------------------------------------------------------- /src/docs/src/docs.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, docs, [ 14 | {description, "CouchDB Documentation"}, 15 | {vsn, git}, 16 | {registered, []}, 17 | {applications, [kernel, stdlib]} 18 | ]}. 19 | -------------------------------------------------------------------------------- /src/docs/src/fauxton/index.rst: -------------------------------------------------------------------------------- 1 | .. Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | .. use this file except in compliance with the License. You may obtain a copy of 3 | .. the License at 4 | .. 5 | .. http://www.apache.org/licenses/LICENSE-2.0 6 | .. 7 | .. Unless required by applicable law or agreed to in writing, software 8 | .. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | .. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | .. License for the specific language governing permissions and limitations under 11 | .. the License. 12 | 13 | .. _fauxton: 14 | 15 | ======= 16 | Fauxton 17 | ======= 18 | 19 | .. toctree:: 20 | 21 | install 22 | -------------------------------------------------------------------------------- /src/docs/src/install/index.rst: -------------------------------------------------------------------------------- 1 | .. Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | .. use this file except in compliance with the License. You may obtain a copy of 3 | .. the License at 4 | .. 5 | .. http://www.apache.org/licenses/LICENSE-2.0 6 | .. 7 | .. Unless required by applicable law or agreed to in writing, software 8 | .. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | .. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | .. License for the specific language governing permissions and limitations under 11 | .. the License. 12 | 13 | .. _install: 14 | 15 | ============ 16 | Installation 17 | ============ 18 | 19 | .. toctree:: 20 | :maxdepth: 2 21 | 22 | unix 23 | windows 24 | mac 25 | freebsd 26 | docker 27 | snap 28 | kubernetes 29 | search 30 | nouveau 31 | upgrading 32 | troubleshooting 33 | -------------------------------------------------------------------------------- /src/docs/src/maintenance/index.rst: -------------------------------------------------------------------------------- 1 | .. Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | .. use this file except in compliance with the License. You may obtain a copy of 3 | .. the License at 4 | .. 5 | .. http://www.apache.org/licenses/LICENSE-2.0 6 | .. 7 | .. Unless required by applicable law or agreed to in writing, software 8 | .. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | .. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | .. License for the specific language governing permissions and limitations under 11 | .. the License. 12 | 13 | =========== 14 | Maintenance 15 | =========== 16 | 17 | .. toctree:: 18 | 19 | compaction 20 | performance 21 | backups 22 | -------------------------------------------------------------------------------- /src/docs/src/setup/index.rst: -------------------------------------------------------------------------------- 1 | .. Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | .. use this file except in compliance with the License. You may obtain a copy of 3 | .. the License at 4 | .. 5 | .. http://www.apache.org/licenses/LICENSE-2.0 6 | .. 7 | .. Unless required by applicable law or agreed to in writing, software 8 | .. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | .. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | .. License for the specific language governing permissions and limitations under 11 | .. the License. 12 | 13 | .. _setup: 14 | 15 | ===== 16 | Setup 17 | ===== 18 | 19 | CouchDB 2.x can be deployed in either a single-node or a clustered 20 | configuration. This section covers the first-time setup steps required for each 21 | of these configurations. 22 | 23 | .. toctree:: 24 | :maxdepth: 2 25 | 26 | single-node 27 | cluster 28 | -------------------------------------------------------------------------------- /src/docs/src/whatsnew/index.rst: -------------------------------------------------------------------------------- 1 | .. Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | .. use this file except in compliance with the License. You may obtain a copy of 3 | .. the License at 4 | .. 5 | .. http://www.apache.org/licenses/LICENSE-2.0 6 | .. 7 | .. Unless required by applicable law or agreed to in writing, software 8 | .. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | .. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | .. License for the specific language governing permissions and limitations under 11 | .. the License. 12 | 13 | .. _releases: 14 | 15 | ============= 16 | Release Notes 17 | ============= 18 | 19 | .. toctree:: 20 | :glob: 21 | :maxdepth: 2 22 | 23 | 3.5 24 | 3.4 25 | 3.3 26 | 3.2 27 | 3.1 28 | 3.0 29 | 2.3 30 | 2.2 31 | 2.1 32 | 2.0 33 | 1.7 34 | 1.6 35 | 1.5 36 | 1.4 37 | 1.3 38 | 1.2 39 | 1.1 40 | 1.0 41 | 0.11 42 | 0.10 43 | 0.9 44 | 0.8 45 | -------------------------------------------------------------------------------- /src/docs/static/css/tablefix.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 3 | * use this file except in compliance with the License. You may obtain a copy of 4 | * the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | * License for the specific language governing permissions and limitations under 12 | * the License. 13 | */ 14 | 15 | /* Reference https://github.com/readthedocs/sphinx_rtd_theme/issues/117 */ 16 | /* override table width restrictions */ 17 | .wy-table-responsive table td, 18 | .wy-table-responsive table th { 19 | white-space: normal; 20 | } 21 | 22 | .wy-table-responsive { 23 | margin-bottom: 24px; 24 | max-width: 100%; 25 | overflow: visible; 26 | } 27 | -------------------------------------------------------------------------------- /src/docs/templates/breadcrumbs.html: -------------------------------------------------------------------------------- 1 | {%- extends "sphinx_rtd_theme/breadcrumbs.html" %} 2 | 3 | {% block breadcrumbs_aside %} 4 | {% if pagename != 'index' %} 5 | {{ super() }} 6 | {% else %} 7 |
  • 8 | Edit on GitHub 9 |
  • 10 | {% endif %} 11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /src/dreyfus/.gitignore: -------------------------------------------------------------------------------- 1 | ebin/ 2 | .*.sw? 3 | test/elixir/_build 4 | test/elixir/deps 5 | -------------------------------------------------------------------------------- /src/dreyfus/src/dreyfus.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | 14 | %% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- 15 | 16 | {application, dreyfus, [ 17 | {description, "Clouseau index manager"}, 18 | {vsn, git}, 19 | {mod, {dreyfus_app, []}}, 20 | {registered, [dreyfus_index_manager, dreyfus_sup]}, 21 | {applications, [kernel, stdlib, couch_log, config, couch_event, mem3, ioq, couch_epi]} 22 | ]}. 23 | -------------------------------------------------------------------------------- /src/dreyfus/src/dreyfus.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | %% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- 14 | 15 | -module(dreyfus). 16 | 17 | -export([available/0]). 18 | 19 | available() -> 20 | case application:get_env(dreyfus, available) of 21 | {ok, Val} -> 22 | Val; 23 | undefined -> 24 | case clouseau_rpc:connected() of 25 | true -> 26 | ok = application:set_env(dreyfus, available, true), 27 | true; 28 | false -> 29 | false 30 | end 31 | end. 32 | -------------------------------------------------------------------------------- /src/dreyfus/src/dreyfus_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | %% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- 14 | 15 | -module(dreyfus_app). 16 | -behaviour(application). 17 | -export([start/2, stop/1]). 18 | 19 | start(_Type, []) -> 20 | dreyfus_sup:start_link(). 21 | 22 | stop([]) -> 23 | ok. 24 | -------------------------------------------------------------------------------- /src/dreyfus/src/dreyfus_config.erl: -------------------------------------------------------------------------------- 1 | -module(dreyfus_config). 2 | 3 | -export([data/0, get/1]). 4 | 5 | data() -> 6 | try 7 | config:get("dreyfus_blacklist") 8 | catch 9 | error:badarg -> 10 | % lazy workaround to address issue with epi invocation on startup 11 | [] 12 | end. 13 | 14 | get(Key) -> 15 | Handle = couch_epi:get_handle({dreyfus, black_list}), 16 | couch_epi:get_value(Handle, dreyfus, Key). 17 | -------------------------------------------------------------------------------- /src/dreyfus/src/dreyfus_epi.erl: -------------------------------------------------------------------------------- 1 | -module(dreyfus_epi). 2 | 3 | -behaviour(couch_epi_plugin). 4 | 5 | -export([ 6 | app/0, 7 | providers/0, 8 | services/0, 9 | data_subscriptions/0, 10 | data_providers/0, 11 | processes/0, 12 | notify/3 13 | ]). 14 | 15 | -define(DATA_INTERVAL, 1000). 16 | 17 | app() -> 18 | dreyfus. 19 | 20 | providers() -> 21 | [ 22 | {couch_db, dreyfus_plugin_couch_db}, 23 | {chttpd_handlers, dreyfus_httpd_handlers} 24 | ]. 25 | 26 | services() -> 27 | []. 28 | 29 | data_subscriptions() -> 30 | [{dreyfus, black_list}]. 31 | 32 | data_providers() -> 33 | [ 34 | {{dreyfus, black_list}, {callback_module, dreyfus_config}, [{interval, ?DATA_INTERVAL}]} 35 | ]. 36 | 37 | processes() -> 38 | []. 39 | 40 | notify(_Key, _Old, _New) -> 41 | Listeners = application:get_env(dreyfus, config_listeners, []), 42 | lists:foreach( 43 | fun(L) -> 44 | L ! dreyfus_config_change_finished 45 | end, 46 | Listeners 47 | ). 48 | -------------------------------------------------------------------------------- /src/dreyfus/src/dreyfus_plugin_couch_db.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(dreyfus_plugin_couch_db). 14 | 15 | -export([ 16 | is_valid_purge_client/2, 17 | on_compact/2 18 | ]). 19 | 20 | is_valid_purge_client(DbName, Props) -> 21 | dreyfus_util:verify_index_exists(DbName, Props). 22 | 23 | on_compact(DbName, DDocs) -> 24 | dreyfus_util:ensure_local_purge_docs(DbName, DDocs). 25 | -------------------------------------------------------------------------------- /src/dreyfus/src/dreyfus_sup.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | %% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- 14 | 15 | -module(dreyfus_sup). 16 | -behaviour(supervisor). 17 | 18 | -export([start_link/0, init/1]). 19 | 20 | start_link() -> 21 | supervisor:start_link({local, ?MODULE}, ?MODULE, []). 22 | 23 | init(_Args) -> 24 | Children = [ 25 | child(dreyfus_index_manager) 26 | ], 27 | {ok, {{one_for_one, 10, 1}, couch_epi:register_service(dreyfus_epi, Children)}}. 28 | 29 | child(Child) -> 30 | {Child, {Child, start_link, []}, permanent, 1000, worker, [Child]}. 31 | -------------------------------------------------------------------------------- /src/dreyfus/test/eunit/dreyfus_test_util.erl: -------------------------------------------------------------------------------- 1 | -module(dreyfus_test_util). 2 | 3 | -export([ 4 | wait_config_change/2 5 | ]). 6 | 7 | wait_config_change(Key, Value) -> 8 | test_util:wait(fun() -> 9 | case dreyfus_config:get(Key) of 10 | Value -> ok; 11 | _ -> wait 12 | end 13 | end). 14 | -------------------------------------------------------------------------------- /src/ets_lru/.gitignore: -------------------------------------------------------------------------------- 1 | .rebar 2 | ebin/ 3 | *~ 4 | -------------------------------------------------------------------------------- /src/ets_lru/Makefile: -------------------------------------------------------------------------------- 1 | REBAR?=rebar 2 | 3 | 4 | .PHONY: all 5 | # target: all - Makes everything 6 | all: build 7 | 8 | 9 | .PHONY: build 10 | # target: build - Builds the project 11 | build: 12 | $(REBAR) compile 13 | 14 | 15 | .PHONY: check 16 | # target: check - Checks if project builds and passes all the tests 17 | check: build eunit 18 | 19 | 20 | .PHONY: clean 21 | # target: clean - Removes build artifacts 22 | clean: 23 | $(REBAR) clean 24 | 25 | 26 | .PHONY: distclean 27 | # target: distclean - Removes all unversioned files 28 | distclean: clean 29 | git clean -fxd 30 | 31 | 32 | .PHONY: eunit 33 | # target: eunit - Runs eunit test suite 34 | eunit: 35 | $(REBAR) eunit 36 | 37 | 38 | .PHONY: help 39 | # target: help - Prints this help 40 | help: 41 | @egrep "^# target:" Makefile | sed -e 's/^# target: //g' | sort 42 | -------------------------------------------------------------------------------- /src/ets_lru/src/ets_lru.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, ets_lru, [ 14 | {description, "ETS Base LRU Cache"}, 15 | {vsn, git}, 16 | {registered, []}, 17 | {applications, [ 18 | kernel, 19 | stdlib 20 | ]} 21 | ]}. 22 | -------------------------------------------------------------------------------- /src/exxhash/.gitignore: -------------------------------------------------------------------------------- 1 | c_src/*.o 2 | ebin/ 3 | priv/ 4 | .rebar/ 5 | compile_commands.json 6 | _build/ 7 | c_src/*.d 8 | -------------------------------------------------------------------------------- /src/exxhash/Makefile: -------------------------------------------------------------------------------- 1 | REBAR?=rebar 2 | 3 | 4 | .PHONY: all 5 | # target: all - Makes everything 6 | all: build 7 | 8 | 9 | .PHONY: build 10 | # target: build - Builds the project 11 | build: 12 | $(REBAR) compile 13 | 14 | 15 | .PHONY: check 16 | # target: check - Checks if project builds and passes all the tests 17 | check: build eunit 18 | 19 | 20 | .PHONY: clean 21 | # target: clean - Removes build artifacts 22 | clean: 23 | $(REBAR) clean 24 | rm -f test/*.beam 25 | 26 | 27 | .PHONY: distclean 28 | # target: distclean - Removes all unversioned files 29 | distclean: clean 30 | git clean -fxd 31 | 32 | 33 | .PHONY: eunit 34 | # target: eunit - Runs eunit test suite 35 | eunit: 36 | $(REBAR) eunit 37 | 38 | 39 | .PHONY: help 40 | # target: help - Prints this help 41 | help: 42 | @egrep "^# target:" Makefile | sed -e 's/^# target: //g' | sort 43 | 44 | 45 | %.beam: %.erl 46 | erlc -o test/ $< 47 | -------------------------------------------------------------------------------- /src/exxhash/README.md: -------------------------------------------------------------------------------- 1 | exxhash 2 | ======= 3 | 4 | https://cyan4973.github.io/xxHash/ 5 | 6 | xxHash is an extremely fast non-cryptographic hash algorithm. The idea is to 7 | use it replace MD5 throughout Apache CouchDB codebase. 8 | 9 | This is not a complete implementation of xxHash it only implement the basic 128 10 | bit hash API. 11 | 12 | API 13 | === 14 | 15 | ``` 16 | exxhash:xxhash128(Binary) 17 | ``` 18 | 19 | Updating 20 | === 21 | 22 | xxHash was originally vendored from https://cyan4973.github.io/xxHash/ 23 | with commit SHA f4bef929aa854e9f52a303c5e58fd52855a0ecfa 24 | 25 | Updated on 2025-04-30 from commit 41fea3d9ac7881c78fdc4003626977aa073bb906 26 | 27 | Only these two files are used from the original library: 28 | `c_src/xxhash.h` 29 | `c_src/xxhash.c` 30 | -------------------------------------------------------------------------------- /src/exxhash/rebar.config: -------------------------------------------------------------------------------- 1 | {plugins, [ 2 | pc 3 | ]}. 4 | 5 | {project_plugins, [ 6 | erlfmt 7 | ]}. 8 | 9 | {provider_hooks, [ 10 | {pre, [ 11 | {compile, {pc, compile}}, 12 | {clean, {pc, clean}} 13 | ]} 14 | ]}. 15 | 16 | {port_specs, [ 17 | {"priv/exxhash.so", ["c_src/*.c"]} 18 | ]}. 19 | 20 | {port_env, [ 21 | % Development compilation 22 | % {".*", "CFLAGS", "$CFLAGS -g -Wall -Werror -fPIC"} 23 | 24 | % Production compilation 25 | {"(linux|solaris|darwin|freebsd)", "CFLAGS", "$CFLAGS -Wall -Werror -DNDEBUG -O3"}, 26 | {"win32", "CFLAGS", "$CFLAGS /O2 /DNDEBUG /Wall"} 27 | ]}. 28 | 29 | {eunit_opts, [ 30 | debug_info, 31 | verbose 32 | ]}. 33 | -------------------------------------------------------------------------------- /src/exxhash/src/exxhash.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, exxhash, [ 14 | {description, "xxhash in Erlang for Apache CouchDB"}, 15 | {vsn, git}, 16 | {registered, []}, 17 | {applications, [kernel, stdlib]} 18 | ]}. 19 | -------------------------------------------------------------------------------- /src/fabric/README.md: -------------------------------------------------------------------------------- 1 | ## fabric 2 | 3 | Fabric is a collection of proxy functions for [CouchDB][1] operations in a cluster. These functions are used in CouchDB as the remote procedure endpoints on each of the cluster nodes. 4 | 5 | For example, creating a database is a straightforward task in CouchDB 1.x, but for a clustered CouchDB, each node that will store a shard for the database needs to receive and execute a fabric function. The node handling the request also needs to compile the results from each of the nodes and respond accordingly to the client. 6 | 7 | Fabric is used in conjunction with 'Rexi' which is also an application within CouchDB. 8 | 9 | ### Getting Started 10 | Fabric requires R13B03 or higher and can be built with [rebar][3]. 11 | 12 | ### License 13 | [Apache 2.0][2] 14 | 15 | 16 | [1]: http://couchdb.apache.org 17 | [2]: http://www.apache.org/licenses/LICENSE-2.0.html 18 | [3]: http://github.com/basho/rebar 19 | -------------------------------------------------------------------------------- /src/fabric/priv/stats_descriptions.cfg: -------------------------------------------------------------------------------- 1 | {[fabric, worker, timeouts], [ 2 | {type, counter}, 3 | {desc, <<"number of worker timeouts">>} 4 | ]}. 5 | {[fabric, open_shard, timeouts], [ 6 | {type, counter}, 7 | {desc, <<"number of open shard timeouts">>} 8 | ]}. 9 | {[fabric, read_repairs, success], [ 10 | {type, counter}, 11 | {desc, <<"number of successful read repair operations">>} 12 | ]}. 13 | {[fabric, read_repairs, failure], [ 14 | {type, counter}, 15 | {desc, <<"number of failed read repair operations">>} 16 | ]}. 17 | {[fabric, doc_update, errors], [ 18 | {type, counter}, 19 | {desc, <<"number of document update errors">>} 20 | ]}. 21 | {[fabric, doc_update, mismatched_errors], [ 22 | {type, counter}, 23 | {desc, <<"number of document update errors with multiple error types">>} 24 | ]}. 25 | {[fabric, doc_update, write_quorum_errors], [ 26 | {type, counter}, 27 | {desc, <<"number of write quorum errors">>} 28 | ]}. 29 | -------------------------------------------------------------------------------- /src/fabric/src/fabric.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, fabric, [ 14 | {description, "Routing and proxying layer for CouchDB cluster"}, 15 | {vsn, git}, 16 | {registered, []}, 17 | {applications, [ 18 | kernel, 19 | stdlib, 20 | config, 21 | couch, 22 | rexi, 23 | mem3, 24 | couch_log, 25 | couch_stats 26 | ]} 27 | ]}. 28 | -------------------------------------------------------------------------------- /src/global_changes/.gitignore: -------------------------------------------------------------------------------- 1 | .eunit/ 2 | ebin/ 3 | -------------------------------------------------------------------------------- /src/global_changes/priv/stats_descriptions.cfg: -------------------------------------------------------------------------------- 1 | {[global_changes, db_writes], [ 2 | {type, counter}, 3 | {desc, <<"number of db writes performed by global changes">>} 4 | ]}. 5 | {[global_changes, event_doc_conflict], [ 6 | {type, counter}, 7 | {desc, <<"number of conflicted event docs encountered by global changes">>} 8 | ]}. 9 | {[global_changes, listener_pending_updates], [ 10 | {type, gauge}, 11 | {desc, <<"number of global changes updates pending writes in global_changes_listener">>} 12 | ]}. 13 | {[global_changes, rpcs], [ 14 | {type, counter}, 15 | {desc, <<"number of rpc operations performed by global_changes">>} 16 | ]}. 17 | {[global_changes, server_pending_updates], [ 18 | {type, gauge}, 19 | {desc, <<"number of global changes updates pending writes in global_changes_server">>} 20 | ]}. 21 | -------------------------------------------------------------------------------- /src/global_changes/src/global_changes_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(global_changes_app). 14 | -behavior(application). 15 | 16 | -export([ 17 | start/2, 18 | stop/1 19 | ]). 20 | 21 | start(_StartType, _StartArgs) -> 22 | global_changes_sup:start_link(). 23 | 24 | stop(_State) -> 25 | ok. 26 | -------------------------------------------------------------------------------- /src/global_changes/src/global_changes_httpd_handlers.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(global_changes_httpd_handlers). 14 | 15 | -export([url_handler/1, db_handler/1, design_handler/1]). 16 | 17 | url_handler(<<"_db_updates">>) -> fun global_changes_httpd:handle_global_changes_req/1; 18 | url_handler(_) -> no_match. 19 | 20 | db_handler(_) -> no_match. 21 | 22 | design_handler(_) -> no_match. 23 | -------------------------------------------------------------------------------- /src/global_changes/src/global_changes_util.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(global_changes_util). 14 | 15 | -export([get_dbname/0]). 16 | 17 | get_dbname() -> 18 | case application:get_env(global_changes, dbname) of 19 | {ok, DbName} when is_binary(DbName) -> 20 | DbName; 21 | {ok, DbName} when is_list(DbName) -> 22 | iolist_to_binary(DbName); 23 | _ -> 24 | <<"_global_changes">> 25 | end. 26 | -------------------------------------------------------------------------------- /src/ioq/.gitignore: -------------------------------------------------------------------------------- 1 | .rebar 2 | ebin/ 3 | -------------------------------------------------------------------------------- /src/ioq/src/ioq.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application,ioq, [ 14 | {description, "I/O prioritizing engine"}, 15 | {vsn, git}, 16 | {registered,[]}, 17 | {applications,[kernel,stdlib,config]}, 18 | {mod,{ioq_app,[]}}, 19 | {env, []}, 20 | {modules,[ioq,ioq_app,ioq_sup]} 21 | ]}. 22 | -------------------------------------------------------------------------------- /src/ioq/src/ioq_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(ioq_app). 14 | -behaviour(application). 15 | -export([start/2, stop/1]). 16 | 17 | start(_StartType, _StartArgs) -> 18 | ioq_sup:start_link(). 19 | 20 | stop(_State) -> 21 | ok. 22 | -------------------------------------------------------------------------------- /src/ioq/src/ioq_sup.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(ioq_sup). 14 | -behaviour(supervisor). 15 | -export([start_link/0, init/1]). 16 | 17 | %% Helper macro for declaring children of supervisor 18 | -define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}). 19 | 20 | start_link() -> 21 | supervisor:start_link({local, ?MODULE}, ?MODULE, []). 22 | 23 | init([]) -> 24 | {ok, {{one_for_one, 5, 10}, [?CHILD(ioq, worker)]}}. 25 | -------------------------------------------------------------------------------- /src/jwtf/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | _build/ 3 | doc/ 4 | rebar.lock 5 | -------------------------------------------------------------------------------- /src/jwtf/README.md: -------------------------------------------------------------------------------- 1 | # jwtf 2 | 3 | JSON Web Token Functions 4 | 5 | This library provides JWT parsing and validation functions 6 | 7 | Supports; 8 | 9 | * Verify 10 | * RS256 11 | * RS384 12 | * RS512 13 | * HS256 14 | * HS384 15 | * HS512 16 | * ES256 17 | * ES384 18 | * ES512 19 | -------------------------------------------------------------------------------- /src/jwtf/rebar.config: -------------------------------------------------------------------------------- 1 | % vim: set ft=erlang : -*- erlang -*- % Magic lines for code editors 2 | -------------------------------------------------------------------------------- /src/jwtf/src/jwtf.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, jwtf, [ 14 | {description, "JSON Web Token Functions"}, 15 | {vsn, git}, 16 | {registered, []}, 17 | {applications, [ 18 | kernel, 19 | stdlib, 20 | b64url, 21 | config, 22 | crypto, 23 | jiffy, 24 | public_key 25 | ]}, 26 | {mod, {jwtf_app, []}}, 27 | {env,[]}, 28 | {modules, []}, 29 | {maintainers, []}, 30 | {licenses, []}, 31 | {links, []} 32 | ]}. 33 | -------------------------------------------------------------------------------- /src/jwtf/src/jwtf_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(jwtf_app). 14 | 15 | -behaviour(application). 16 | 17 | %% Application callbacks 18 | -export([start/2, stop/1]). 19 | 20 | %% =================================================================== 21 | %% Application callbacks 22 | %% =================================================================== 23 | 24 | start(_StartType, _StartArgs) -> 25 | jwtf_sup:start_link(). 26 | 27 | stop(_State) -> 28 | ok. 29 | -------------------------------------------------------------------------------- /src/ken/README.md: -------------------------------------------------------------------------------- 1 | ken 2 | === 3 | 4 | Ken builds views and search indexes. Automatically. 5 | 6 | #### Overview 7 | 8 | When the couch\_db\_update event is triggered with an `updated` event, ken will spawn indexing jobs for view groups and search indexes (one job per view group shard or search index shard). If a `deleted` event is triggered, all jobs associated with the corresponding database shard will be removed. 9 | 10 | #### Testing 11 | 12 | Testing for ken expected to be executed from the top level `couchdb` repo as a part of `make check` run. The isolated ken test could be ran as `rebar eunit apps=ken verbose=1` from the `couchdb`'s root directory. 13 | -------------------------------------------------------------------------------- /src/ken/src/ken.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(ken). 14 | 15 | -export([add/1]). 16 | -export([remove/1]). 17 | -export([add_all_shards/1]). 18 | 19 | % Add a database shard to be indexed. 20 | add(DbName) -> 21 | ken_server:add(DbName). 22 | 23 | % Remove all pending jobs for a database shard. 24 | remove(DbName) -> 25 | ken_server:remove(DbName). 26 | 27 | % Add all shards for a database to be indexed. 28 | add_all_shards(DbName) -> 29 | ken_server:add_all_shards(DbName). 30 | -------------------------------------------------------------------------------- /src/ken/src/ken_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(ken_app). 14 | 15 | -behaviour(application). 16 | 17 | %% Application callbacks 18 | -export([start/2, stop/1]). 19 | 20 | %% =================================================================== 21 | %% Application callbacks 22 | %% =================================================================== 23 | 24 | start(_StartType, _StartArgs) -> 25 | ken_sup:start_link(). 26 | 27 | stop(_State) -> 28 | ok. 29 | -------------------------------------------------------------------------------- /src/ken/src/ken_sup.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(ken_sup). 14 | 15 | -behaviour(supervisor). 16 | 17 | %% API 18 | -export([start_link/0]). 19 | 20 | %% Supervisor callbacks 21 | -export([init/1]). 22 | 23 | %% Helper macro for declaring children of supervisor 24 | -define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}). 25 | 26 | start_link() -> 27 | supervisor:start_link({local, ?MODULE}, ?MODULE, []). 28 | 29 | %% supervisor callbacks 30 | 31 | init([]) -> 32 | {ok, {{one_for_one, 5, 10}, [?CHILD(ken_server, worker)]}}. 33 | -------------------------------------------------------------------------------- /src/ken/test/config.ini: -------------------------------------------------------------------------------- 1 | [ken] 2 | limit = 42 3 | -------------------------------------------------------------------------------- /src/mango/.gitignore: -------------------------------------------------------------------------------- 1 | .rebar/ 2 | ebin/ 3 | test/*.pyc 4 | venv/ 5 | .eunit 6 | -------------------------------------------------------------------------------- /src/mango/TODO.md: -------------------------------------------------------------------------------- 1 | 2 | * Patch the view engine to do alternative sorts. This will include both the lower level couch\_view* modules as well as the fabric coordinators. 3 | 4 | * Patch the view engine so we can specify options when returning docs from cursors. We'll want this so that we can delete specific revisions from a document. 5 | 6 | * Need to figure out how to do raw collation on some indices because at 7 | least the _id index uses it forcefully. 8 | 9 | * Add lots more to the update API. Mongo appears to be missing some pretty obvious easy functionality here. Things like managing values doing things like multiplying numbers, or common string mutations would be obvious examples. Also it could be interesting to add to the language so that you can do conditional updates based on other document attributes. Definitely not a V1 endeavor. -------------------------------------------------------------------------------- /src/mango/rebar.config.script: -------------------------------------------------------------------------------- 1 | % vim: set ft=erlang : -*- erlang -*- % Magic lines for code editors 2 | 3 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | % use this file except in compliance with the License. You may obtain a copy of 5 | % the License at 6 | % 7 | % http://www.apache.org/licenses/LICENSE-2.0 8 | % 9 | % Unless required by applicable law or agreed to in writing, software 10 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | % License for the specific language governing permissions and limitations under 13 | % the License. 14 | 15 | 16 | HaveDreyfus = code:lib_dir(dreyfus) /= {error, bad_name}. 17 | 18 | if not HaveDreyfus -> CONFIG; true -> 19 | CurrOpts = case lists:keyfind(erl_opts, 1, CONFIG) of 20 | {erl_opts, Opts} -> Opts; 21 | false -> [] 22 | end, 23 | NewOpts = [ 24 | {d, 'HAVE_DREYFUS'} 25 | ] ++ CurrOpts, 26 | lists:keystore(erl_opts, 1, CONFIG, {erl_opts, NewOpts}) 27 | end. 28 | 29 | -------------------------------------------------------------------------------- /src/mango/requirements.txt: -------------------------------------------------------------------------------- 1 | # nose2 0.13.0, requests, hypothesis version are driven 2 | # by the minimum version for python on centos 8 currently 3 | nose2==0.13.0 4 | requests==2.27.1 5 | hypothesis==6.31.6 6 | -------------------------------------------------------------------------------- /src/mango/src/mango.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, mango, [ 14 | {description, "MongoDB API compatibility layer for CouchDB"}, 15 | {vsn, git}, 16 | {registered, []}, 17 | {applications, [ 18 | kernel, 19 | stdlib, 20 | couch_epi, 21 | config, 22 | couch_log, 23 | fabric, 24 | nouveau 25 | ]}, 26 | {mod, {mango_app, []}} 27 | ]}. 28 | -------------------------------------------------------------------------------- /src/mango/src/mango_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(mango_app). 14 | -behaviour(application). 15 | -export([start/2, stop/1]). 16 | 17 | start(_Type, StartArgs) -> 18 | mango_sup:start_link(StartArgs). 19 | 20 | stop(_State) -> 21 | ok. 22 | -------------------------------------------------------------------------------- /src/mango/src/mango_cursor.hrl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -include("mango_execution_stats.hrl"). 14 | 15 | 16 | -record(cursor, { 17 | db, 18 | index, 19 | ranges, 20 | trace, 21 | selector, 22 | opts, 23 | limit, 24 | skip = 0, 25 | fields = undefined, 26 | user_fun, 27 | user_acc, 28 | execution_stats, 29 | bookmark, 30 | bookmark_docid, 31 | bookmark_key 32 | }). 33 | -------------------------------------------------------------------------------- /src/mango/src/mango_execution_stats.hrl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -record(execution_stats, { 14 | totalKeysExamined = 0, 15 | totalDocsExamined = 0, 16 | totalQuorumDocsExamined = 0, 17 | resultsReturned = 0, 18 | executionStartTime, 19 | executionTimeMs, 20 | dbname 21 | }). 22 | -------------------------------------------------------------------------------- /src/mango/src/mango_httpd_handlers.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(mango_httpd_handlers). 14 | 15 | -export([url_handler/1, db_handler/1, design_handler/1]). 16 | 17 | url_handler(_) -> no_match. 18 | 19 | db_handler(<<"_index">>) -> fun mango_httpd:handle_req/2; 20 | db_handler(<<"_explain">>) -> fun mango_httpd:handle_req/2; 21 | db_handler(<<"_find">>) -> fun mango_httpd:handle_req/2; 22 | db_handler(_) -> no_match. 23 | 24 | design_handler(_) -> no_match. 25 | -------------------------------------------------------------------------------- /src/mango/src/mango_idx_view.hrl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -define(MAX_JSON_OBJ, {<<255, 255, 255, 255>>}). -------------------------------------------------------------------------------- /src/mango/src/mango_sup.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(mango_sup). 14 | -behaviour(supervisor). 15 | -export([init/1]). 16 | 17 | -export([start_link/1]). 18 | 19 | start_link(Args) -> 20 | supervisor:start_link({local, ?MODULE}, ?MODULE, Args). 21 | 22 | init([]) -> 23 | {ok, {{one_for_one, 3, 10}, couch_epi:register_service(mango_epi, [])}}. 24 | -------------------------------------------------------------------------------- /src/mango/unittest.cfg: -------------------------------------------------------------------------------- 1 | [unittest] 2 | start-dir=test 3 | test-file-pattern=[0-9]*.py 4 | -------------------------------------------------------------------------------- /src/mem3/priv/stats_descriptions.cfg: -------------------------------------------------------------------------------- 1 | {[mem3, shard_cache, eviction], [ 2 | {type, counter}, 3 | {desc, <<"number of shard cache evictions">>} 4 | ]}. 5 | {[mem3, shard_cache, hit], [ 6 | {type, counter}, 7 | {desc, <<"number of shard cache hits">>} 8 | ]}. 9 | {[mem3, shard_cache, miss], [ 10 | {type, counter}, 11 | {desc, <<"number of shard cache misses">>} 12 | ]}. 13 | -------------------------------------------------------------------------------- /src/mem3/rebar.config.script: -------------------------------------------------------------------------------- 1 | %% vim: set ft=erlang : -*- erlang -*- % Magic lines for code editors 2 | 3 | %% Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | %% use this file except in compliance with the License. You may obtain a copy of 5 | %% the License at 6 | %% 7 | %% http://www.apache.org/licenses/LICENSE-2.0 8 | %% 9 | %% Unless required by applicable law or agreed to in writing, software 10 | %% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | %% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | %% License for the specific language governing permissions and limitations under 13 | %% the License. 14 | 15 | WithProper = code:lib_dir(proper) /= {error, bad_name}. 16 | 17 | if not WithProper -> CONFIG; true -> 18 | CurrOpts = case lists:keyfind(erl_opts, 1, CONFIG) of 19 | {erl_opts, Opts} -> Opts; 20 | false -> [] 21 | end, 22 | NewOpts = [{d, 'WITH_PROPER'} | CurrOpts], 23 | lists:keystore(erl_opts, 1, CONFIG, {erl_opts, NewOpts}) 24 | end. 25 | -------------------------------------------------------------------------------- /src/mem3/src/mem3_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(mem3_app). 14 | -behaviour(application). 15 | -export([start/2, stop/1]). 16 | 17 | start(_Type, []) -> 18 | mem3_sup:start_link(). 19 | 20 | stop([]) -> 21 | ok. 22 | -------------------------------------------------------------------------------- /src/mem3/src/mem3_httpd_handlers.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(mem3_httpd_handlers). 14 | 15 | -export([url_handler/1, db_handler/1, design_handler/1]). 16 | 17 | url_handler(<<"_membership">>) -> fun mem3_httpd:handle_membership_req/1; 18 | url_handler(<<"_reshard">>) -> fun mem3_reshard_httpd:handle_reshard_req/1; 19 | url_handler(_) -> no_match. 20 | 21 | db_handler(<<"_shards">>) -> fun mem3_httpd:handle_shards_req/2; 22 | db_handler(<<"_sync_shards">>) -> fun mem3_httpd:handle_sync_req/2; 23 | db_handler(_) -> no_match. 24 | 25 | design_handler(_) -> no_match. 26 | -------------------------------------------------------------------------------- /src/mem3/src/mem3_plugin_couch_db.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(mem3_plugin_couch_db). 14 | 15 | -export([ 16 | is_valid_purge_client/2 17 | ]). 18 | 19 | is_valid_purge_client(DbName, Props) -> 20 | mem3_rep:verify_purge_checkpoint(DbName, Props). 21 | -------------------------------------------------------------------------------- /src/mem3/test/eunit/mem3_hash_test.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(mem3_hash_test). 14 | 15 | -include_lib("eunit/include/eunit.hrl"). 16 | 17 | hash_test() -> 18 | ?assertEqual(1624516141, mem3_hash:crc32(0)), 19 | ?assertEqual(3816901808, mem3_hash:crc32("0")), 20 | ?assertEqual(3523407757, mem3_hash:crc32(<<0>>)), 21 | ?assertEqual(4108050209, mem3_hash:crc32(<<"0">>)), 22 | ?assertEqual(3094724072, mem3_hash:crc32(zero)), 23 | ok. 24 | -------------------------------------------------------------------------------- /src/nouveau/include/nouveau.hrl: -------------------------------------------------------------------------------- 1 | %% 2 | %% Licensed under the Apache License, Version 2.0 (the "License"); 3 | %% you may not use this file except in compliance with the License. 4 | %% You may obtain a copy of the License at 5 | %% 6 | %% http://www.apache.org/licenses/LICENSE-2.0 7 | %% 8 | %% Unless required by applicable law or agreed to in writing, software 9 | %% distributed under the License is distributed on an "AS IS" BASIS, 10 | %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | %% See the License for the specific language governing permissions and 12 | %% limitations under the License. 13 | 14 | -record(index, { 15 | dbname, 16 | ddoc_id, 17 | default_analyzer, 18 | field_analyzers, 19 | def, 20 | def_lang, 21 | name, 22 | sig=nil 23 | }). 24 | -------------------------------------------------------------------------------- /src/nouveau/src/nouveau.app.src: -------------------------------------------------------------------------------- 1 | %% 2 | %% Licensed under the Apache License, Version 2.0 (the "License"); 3 | %% you may not use this file except in compliance with the License. 4 | %% You may obtain a copy of the License at 5 | %% 6 | %% http://www.apache.org/licenses/LICENSE-2.0 7 | %% 8 | %% Unless required by applicable law or agreed to in writing, software 9 | %% distributed under the License is distributed on an "AS IS" BASIS, 10 | %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | %% See the License for the specific language governing permissions and 12 | %% limitations under the License. 13 | 14 | %% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- 15 | 16 | {application, nouveau, [ 17 | {description, "FuLL tExT SeArcH"}, 18 | {vsn, git}, 19 | {applications, [ 20 | config, 21 | ibrowse, 22 | kernel, 23 | stdlib, 24 | mem3, 25 | rexi 26 | ]}, 27 | {mod, {nouveau_app, []}}, 28 | {registered, [nouveau_index_manager, nouveau_sup]} 29 | ]}. 30 | -------------------------------------------------------------------------------- /src/nouveau/src/nouveau.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | %% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- 14 | 15 | -module(nouveau). 16 | 17 | -export([enabled/0]). 18 | 19 | enabled() -> 20 | config:get_boolean("nouveau", "enable", false). 21 | -------------------------------------------------------------------------------- /src/nouveau/src/nouveau_app.erl: -------------------------------------------------------------------------------- 1 | %% 2 | %% Licensed under the Apache License, Version 2.0 (the "License"); 3 | %% you may not use this file except in compliance with the License. 4 | %% You may obtain a copy of the License at 5 | %% 6 | %% http://www.apache.org/licenses/LICENSE-2.0 7 | %% 8 | %% Unless required by applicable law or agreed to in writing, software 9 | %% distributed under the License is distributed on an "AS IS" BASIS, 10 | %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | %% See the License for the specific language governing permissions and 12 | %% limitations under the License. 13 | 14 | %% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- 15 | 16 | -module(nouveau_app). 17 | -behaviour(application). 18 | 19 | %% Application callbacks 20 | -export([start/2, stop/1]). 21 | 22 | %% =================================================================== 23 | %% Application callbacks 24 | %% =================================================================== 25 | 26 | start(_StartType, _StartArgs) -> 27 | nouveau_sup:start_link(). 28 | 29 | stop(_State) -> 30 | ok. 31 | -------------------------------------------------------------------------------- /src/nouveau/src/nouveau_int.hrl: -------------------------------------------------------------------------------- 1 | %% 2 | %% Licensed under the Apache License, Version 2.0 (the "License"); 3 | %% you may not use this file except in compliance with the License. 4 | %% You may obtain a copy of the License at 5 | %% 6 | %% http://www.apache.org/licenses/LICENSE-2.0 7 | %% 8 | %% Unless required by applicable law or agreed to in writing, software 9 | %% distributed under the License is distributed on an "AS IS" BASIS, 10 | %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | %% See the License for the specific language governing permissions and 12 | %% limitations under the License. 13 | 14 | %% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- 15 | 16 | -define(TOP_N_DEFAULT, 10). 17 | -------------------------------------------------------------------------------- /src/nouveau/src/nouveau_plugin_couch_db.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(nouveau_plugin_couch_db). 14 | 15 | -export([ 16 | is_valid_purge_client/2, 17 | on_compact/2 18 | ]). 19 | 20 | is_valid_purge_client(DbName, Props) -> 21 | nouveau_util:verify_index_exists(DbName, Props). 22 | 23 | on_compact(DbName, DDocs) -> 24 | nouveau_util:ensure_local_purge_docs(DbName, DDocs). 25 | -------------------------------------------------------------------------------- /src/rexi/include/rexi.hrl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -record(error, { 14 | timestamp, 15 | reason, 16 | mfa, 17 | nonce, 18 | stack 19 | }). 20 | 21 | -------------------------------------------------------------------------------- /src/rexi/priv/stats_descriptions.cfg: -------------------------------------------------------------------------------- 1 | {[rexi, buffered], [ 2 | {type, counter}, 3 | {desc, <<"number of rexi messages buffered">>} 4 | ]}. 5 | {[rexi, down], [ 6 | {type, counter}, 7 | {desc, <<"number of rexi_DOWN messages handled">>} 8 | ]}. 9 | {[rexi, dropped], [ 10 | {type, counter}, 11 | {desc, <<"number of rexi messages dropped from buffers">>} 12 | ]}. 13 | {[rexi, streams, timeout, init_stream], [ 14 | {type, counter}, 15 | {desc, <<"number of rexi stream initialization timeouts">>} 16 | ]}. 17 | {[rexi, streams, timeout, stream], [ 18 | {type, counter}, 19 | {desc, <<"number of rexi stream timeouts">>} 20 | ]}. 21 | {[rexi, streams, timeout, wait_for_ack], [ 22 | {type, counter}, 23 | {desc, <<"number of rexi stream timeouts while waiting for acks">>} 24 | ]}. 25 | -------------------------------------------------------------------------------- /src/rexi/src/rexi.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, rexi, [ 14 | {description, "Lightweight RPC server"}, 15 | {vsn, git}, 16 | {registered, [ 17 | rexi_sup, 18 | rexi_server 19 | ]}, 20 | {applications, [ 21 | kernel, 22 | stdlib, 23 | couch_log, 24 | couch_stats, 25 | config 26 | ]}, 27 | {mod, {rexi_app,[]}} 28 | ]}. 29 | -------------------------------------------------------------------------------- /src/rexi/src/rexi_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(rexi_app). 14 | -behaviour(application). 15 | -export([start/2, stop/1]). 16 | 17 | start(_Type, StartArgs) -> 18 | rexi_sup:start_link(StartArgs). 19 | 20 | stop(_State) -> 21 | ok. 22 | -------------------------------------------------------------------------------- /src/rexi/src/rexi_server_sup.erl: -------------------------------------------------------------------------------- 1 | % Copyright 2010 Cloudant 2 | % 3 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | % use this file except in compliance with the License. You may obtain a copy of 5 | % the License at 6 | % 7 | % http://www.apache.org/licenses/LICENSE-2.0 8 | % 9 | % Unless required by applicable law or agreed to in writing, software 10 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | % License for the specific language governing permissions and limitations under 13 | % the License. 14 | 15 | -module(rexi_server_sup). 16 | -behaviour(supervisor). 17 | 18 | -export([init/1]). 19 | 20 | -export([start_link/1]). 21 | 22 | start_link(Name) -> 23 | supervisor:start_link({local, Name}, ?MODULE, []). 24 | 25 | init([]) -> 26 | {ok, {{one_for_one, 1, 1}, []}}. 27 | -------------------------------------------------------------------------------- /src/setup/.gitignore: -------------------------------------------------------------------------------- 1 | ebin 2 | .rebar 3 | *~ 4 | *.swp 5 | -------------------------------------------------------------------------------- /src/setup/src/setup.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, setup, [ 14 | {description, "Implements `_cluster_setup` and manages the setup of a CouchDB cluster"}, 15 | {vsn, git}, 16 | {registered, []}, 17 | {applications, [ 18 | kernel, 19 | stdlib, 20 | couch_epi, 21 | chttpd, 22 | couch_log 23 | ]}, 24 | {mod, {setup_app, []}}, 25 | {env, []} 26 | ]}. 27 | -------------------------------------------------------------------------------- /src/setup/src/setup_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(setup_app). 14 | 15 | -behaviour(application). 16 | 17 | %% Application callbacks 18 | -export([start/2, stop/1]). 19 | 20 | %% =================================================================== 21 | %% Application callbacks 22 | %% =================================================================== 23 | 24 | start(_StartType, _StartArgs) -> 25 | setup_sup:start_link(). 26 | 27 | stop(_State) -> 28 | ok. 29 | -------------------------------------------------------------------------------- /src/setup/src/setup_httpd_handlers.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(setup_httpd_handlers). 14 | 15 | -export([url_handler/1, db_handler/1, design_handler/1]). 16 | 17 | url_handler(<<"_cluster_setup">>) -> fun setup_httpd:handle_setup_req/1; 18 | url_handler(_) -> no_match. 19 | 20 | db_handler(_) -> no_match. 21 | 22 | design_handler(_) -> no_match. 23 | -------------------------------------------------------------------------------- /src/setup/test/t-single-node-auto-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 3 | # use this file except in compliance with the License. You may obtain a copy of 4 | # the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations under 12 | # the License. 13 | 14 | HEADERS="-HContent-Type:application/json" 15 | 16 | # Show cluster state: 17 | curl a:b@127.0.0.1:15986/_nodes/_all_docs 18 | curl a:b@127.0.0.1:15984/_all_dbs 19 | curl a:b@127.0.0.1:15984/_cluster_setup 20 | 21 | # Change the check 22 | curl -g 'a:b@127.0.0.1:15984/_cluster_setup?ensure_dbs_exist=["_replicator","_users"]' 23 | 24 | echo "YAY ALL GOOD" 25 | -------------------------------------------------------------------------------- /src/smoosh/src/smoosh.app.src: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | {application, smoosh, [ 14 | {description, "Auto-compaction daemon"}, 15 | {vsn, git}, 16 | {registered, [smoosh_server]}, 17 | {applications, [ 18 | kernel, 19 | stdlib, 20 | couch_log, 21 | config, 22 | couch_event, 23 | couch, 24 | mem3 25 | ]}, 26 | {mod, {smoosh_app, []}}, 27 | {env, []} 28 | ]}. 29 | -------------------------------------------------------------------------------- /src/smoosh/src/smoosh_app.erl: -------------------------------------------------------------------------------- 1 | % Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 | % use this file except in compliance with the License. You may obtain a copy of 3 | % the License at 4 | % 5 | % http://www.apache.org/licenses/LICENSE-2.0 6 | % 7 | % Unless required by applicable law or agreed to in writing, software 8 | % distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | % WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | % License for the specific language governing permissions and limitations under 11 | % the License. 12 | 13 | -module(smoosh_app). 14 | 15 | -behaviour(application). 16 | 17 | %% Application callbacks 18 | -export([start/2, stop/1]). 19 | 20 | %% =================================================================== 21 | %% Application callbacks 22 | %% =================================================================== 23 | 24 | start(_StartType, _StartArgs) -> 25 | smoosh_sup:start_link(). 26 | 27 | stop(_State) -> 28 | ok. 29 | -------------------------------------------------------------------------------- /src/weatherreport/.gitignore: -------------------------------------------------------------------------------- 1 | doc/ 2 | deps/ 3 | ebin/* 4 | log/ 5 | edoc/ 6 | index.html 7 | weatherreport 8 | *.png 9 | pkg/ 10 | erl_crash.dump 11 | .eunit/ 12 | *~ 13 | #*# 14 | -------------------------------------------------------------------------------- /src/weatherreport/.manifest: -------------------------------------------------------------------------------- 1 | src 2 | weatherreport 3 | doc 4 | LICENSE 5 | README.md 6 | -------------------------------------------------------------------------------- /test/build/test-configure-distclean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rm -rf apache-couchdb apache-couchdb-pristine 3 | ./configure 4 | make release 5 | cp -r apache-couchdb apache-couchdb-pristine 6 | cd apache-couchdb 7 | ./configure 8 | make distclean 9 | cd .. 10 | 11 | echo "********************************************" 12 | echo "If you see anything here" 13 | diff -r apache-couchdb apache-couchdb-pristine 14 | echo "and here, something is wrong" 15 | echo "********************************************" 16 | -------------------------------------------------------------------------------- /test/build/test-make-clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rm -rf apache-couchdb* 3 | ./configure 4 | make release 5 | cd apache-couchdb 6 | ./configure 7 | cd .. 8 | 9 | cp -r apache-couchdb apache-couchdb-pristine 10 | 11 | cd apache-couchdb 12 | make 13 | make clean 14 | cd .. 15 | 16 | echo "********************************************" 17 | echo "If you see anything here" 18 | diff -r apache-couchdb apache-couchdb-pristine 19 | echo "and here, something is wrong" 20 | echo "********************************************" 21 | -------------------------------------------------------------------------------- /test/elixir/.formatter.exs: -------------------------------------------------------------------------------- 1 | # Used by "mix format" 2 | [ 3 | inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"], 4 | line_length: 90, 5 | rename_deprecated_at: "1.5.0" 6 | ] 7 | -------------------------------------------------------------------------------- /test/elixir/.gitignore: -------------------------------------------------------------------------------- 1 | _build/ 2 | deps/ 3 | -------------------------------------------------------------------------------- /test/elixir/Makefile: -------------------------------------------------------------------------------- 1 | SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST))) 2 | 3 | all: 4 | make -C ${SELF_DIR}../.. elixir 5 | -------------------------------------------------------------------------------- /test/elixir/config/test.exs: -------------------------------------------------------------------------------- 1 | config :logger, 2 | backends: [:console], 3 | compile_time_purge_matching: [ 4 | [level_lower_than: :debug] 5 | ] 6 | -------------------------------------------------------------------------------- /test/elixir/lib/setup/common.ex: -------------------------------------------------------------------------------- 1 | defmodule Couch.Test.Setup.Common do 2 | @moduledoc """ 3 | A set of common setup pipelines for reuse 4 | 5 | - httpd_with_admin - chttpd is started and new admin is created 6 | - httpd_with_db - httpd_with_admin and new database is created 7 | """ 8 | alias Couch.Test.Setup.Step 9 | 10 | def httpd_with_admin(setup) do 11 | setup 12 | |> Step.Start.new(:start, extra_apps: [:chttpd]) 13 | |> Step.User.new(:admin, roles: [:server_admin]) 14 | end 15 | 16 | def httpd_with_db(setup) do 17 | setup 18 | |> httpd_with_admin() 19 | |> Step.Create.DB.new(:db) 20 | end 21 | 22 | def with_db(setup) do 23 | setup 24 | |> Step.Start.new(:start, extra_apps: [:fabric]) 25 | |> Step.Create.DB.new(:db) 26 | end 27 | end -------------------------------------------------------------------------------- /test/elixir/lib/step/config.ex: -------------------------------------------------------------------------------- 1 | defmodule Couch.Test.Setup.Step.Config do 2 | @moduledoc """ 3 | This setup reads configuration for a test run. 4 | It is not supposed to be called manually. 5 | """ 6 | 7 | alias Couch.Test.Setup 8 | 9 | defstruct [:config, :config_file] 10 | 11 | def new(setup, id, config_file: config_file) do 12 | setup |> Setup.step(id, %__MODULE__{config_file: config_file}) 13 | end 14 | 15 | def setup(_setup, %__MODULE__{config_file: _config_file} = step) do 16 | # TODO we would need to access config file here 17 | %{step | config: %{ 18 | backdoor: %{ 19 | protocol: "http" 20 | }, 21 | clustered: %{ 22 | protocol: "http" 23 | } 24 | }} 25 | end 26 | 27 | def teardown(_setup, _step) do 28 | end 29 | 30 | def get(%__MODULE__{config: config}) do 31 | config 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /test/elixir/run.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | cd %~dp0 4 | call mix local.hex --force 5 | call mix local.rebar --force 6 | call mix deps.get 7 | call mix test --trace %* 8 | -------------------------------------------------------------------------------- /test/elixir/test/config/nouveau.elixir: -------------------------------------------------------------------------------- 1 | %{ 2 | "NouveauTest": [ 3 | "user-agent header is forbidden", 4 | "search analyze", 5 | "search info", 6 | "search returns all items for GET", 7 | "search returns all items for POST", 8 | "search returns all items (paginated)", 9 | "search for foo:bar", 10 | "search for numeric ranges with locales", 11 | "multiple values for stored field", 12 | "sort by string field (asc)", 13 | "sort by string field (desc)", 14 | "sort by numeric field (asc)", 15 | "sort by numeric field (desc)", 16 | "counts", 17 | "ranges", 18 | "ranges (open)", 19 | "top_n", 20 | "mango search by number", 21 | "mango search by string", 22 | "mango search by text", 23 | "mango sort by number", 24 | "mango sort by string", 25 | "search GET (partitioned)", 26 | "search POST (partitioned)", 27 | "mango (partitioned)", 28 | "delete", 29 | "purge", 30 | "purge with conflicts", 31 | "index same field with different field types", 32 | "index not found", 33 | "meta" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /test/elixir/test/config/skip.elixir: -------------------------------------------------------------------------------- 1 | %{ 2 | "CookieAuthTest": [ 3 | "cookie auth" 4 | ], 5 | "ReaderACLTest": [ 6 | "unrestricted db can be read" 7 | ], 8 | "ReplicationTest": [ 9 | "non-admin user on target - remote-to-remote", 10 | "non-admin or reader user on source - remote-to-remote", 11 | "unauthorized replication cancellation" 12 | ], 13 | "SecurityValidationTest": [ 14 | "Author presence and user security when replicated" 15 | ], 16 | "WithQuorumTest": [ 17 | "Creating/Deleting DB should return 201-Created/202-Acepted" 18 | ], 19 | "WithoutQuorumTest": [ 20 | "Attachments should return 202-Acepted", 21 | "Bulk docs should return 202-Acepted", 22 | "Copy doc should return 202-Acepted", 23 | "Creating/Deleting DB should return 202-Acepted", 24 | "Creating/Updating/Deleting doc should return 202-Acepted" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /test/elixir/test/config/test-config.ini: -------------------------------------------------------------------------------- 1 | [log] 2 | level = warn 3 | 4 | [chttpd] 5 | authentication_handlers = {chttpd_auth, jwt_authentication_handler}, {chttpd_auth, proxy_authentication_handler}, {chttpd_auth, cookie_authentication_handler}, {chttpd_auth, default_authentication_handler} 6 | 7 | [dreyfus] 8 | name = clouseau@127.0.0.1 9 | 10 | [nouveau] 11 | enable = true 12 | -------------------------------------------------------------------------------- /test/elixir/test/form_submit_test.exs: -------------------------------------------------------------------------------- 1 | defmodule FormSubmitTest do 2 | use CouchTestCase 3 | 4 | @moduletag :form_submit 5 | 6 | @moduledoc """ 7 | Test that form submission is invalid 8 | This is a port of form_submit.js 9 | """ 10 | 11 | @tag :with_db 12 | test "form submission gives back invalid content-type", context do 13 | headers = [ 14 | Referer: "http://127.0.0.1:15984", 15 | "Content-Type": "application/x-www-form-urlencoded" 16 | ] 17 | 18 | body = %{} 19 | 20 | %{:body => response_body, :status_code => status_code} = 21 | Couch.post("/#{context[:db_name]}/baz", headers: headers, body: body) 22 | 23 | %{"error" => error, "reason" => reason} = response_body 24 | 25 | assert status_code == 415 26 | assert error == "bad_content_type" 27 | assert reason == "Content-Type must be multipart/form-data" 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /test/elixir/test/helper_test.exs: -------------------------------------------------------------------------------- 1 | defmodule HelperTest do 2 | use CouchTestCase 3 | 4 | @moduledoc """ 5 | Test helper code 6 | """ 7 | 8 | test "retry_until handles boolean conditions", _context do 9 | retry_until(fn -> 10 | true 11 | end) 12 | end 13 | 14 | test "retry_until handles assertions", _context do 15 | retry_until(fn -> 16 | assert true 17 | end) 18 | end 19 | 20 | test "retry_until times out", _context do 21 | assert_raise ExUnit.AssertionError, "\n\nExpected truthy, got false\ncode: assert false\n", fn -> 22 | retry_until( 23 | fn -> 24 | assert false 25 | end, 26 | 1, 27 | 5 28 | ) 29 | end 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /test/elixir/test/partition_design_docs_test.exs: -------------------------------------------------------------------------------- 1 | defmodule PartitionDesignDocsTest do 2 | use CouchTestCase 3 | 4 | @moduledoc """ 5 | Test Partition functionality for partition design docs 6 | """ 7 | 8 | @tag :with_partitioned_db 9 | test "/_partition/:pk/_design/doc 404", context do 10 | db_name = context[:db_name] 11 | 12 | url = "/#{db_name}/_partition/fakekey/_design/mrtest/_view/some" 13 | resp = Couch.get(url) 14 | assert resp.status_code == 404 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /test/elixir/test/support/couch_test_case.ex: -------------------------------------------------------------------------------- 1 | defmodule CouchTestCase do 2 | @moduledoc false 3 | 4 | use ExUnit.CaseTemplate 5 | 6 | using do 7 | quote do 8 | require Logger 9 | use ExUnit.Case 10 | 11 | import Couch.DBTest 12 | end 13 | end 14 | 15 | setup context do 16 | setup_funs = [ 17 | &Couch.DBTest.set_db_context/1, 18 | &Couch.DBTest.set_config_context/1, 19 | &Couch.DBTest.set_user_context/1 20 | ] 21 | 22 | context = 23 | Enum.reduce(setup_funs, context, fn setup_fun, acc -> 24 | setup_fun.(acc) 25 | end) 26 | 27 | {:ok, context} 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /test/elixir/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | Couch.Test.Suite.start() 2 | Code.require_file("partition_helpers.exs", __DIR__) 3 | Code.require_file("reshard_helpers.exs", __DIR__) 4 | -------------------------------------------------------------------------------- /test/fixtures/allowed-xref.txt: -------------------------------------------------------------------------------- 1 | src/ioq.erl: Warning: ioq:get_disk_queues/0 is undefined function (Xref) 2 | src/weatherreport_check_ioq.erl:{95,1}: Warning: weatherreport_check_ioq:check_legacy_int/1 calls undefined function ioq:get_disk_queues/0 (Xref) 3 | -------------------------------------------------------------------------------- /test/random_port.ini: -------------------------------------------------------------------------------- 1 | ; Licensed to the Apache Software Foundation (ASF) under one 2 | ; or more contributor license agreements. See the NOTICE file 3 | ; distributed with this work for additional information 4 | ; regarding copyright ownership. The ASF licenses this file 5 | ; to you under the Apache License, Version 2.0 (the 6 | ; "License"); you may not use this file except in compliance 7 | ; with the License. You may obtain a copy of the License at 8 | ; 9 | ; http://www.apache.org/licenses/LICENSE-2.0 10 | ; 11 | ; Unless required by applicable law or agreed to in writing, 12 | ; software distributed under the License is distributed on an 13 | ; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ; KIND, either express or implied. See the License for the 15 | ; specific language governing permissions and limitations 16 | ; under the License. 17 | 18 | [httpd] 19 | port = 0 20 | -------------------------------------------------------------------------------- /version.mk: -------------------------------------------------------------------------------- 1 | vsn_major=3 2 | vsn_minor=5 3 | vsn_patch=0 4 | --------------------------------------------------------------------------------