diff options
author | Randall Leeds <randall@apache.org> | 2011-10-04 14:10:13 -0700 |
---|---|---|
committer | Randall Leeds <randall@apache.org> | 2011-10-04 14:11:33 -0700 |
commit | 3c24a94dde5598ec03e0e6d8dec5b697b4eff247 (patch) | |
tree | 78035b273bc238b31eefe8282df218e4dd5c3a17 | |
parent | 37afbce7cf80289783b2eb813d023fbde4ad69fd (diff) | |
download | couchdb-3c24a94dde5598ec03e0e6d8dec5b697b4eff247.tar.gz |
vendor info in welcome message (COUCHDB-1285)
-rw-r--r-- | etc/couchdb/Makefile.am | 6 | ||||
-rw-r--r-- | etc/couchdb/default.ini.tpl.in | 3 | ||||
-rw-r--r-- | src/couchdb/couch_httpd_misc_handlers.erl | 8 |
3 files changed, 16 insertions, 1 deletions
diff --git a/etc/couchdb/Makefile.am b/etc/couchdb/Makefile.am index 9367ceacc..dd1054b6b 100644 --- a/etc/couchdb/Makefile.am +++ b/etc/couchdb/Makefile.am @@ -35,6 +35,8 @@ default.ini: default.ini.tpl -e "s|%localstaterundir%|../var/run/couchdb|g" \ -e "s|%couchprivlibdir%|../lib/couch-$(version)/priv/lib|g" \ -e "s|%couchjs_command_name%|couchjs.exe|g" \ + -e "s|%package_author_name%|$(package_author_name)|g" \ + -e "s|%version%|$(version)|g" \ < $< > $@ else default.ini: default.ini.tpl @@ -47,6 +49,8 @@ default.ini: default.ini.tpl -e "s|%localstaterundir%|$(localstaterundir)|g" \ -e "s|%couchprivlibdir%|$(couchprivlibdir)|g" \ -e "s|%couchjs_command_name%|$(couchjs_command_name)|g" \ + -e "s|%package_author_name%|$(package_author_name)|g" \ + -e "s|%version%|$(version)|g" \ < $< > $@ endif @@ -60,6 +64,8 @@ default_dev.ini: default.ini.tpl -e "s|%localstaterundir%|$(abs_top_builddir)/tmp/run|g" \ -e "s|%couchprivlibdir%|$(devcouchprivlibdir)|g" \ -e "s|%couchjs_command_name%|$(couchjs_dev_command_name)|g" \ + -e "s|%package_author_name%|$(package_author_name)|g" \ + -e "s|%version%|$(version)|g" \ < $< > $@ # Noah said to not specify local.ini but it borks diff --git a/etc/couchdb/default.ini.tpl.in b/etc/couchdb/default.ini.tpl.in index 12bc20f01..7fd3cb4f9 100644 --- a/etc/couchdb/default.ini.tpl.in +++ b/etc/couchdb/default.ini.tpl.in @@ -1,6 +1,9 @@ ; @configure_input@ ; Upgrading CouchDB will overwrite this file. +[vendor] +name = %package_author_name% +version = %version% [couchdb] database_dir = %localstatelibdir% diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl index ff355715c..8abf0aad9 100644 --- a/src/couchdb/couch_httpd_misc_handlers.erl +++ b/src/couchdb/couch_httpd_misc_handlers.erl @@ -33,7 +33,13 @@ handle_welcome_req(#httpd{method='GET'}=Req, WelcomeMessage) -> send_json(Req, {[ {couchdb, WelcomeMessage}, {version, list_to_binary(couch_server:get_version())} - ]}); + ] ++ case couch_config:get("vendor") of + [] -> + []; + Properties -> + [{vendor, {[{?l2b(K), ?l2b(V)} || {K, V} <- Properties]}}] + end + }); handle_welcome_req(Req, _) -> send_method_not_allowed(Req, "GET,HEAD"). |