diff options
Diffstat (limited to '1.1.x/etc/couchdb')
-rw-r--r-- | 1.1.x/etc/couchdb/Makefile.am | 86 | ||||
-rw-r--r-- | 1.1.x/etc/couchdb/default.ini.tpl.in | 148 | ||||
-rw-r--r-- | 1.1.x/etc/couchdb/local.ini | 74 |
3 files changed, 308 insertions, 0 deletions
diff --git a/1.1.x/etc/couchdb/Makefile.am b/1.1.x/etc/couchdb/Makefile.am new file mode 100644 index 00000000..9367ceac --- /dev/null +++ b/1.1.x/etc/couchdb/Makefile.am @@ -0,0 +1,86 @@ +## Licensed under the Apache License, Version 2.0 (the "License"); you may not +## use this file except in compliance with the License. You may obtain a copy of +## the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +## License for the specific language governing permissions and limitations under +## the License. + +couchprivlibdir = $(localerlanglibdir)/couch-$(version)/priv/lib +devcouchprivlibdir = $(abs_top_builddir)/src/couchdb/priv/.libs + +localconf_DATA = default.ini +noinst_DATA = default_dev.ini local_dev.ini + +EXTRA_DIST = local.ini + +CLEANFILES = $(localconf_DATA) $(noinst_DATA) + +transform = @program_transform_name@ +couchjs_command_name = `echo couchjs | sed '$(transform)'` +couchjs_dev_command_name = `echo couchjs_dev | sed '$(transform)'` + +if WINDOWS +default.ini: default.ini.tpl + sed -e "s|%bindir%|.|g" \ + -e "s|%localconfdir%|$(localconfdir)|g" \ + -e "s|%localdatadir%|../share/couchdb|g" \ + -e "s|%localbuilddatadir%|../share/couchdb|g" \ + -e "s|%localstatelibdir%|../var/lib/couchdb|g" \ + -e "s|%localstatelogdir%|../var/log/couchdb|g" \ + -e "s|%localstaterundir%|../var/run/couchdb|g" \ + -e "s|%couchprivlibdir%|../lib/couch-$(version)/priv/lib|g" \ + -e "s|%couchjs_command_name%|couchjs.exe|g" \ + < $< > $@ +else +default.ini: default.ini.tpl + sed -e "s|%bindir%|$(bindir)|g" \ + -e "s|%localconfdir%|$(localconfdir)|g" \ + -e "s|%localdatadir%|$(localdatadir)|g" \ + -e "s|%localbuilddatadir%|$(localdatadir)|g" \ + -e "s|%localstatelibdir%|$(localstatelibdir)|g" \ + -e "s|%localstatelogdir%|$(localstatelogdir)|g" \ + -e "s|%localstaterundir%|$(localstaterundir)|g" \ + -e "s|%couchprivlibdir%|$(couchprivlibdir)|g" \ + -e "s|%couchjs_command_name%|$(couchjs_command_name)|g" \ + < $< > $@ +endif + +default_dev.ini: default.ini.tpl + sed -e "s|%bindir%|$(abs_top_builddir)/bin|g" \ + -e "s|%localconfdir%|$(abs_top_builddir)/etc/couchdb|g" \ + -e "s|%localdatadir%|$(abs_top_srcdir)/share|g" \ + -e "s|%localbuilddatadir%|$(abs_top_builddir)/share|g" \ + -e "s|%localstatelibdir%|$(abs_top_builddir)/tmp/lib|g" \ + -e "s|%localstatelogdir%|$(abs_top_builddir)/tmp/log|g" \ + -e "s|%localstaterundir%|$(abs_top_builddir)/tmp/run|g" \ + -e "s|%couchprivlibdir%|$(devcouchprivlibdir)|g" \ + -e "s|%couchjs_command_name%|$(couchjs_dev_command_name)|g" \ + < $< > $@ + +# Noah said to not specify local.ini but it borks +# VPATH builds that make distcheck uses. +local_dev.ini: local.ini + if test ! -f "$@"; then \ + cp $< $@; \ + fi + +install-data-hook: + if test ! -f "$(DESTDIR)$(localconfdir)/local.ini"; then \ + cp $(srcdir)/local.ini "$(DESTDIR)$(localconfdir)/local.ini"; \ + fi + if test ! "$(mkdir_p)" = ""; then \ + $(mkdir_p) "$(DESTDIR)$(localconfdir)/default.d"; \ + $(mkdir_p) "$(DESTDIR)$(localconfdir)/local.d"; \ + else \ + echo "WARNING: You may have to create these directories by hand."; \ + mkdir -p "$(DESTDIR)$(localconfdir)/default.d"; \ + mkdir -p "$(DESTDIR)$(localconfdir)/local.d"; \ + fi + +uninstall-local: + rm -f "$(DESTDIR)/$(localconfdir)/local.ini" diff --git a/1.1.x/etc/couchdb/default.ini.tpl.in b/1.1.x/etc/couchdb/default.ini.tpl.in new file mode 100644 index 00000000..f5dc24af --- /dev/null +++ b/1.1.x/etc/couchdb/default.ini.tpl.in @@ -0,0 +1,148 @@ +; @configure_input@ + +; Upgrading CouchDB will overwrite this file. + +[couchdb] +database_dir = %localstatelibdir% +view_index_dir = %localstatelibdir% +util_driver_dir = %couchprivlibdir% +max_document_size = 4294967296 ; 4 GB +os_process_timeout = 5000 ; 5 seconds. for view and external servers. +max_dbs_open = 100 +delayed_commits = true ; set this to false to ensure an fsync before 201 Created is returned +uri_file = %localstaterundir%/couch.uri + +[httpd] +port = 5984 +bind_address = 127.0.0.1 +authentication_handlers = {couch_httpd_oauth, oauth_authentication_handler}, {couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler} +default_handler = {couch_httpd_db, handle_request} +secure_rewrites = true +vhost_global_handlers = _utils, _uuids, _session, _oauth, _users +allow_jsonp = false +; Options for the MochiWeb HTTP server. +;server_options = [{backlog, 128}, {acceptor_pool_size, 16}] +; For more socket options, consult Erlang's module 'inet' man page. +;socket_options = [{recbuf, 262144}, {sndbuf, 262144}, {nodelay, true}] + +[ssl] +port = 6984 + +[log] +file = %localstatelogdir%/couch.log +level = info +include_sasl = true + +[couch_httpd_auth] +authentication_db = _users +authentication_redirect = /_utils/session.html +require_valid_user = false +timeout = 43200 ; (default to 12 hours) number of seconds before automatic logout +auth_cache_size = 50 ; size is number of cache entries + +[query_servers] +javascript = %bindir%/%couchjs_command_name% %localbuilddatadir%/server/main.js + +; Changing reduce_limit to false will disable reduce_limit. +; If you think you're hitting reduce_limit with a "good" reduce function, +; please let us know on the mailing list so we can fine tune the heuristic. +[query_server_config] +reduce_limit = true +os_process_limit = 25 + +[daemons] +view_manager={couch_view, start_link, []} +external_manager={couch_external_manager, start_link, []} +db_update_notifier={couch_db_update_notifier_sup, start_link, []} +query_servers={couch_query_servers, start_link, []} +httpd={couch_httpd, start_link, []} +stats_aggregator={couch_stats_aggregator, start, []} +stats_collector={couch_stats_collector, start, []} +uuids={couch_uuids, start, []} +auth_cache={couch_auth_cache, start_link, []} +replication_manager={couch_replication_manager, start_link, []} +vhosts={couch_httpd_vhost, start_link, []} +os_daemons={couch_os_daemons, start_link, []} + +[httpd_global_handlers] +/ = {couch_httpd_misc_handlers, handle_welcome_req, <<"Welcome">>} +favicon.ico = {couch_httpd_misc_handlers, handle_favicon_req, "%localdatadir%/www"} + +_utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "%localdatadir%/www"} +_all_dbs = {couch_httpd_misc_handlers, handle_all_dbs_req} +_active_tasks = {couch_httpd_misc_handlers, handle_task_status_req} +_config = {couch_httpd_misc_handlers, handle_config_req} +_replicate = {couch_httpd_misc_handlers, handle_replicate_req} +_uuids = {couch_httpd_misc_handlers, handle_uuids_req} +_restart = {couch_httpd_misc_handlers, handle_restart_req} +_stats = {couch_httpd_stats_handlers, handle_stats_req} +_log = {couch_httpd_misc_handlers, handle_log_req} +_session = {couch_httpd_auth, handle_session_req} +_oauth = {couch_httpd_oauth, handle_oauth_req} + +[httpd_db_handlers] +_view_cleanup = {couch_httpd_db, handle_view_cleanup_req} +_compact = {couch_httpd_db, handle_compact_req} +_design = {couch_httpd_db, handle_design_req} +_temp_view = {couch_httpd_view, handle_temp_view_req} +_changes = {couch_httpd_db, handle_changes_req} + +; The external module takes an optional argument allowing you to narrow it to a +; single script. Otherwise the script name is inferred from the first path section +; after _external's own path. +; _mypath = {couch_httpd_external, handle_external_req, <<"mykey">>} +; _external = {couch_httpd_external, handle_external_req} + +[httpd_design_handlers] +_view = {couch_httpd_view, handle_view_req} +_show = {couch_httpd_show, handle_doc_show_req} +_list = {couch_httpd_show, handle_view_list_req} +_info = {couch_httpd_db, handle_design_info_req} +_rewrite = {couch_httpd_rewrite, handle_rewrite_req} +_update = {couch_httpd_show, handle_doc_update_req} + +; enable external as an httpd handler, then link it with commands here. +; note, this api is still under consideration. +; [external] +; mykey = /path/to/mycommand + +; Here you can setup commands for CouchDB to manage +; while it is alive. It will attempt to keep each command +; alive if it exits. +; [os_daemons] +; some_daemon_name = /path/to/script -with args + + +[uuids] +; Known algorithms: +; random - 128 bits of random awesome +; All awesome, all the time. +; sequential - monotonically increasing ids with random increments +; First 26 hex characters are random. Last 6 increment in +; random amounts until an overflow occurs. On overflow, the +; random prefix is regenerated and the process starts over. +; utc_random - Time since Jan 1, 1970 UTC with microseconds +; First 14 characters are the time in hex. Last 18 are random. +algorithm = sequential + +[stats] +; rate is in milliseconds +rate = 1000 +; sample intervals are in seconds +samples = [0, 60, 300, 900] + +[attachments] +compression_level = 8 ; from 1 (lowest, fastest) to 9 (highest, slowest), 0 to disable compression +compressible_types = text/*, application/javascript, application/json, application/xml + +[replicator] +db = _replicator +max_replication_retry_count = 10 +max_http_sessions = 20 +max_http_pipeline_size = 50 +; set to true to validate peer certificates +verify_ssl_certificates = false +; file containing a list of peer trusted certificates (PEM format) +; ssl_trusted_certificates_file = /etc/ssl/certs/ca-certificates.crt +; maximum peer certificate depth (must be set even if certificate validation is off) +ssl_certificate_max_depth = 3 diff --git a/1.1.x/etc/couchdb/local.ini b/1.1.x/etc/couchdb/local.ini new file mode 100644 index 00000000..33380a32 --- /dev/null +++ b/1.1.x/etc/couchdb/local.ini @@ -0,0 +1,74 @@ +; CouchDB Configuration Settings + +; Custom settings should be made in this file. They will override settings +; in default.ini, but unlike changes made to default.ini, this file won't be +; overwritten on server upgrade. + +[couchdb] +;max_document_size = 4294967296 ; bytes + +[httpd] +;port = 5984 +;bind_address = 127.0.0.1 +; Options for the MochiWeb HTTP server. +;server_options = [{backlog, 128}, {acceptor_pool_size, 16}] +; For more socket options, consult Erlang's module 'inet' man page. +;socket_options = [{recbuf, 262144}, {sndbuf, 262144}, {nodelay, true}] + +; Uncomment next line to trigger basic-auth popup on unauthorized requests. +;WWW-Authenticate = Basic realm="administrator" + +; Uncomment next line to set the configuration modification whitelist. Only +; whitelisted values may be changed via the /_config URLs. To allow the admin +; to change this value over HTTP, remember to include {httpd,config_whitelist} +; itself. Excluding it from the list would require editing this file to update +; the whitelist. +;config_whitelist = [{httpd,config_whitelist}, {log,level}, {etc,etc}] + +[httpd_global_handlers] +;_google = {couch_httpd_proxy, handle_proxy_req, <<"http://www.google.com">>} + +[couch_httpd_auth] +; If you set this to true, you should also uncomment the WWW-Authenticate line +; above. If you don't configure a WWW-Authenticate header, CouchDB will send +; Basic realm="server" in order to prevent you getting logged out. +; require_valid_user = false + +[log] +;level = debug + +[os_daemons] +; For any commands listed here, CouchDB will attempt to ensure that +; the process remains alive while CouchDB runs as well as shut them +; down when CouchDB exits. +;foo = /path/to/command -with args + +[daemons] +; enable SSL support by uncommenting the following line and supply the PEM's below. +; the default ssl port CouchDB listens on is 6984 +; httpsd = {couch_httpd, start_link, [https]} + +[ssl] +;cert_file = /full/path/to/server_cert.pem +;key_file = /full/path/to/server_key.pem + +; To enable Virtual Hosts in CouchDB, add a vhost = path directive. All requests to +; the Virual Host will be redirected to the path. In the example below all requests +; to http://example.com/ are redirected to /database. +; If you run CouchDB on a specific port, include the port number in the vhost: +; example.com:5984 = /database + +[vhosts] +;example.com = /database/ + +[update_notification] +;unique notifier name=/full/path/to/exe -with "cmd line arg" + +; To create an admin account uncomment the '[admins]' section below and add a +; line in the format 'username = password'. When you next start CouchDB, it +; will change the password to a hash (so that your passwords don't linger +; around in plain-text files). You can add more admin accounts with more +; 'username = password' lines. Don't forget to restart CouchDB after +; changing this. +[admins] +;admin = mysecretpassword |