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

Can not set timezone in Docker version #1654

Closed
MatejKovacic opened this issue Oct 20, 2024 · 10 comments
Closed

Can not set timezone in Docker version #1654

MatejKovacic opened this issue Oct 20, 2024 · 10 comments

Comments

@MatejKovacic
Copy link

Versions

  • Pi-hole version is v5.18.3 (Latest: v5.18.3)
  • web version is v5.21 (Latest: v5.21)
  • FTL version is v5.25.2 (Latest: v5.25.2)

Platform

  • OS and version: Debian 12.7
  • Platform: Docker

Expected behavior

When I run docker-compose up -d, timezone is not set.

Actual behavior / bug

It seems that timezone parameter is not passed to Pihole docker?

Steps to reproduce

In docker-compose.yml I have:

    environment:
      - TZ='Europe/Ljubljana'

When I log in to web interface, times are still in UTC and not in my timezone.

@rdwebdesign
Copy link
Member

I could be wrong, but I think the correct syntax should be:

    environment:
      - TZ=Europe/Ljubljana

Or:

    environment:
      TZ: 'Europe/Ljubljana'

@MatejKovacic
Copy link
Author

OK, I changed it to

    environment:
      - TZ=Europe/Ljubljana

...and it is still the same problem.

Also, I have this:

    environment:
      - FTLCONF_LOCAL_IPV4=${FTLCONF_LOCAL_IPV4}
      - TZ=Europe/Ljubljana
      - WEBTHEME=${WEBTHEME:-default-light}
      - REV_SERVER=false
      - PIHOLE_DNS_=xx.xx.xx.xx#5335
      - DNSSEC=true
      - DNSMASQ_LISTENING=single

... and those settings do work (for instance, custom DNS, webtheme, etc... Just timezone does not work.

@yubiuser yubiuser transferred this issue from pi-hole/pi-hole Oct 20, 2024
@yubiuser
Copy link
Member

Do you see such line in your docker log?

[i] Added ENV to php:"
     "TZ" => "Europe/Ljubljana",

@MatejKovacic
Copy link
Author

Yes,

  [i] Added ENV to php:
                    "TZ" => "Europe/Ljubljana",

@yubiuser
Copy link
Member

Please switch into your running container and check if /etc/lighttpd/conf-available/15-pihole-admin.conf contains the correct TZ env variable.

@rdwebdesign
Copy link
Member

rdwebdesign commented Oct 20, 2024

Running from the host, what is the output of this command (replace Pihole with the name of your container)?

docker exec Pihole bash -c 'echo $TZ'

EDIT:
Please also generate a debug log, upload it and post here only the Token.

@MatejKovacic
Copy link
Author

docker exec pihole bash -c 'echo $TZ'
Europe/Ljubljana

But when I open a new domain and check the logs are exactly two hours back.

@MatejKovacic
Copy link
Author

Wow, just found out that Firefox shows logs with -2 hours (in UTC), but Chromium shows times correctly (in Europe/Ljubljana).

Why??

@rdwebdesign
Copy link
Member

Note sure...

Try adding this to your compose file:

  volumes: 
    - /etc/timezone:/etc/timezone:ro

@MatejKovacic
Copy link
Author

OK, it seems to be crappy Firefox setting: under about:config I have privacy.resistFingerprinting = true. So it is not Pihole problem...

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

No branches or pull requests

3 participants