Skip to content

Commit 451fa95

Browse files
author
garrett
committed
Copied ech and updated to latest couchdb.
1 parent 2309ea9 commit 451fa95

26 files changed

+2306
-0
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
erl_crash.dump
2+
*.couch
3+
*.beam
4+
lib/mochiweb
5+
lib/couch

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
This is the MIT license.
2+
3+
Copyright (c) 2010 Garrett Smith
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9+
of the Software, and to permit persons to whom the Software is furnished to do
10+
so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include ./make/project.mk
2+
3+
shell: apps
4+
cd lib/couchlib && make shell
5+
6+
test: apps
7+
cd lib/couchlib; make TESTS=couchlib_tests test

lib/Makefile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apps: link-couch
2+
cd couch && make
3+
cd mochiweb && make
4+
cd couchlib && make
5+
6+
clean:
7+
rm -f couch
8+
rm -f mochiweb
9+
cd couchlib && make clean
10+
11+
# Creates symlinks to couchdb source dirs
12+
link-couch:
13+
@if [ ! -d "$(COUCH_HOME)" ]; then \
14+
echo "set COUCH_HOME to couchdb root dir"; exit 1; fi
15+
ln -fs $(COUCH_HOME)/src/couchdb couch
16+
ln -fs $(COUCH_HOME)/src/couchdb couch/ebin
17+
ln -fs $(COUCH_HOME)/src/mochiweb mochiweb
18+
ln -fs $(COUCH_HOME)/src/mochiweb mochiweb/ebin

lib/couchlib/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-include ../../make/app.mk

lib/couchlib/ebin/couchlib.app

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
%%% -*-erlang-*-
2+
{application, couchlib,
3+
[{description, "Embedded CouchDB"},
4+
{vsn, "0.0"},
5+
{modules, []},
6+
{registered, []},
7+
{applications, [kernel,
8+
stdlib,
9+
sasl,
10+
crypto]},
11+
{mod, {couchlib_app, []}}]}.

lib/couchlib/priv/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.config
2+
*.ini

lib/couchlib/priv/config.in

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
%%% -*-erlang-*-
2+
[{ech, [{ini, ["PATH-TO-INI"]}]}].

lib/couchlib/priv/ini.in

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
; Copy of CouchDB default.ini from source package. Use as a template.
2+
;
3+
; Default settings are commented out - uncomment and optionally change to
4+
; enable. The couchdb application will work without an ini file.
5+
;
6+
; To use, rename the file and configure as needed. Reference it in the
7+
; application config for couchdb. For example, in a config file:
8+
;
9+
; [{couchdb, [{ini, "path/to/your.ini"}]}].
10+
;
11+
; You can also specify as a command line arg to erl:
12+
;
13+
; erl -couchdb ini "path/to/your.ini" ...
14+
15+
[couchdb]
16+
;;database_dir = /var/lib/couchdb
17+
;;view_index_dir = /var/lib/couchdb
18+
;;util_driver_dir = /usr/lib/couchdb/erlang/lib/couch-1.0.0/priv/lib
19+
;;max_document_size = 4294967296 ; 4 GB
20+
;;max_attachment_chunk_size = 4294967296 ; 4GB
21+
;;os_process_timeout = 5000 ; 5 seconds. for view and external servers.
22+
;;max_dbs_open = 100
23+
;;delayed_commits = true ; set this to false to ensure an fsync before 201 Created is returned
24+
;;uri_file = /var/lib/couchdb/couch.uri
25+
26+
[httpd]
27+
;;port = 5984
28+
;;bind_address = 127.0.0.1
29+
;;max_connections = 2048
30+
;;authentication_handlers = {couch_httpd_oauth, oauth_authentication_handler}, {c;ouch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}
31+
;;default_handler = {couch_httpd_db, handle_request}
32+
;;secure_rewrites = true
33+
;;vhost_global_handlers = _utils, _uuids, _session, _oauth, _users
34+
;;allow_jsonp = false
35+
36+
[log]
37+
;;file = /var/log/couchdb/couch.log
38+
;;level = info
39+
;;include_sasl = true
40+
41+
[couch_httpd_auth]
42+
;;authentication_db = _users
43+
;;authentication_redirect = /_utils/session.html
44+
;;require_valid_user = false
45+
;;timeout = 600 ; number of seconds before automatic logout
46+
;;auth_cache_size = 50 ; size is number of cache entries
47+
48+
[query_servers]
49+
;;javascript = /usr/bin/couchjs /usr/share/couchdb/server/main.js
50+
51+
[native_query_servers]
52+
;;erlang = {couch_native_process, start_link, []}
53+
54+
; Changing reduce_limit to false will disable reduce_limit.
55+
; If you think you're hitting reduce_limit with a "good" reduce function,
56+
; please let us know on the mailing list so we can fine tune the heuristic.
57+
[query_server_config]
58+
;;reduce_limit = true
59+
60+
; enable external as an httpd handler, then link it with commands here.
61+
; note, this api is still under consideration.
62+
; [external]
63+
; mykey = /path/to/mycommand
64+
65+
[daemons]
66+
;;view_manager={couch_view, start_link, []}
67+
;;external_manager={couch_external_manager, start_link, []}
68+
;;db_update_notifier={couch_db_update_notifier_sup, start_link, []}
69+
;;query_servers={couch_query_servers, start_link, []}
70+
;;httpd={couch_httpd, start_link, []}
71+
;;stats_aggregator={couch_stats_aggregator, start, []}
72+
;;stats_collector={couch_stats_collector, start, []}
73+
;;uuids={couch_uuids, start, []}
74+
;;auth_cache={couch_auth_cache, start_link, []}
75+
76+
[httpd_global_handlers]
77+
;;/ = {couch_httpd_misc_handlers, handle_welcome_req, <<"Welcome">>}
78+
;;favicon.ico = {couch_httpd_misc_handlers, handle_favicon_req, "/usr/share/couchdb/www"}
79+
80+
;;_utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "/usr/share/couchdb/www"}
81+
;;_all_dbs = {couch_httpd_misc_handlers, handle_all_dbs_req}
82+
;;_active_tasks = {couch_httpd_misc_handlers, handle_task_status_req}
83+
;;_config = {couch_httpd_misc_handlers, handle_config_req}
84+
;;_replicate = {couch_httpd_misc_handlers, handle_replicate_req}
85+
;;_uuids = {couch_httpd_misc_handlers, handle_uuids_req}
86+
;;_restart = {couch_httpd_misc_handlers, handle_restart_req}
87+
;;_stats = {couch_httpd_stats_handlers, handle_stats_req}
88+
;;_log = {couch_httpd_misc_handlers, handle_log_req}
89+
;;_session = {couch_httpd_auth, handle_session_req}
90+
;;_oauth = {couch_httpd_oauth, handle_oauth_req}
91+
92+
[httpd_db_handlers]
93+
;;_view_cleanup = {couch_httpd_db, handle_view_cleanup_req}
94+
;;_compact = {couch_httpd_db, handle_compact_req}
95+
;;_design = {couch_httpd_db, handle_design_req}
96+
;;_temp_view = {couch_httpd_view, handle_temp_view_req}
97+
;;_changes = {couch_httpd_db, handle_changes_req}
98+
99+
; The external module takes an optional argument allowing you to narrow it to a
100+
; single script. Otherwise the script name is inferred from the first path section
101+
; after _external's own path.
102+
; _mypath = {couch_httpd_external, handle_external_req, <<"mykey">>}
103+
; _external = {couch_httpd_external, handle_external_req}
104+
105+
[httpd_design_handlers]
106+
;;_view = {couch_httpd_view, handle_view_req}
107+
;;_show = {couch_httpd_show, handle_doc_show_req}
108+
;;_list = {couch_httpd_show, handle_view_list_req}
109+
;;_info = {couch_httpd_db, handle_design_info_req}
110+
;;_rewrite = {couch_httpd_rewrite, handle_rewrite_req}
111+
;;_update = {couch_httpd_show, handle_doc_update_req}
112+
113+
[uuids]
114+
; Known algorithms:
115+
; random - 128 bits of random awesome
116+
; All awesome, all the time.
117+
; sequential - monotonically increasing ids with random increments
118+
; First 26 hex characters are random. Last 6 increment in
119+
; random amounts until an overflow occurs. On overflow, the
120+
; random prefix is regenerated and the process starts over.
121+
; utc_random - Time since Jan 1, 1970 UTC with microseconds
122+
; First 14 characters are the time in hex. Last 18 are random.
123+
;;algorithm = sequential
124+
125+
[stats]
126+
; rate is in milliseconds
127+
;;rate = 1000
128+
; sample intervals are in seconds
129+
;;samples = [0, 60, 300, 900]
130+
131+
[attachments]
132+
;;compression_level = 8 ; from 1 (lowest, fastest) to 9 (highest, slowest), 0 to disable compression
133+
;;compressible_types = text/*, application/javascript, application/json, application/xml
134+
135+
[replicator]
136+
;;max_http_sessions = 10
137+
;;max_http_pipeline_size = 10

lib/couchlib/src/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
DEPENDS :=
2+
CONFIG := empty
3+
SHELL_OPTS := -config ../priv/$(CONFIG) -s reloader -s ech
4+
include ../../../make/app_src.mk

0 commit comments

Comments
 (0)