feature: serve penpot un subpath
Is your feature request related to a problem? Please describe.
I’m running Penpot behind a reverse proxy with subpath (i.e 'https://my-host/penpot' ).
Setting PENPOT_PUBLIC_URI in docker-compose.penpot.env does'nt reflect to public-uri(defined in frontend/src/app/config.cljs)
Describe the solution you'd like.
Hope to add penpotPublicURI setting according to 'PENPOT_PUBLIC_URI' by nginx-entrypoint.sh
var penpotPublicURI="<Value of PENPOT_PUBLIC_URI>";
Describe alternatives you've considered.
No response
Additional context
No response
Question: why do you need to set it? I mean, when it is not set on frontend it uses the default origin/href. Ourselves don't use it on our SAAS.
I believe you are referring to the following code for what happens when "penpotPublicURI" has no value.
frontend/src/app/config.cljs
(def public-uri
(atom
(normalize-uri (or (obj/get global "penpotPublicURI")
(.-origin ^js location)))))
However, this code doesn't seem to take subpaths into account.
The 'public-uri' is set to 'https://my-host/' even though the penpot's access URL is 'https://my-host/penpot'
My current workaround is:
docker/images/files/nginx-entrypoint.sh(entrypoint.sh in docker image)
if [ "$PENPOT_PUBLIC_URI" != "http://localhost:9001" ]; then
printf "var penpotPublicURI='%s';\\n" "$PENPOT_PUBLIC_URI" >> "$1"
fi
Oh, I understand, penpot right now is not working correctly on subpath, so setting it on config.js will not male it work correctly anyway. This is something that some people have asked us for, and we have had it working for some versions, but right now it is buggy and we consider it as not supported.
In any case, soon we will have a conversation about on-premise features and I will raise this issue to talk about on the team.
Thank you for the title change!