Giter Club home page Giter Club logo

Comments (13)

Tzahi12345 avatar Tzahi12345 commented on July 24, 2024 4

@kzaoaai

My main hesitation here is that there's a decent chunk of people who have reverse proxies setup with the /api/ route. I guess that's a bad reason to not change it but if I can avoid having a breaking change I'd prefer that. But maybe it's not possible.

Let's do a poll of sorts, then. If this comment gets 5 thumbs up without a violent reaction I'll change it. Otherwise I'll keep it as it is.

from youtubedl-material.

Tzahi12345 avatar Tzahi12345 commented on July 24, 2024 2

I was just thinking of that, the main issue is the UI needs to know how to contact the server, and the UI is prebuilt in the image, so environment variables won't help here. But I just thought of another solution: we move the config endpoint to /ytdl_api/config or something like that. Before the UI does anything, it calls that endpoint and gets back the config and the prefix for all other endpoints.

That way it's basically configurable from the settings menu, and would only require a restart to update.

This should be possible, and would likely not even introduce a delay since we don't do anything until the config is retrieved anyways.

from youtubedl-material.

Kruhlmann avatar Kruhlmann commented on July 24, 2024 1

You're right I missed this part here in the configuration:

location ~/ytdl(.*)$ {
	rewrite /ytdl/(.*) /  break;
	proxy_pass http://example.com:8998;
}

I didn't realize it was possible to route using paths like this. My bad 👍

from youtubedl-material.

kzaoaai avatar kzaoaai commented on July 24, 2024 1

@Tzahi12345 how about maybe an environment variable that defaults to /api/ ? That way, people who have a conflicting app like me can change it, while others will keep the default /api/.

I personally have no clue how to implement it, just a thought.

EDIT: I just realized that while my installation is docker, you have other installation methods. Not sure how this would be implemented outside of docker.

from youtubedl-material.

GlassedSilver avatar GlassedSilver commented on July 24, 2024 1

/ytdl_config/ first call to check for which is set:
/ytdl_api/ or /api/

That way you have less semantic redundancy.

from youtubedl-material.

Tzahi12345 avatar Tzahi12345 commented on July 24, 2024

Have you checked out the reverse proxy setup page? You can use nginx or apache2 to channel all requests through your web server, not sure if you're doing this already. You can set a subpath using the appropriate configuration. Some more details on your setup would be helpful for figuring out how to get it working on the subpath.

Since the last update, the frontend url setting isn't actually used anymore. The server just exposes the port specified, and because your subdomain likely points to the same place as the root domain, it send you to the right place.

It would be a nice feature to have, but I'm not sure if there's a way to allow for subpaths without interfering with web servers like nginx or apache2.

from youtubedl-material.

Tzahi12345 avatar Tzahi12345 commented on July 24, 2024

Cool! Glad you got it working.

from youtubedl-material.

hjhee avatar hjhee commented on July 24, 2024

Hi, I'd like to point out a problem when reverse forwarding the /api path using another reverse proxy server traefik. When its dashboard is enabled, it requires that both /api and /dashboard be forwarded to its internal service. So it means the /api could not be forwarded to youtube-dl-material.

traefik is a popularly used reverse proxy server that handles routing for docker images without manual configuration. It would be great if the wiki also provides instructuion.

from youtubedl-material.

qlonik avatar qlonik commented on July 24, 2024

Hey. I encountered the same problem with traefik. It seems that the path for api endpoint is hard-coded via this line. If it could be configured somehow so we can add extra subpath between location origin and /api/, I think it would solve our issues.

from youtubedl-material.

Tzahi12345 avatar Tzahi12345 commented on July 24, 2024

@qlonik The main issue with that the frontend would be unaware of the new path. The backend would need an API subpath just for the config, and then before any other requests get send out, the frontend would have to retrieve that. Not an impossible solution, but perhaps it would be better to replace /api with something that won't collide with other apps, like /ytdl_api. It's a bit ugly and would break a lot of people's reverse proxy setup, but so would the first solution too.

If the reverse proxy workaround works, I'm inclined so say that's the official way to go, but I could definitely be convinced otherwise as traefik isn't some obscure proxy service.

from youtubedl-material.

samcro1967 avatar samcro1967 commented on July 24, 2024

Anyone have any luck getting this to work in caddy without a base url?

from youtubedl-material.

kzaoaai avatar kzaoaai commented on July 24, 2024

@qlonik The main issue with that the frontend would be unaware of the new path. The backend would need an API subpath just for the config, and then before any other requests get send out, the frontend would have to retrieve that. Not an impossible solution, but perhaps it would be better to replace /api with something that won't collide with other apps, like /ytdl_api. It's a bit ugly and would break a lot of people's reverse proxy setup, but so would the first solution too.

If the reverse proxy workaround works, I'm inclined so say that's the official way to go, but I could definitely be convinced otherwise as traefik isn't some obscure proxy service.

Was this pursued? replacing api with something more specific? I have the main issue as another container (Organizrr) uses /api/ on the main page.

from youtubedl-material.

kzaoaai avatar kzaoaai commented on July 24, 2024

@Tzahi12345 that should do it. I'd be glad to test your proposed fix. Thanks!

Sidenote: I've seen a couple other people post in the issues about the api, and i'm sure most just implemented a subdomain instead. That works only if the auth module api for organizr is disabled for the subdomain.

from youtubedl-material.

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.