Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Support hosting under a relative path #102

Open
optroodt opened this issue Apr 15, 2024 · 4 comments
Open

[Feature request] Support hosting under a relative path #102

optroodt opened this issue Apr 15, 2024 · 4 comments
Labels
feature request New feature or request long-term Unlikely to be implemented anytime soon

Comments

@optroodt
Copy link

First of all, I really like this project, well done!

I have multiple dockerized apps that I host under a single domain. I using Nginx to proxy requests to the correct container, based on the path.

For example, requests to https://mydomain.com/app1 are proxied to a container on http://127.0.0.1:2000, requests to https://mydomain.com/hoarder are proxied to http://127.0.0.1:3000 and so on.

The rules in Nginx look like this:

    location /hoarder/ {
        access_log /var/log/nginx/hoarder.access.log;
        error_log /var/log/nginx/hoarder.error.log;
        rewrite /hoarder/(.*) /$1 break;
        proxy_pass http://127.0.0.1:3000;
        proxy_redirect / /hoarder/;
    }

Hoarder-app has no setting to set this base path, so I'm running into various issues:

  • static resources are retrieved from /_next/
  • login urls come from /providers and others
  • main app urls go to /dashboard

I can add multiple locations in my Nginx config, but this is cumbersome and error prone (i.e. higher probability of conflicts between apps using the same paths). It would be much more convenient if there would be a setting that lets you define the base path. Any url generated by the app would then be relative to this base path. (e.g. /hoarder/_next/..., /hoarder/dashboard/...)

Thanks!

@optroodt optroodt changed the title Support hosting under a relative path [Feature request] Support hosting under a relative path Apr 15, 2024
@MohamedBassem
Copy link
Collaborator

Unfortunately, this is going to be hard to implement due to limitations in the framework I'm using. NextJS allows specifying the baseUrl only during build time, and can't be configured in runtime with env variables.

I'm curious, why did you opt into hosting stuff under relative paths versus subdomains?

@optroodt
Copy link
Author

I use Duck DNS, which gives you a limited number of free dns entries. I would have to automatically renew multiple certificates and remember the domains. I just found that hosting under a path would be quicker (and dirtier... 😅).

Ultimately I guess I will have to set up another domain. :)

Thanks for the quick response!

@MohamedBassem
Copy link
Collaborator

hmmmm, the limited number of dns entries is probably solved by just using DuckDNS for the dynamic dns and then having another domain with a CNAME to the duckdns one. That other domain can then have as many subdomains as you want.
As for the certs, yeah you'll have to manage them (unless you're using something like caddy for auto certs). Putting stuff behind cloudflare also can help you avoid the need for managing the certs as well.

Sorry for intruding on your homelab setup 😅 While not strictly related to hoarder, I love homelabbing and if you have any questions about what I mentioned above, I'm more than happy to help on the hoarder discord ;)

As for the feature request itself, to be honest, it's unlikely to happen anytime soon given the framework limitation, sorry :(

@optroodt
Copy link
Author

No worries, feel free to close the issue if you like (or keep it open to see if there is more interest).

I use certbot for cert renewal and I've set up a new domain just for hoarder, it works perfectly. 👌

Thanks again, really appreciate your work and keep it up!

@MohamedBassem MohamedBassem added feature request New feature or request long-term Unlikely to be implemented anytime soon labels Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request long-term Unlikely to be implemented anytime soon
Projects
None yet
Development

No branches or pull requests

2 participants