immich icon indicating copy to clipboard operation
immich copied to clipboard

feat(cli): Use well-known endpoint to resolve API

Open bo0tzz opened this issue 1 year ago • 5 comments

bo0tzz avatar Jan 29 '24 20:01 bo0tzz

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: fe9bd06
Status: ✅  Deploy successful!
Preview URL: https://ed7790d0.immich.pages.dev
Branch Preview URL: https://feat-cli-well-known.immich.pages.dev

View logs

Would fix #6487, #6731

bo0tzz avatar Jan 29 '24 21:01 bo0tzz

The fallback logic for constructing the URL is a bit more complex than I'd anticipated. For example, this code currently doesn't handle cases where .well-known returns successfully but builds an invalid endpoint.

bo0tzz avatar Jan 29 '24 21:01 bo0tzz

I'm not exactly sure what well-known does. Could you summarize the idea here?

etnoy avatar Jan 30 '24 08:01 etnoy

The API is served at /api usually, but it you type in the root path / to the mobile app, there is a special endpoint (/.well-known/immich) that can check instead and it returns a response that indicates where the API is actually located. It is like a special discovery endpoint that can be used so the user isn't required to remember to add /api

jrasm91 avatar Jan 30 '24 13:01 jrasm91