mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-06 09:13:19 +03:00
🚀 Feature: Support path-based routing #165
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jcstryker on GitHub.
Feature description
Followup to https://github.com/pocket-id/pocket-id/issues/224
I am suggesting enabling support for hosting the pocket-id web app on a path other than
/, e.g.https://foo.bar/authorhttps://foo.bar/idPitch
This would enable deploying the app in environments without DNS e.g. virtual machines or docker images that only are accessible via IP - requiring apps to be routed based on path instead of subdomain.
There are other benefits to path-based routing that make it preferable in certain production environments including:
@stonith404 commented on GitHub:
Thanks for your suggestion but I agree with @ItalyPaleAle.
@jcstryker commented on GitHub:
@ItalyPaleAle - I think what you may be misunderstanding is that for some environments DNS is not available at all. We would be accessing pocket-id via IP e.g.
10.96.0.1instead of a domain name.@jcstryker commented on GitHub:
Setting up Traefik with an IP address instead of a DNS name would require path based routing. For some threat models - the inclusion of DNS is a larger risk than a self contained application addressed via IP.
It feels like this response is dismissive of that use case.
I recognize the complexity - but supporting this would enable some important use cases. I agree that the recommended path should be to run it on a standalone domain, but there are some valid use cases where that might not be possible.
@ItalyPaleAle commented on GitHub:
Putting Pocket ID on a sub-domain comes with some security risk. Passkeys are tied to a specific domain, so you should host on a domain Pocket ID only, or some of the security offered by passkeys gets lost. (see RP-ID spec)
In addition to that, there's quite some complexity in supporting sub-paths.
In your case, I would recommend setting up a load balancer like Traefik to be able to host multiple apps on the same IP/port combination!
@ItalyPaleAle commented on GitHub:
I'm not following, sorry.
My advice was to set up a single Traefik (or Caddy, or Nginx, or your preferred load balancer) in front of all containers.
For example, all services are on the domain
example.com. The DNS record for*.example.compoints to the Traefik server.id.example.compoints to Pocket IDmyapp.example.compoints to an appAll go through Traefik and have TLS. Traefik has a wildcard TLS certificate for
*.example.com(via Let's Encrypt, using the DNS01 challenge).@ItalyPaleAle commented on GitHub:
Still not sure I understand. What environments can't have DNS?
example.comand assign*.example.comto10.96.0.1(it's perfectly valid to assign private IPs to a public DNS name)/etc/hosts@jcstryker commented on GitHub:
I agree that it is technically possible and very easy to deploy DNS. Your recommendations are very good for a majority of use-cases.
For some environments however the removal of DNS is intentional, to remove a potential attack vector or there are scalability concerns when managing the
/etc/hostsfile for a large fleet of machines when there is no central DNS server.I love pocket-id and personally host it on a dedicated DNS domain similar to the setup you recommend - I also have other use cases that have some of the limitations that I mentioned that I would like to be able to bring pocket-id into to improve overall security, thus this feature request.