CorentinTh / enclosed

Minimalistic web app designed for sending private and secure notes.
https://enclosed.cc
Apache License 2.0
682 stars 51 forks source link

Customize the root path when selfhosting #183

Closed graphixillusion closed 1 month ago

graphixillusion commented 1 month ago

What type of request is this?

Hosting or Self-hosting improvement

Clear and concise description of the feature you are proposing

As the title says, is it possible to configure where is the root of the service? I already tried with this env var but it doesn't seems to work as intended:

SERVER_CORS_ORIGINS="https://web.site/custompath/enclosed/"

Like this it doesn't load any resources as it always looks for them in https://web.site/api/config

Additional context

No response

Validations

CorentinTh commented 1 month ago

Hi @graphixillusion

Just added the env variable PUBLIC_BASE_API_URL en variable in #211, available in the v1.6.8/latest version of enclosed. It permits to configure the base URL of the api, it can be an absolute URL (like https://example.com/enclosed) or a path (like /enclosed)

So you can no retry with PUBLIC_BASE_API_URL=web.site/custompath/enclosed

graphixillusion commented 1 month ago

I've just tried this update but it seems to work just for the api and not for all the other resources. So with this new env

PUBLIC_BASE_API_URL=web.site/custompath/enclosed

i'm not having anymore the api error but the site is still not loading becouse it searches for assets and other thigs from web.site/assets/blabla and web.site/site.webmanifest while it should looks in web.site/custompath/enclosed/assets/blabla and web.site/custompath/enclosed/site.webmanifest instead...