{"action":"created","issue":{"url":"https://api.github.com/repos/apache/couchdb/issues/1602","repository_url":"https://api.github.com/repos/apache/couchdb","labels_url":"https://api.github.com/repos/apache/couchdb/issues/1602/labels{/name}","comments_url":"https://api.github.com/repos/apache/couchdb/issues/1602/comments","events_url":"https://api.github.com/repos/apache/couchdb/issues/1602/events","html_url":"https://github.com/apache/couchdb/pull/1602","id":360243582,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1NTQ2Nzg2","number":1602,"title":"Remove runtime configurability of core system components","user":{"login":"janl","id":11321,"node_id":"MDQ6VXNlcjExMzIx","avatar_url":"https://avatars1.githubusercontent.com/u/11321?v=4","gravatar_id":"","url":"https://api.github.com/users/janl","html_url":"https://github.com/janl","followers_url":"https://api.github.com/users/janl/followers","following_url":"https://api.github.com/users/janl/following{/other_user}","gists_url":"https://api.github.com/users/janl/gists{/gist_id}","starred_url":"https://api.github.com/users/janl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janl/subscriptions","organizations_url":"https://api.github.com/users/janl/orgs","repos_url":"https://api.github.com/users/janl/repos","events_url":"https://api.github.com/users/janl/events{/privacy}","received_events_url":"https://api.github.com/users/janl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/apache/couchdb/milestones/4","html_url":"https://github.com/apache/couchdb/milestone/4","labels_url":"https://api.github.com/repos/apache/couchdb/milestones/4/labels","id":3671233,"node_id":"MDk6TWlsZXN0b25lMzY3MTIzMw==","number":4,"title":"2.3.0","description":"","creator":{"login":"janl","id":11321,"node_id":"MDQ6VXNlcjExMzIx","avatar_url":"https://avatars1.githubusercontent.com/u/11321?v=4","gravatar_id":"","url":"https://api.github.com/users/janl","html_url":"https://github.com/janl","followers_url":"https://api.github.com/users/janl/followers","following_url":"https://api.github.com/users/janl/following{/other_user}","gists_url":"https://api.github.com/users/janl/gists{/gist_id}","starred_url":"https://api.github.com/users/janl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janl/subscriptions","organizations_url":"https://api.github.com/users/janl/orgs","repos_url":"https://api.github.com/users/janl/repos","events_url":"https://api.github.com/users/janl/events{/privacy}","received_events_url":"https://api.github.com/users/janl/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":8,"state":"open","created_at":"2018-09-19T12:40:51Z","updated_at":"2018-11-08T03:17:53Z","due_on":null,"closed_at":null},"comments":17,"created_at":"2018-09-14T10:14:12Z","updated_at":"2018-11-09T10:34:34Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/apache/couchdb/pulls/1602","html_url":"https://github.com/apache/couchdb/pull/1602","diff_url":"https://github.com/apache/couchdb/pull/1602.diff","patch_url":"https://github.com/apache/couchdb/pull/1602.patch"},"body":"## Overview\r\n\r\nIn the 1.x era of CouchDB, many parts of the core systems were managed via the config system. This is mostly due to in the early days, no good standard patterns for what Erlang apps looked like were obvious. This has changed now.\r\n\r\nIn addition, being able to change core parts of the database, including what code modules to load when and where, and which OS binaries to run when and where, opened us up to [a](\r\nhttp://docs.couchdb.org/en/stable/cve/2017-12635.html) [set](\r\nhttp://docs.couchdb.org/en/stable/cve/2017-12636.html) of [security](\r\nhttp://docs.couchdb.org/en/stable/cve/2018-11769.html) [vulnerabilities](\r\nhttp://docs.couchdb.org/en/stable/cve/2018-8007.html), that we want to close once and for all with this PR by no longer allowing runtime configuration of core system parts.\r\n\r\nSpecifically:\r\n  - `daemons`\r\n  - `[httpd] default_handler`\r\n  -`httpd_global_handlers`\r\n  -`httpd_db_handlers`\r\n  -`httpd_design_handlers`\r\n  - `vhost_global_handlers`\r\n  - `redirect_vhost_handler`\r\n  - `os_daemons`\r\n  - `query_servers`\r\n  - `native_query_servers`\r\n\r\nThis patch retains the ability to configure an existing CouchDB installation to, say, add a third party query server, but it’ll require console access to the server and restarting CouchDB from said console.\r\n\r\n* * * \r\n\r\n## Details \r\n\r\nCouchDB ships with two default query_servers (javascript and coffeescript)\r\nas well as one default native_query_server (query aka mango). These used\r\nto be configured in default.ini in these sections:\r\n\r\n```\r\n[query_servers]\r\njavascript = {{prefix}}/bin/couchjs {{prefix}}/share/server/main.js\r\ncoffeescript = {{prefix}}/bin/couchjs {{prefix}}/share/server/main-coffee.js\r\n\r\n; enable mango query engine\r\n[native_query_servers]\r\nquery = {mango_native_proc, start_link, []}\r\n; erlang query server\r\n; erlang = {couch_native_process, start_link, []}\r\n```\r\n\r\nThis allowed end-users post-install and even runtime-changes to which\r\nquery servers are enabled and where their binaries live.\r\n\r\nThis patch changes things, so only a post-install, but not at-runtime\r\nchanges are possible from now on.\r\n\r\nThis still allows people to configure their CouchDB to run a third-\r\nparty query server like the somewhat popular Python query server,\r\nbut it changes the way the setup is done.\r\n\r\n## Query Servers\r\n\r\nThe javascript and coffeescript query servers continue to be enabled\r\nby default. Setup differences have been moved from default.ini to\r\nthe couchdb and couchdb.cmd start scripts respectively.\r\n\r\nAdditional query servers can now be configured using environment\r\nvariables:\r\n\r\n```\r\nexport COUCHDB_QUERY_SERVER_PYTHON=\"/path/to/python/query/server.py with args\"\r\ncouchdb\r\n```\r\n\r\nWhere the last segment in the environment variable matches the usual\r\nlowercase(!) query language in the design doc `language` field.\r\n\r\nMultiple query servers can be configured by using more environment\r\nvariables.\r\n\r\n## Native Query Servers\r\n\r\nThe mango query server continues to be enabled by default. The erlang\r\nquery server continues to be disabled by default. This patch adds\r\na `[native_query_servers] enable_erlang_query_server = BOOL` setting\r\n(defaults to `\"false\"`) to enable the erlang query server.\r\n\r\nIf the legacy configuration for enabling the query server is detected,\r\nthat is counted as a `true` setting as well, so existing configurations\r\ncontinue to work just fine.\r\n\r\n## Windows\r\n\r\nSince the setting of the `./configure` time `PREFIX` happens during\r\n`make release`, I had to adapt the `couchdb` and `couchdb.cmd` scripts\r\nto have the correct env vars set and the `PREFIX` replaced there.\r\n\r\nI did this to the best of my abilities and research, but this needs\r\nreview from the Windows team (Hi Joan! :).\r\n\r\n## OS Daemons\r\n\r\nOS Daemons have been deleted completely as they were deprecated in 2.2.0\r\n\r\n\r\n## Testing recommendations\r\n\r\n`make check` as well as following the instructions above for configuring third party query servers and/or `os_daemons` as well as enabling the erlang query server.\r\n\r\n## Checklist\r\n\r\n- [x] Code is written and works correctly;\r\n- [x] Changes are covered by tests;\r\n- [x] Documentation reflects the changes;"},"comment":{"url":"https://api.github.com/repos/apache/couchdb/issues/comments/437319020","html_url":"https://github.com/apache/couchdb/pull/1602#issuecomment-437319020","issue_url":"https://api.github.com/repos/apache/couchdb/issues/1602","id":437319020,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzMxOTAyMA==","user":{"login":"janl","id":11321,"node_id":"MDQ6VXNlcjExMzIx","avatar_url":"https://avatars1.githubusercontent.com/u/11321?v=4","gravatar_id":"","url":"https://api.github.com/users/janl","html_url":"https://github.com/janl","followers_url":"https://api.github.com/users/janl/followers","following_url":"https://api.github.com/users/janl/following{/other_user}","gists_url":"https://api.github.com/users/janl/gists{/gist_id}","starred_url":"https://api.github.com/users/janl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janl/subscriptions","organizations_url":"https://api.github.com/users/janl/orgs","repos_url":"https://api.github.com/users/janl/repos","events_url":"https://api.github.com/users/janl/events{/privacy}","received_events_url":"https://api.github.com/users/janl/received_events","type":"User","site_admin":false},"created_at":"2018-11-09T10:34:34Z","updated_at":"2018-11-09T10:34:34Z","author_association":"MEMBER","body":"Pending any test issues and/or review notes, this is good to go now. Thanks everyone for the input!"}}
{"actor":{"display_login":"janl"}}