Git Product home page Git Product logo

Comments (27)

gugahoi avatar gugahoi commented on May 29, 2024

https://maraschino.lighthouseapp.com/projects/85614/tickets/41-core-feature-mount-maraschino-to-subdirectory

from maraschino.

mvanderberg avatar mvanderberg commented on May 29, 2024

Hi All,

Does any of you know how to adjust Maraschino to have a function like requested in the first post?
If I use the 'location' directive in apache, I can route traffic to the correct suffix, when running apache on the box where Maraschino lives.
Unfortunately my reverse proxy lives in my DMZ, and when I want to use a single fqdn I run into problems with Sickbeard, Headphones and Couchpotato.
Within the previous mentioned applications I am able to set a base suffix...

Thanks in advance,
best regards, Mark

from maraschino.

gugahoi avatar gugahoi commented on May 29, 2024

You can try this: http://forum.xbmc.org/showpost.php?p=1022300&postcount=1306

from maraschino.

mvanderberg avatar mvanderberg commented on May 29, 2024

Hi Gugahoi,

I tried the suggestion you gave, but that seems to work only when using apache on the same host where Maraschino is running...

Thanks for the help, but unresolved..

best regards, Mark

from maraschino.

gugahoi avatar gugahoi commented on May 29, 2024

@mvanderberg it's been a long time coming but i just merged this functionality. Please have a play around with it and report back with any feedback. Note that to run on port 80 you will need to grant Maraschino 'sudo' privileges. I will close this issue since issue #139 is also regarding this.

from maraschino.

mvanderberg avatar mvanderberg commented on May 29, 2024

@gugahoi I tested this and when using a reverse proxy in front of Maraschino I get errors like the one below when tracing:

http://hpstorage/maraschino/static/less/http://127.0.0.1:7000/maraschino/static/images/backgrounds/grass.jpg
http://hpstorage/maraschino/static/less/http://127.0.0.1:7000/maraschino/static/images/alpha/000_70.png
http://hpstorage/maraschino/static/less/http://127.0.0.1:7000/maraschino/static/images/settings_icon.png
http://hpstorage/maraschino/static/less/http://127.0.0.1:7000/maraschino/static/images/alpha/000_80.png
http://hpstorage/maraschino/static/less/http://127.0.0.1:7000/maraschino/static/images/alpha/fff_10.png

Because off these errors, the pictures are not displayed...
The main reason I'm using a reverse proxy (apache or nginx) is to access the site externally via HTTPS with client certificates...
The behaviour is correct when I bypass the reverse proxy and access maraschino directly on http://host:7000/maraschino..

Any idea?

Thanks in advance,
best regards, Mark

from maraschino.

gugahoi avatar gugahoi commented on May 29, 2024

I'm not sure I understand what you mean. When you access http://host:7000/maraschino it works? Then when does it not work?

from maraschino.

mvanderberg avatar mvanderberg commented on May 29, 2024

I have a proxy rule in my reverse proxy which basically rewrites everything from http://host:7000/maraschino to http://host:80/maraschino... That's when I get the errors mentioned before..

On my external site I only have port 80 and 443 open. With the webroots for the other application I can access everything by using for example http://host/couchpotato etc...

from maraschino.

gugahoi avatar gugahoi commented on May 29, 2024

Ah ok. Try setting maraschino to port 80 and not 7000, remember to give it sudo privileges tho otherwise it wont be able to attach to that port. Furthermore you should try and make sure you are not using the development server otherwise the reverse proxy does not seem to work very well as I have just noticed. What parameters are you using when starting maraschino?

from maraschino.

mvanderberg avatar mvanderberg commented on May 29, 2024

I can't have maraschino run on port 80, as the reverse proxy is listening on that port (and serving the other webapps)...

But i just shutdown the reverse proxy, and had Maraschino listen on port 80, and that works well.

I'm starting Maraschino without any parameters.. The parameters I set inside Maraschino are the webroot and the port (/maraschino and 7000)

I'm not sure why there is a callback from 127.0.0.1 in the traces...

http://hpstorage/maraschino/static/less/http://127.0.0.1:7000/maraschino/static/images/backgrounds/grass.jpg

I'll try to adjust the reverse proxy config to see if I can improve things on that end...

For the rest Maraschino seems a lot faster with all the changes from the last couple of days...

I'm not sure if I can give sudo privileges on windows, but Maraschino is running under an administrator account...

from maraschino.

mvanderberg avatar mvanderberg commented on May 29, 2024

Is there any way I can increase the loglevel within Maraschino?

from maraschino.

gugahoi avatar gugahoi commented on May 29, 2024

I thought that would be the case after I posted. I believe I know where that callback is coming from and I will try to find a workaround but might have to way till tomorrow... It logs everything although the logger is not yet optimal so I would not rely on it too much.

from maraschino.

mvanderberg avatar mvanderberg commented on May 29, 2024

Thanks for the help!

I'll try to fiddle around with the proxy on my end.

In the end Maraschino is fully functional and faster than I've seen it before, so I'm as happy as one can be :-)...

best regards, Mark

from maraschino.

gugahoi avatar gugahoi commented on May 29, 2024

@mvanderberg I think there's no way around what is happening on your end. I found out LESS, which is the CSS compiler we are using, has some weird thing where it rewrites the URL to CSS images and such with absolute paths which obviously defeats the purpose of a webroot. I have found a workaround which could possibly fix it for you. If you can, download/checkout the "webroot_relative" branch from this repository and let me know if it fixes things for you... I really believe this is the solution so fingers crossed.

In case you dont know how to checkout a different branch and you pulled it with git, it's as simple as going into Maraschino's folder and running

git checkout webroot_relative

Let me know!

from maraschino.

mvanderberg avatar mvanderberg commented on May 29, 2024

@gugahoi Excellent!

It seems to work perfectly for the 'normal' interface (which I use) through the reverse proxy, but when using /mobile i get the following (when it's fetching thumbs it throws in an extra /maraschino):

http://192.168.0.100:7000/maraschino/maraschino/xhr/vfs_proxy/masterprofile/Thumbnails/Video/7/7d5394c5.tbn

When using the master branch, the url looks like this:

http://192.168.0.100:7000/maraschino/xhr/vfs_proxy/masterprofile/Thumbnails/Video/e/ec670428.tbn

Good work!
Thanks.

best regards, Mark

_EDIT_:

When accessing Maraschino outside of the reverse proxy, so on it's own port I get this:

http://maraschino/static/images/backgrounds/grass.jpg
http://maraschino/static/images/alpha/000_70.png
http://maraschino/static/images/alpha/000_80.png
http://maraschino/static/images/settings_icon.png
http://maraschino/static/images/alpha/fff_10.png

So it looks like the host:port is replaced by the webroot...
Through the reverse proxy everything works fine...

Any idea?
Could it have something to do with the following changes in maraschino/init.py?

112     120 if WEBROOT:
113     -       if WEBROOT[0] != '/':
114     -           WEBROOT = '/' + WEBROOT
115     -       d = wsgiserver.WSGIPathInfoDispatcher({WEBROOT: app})
121     +       d = wsgiserver.WSGIPathInfoDispatcher({'/' + WEBROOT: app})
116     122 else:
117     123     d = wsgiserver.WSGIPathInfoDispatcher({'/': app})
118     124 SERVER = wsgiserver.CherryPyWSGIServer(('0.0.0.0', PORT), d)

_EDIT_
Everything seems to work normal if i have Maraschino listening on port 80. All other ports give the same behaviour as mentioned in the previous edit..

from maraschino.

mvanderberg avatar mvanderberg commented on May 29, 2024

@gugahoi One other thing I just found related to the previous findings:

In the current version of Maraschino, if I use startargument "--webroot=/maraschino" everything works. If i use "--webroot=maraschino" the images are not shown.

In your branch however...:
When the webroot variable is in the form of "/maraschino" instead of "maraschino", an extra slash is thrown in..
_e.g. http://host:port//maraschino_

I think it has something to do with the following change in maraschino/init.py:

112     120 if WEBROOT:
113     -       if WEBROOT[0] != '/':
114     -           WEBROOT = '/' + WEBROOT
115     -       d = wsgiserver.WSGIPathInfoDispatcher({WEBROOT: app})
121     +       d = wsgiserver.WSGIPathInfoDispatcher({'/' + WEBROOT: app})
116     122 else:
117     123     d = wsgiserver.WSGIPathInfoDispatcher({'/': app})
118     124 SERVER = wsgiserver.CherryPyWSGIServer(('0.0.0.0', PORT), d)

If I change it back to the line below, everything works through the reverse proxy, but outside the reverse proxy the same problems as previous mentioned exist :

        if WEBROOT:
        if WEBROOT[0] != '/':
            WEBROOT = '/' + WEBROOT
        d = wsgiserver.WSGIPathInfoDispatcher({WEBROOT: app})
        else:
            d = wsgiserver.WSGIPathInfoDispatcher({'/': app})
        SERVER = wsgiserver.CherryPyWSGIServer(('0.0.0.0', PORT), d)

Am I on the right track?

Thanks in advance,
best regards, Mark

from maraschino.

gugahoi avatar gugahoi commented on May 29, 2024

Can that be related to the Reverse Proxy rule? I believe all the css is now relative to the base url + webroot.

So if I have myhost and port than all the css images point to http://myhost:port/webroot/static/images/.

I see no reason why it would skip the host:port information! Can you give me some information on how your reverse proxy rules actually work?

As I understand you want to have host:80/maraschino point to host:7000/maraschino and consequently all the incoming requests such as

host:80/maraschino/static/images

should go to:

host:7000/maraschino/static/images

I believe this should be handled by your own rules. All I can do is certify that I give you relative paths.

Please correct me if I'm wrong tho...

from maraschino.

gugahoi avatar gugahoi commented on May 29, 2024

Just saw your other reply, use --webroot=maraschino on my branch

If you can, come on IRC as it will be easier to communicate -- #maraschino on freenode

from maraschino.

mvanderberg avatar mvanderberg commented on May 29, 2024

I'll try to use IRC...Has been a while...The last time I used IRC was just before I got a cell phone :-)

I tried a couple of scenarios:

  1. without reverse proxy, without startarguments (webroot etc)
    Works fine

  2. without reverse proxy, with webroot
    No Images

  3. with reverse proxy, with webroot
    Works fine except for the "/maraschino/mobile" (no thumbs)

As I personally don't see why you should use a webroot without a reverse proxy (point 2) everything works (except for the /maraschino/mobile)...

Which basically means that this could work for everybody I guess (unless your reverse proxy is down, and you want to access Maraschino on its default port)....

from maraschino.

mvanderberg avatar mvanderberg commented on May 29, 2024

For the reverse proxy rules.... I use nginx at the moment:

##################
#Maraschino
##################
    location /maraschino {
    include proxy.conf;
    proxy_pass http://localhost:7000/maraschino;
    }

##################
# SABnzbd+
##################
    location /sabnzbd {
    include proxy.conf;
    proxy_pass http://localhost:8085;
    }

##################
# uTorrent
##################
    location /gui {
    include proxy.conf;
    proxy_pass http://localhost:8080/gui;
    }

##################
# SickBeard
##################     
    location /sickbeard {
    include proxy.conf;
    proxy_pass http://localhost:8081/sickbeard;
    }

##################
# HeadPhones
##################     
    location /headphones {
    include proxy.conf;
    proxy_pass http://localhost:8083/headphones;
    }

##################
# CouchPotatoServer
##################
    location /couchpotato {
    include proxy.conf;
    proxy_pass http://localhost:5050/couchpotato;
    # rewrite ^/couchpotato/?$ /couchpotato/movie/ permanent;
    }

from maraschino.

N3MIS15 avatar N3MIS15 commented on May 29, 2024

for mobile thumbs change line 24 in mobile.py to:

        episode['thumbnail'] = '/' + maraschino.WEBROOT + '/xhr/vfs_proxy/' + strip_special(episode['thumbnail'])

this is the only thing that i can find also. tested localy with http://localhost:7000/maraschino
EDIT: i got a reverse proxy set up on a virtual machine (finally) and it seems to be working there too. ip/maraschino (ip:7000/maraschino redirected)

from maraschino.

N3MIS15 avatar N3MIS15 commented on May 29, 2024

And for the / thing.

If WEBROOT[0] == '/':
WEBROOT = WEBROOT[1:]

It's just to protect the user from themselves..

from maraschino.

mvanderberg avatar mvanderberg commented on May 29, 2024

@N3MIS15
Thanks, the change in mobile.py works for me..

For the / thing:
Is the removal of that code to protect the user from themselves or the inclusion of that code?

Thanks in advance,
best regards, Mark

from maraschino.

N3MIS15 avatar N3MIS15 commented on May 29, 2024

https://gist.github.com/2976868 <-- i believe this should fix mobile.py issue aswell as allow /webroot in everything but less

removing the / is required for .less. But i believe it should be present for the rest of the code.

by 'protecting the user from themself' i ment that either '/webroot' or simply 'webroot' could be used, creating less of a chance that the user could input the wrong thing.

EDIT: you could also override webroot when in development with:

if DEVELOPMENT:
WEBROOT = ''

from maraschino.

mvanderberg avatar mvanderberg commented on May 29, 2024

@N3MIS15
I used your last modifications and restored the initial mobile.py.
Everything seems to work on my side:

  1. without reverse proxy, without startarguments (webroot etc)
    Works fine

  2. without reverse proxy, with webroot
    Works fine

  3. with reverse proxy, with webroot
    Works fine

Thanks!

best regards, Mark

from maraschino.

gugahoi avatar gugahoi commented on May 29, 2024

Ok, this should be done. If you want to test it out on that branch and let me know if it is working for you...

from maraschino.

mvanderberg avatar mvanderberg commented on May 29, 2024

@N3MIS15 @gugahoi
I tested your branch with the changes for mobile.py proposed by N3MIS15 a couple of posts ago.
Unfortunately I have to fly in two hours, so I'm not able to test my skills in creating a pull request :-)..

from maraschino.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.