Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezone env var not working and add new env var for country? #74

Closed
simonvanderveldt opened this issue Nov 12, 2017 · 4 comments
Closed

Comments

@simonvanderveldt
Copy link

First of all thanks for this image! Very nice, saves me having to install all kinds of Java stuff ;)

I just started the container/the controller for the first time and it seems like the timezone env var isn't being picked up. I passed TZ='Europe/Amsterdam' as env var, yet the setup wizard has "Brussels, Copenhagen, Madrid, Paris" selected.
Any idea why this isn't working?

And I was wondering if it would be possible to pass the country as an env var as well, just like the timezone. Hoping to be able to just skip the initial setup screen when starting a clean container :)

@jacobalberty
Copy link
Owner

I cant find any way to influence the wizard's defaults. I suspect (haven't been able to confirm or deny though) that it is getting that data from your web browser and not from the server environment.

@jbehrends
Copy link

Not sure if this is the same issue or not.. but I found that the timezone in the container (5.8.30) appeared to be UTC and passing the TZ variable did nothing to fix/change that. My fix was to mount in the host system's (in my cause Ubuntu) timezone/localtime files when running the container.

Example docker run options:

  -v /etc/timezone:/etc/timezone:ro \
  -v /etc/localtime:/etc/localtime:ro \

@phroggster
Copy link
Contributor

The time stamps reported in the web interface are controlled appropriately from the web interface (and are set from the browser time zone during initial setup). Unfortunately, the initial setup wizard only seems to take the browser's reported UTC offset into account, then attempts to map that to a time zone, which can result in an inaccurate pre-selected default. You're just going to have to select the correct time zone during initial setup, adjust it during runtime, or file a bug with Ubiquiti to inform them that the default isn't accurate in certain conditions.

However, the time stamps reported in the container logs are seemingly locked to UTC regardless of any other setting. Adding an apt-get install tzdata to the image build process yields container logging timestamps that honor the TZ environment variable appropriately. Bind-mounting /etc/timezone and /etc/localtime seemingly works on a Debian-based host, but it isn't portable. Adding additional processing to docker-entrypoint.sh to dump the TZ environment var into /etc/timezone and parse & relink /etc/localtime is another possibility, but it's way easier to just install tzdata in the image and let it convert the time stamps automatically based on TZ.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants