gdash icon indicating copy to clipboard operation
gdash copied to clipboard

prefix config parameter doesn't work

Open viralshah opened this issue 12 years ago • 5 comments

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.

viralshah avatar Sep 28 '12 10:09 viralshah

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.

keymon avatar Feb 10 '13 22:02 keymon

:+1:

falkenbt avatar Feb 10 '13 23:02 falkenbt

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

tubit avatar Mar 28 '13 10:03 tubit

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

keymon avatar Mar 28 '13 11:03 keymon

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

tubit avatar Mar 29 '13 14:03 tubit