webgiss / niolesk

Edit diagrams from textual descriptions! : A kroki interface.
https://niolesk.top
MIT License
84 stars 10 forks source link

Link to own instance not working via NIOLESK_KROKI_ENGINE #30

Closed ping13 closed 1 year ago

ping13 commented 1 year ago

When I use

docker run -d --rm=true -e "NIOLESK_KROKI_ENGINE=https://kroki.example.com/" -p 8017:80 ghcr.io/webgiss/niolesk

on my machine (Windows with wsl2), the localhost-page still has the default in the input box

image

Environment variables looks fine in the ocntainer

/ # env
HOSTNAME=db789cbf0e54
SHLVL=1
HOME=/root
PKG_RELEASE=1
TERM=xterm
NGINX_VERSION=1.23.3
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
NJS_VERSION=0.7.9
NIOLESK_KROKI_ENGINE=https://my.local.instance.com
PWD=/
/ #
gissehel commented 1 year ago

I'm trying to reproduce it with:

I don't reproduce it:

image

gissehel commented 1 year ago

Note that the engine is "the default value" when you don't provide a kroki image as url.

Which means, if you previously used the service with the default engine (ie: using kroki.io as the default engine) and you come back to your new site with an url containing an url pointing on kroki.io (ie: http://127.0.0.1:8017/#https://kroki.io/diagram/data00== ), you'll see "https://kroki.io" as the engine, because it's the engine you provided in the url.

The variable NIOLESK_KROKI_ENGINE is only used as the default engine when you don't provide an url.

So you need to come with the URL in my example http://127.0.0.1:8017/

Does that explain what you've experienced ? Or does the problem still persist ?

ping13 commented 1 year ago

Thanks again for the quick response. Mmh, you are right, it works for http://127.0.0.1:8017/, but not for http://localhost:8017/ 🤔

gissehel commented 1 year ago

So it look like the "old version" was still in the cache.

I suppose that if you go to http://localhost:8017/ with private navigation, you will see the expected default engine...

ping13 commented 1 year ago

🤦 you are right, thanks!