milesmcc / shynet

Modern, privacy-friendly, and detailed web analytics that works without cookies or JS.
Apache License 2.0
2.89k stars 183 forks source link

$LATITUDE / $LONGITUDE not working #238

Closed tcpekin closed 6 months ago

tcpekin commented 1 year ago

Hello, when I launch my docker container (using docker-compose), I get the following error

WARN[000] The "LATITUDE" variable is not set. Defaulting to a blank string.
WARN[000] The "LONGITUDE" variable is not set. Defaulting to a blank string.

This then manifests itself when clicking on the 'Location - Open in Maps' button when viewing a session. OSM opens, but not to a specific location.

Any idea what might be causing this? I don't think I've changed that much in Shynet, it's all relatively standard what I've done I think, but I'm happy to give more details if you want.

milesmcc commented 1 year ago

Has anyone else run into this issue? Looks like a new one...

tcpekin commented 1 year ago

I just cloned the repo into a fresh directory, changed the shynet image to the edge one, and tried both the Postgres and SQLite databases (not sure if that should matter). I also changed hosts to localhost... Immediately upon running docker compose up I get the following:

image

followed by the normal Docker output.

tcpekin commented 1 year ago

Maybe this has something to do with it? I'll test out the double $$.

milesmcc commented 1 year ago

Ah, so it seems to be misinterpreting this line as variable interpolation:

https://github.com/milesmcc/shynet/blob/f746bce1001c925d4992bcfc5c890306861faa86/TEMPLATE.env#L105

Does the issue go away if you wrap the string in quotes (or escape the value some other way)?

tcpekin commented 1 year ago

String quotes didn't work for me, but double dollar signs did and the link to OSM works in the dashboard. https://github.com/docker/compose/issues/4189#issuecomment-995404118

I haven't tested it with just a normal Docker command passing in a .env file (not using compose) but it might be different... so I'm hesitant to make a PR myself.