sensu / sensu-dashboard

A dashboard for Sensu, for displaying & managing events & clients.
http://sensuapp.org
MIT License
96 stars 44 forks source link

[auth] don't require basic auth if on loopback #95

Closed ChrisLundquist closed 11 years ago

ChrisLundquist commented 11 years ago

If we are listening on loopback, we are not world reachable, so we don't require basic auth.

ChrisLundquist commented 11 years ago

This works now.

$ cat /etc/sensu/config.json

{
  "rabbitmq": {
    "host": "localhost",
    "port": 5671,
    "ssl": {
      "cert_chain_file": "/etc/sensu/ssl/cert.pem",
      "private_key_file": "/etc/sensu/ssl/key.pem"
    },
    "vhost": "/sensu",
    "user": "sensu",
    "password": "password"
  },
  "redis": {
    "host": "localhost",
    "port": 6379
  },
  "api": {
    "host": "localhost",
    "port": 4567
  },
  "dashboard": {
    "port": 8080,
    "host": "localhost"
  }
}
[deploy@sensu ~]$ sudo /etc/init.d/sensu-dashboard restart
Stopping sensu-dashboard                                   [  OK  ]
Starting sensu-dashboard                                   [  OK  ]
[deploy@sensu ~]$ sudo netstat -plant | grep ruby
tcp        0      0 0.0.0.0:4567                0.0.0.0:*                   LISTEN      622/ruby            
tcp        0      0 127.0.0.1:8080              0.0.0.0:*                   LISTEN      14449/ruby          
tcp        0      0 127.0.0.1:37738             127.0.0.1:6379              ESTABLISHED 550/ruby            
tcp        0      0 127.0.0.1:38173             127.0.0.1:6379              ESTABLISHED 622/ruby            
tcp        0      0 127.0.0.1:55064             127.0.0.1:5671              ESTABLISHED 550/ruby            
tcp        0      0 127.0.0.1:55066             127.0.0.1:5671              ESTABLISHED 622/ruby   
ChrisLundquist commented 11 years ago

This most recent changes have been casually tested in the same manor as shown above. The dashboard side of things does work, however I can't seem to deploy them with sensu-chef.

There is an issue deploying these changes with chef. I think it might be related to https://github.com/sensu/sensu-chef/blob/master/providers/base_config.rb#L3

basically I have a role, and a wrapper cookbook, and setting the attribute either place generates the config found https://gist.github.com/ChrisLundquist/f552cd155e7ce06be089

if I change the sensu-chef cookbook directly and change the dashboard attributes to nil, then it works.

portertech commented 11 years ago

The Sensu Dashboard has been updated to UI 2.0, which made several large changes. This PR will not be able to merge into master, as the branch was cut from UI 1.0.

What's the use case behind this? Just behind a proxy that's doing authentication?

I would love to see a new PR, using a branch cut from the current master!