|
|
|
@@ -116,16 +116,16 @@ action = function(host, port)
|
|
|
|
|
|
|
|
|
|
|
|
-- Additionally, we can check if authentication is used :
|
|
|
|
-- Additionally, we can check if authentication is used :
|
|
|
|
-- The following actions are restricted if auth is used
|
|
|
|
-- The following actions are restricted if auth is used
|
|
|
|
-- create db (PUT /database)
|
|
|
|
-- create db (PUT /database)
|
|
|
|
-- delete db (DELETE /database)
|
|
|
|
-- delete db (DELETE /database)
|
|
|
|
-- Creating a design document (PUT /database/_design/app)
|
|
|
|
-- Creating a design document (PUT /database/_design/app)
|
|
|
|
-- Updating a design document (PUT /database/_design/app?rev=1-4E2)
|
|
|
|
-- Updating a design document (PUT /database/_design/app?rev=1-4E2)
|
|
|
|
-- Deleting a design document (DELETE /database/_design/app?rev=1-6A7)
|
|
|
|
-- Deleting a design document (DELETE /database/_design/app?rev=1-6A7)
|
|
|
|
-- Triggering compaction (POST /_compact)
|
|
|
|
-- Triggering compaction (POST /_compact)
|
|
|
|
-- Reading the task status list (GET /_active_tasks)
|
|
|
|
-- Reading the task status list (GET /_active_tasks)
|
|
|
|
-- Restart the server (POST /_restart)
|
|
|
|
-- Restart the server (POST /_restart)
|
|
|
|
-- Read the active configuration (GET /_config)
|
|
|
|
-- Read the active configuration (GET /_config)
|
|
|
|
-- Update the active configuration (PUT /_config)
|
|
|
|
-- Update the active configuration (PUT /_config)
|
|
|
|
|
|
|
|
|
|
|
|
data = http.get( host, port, '/_config' )
|
|
|
|
data = http.get( host, port, '/_config' )
|
|
|
|
local status, authresult = json.parse(data.body)
|
|
|
|
local status, authresult = json.parse(data.body)
|
|
|
|
@@ -133,33 +133,33 @@ action = function(host, port)
|
|
|
|
-- If authorization is used, we should get back something like
|
|
|
|
-- If authorization is used, we should get back something like
|
|
|
|
-- {"error":"unauthorized","reason":"You are not a server admin."}
|
|
|
|
-- {"error":"unauthorized","reason":"You are not a server admin."}
|
|
|
|
-- Otherwise, a *lot* of data, :
|
|
|
|
-- Otherwise, a *lot* of data, :
|
|
|
|
-- {"httpd_design_handlers":{"_info":"{couch_httpd_db, handle_design_info_req}",
|
|
|
|
-- {"httpd_design_handlers":{"_info":"{couch_httpd_db, handle_design_info_req}",
|
|
|
|
-- "_list":"{couch_httpd_show, handle_view_list_req}","_show":"{couch_httpd_show, handle_doc_show_req}",
|
|
|
|
-- "_list":"{couch_httpd_show, handle_view_list_req}","_show":"{couch_httpd_show, handle_doc_show_req}",
|
|
|
|
-- "_update":"{couch_httpd_show, handle_doc_update_req}","_view":"{couch_httpd_view, handle_view_req}"},
|
|
|
|
-- "_update":"{couch_httpd_show, handle_doc_update_req}","_view":"{couch_httpd_view, handle_view_req}"},
|
|
|
|
-- "httpd_global_handlers":{"/":"{couch_httpd_misc_handlers, handle_welcome_req, <<\"Welcome\">>}",
|
|
|
|
-- "httpd_global_handlers":{"/":"{couch_httpd_misc_handlers, handle_welcome_req, <<\"Welcome\">>}",
|
|
|
|
-- "_active_tasks":"{couch_httpd_misc_handlers, handle_task_status_req}",
|
|
|
|
-- "_active_tasks":"{couch_httpd_misc_handlers, handle_task_status_req}",
|
|
|
|
-- "_all_dbs":"{couch_httpd_misc_handlers, handle_all_dbs_req}",
|
|
|
|
-- "_all_dbs":"{couch_httpd_misc_handlers, handle_all_dbs_req}",
|
|
|
|
-- "_config":"{couch_httpd_misc_handlers, handle_config_req}",
|
|
|
|
-- "_config":"{couch_httpd_misc_handlers, handle_config_req}",
|
|
|
|
-- "_log":"{couch_httpd_misc_handlers, handle_log_req}","_oauth":"{couch_httpd_oauth, handle_oauth_req}",
|
|
|
|
-- "_log":"{couch_httpd_misc_handlers, handle_log_req}","_oauth":"{couch_httpd_oauth, handle_oauth_req}",
|
|
|
|
-- "_replicate":"{couch_httpd_misc_handlers, handle_replicate_req}","_restart":"{couch_httpd_misc_handlers, handle_restart_req}",
|
|
|
|
-- "_replicate":"{couch_httpd_misc_handlers, handle_replicate_req}","_restart":"{couch_httpd_misc_handlers, handle_restart_req}",
|
|
|
|
-- "_session":"{couch_httpd_auth, handle_session_req}","_sleep":"{couch_httpd_misc_handlers, handle_sleep_req}",
|
|
|
|
-- "_session":"{couch_httpd_auth, handle_session_req}","_sleep":"{couch_httpd_misc_handlers, handle_sleep_req}",
|
|
|
|
-- "_stats":"{couch_httpd_stats_handlers, handle_stats_req}","_user":"{couch_httpd_auth, handle_user_req}",
|
|
|
|
-- "_stats":"{couch_httpd_stats_handlers, handle_stats_req}","_user":"{couch_httpd_auth, handle_user_req}",
|
|
|
|
-- "_utils":"{couch_httpd_misc_handlers, handle_utils_dir_req, \"/usr/share/couchdb/www\"}",
|
|
|
|
-- "_utils":"{couch_httpd_misc_handlers, handle_utils_dir_req, \"/usr/share/couchdb/www\"}",
|
|
|
|
-- "_uuids":"{couch_httpd_misc_handlers, handle_uuids_req}","favicon.ico":"{couch_httpd_misc_handlers, handle_favicon_req, \"/usr/share/couchdb/www\"}"},
|
|
|
|
-- "_uuids":"{couch_httpd_misc_handlers, handle_uuids_req}","favicon.ico":"{couch_httpd_misc_handlers, handle_favicon_req, \"/usr/share/couchdb/www\"}"},
|
|
|
|
-- "query_server_config":{"reduce_limit":"true"},"log":{"file":"/var/log/couchdb/0.10.0/couch.log","level":"info"},
|
|
|
|
-- "query_server_config":{"reduce_limit":"true"},"log":{"file":"/var/log/couchdb/0.10.0/couch.log","level":"info"},
|
|
|
|
-- "query_servers":{"javascript":"/usr/bin/couchjs /usr/share/couchdb/server/main.js"},
|
|
|
|
-- "query_servers":{"javascript":"/usr/bin/couchjs /usr/share/couchdb/server/main.js"},
|
|
|
|
-- "daemons":{"batch_save":"{couch_batch_save_sup, start_link, []}","db_update_notifier":"{couch_db_update_notifier_sup, start_link, []}",
|
|
|
|
-- "daemons":{"batch_save":"{couch_batch_save_sup, start_link, []}","db_update_notifier":"{couch_db_update_notifier_sup, start_link, []}",
|
|
|
|
-- "external_manager":"{couch_external_manager, start_link, []}","httpd":"{couch_httpd, start_link, []}",
|
|
|
|
-- "external_manager":"{couch_external_manager, start_link, []}","httpd":"{couch_httpd, start_link, []}",
|
|
|
|
-- "query_servers":"{couch_query_servers, start_link, []}","stats_aggregator":"{couch_stats_aggregator, start, []}",
|
|
|
|
-- "query_servers":"{couch_query_servers, start_link, []}","stats_aggregator":"{couch_stats_aggregator, start, []}",
|
|
|
|
-- "stats_collector":"{couch_stats_collector, start, []}","view_manager":"{couch_view, start_link, []}"},
|
|
|
|
-- "stats_collector":"{couch_stats_collector, start, []}","view_manager":"{couch_view, start_link, []}"},
|
|
|
|
-- "httpd":{"WWW-Authenticate":"Basic realm=\"administrator\"","authentication_handlers":"{couch_httpd_oauth, oauth_authentication_handler}, {couch_httpd_auth, default_authentication_handler}",
|
|
|
|
-- "httpd":{"WWW-Authenticate":"Basic realm=\"administrator\"","authentication_handlers":"{couch_httpd_oauth, oauth_authentication_handler}, {couch_httpd_auth, default_authentication_handler}",
|
|
|
|
-- "bind_address":"127.0.0.1","default_handler":"{couch_httpd_db, handle_request}","port":"5984"},"httpd_db_handlers":{"_changes":"{couch_httpd_db, handle_changes_req}",
|
|
|
|
-- "bind_address":"127.0.0.1","default_handler":"{couch_httpd_db, handle_request}","port":"5984"},"httpd_db_handlers":{"_changes":"{couch_httpd_db, handle_changes_req}",
|
|
|
|
-- "_compact":"{couch_httpd_db, handle_compact_req}","_design":"{couch_httpd_db, handle_design_req}","_temp_view":"{couch_httpd_view, handle_temp_view_req}",
|
|
|
|
-- "_compact":"{couch_httpd_db, handle_compact_req}","_design":"{couch_httpd_db, handle_design_req}","_temp_view":"{couch_httpd_view, handle_temp_view_req}",
|
|
|
|
-- "_view":"{couch_httpd_view, handle_db_view_req}","_view_cleanup":"{couch_httpd_db, handle_view_cleanup_req}"},
|
|
|
|
-- "_view":"{couch_httpd_view, handle_db_view_req}","_view_cleanup":"{couch_httpd_db, handle_view_cleanup_req}"},
|
|
|
|
-- "couch_httpd_auth":{"authentication_db":"users","require_valid_user":"false","secret":"replace this with a real secret in your local.ini file"},
|
|
|
|
-- "couch_httpd_auth":{"authentication_db":"users","require_valid_user":"false","secret":"replace this with a real secret in your local.ini file"},
|
|
|
|
-- "couchdb":{"batch_save_interval":"1000","batch_save_size":"1000","database_dir":"/var/lib/couchdb/0.10.0","delayed_commits":"true",
|
|
|
|
-- "couchdb":{"batch_save_interval":"1000","batch_save_size":"1000","database_dir":"/var/lib/couchdb/0.10.0","delayed_commits":"true",
|
|
|
|
-- "max_attachment_chunk_size":"4294967296","max_dbs_open":"100","max_document_size":"4294967296",
|
|
|
|
-- "max_attachment_chunk_size":"4294967296","max_dbs_open":"100","max_document_size":"4294967296",
|
|
|
|
-- "os_process_timeout":"5000","util_driver_dir":"/usr/lib/couchdb/erlang/lib/couch-0.10.0/priv/lib","view_index_dir":"/var/lib/couchdb/0.10.0"}}
|
|
|
|
-- "os_process_timeout":"5000","util_driver_dir":"/usr/lib/couchdb/erlang/lib/couch-0.10.0/priv/lib","view_index_dir":"/var/lib/couchdb/0.10.0"}}
|
|
|
|
local auth = "Authentication : %s"
|
|
|
|
local auth = "Authentication : %s"
|
|
|
|
local authEnabled = "unknown"
|
|
|
|
local authEnabled = "unknown"
|
|
|
|
|
|
|
|
|
|
|
|
|