YummYume/affine-bun-workers

Mismatched default env value for ELYSIA_PREFIX

Closed this issue · 3 comments

AFFiNE calls /api/worker/* and in README I see /api/worker as the default value of ELYSIA_PREFIX env variable. But in the dockerfile it defaults to /api/workers, this is rather confusing for new users.

ENV ELYSIA_PREFIX=/api/workers

Hey @JokerQyou 👋

I'm not sure what's confusing, is the documentation not clear enough ? The ELYSIA_PREFIX env variable is used to set a prefix to all routes from the workers (/image-proxy and /link-preview). By default, you don't need to change this because this is what AFFiNE will call, but if your reverse proxy is stripping or rewriting the prefix, then you would need to change it.

  • AFFiNE calls /api/worker/link-preview
  • The docker file sets ELYSIA_PREFIX to a default value of /api/workers, notice the s at the end
  • So if the user does not set ELYSIA_PREFIX (in docker commandline option or compose config file) to /api/worker, AFFiNE will not be able to use these APIs.

@JokerQyou You're right there's a typo on the default value, I didn't even notice it. Thank you for pointing that out, I'll fix it straight away