From 264cb29e3014acdece32f2e0167b060e22fc9060 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Mon, 23 Aug 2010 23:19:25 -0400 Subject: no more rebar templates in configure --- .gitignore | 6 +- .rebar/templates/Makefile | 34 ---------- .rebar/templates/etc/default.ini | 123 ----------------------------------- .rebar/templates/production.template | 8 --- .rebar/templates/rebar.config | 15 ----- Makefile | 35 ++++++++++ configure | 21 ++++-- rebar.config | 15 +++++ rel/overlay/etc/default.ini | 123 +++++++++++++++++++++++++++++++++++ rel/reltool.config | 12 ++-- 10 files changed, 199 insertions(+), 193 deletions(-) delete mode 100644 .rebar/templates/Makefile delete mode 100644 .rebar/templates/etc/default.ini delete mode 100644 .rebar/templates/production.template delete mode 100644 .rebar/templates/rebar.config create mode 100644 Makefile create mode 100644 rebar.config create mode 100644 rel/overlay/etc/default.ini diff --git a/.gitignore b/.gitignore index d2c8acb1..c231db32 100644 --- a/.gitignore +++ b/.gitignore @@ -6,11 +6,9 @@ erl_crash.dump # building apps/*/ebin/ -rel/overlay/etc/default*.ini rel/dbcore -rel/overlay/erts-vsn/bin/erl_call -Makefile -rebar.config +rel/overlay.config +install.mk # scons building couchjs/.sconf_temp/ diff --git a/.rebar/templates/Makefile b/.rebar/templates/Makefile deleted file mode 100644 index dacd2012..00000000 --- a/.rebar/templates/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -all: compile - -compile: - @echo "==> couchjs (compile)" - @cd couchjs && python scons/scons.py - @./rebar compile - -clean: - @echo "==> couchjs (clean)" - @cd couchjs && python scons/scons.py --clean - @./rebar clean - -check: - @./rebar eunit - @ERL_LIBS="`pwd`/apps" prove apps/couch/test/etap/*.t - -dist: compile - @rm -rf rel/dbcore - @./rebar generate - @mkdir -p rel/dbcore/var/share/server - @cp couchjs/build/main.js rel/dbcore/var/share/server/ - @cp couchjs/build/couchjs rel/dbcore/bin/ - -distclean: clean - @rm -rf rel/dbcore - @rm -f rel/overlay/etc/default.ini - -install: dist - @mkdir -p {{prefix}}/dbcore/ - @cp -R rel/dbcore/* {{prefix}}/dbcore/ - @mkdir -p {{data_dir}} - @chown {{user}} {{data_dir}} - @mkdir -p {{view_dir}} - @chown {{user}} {{view_dir}} diff --git a/.rebar/templates/etc/default.ini b/.rebar/templates/etc/default.ini deleted file mode 100644 index d055217e..00000000 --- a/.rebar/templates/etc/default.ini +++ /dev/null @@ -1,123 +0,0 @@ -[couchdb] -database_dir = {{data_dir}} -view_index_dir = {{view_dir}} -max_document_size = 67108864 -os_process_timeout = 5000 -max_dbs_open = 500 -max_view_index_lag = 9999999999 -delayed_commits = false - -[cluster] -q=8 -r=2 -w=2 -n=3 - -[chttpd] -port = 5984 -backlog = 512 -docroot = {{core_dir}}/var/share/www - -[httpd] -port = 5986 -bind_address = 0.0.0.0 -authentication_handlers = {couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler} -default_handler = {couch_httpd_db, handle_request} -WWW-Authenticate = Basic realm="Cloudant Private Database" -backlog = 512 -secure_rewrites = true - -[log] -file = /dev/null -level = info - -[metrics] -db = metrics_specs - -[couch_httpd_auth] -authentication_redirect = /_utils/session.html -authentication_db = users -secret = replace this with a real secret in your local.ini file -require_valid_user = false -timeout = 600 ; number of seconds before automatic logout -auth_cache_size = 50 ; size is number of cache entries - -[query_servers] -javascript = {{core_dir}}/bin/couchjs {{core_dir}}/var/share/server/main.js - -[query_server_config] -reduce_limit = true - -[daemons] -view_manager={couch_view, start_link, []} -external_manager={couch_external_manager, 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, []} - -[httpd_global_handlers] -/ = {couch_httpd_misc_handlers, handle_welcome_req, <<"Welcome">>} -favicon.ico = {couch_httpd_misc_handlers, handle_favicon_req, "{{core_dir}}/var/share/www"} - -_utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "{{core_dir}}/var/share/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} -_user = {couch_httpd_auth, handle_user_req} -_metrics = {couch_httpd_metrics_handlers, handle_metrics_req} -_system = {chttpd_misc, handle_system_req} - -_cloudant = {showroom_httpd_admin, handle_cloudant_req} -_membership = {membership_httpd, handle_membership_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} -_search = {couch_httpd_external, handle_external_req, <<"search">>} - -[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} - -[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] -max_http_sessions = 10 -max_http_pipeline_size = 10 \ No newline at end of file diff --git a/.rebar/templates/production.template b/.rebar/templates/production.template deleted file mode 100644 index ef367fc2..00000000 --- a/.rebar/templates/production.template +++ /dev/null @@ -1,8 +0,0 @@ -{variables, [{prefix, "{{prefix}}"}, - {core_dir, "{{prefix}}/dbcore"}, - {data_dir, "/srv/db"}, - {view_dir, "/srv/view_index"}, - {user, "dbcore"}]}. -{template, "./Makefile", "Makefile"}. -{template, "./etc/default.ini", "rel/overlay/etc/default.ini"}. -{file, "rebar.config", "rebar.config"}. diff --git a/.rebar/templates/rebar.config b/.rebar/templates/rebar.config deleted file mode 100644 index f2b91397..00000000 --- a/.rebar/templates/rebar.config +++ /dev/null @@ -1,15 +0,0 @@ -{sub_dirs, [ - "apps/ibrowse", - "apps/couch", - "apps/chttpd", - "apps/etap", - "apps/fabric", - "apps/mem3", - "apps/mochiweb", - "apps/oauth", - "apps/rexi", - "rel" -]}. -{cover_enabled, true}. -{erl_opts, [debug_info, fail_on_warning]}. -{lib_dirs, ["apps"]}. diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..d80f5fbe --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +all: compile + +compile: + @echo "==> couchjs (compile)" + @cd couchjs && python scons/scons.py + @./rebar compile + +clean: + @echo "==> couchjs (clean)" + @cd couchjs && python scons/scons.py --clean + @./rebar clean + +check: + @./rebar eunit + @ERL_LIBS="`pwd`/apps" prove apps/couch/test/etap/*.t + +dist: compile + @rm -rf rel/dbcore + @./rebar generate + @mkdir -p rel/dbcore/var/share/server + @cp couchjs/build/main.js rel/dbcore/var/share/server/ + @cp couchjs/build/couchjs rel/dbcore/bin/ + +distclean: clean + @rm -rf rel/dbcore + @rm -f rel/overlay/etc/default.ini + +include install.mk +install: dist + @mkdir -p $(prefix) + @cp -R rel/dbcore/* $(prefix) + @mkdir -p $(data_dir) + @chown $(user) $(data_dir) + @mkdir -p $(view_dir) + @chown $(user) $(view_dir) diff --git a/configure b/configure index 7127d6fe..96660243 100755 --- a/configure +++ b/configure @@ -5,7 +5,6 @@ function quit { } PREFIX="/opt" -TEMPLATE="production" DATA="/srv/db" VIEW="/srv/view_index" DBCORE_USER=`whoami` @@ -41,9 +40,21 @@ do esac done +echo "==> configuring dbcore in rel/overlay.config" +cat > rel/overlay.config << EOF +{prefix, "$PREFIX"}. +{core_dir, "$PREFIX/dbcore"}. +{data_dir, "$DATA"}. +{view_dir, "$VIEW"}. +{user, "$DBCORE_USER"}. +EOF -echo "configuring dbcore" +cat > install.mk << EOF +# The contents of this file are auto-generated by configure +prefix = $PREFIX +data_dir = $DATA +view_dir = $VIEW +user = $DBCORE_USER +EOF -rm -f rebar.config -# dbcore template -./rebar create template=$TEMPLATE prefix=$PREFIX data_dir=$DATA view_dir=$VIEW user=$DBCORE_USER force=1 +cat rel/overlay.config diff --git a/rebar.config b/rebar.config new file mode 100644 index 00000000..f2b91397 --- /dev/null +++ b/rebar.config @@ -0,0 +1,15 @@ +{sub_dirs, [ + "apps/ibrowse", + "apps/couch", + "apps/chttpd", + "apps/etap", + "apps/fabric", + "apps/mem3", + "apps/mochiweb", + "apps/oauth", + "apps/rexi", + "rel" +]}. +{cover_enabled, true}. +{erl_opts, [debug_info, fail_on_warning]}. +{lib_dirs, ["apps"]}. diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini new file mode 100644 index 00000000..d055217e --- /dev/null +++ b/rel/overlay/etc/default.ini @@ -0,0 +1,123 @@ +[couchdb] +database_dir = {{data_dir}} +view_index_dir = {{view_dir}} +max_document_size = 67108864 +os_process_timeout = 5000 +max_dbs_open = 500 +max_view_index_lag = 9999999999 +delayed_commits = false + +[cluster] +q=8 +r=2 +w=2 +n=3 + +[chttpd] +port = 5984 +backlog = 512 +docroot = {{core_dir}}/var/share/www + +[httpd] +port = 5986 +bind_address = 0.0.0.0 +authentication_handlers = {couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler} +default_handler = {couch_httpd_db, handle_request} +WWW-Authenticate = Basic realm="Cloudant Private Database" +backlog = 512 +secure_rewrites = true + +[log] +file = /dev/null +level = info + +[metrics] +db = metrics_specs + +[couch_httpd_auth] +authentication_redirect = /_utils/session.html +authentication_db = users +secret = replace this with a real secret in your local.ini file +require_valid_user = false +timeout = 600 ; number of seconds before automatic logout +auth_cache_size = 50 ; size is number of cache entries + +[query_servers] +javascript = {{core_dir}}/bin/couchjs {{core_dir}}/var/share/server/main.js + +[query_server_config] +reduce_limit = true + +[daemons] +view_manager={couch_view, start_link, []} +external_manager={couch_external_manager, 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, []} + +[httpd_global_handlers] +/ = {couch_httpd_misc_handlers, handle_welcome_req, <<"Welcome">>} +favicon.ico = {couch_httpd_misc_handlers, handle_favicon_req, "{{core_dir}}/var/share/www"} + +_utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "{{core_dir}}/var/share/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} +_user = {couch_httpd_auth, handle_user_req} +_metrics = {couch_httpd_metrics_handlers, handle_metrics_req} +_system = {chttpd_misc, handle_system_req} + +_cloudant = {showroom_httpd_admin, handle_cloudant_req} +_membership = {membership_httpd, handle_membership_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} +_search = {couch_httpd_external, handle_external_req, <<"search">>} + +[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} + +[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] +max_http_sessions = 10 +max_http_pipeline_size = 10 \ No newline at end of file diff --git a/rel/reltool.config b/rel/reltool.config index fe845140..1bfe94e8 100644 --- a/rel/reltool.config +++ b/rel/reltool.config @@ -34,8 +34,12 @@ {app, chttpd, [{incl_cond, include}]} ]}. +{overlay_vars, "overlay.config"}. {overlay, [ - {copy, "overlay/bin"}, - {copy, "overlay/etc"}, - {copy, "overlay/var"} - ]}. + {copy, "overlay/bin"}, + {copy, "overlay/etc"}, + {copy, "overlay/var"}, + {copy, "../couchjs/build/couchjs", "bin/couchjs"}, + {copy, "../couchjs/build/main.js", "var/share/server/main.js"}, + {template, "overlay/etc/default.ini", "etc/default.ini"} +]}. -- cgit v1.2.3