ripienaar / gdash

A dashboard for Graphite
http://www.devco.net/
Apache License 2.0
754 stars 117 forks source link

prefix config parameter doesn't work #56

Open viralshah opened 12 years ago

viralshah commented 12 years ago

when prefix is set. The app doesn't render correctly with errors for each JS file it tries to include.

Stack trace:

NoMethodError - undefined method list' for nil:NilClass: ./lib/gdash/sinatra_app.rb:128:inGET /:category/:dash/?*' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:1264:in call' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:1264:incompile!' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in []' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:inroute!' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:851:in route_eval' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:inroute!' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:872:in process_route' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:incatch' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in process_route' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:834:inroute!' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in each' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:inroute!' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:936:in dispatch!' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:incall!' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in invoke' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:incatch' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in invoke' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:incall!' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:755:in call' /srv/gdash/vendor/bundle/ruby/1.8/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:incall' /srv/gdash/vendor/bundle/ruby/1.8/gems/rack-protection-1.2.0/lib/rack/protection/path_traversal.rb:16:in call' /srv/gdash/vendor/bundle/ruby/1.8/gems/rack-protection-1.2.0/lib/rack/protection/json_csrf.rb:17:incall' /srv/gdash/vendor/bundle/ruby/1.8/gems/rack-protection-1.2.0/lib/rack/protection/base.rb:47:in call' /srv/gdash/vendor/bundle/ruby/1.8/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:incall' /srv/gdash/vendor/bundle/ruby/1.8/gems/rack-1.4.1/lib/rack/nulllogger.rb:9:in call' /srv/gdash/vendor/bundle/ruby/1.8/gems/rack-1.4.1/lib/rack/head.rb:9:incall' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:99:in call' /srv/gdash/vendor/bundle/ruby/1.8/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:531:inprocess_client' /srv/gdash/vendor/bundle/ruby/1.8/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:606:in worker_loop' /srv/gdash/vendor/bundle/ruby/1.8/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:487:inspawn_missing_workers' /srv/gdash/vendor/bundle/ruby/1.8/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:137:in start' /srv/gdash/vendor/bundle/ruby/1.8/gems/unicorn-4.3.1/bin/unicorn:121 /srv/gdash/bin/unicorn:16:inload' /srv/gdash/bin/unicorn:16

It seems that since the url path has the prefix in it, it can't look up static files (js etc) in the public folder.

keymon commented 11 years ago

Confirmed that it does not work. Completely broke. Not sure how to fix it and if it is easy, I guess we can just drop the feature and remove it from the documentation.

falkenbt commented 11 years ago

:+1:

tubit commented 11 years ago

I'm using gdash with a configured prefix, running with mod_passenger in apache.

Part of my apache configuration:

    RackBaseURI /gdash
    <Directory "/var/www/gdash">
        AllowOverride all
        Options -MultiViews
    </Directory>

And in my gdash.yaml:

  :prefix: "/gdash"

Working without problems. That's the reason for my pull request https://github.com/ripienaar/gdash/pull/92

Cheers Dennis

keymon commented 11 years ago

We should update the configuration to explain this. after that I will close this ticket.

tubit commented 11 years ago

Please mind that /var/www/gdash is a symlink to the gdash/public folder. I think that's important.

lrwxrwxrwx  1 www-data     www-data            19 Jun  1  2012 gdash -> /opt/gdash/public