Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to bind 127.0.0.1 in clustered mode #50

Open
ElmoVanKielmo opened this issue Dec 20, 2017 · 0 comments
Open

Allow to bind 127.0.0.1 in clustered mode #50

ElmoVanKielmo opened this issue Dec 20, 2017 · 0 comments

Comments

@ElmoVanKielmo
Copy link

Expected Behavior

It should not be assumed that CouchDB listen directly to incoming traffic. There can be for example Nginx on the same machine for SSL termination or other reasons - in this case CouchDB node can bind to 127.0.0.1:5984 and Nginx can bind to 0.0.0.0:443 (or other network address) and act as a proxy.

Current Behavior

Cookbook fails if couchdb_node is of type "clustered" and bind_address is "127.0.0.1".
It says it's not allowed to bind to 127.0.0.1 in clustered mode.

Possible Solution

Drop the restriction of 127.0.0.1 in clustered mode.

Steps to Reproduce (for bugs)

Use resource "couchdb_node" with attributes:
type "clustered"
bind_address "127.0.0.1"

Context

In our setup we are using OpenResty Nginx in front of CouchDB for a couple of reasons.
We require that all network traffic is encrypted - even internal. SSL termination provided by Nginx is stable while recently there were problems with SSL directly on CouchDB and even Jan Lehnardt suggested to use proper SSL termination solution.
We are using OAuth 2.0 to authenticate access to any resources. CouchDB doesn't support it but we have found a way to use it with CouchDB. OpenResty Nginx provides auth_request directive allowing request headers to be sent to a different web service. So we have created such a service and based on OAuth token it decides if Nginx should let the request go to CouchDB or deny it.
So in this setup CouchDB, Nginx and OAuth verification service work as one logical web service - secured CouchDB exposed to client apps.

Your Environment

  • Version used: 3.0.3
  • Chef version: 12.21.26
  • Operating System and version: Ubuntu 14.04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant