You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@HorizonNet -- thanks for bringing this up and sorry for the delay. For now we tell users to set up a reverse proxy in front of RethinkDB web UI for authentication (we'll post a document on how to do it soon). I agree this isn't an ideal solution since it requires users to configure another server like nginx.
There are two reasons why we haven't baked authentication into RethinkDB itself yet:
The RethinkDB web server would have to take special care to be secure, which is often error prone and requires significant time and peer review
If we add basic authentication, the next step is to add ssl support, which is a road we don't really want to get on
That being said, I'll talk to some folks here about it and see what we can do. There might be a creative solution we can adopt, or we might have to bite the bullet and just do the whole shebang at some point.
I wrote how to set up a reverse proxy with apache in the new docs (it will be release Tuesday).
I think we can also do it with a local htaccess. If we can, we should write it and provide it to people so they could secure they their web admin with just copying a file.
@HorizonNet if that can help you, here are some docs on how to set a reverse proxy with apache2.
I haven't written how to do it with nginx yet.
Secure the web interface
You also have to make sure to protect access to the web interface. Run the following commands to ensure that the web interface can only be accessed from the local machine running RethinkDB:
<VirtualHost *:80>
ServerName domain.net
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
AuthType Basic
AuthName "Password Required"
AuthUserFile password.file
AuthGroupFile group.file
Require group dbadmin
</Proxy>
ProxyErrorOverride On
ProxyPass /rethinkdb_admin/ http://localhost:8080/
ProxyPassReverse /rethinkdb_admin/ http://localhost:8080/
</VirtualHost>
Create the password file in /etc/apache2/:
htpasswd.exe -c password.file username
Then create a file group.file with this content:
dbadmin: username
You can now access the web interface with http://<ip_machine>/rethinkdb_admin.
You can also set groups (ala the Apache config) with the auth_digest module (if you so choose). You will also want to grab apache2utils for the htpasswd utility, which nginx can leverage as well.
Why not just use an SSH tunnel? that's secure.. ssh -L 8080:127.0.0.1:8080 user@yourserver
Tadah, now just access the admin interface as normal from your own browser.
@neumino I tried your configuration but I have a problem.
Apache can't load the resources because it is looking for them inside DocumentRoot while they are in /usr/local/share/rethinkdb/web.
@neumino The page is loaded but not the external files.
In apache error_log, for example, there is: File does not exist: /Users/Michele/Sites/cluster.css, referer: https://localhost/rethinkdb.
I just tried the configuration with apache 2.2.25-1, it works fine for me.
Does http://localhost:8080 works for you?
The reverse proxy should forward everything, so if it can find index.html, it should also find the cluster.css fle.
/Users/<user>/Sites is the default virtual host used on OSX when you install apache.
Could you deactivate this virtualhost?
The strange thing, is that localhost/rethinkdb_admin/ shouldn't try to reach localhost/cluster.css (I just checked, the path are relative, not absolute in index.html). Which lead to this question: What version of RethinkDB are you running?
Yes, I can connect to the console from http://localhost:8080.
I am using the virtual host specified in httpd-ssl.conf with https.
Version is 1.10.1
@rnhmjoj Can you with Chrome go on http://localhost/rethinkdb_admin/,
Then right click > view page source
Copy everything and paste it here?
@rnhmjoj and http://localhost/rethinkdb_admin/cluster.css?v=1.10.1 returns a 404 error?
The only thing that I think of is: there is a virtualhost that matches http://localhost/rethinkdb_admin/cluster.css?v=1.10.1 before the proxy pass.
Can you disable all the virtualhost (with a2dissite or by removing the symbolic link in /etc/apache2/sites-enabled except the one described here #1163 (comment)
And make sure that there is no other virtualhost except the one with the proxy pass.
Make sure that there is no DocumentRoot in the virtualhost that contains the proxy pass.
If that still doesn't work, I really have no idea what's happening there.
I would like to run more tests, but I don't have an OS X machine available here :( and it works fine on my linux.
Activity
coffeemug commentedon Jul 12, 2013
@HorizonNet -- thanks for bringing this up and sorry for the delay. For now we tell users to set up a reverse proxy in front of RethinkDB web UI for authentication (we'll post a document on how to do it soon). I agree this isn't an ideal solution since it requires users to configure another server like nginx.
There are two reasons why we haven't baked authentication into RethinkDB itself yet:
That being said, I'll talk to some folks here about it and see what we can do. There might be a creative solution we can adopt, or we might have to bite the bullet and just do the whole shebang at some point.
neumino commentedon Jul 12, 2013
I wrote how to set up a reverse proxy with apache in the new docs (it will be release Tuesday).
I think we can also do it with a local htaccess. If we can, we should write it and provide it to people so they could secure they their web admin with just copying a file.
HorizonNet commentedon Jul 12, 2013
Alright, the solution with the reverse proxy should work for the time being.
neumino commentedon Jul 12, 2013
@HorizonNet if that can help you, here are some docs on how to set a reverse proxy with apache2.
I haven't written how to do it with nginx yet.
Secure the web interface
You also have to make sure to protect access to the web interface. Run the following commands to ensure that the web interface can only be accessed from the local machine running RethinkDB:
You can also use apache to allow access (with a basic authentication) to the web interface from other machines:
Then create a new virtual host:
Create the password file in
/etc/apache2/:Then create a file
group.filewith this content:You can now access the web interface with
http://<ip_machine>/rethinkdb_admin.elithrar commentedon Jul 20, 2013
This should do the trick for nginx (tested on v1.1.19 on Ubuntu 12.04). The iptables requirements are the same as @neumino has above.
You can also set groups (ala the Apache config) with the auth_digest module (if you so choose). You will also want to grab
apache2utilsfor thehtpasswdutility, which nginx can leverage as well.mglukhovsky commentedon Jul 20, 2013
Thanks for the nginx config, @elithrar!
neumino commentedon Jul 20, 2013
@elithrar you are awesome! Thanks!
Someguy123 commentedon Sep 15, 2013
Why not just use an SSH tunnel? that's secure..
ssh -L 8080:127.0.0.1:8080 user@yourserverTadah, now just access the admin interface as normal from your own browser.
rnhmjoj commentedon Nov 23, 2013
@neumino I tried your configuration but I have a problem.
Apache can't load the resources because it is looking for them inside
DocumentRootwhile they are in/usr/local/share/rethinkdb/web.neumino commentedon Nov 23, 2013
@rnhmjoj there shouldn't be any document root.
Can you load
index.html?If I would guess, the problem would be that you have a conflict between multiple virtual host.
I removed apache from my machine, give me a few minutes to re-install it and try the config.
rnhmjoj commentedon Nov 23, 2013
@neumino The page is loaded but not the external files.
In apache error_log, for example, there is:
File does not exist: /Users/Michele/Sites/cluster.css, referer: https://localhost/rethinkdb.neumino commentedon Nov 23, 2013
@rnhmjoj sorry for the delay.
I just tried the configuration with apache 2.2.25-1, it works fine for me.
Does
http://localhost:8080works for you?The reverse proxy should forward everything, so if it can find index.html, it should also find the cluster.css fle.
/Users/<user>/Sitesis the default virtual host used on OSX when you install apache.Could you deactivate this virtualhost?
The strange thing, is that localhost/rethinkdb_admin/ shouldn't try to reach localhost/cluster.css (I just checked, the path are relative, not absolute in index.html). Which lead to this question: What version of RethinkDB are you running?
rnhmjoj commentedon Nov 23, 2013
Yes, I can connect to the console from
http://localhost:8080.I am using the virtual host specified in
httpd-ssl.confwith https.Version is 1.10.1
neumino commentedon Nov 24, 2013
@rnhmjoj Can you with Chrome go on
http://localhost/rethinkdb_admin/,Then right click > view page source
Copy everything and paste it here?
rnhmjoj commentedon Nov 24, 2013
https://gist.github.com/Rnhmjoj/7621750
neumino commentedon Nov 24, 2013
@rnhmjoj and
http://localhost/rethinkdb_admin/cluster.css?v=1.10.1returns a 404 error?rnhmjoj commentedon Nov 24, 2013
@neumino Yes. See this.
neumino commentedon Nov 24, 2013
Hum, that's really strange.
The only thing that I think of is: there is a virtualhost that matches
http://localhost/rethinkdb_admin/cluster.css?v=1.10.1before the proxy pass.Can you disable all the virtualhost (with
a2dissiteor by removing the symbolic link in/etc/apache2/sites-enabledexcept the one described here #1163 (comment)And make sure that there is no other virtualhost except the one with the proxy pass.
Make sure that there is no DocumentRoot in the virtualhost that contains the proxy pass.
If that still doesn't work, I really have no idea what's happening there.
I would like to run more tests, but I don't have an OS X machine available here :( and it works fine on my linux.
rnhmjoj commentedon Nov 24, 2013
Ops. It's my bad: I forgot the final
/inProxyPass /rethinkdb_admin/I am so sorry. Sorry for making you lose all this time
neumino commentedon Nov 24, 2013
No problem at least it works now : )
danielmewes commentedon Oct 8, 2014
Closing in favor of #3159.
uchuugaka commentedon Mar 16, 2017
Is it still accurate that there is no built-in web (http/https) log in, just automatically the admin user?
Yikes. That's a real gotcha.