[PR #579] [CLOSED] Use env variable TZ to set timezone, fallback to UTC (updated) #1495

Closed
opened 2025-12-29 02:30:17 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/579
Author: @deonthomasgy
Created: 5/10/2022
Status: Closed

Base: mainHead: dev/thomas/timezone-2


📝 Commits (10+)

  • 5dd32ac Use env variable TZ to set timezone, fallback to UTC
  • e16f1c1 Added NowFromTZEnv() to get time via timezone
  • 91b1d0d Use NowFromTZEnv to get time
  • 7bf5b48 import from headscale, use NowFromTZEnv to get time.
  • 9b18646 remove newline
  • 7fc04e2 add func to convert time to TZ env time
  • 47f7f98 use TimeFromTZEnv to get LastSeen time
  • e56e23e add newline before return
  • ac49671 add newline before return
  • 6163291 override func properly

📊 Changes

12 files changed (+60 additions, -16 deletions)

View changed files

📝 api.go (+3 -3)
📝 app.go (+2 -2)
📝 cmd/headscale/cli/api_key.go (+1 -1)
📝 cmd/headscale/cli/nodes.go (+1 -1)
📝 cmd/headscale/cli/preauthkeys.go (+2 -1)
📝 cmd/headscale/cli/utils.go (+18 -0)
📝 cmd/headscale/headscale.go (+3 -1)
📝 config-example.yaml (+8 -0)
📝 machine.go (+1 -1)
📝 poll.go (+5 -5)
📝 preauth_keys.go (+1 -1)
📝 utils.go (+15 -0)

📄 Description

  • read the CONTRIBUTING guidelines
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/579 **Author:** [@deonthomasgy](https://github.com/deonthomasgy) **Created:** 5/10/2022 **Status:** ❌ Closed **Base:** `main` ← **Head:** `dev/thomas/timezone-2` --- ### 📝 Commits (10+) - [`5dd32ac`](https://github.com/juanfont/headscale/commit/5dd32acc6aac1dd5e729ff7d2691828c18df8aef) Use env variable TZ to set timezone, fallback to UTC - [`e16f1c1`](https://github.com/juanfont/headscale/commit/e16f1c1cd46595710d0f83d3b61e71067009f222) Added NowFromTZEnv() to get time via timezone - [`91b1d0d`](https://github.com/juanfont/headscale/commit/91b1d0d877f270e8b2c5b281756c744c14a8a1fc) Use NowFromTZEnv to get time - [`7bf5b48`](https://github.com/juanfont/headscale/commit/7bf5b48d9f62bd4a4786561041dbd56c8aef82db) import from headscale, use NowFromTZEnv to get time. - [`9b18646`](https://github.com/juanfont/headscale/commit/9b186463cb7fc7f72470e90b4dc89d91dbf78f5d) remove newline - [`7fc04e2`](https://github.com/juanfont/headscale/commit/7fc04e283d3363bdf1d3ce5a6b5fe85b21aa608a) add func to convert time to TZ env time - [`47f7f98`](https://github.com/juanfont/headscale/commit/47f7f9884bf202949b864e0ac82b9c8271be77d7) use TimeFromTZEnv to get LastSeen time - [`e56e23e`](https://github.com/juanfont/headscale/commit/e56e23e24f96e205d858a2e81f2c6543af080301) add newline before return - [`ac49671`](https://github.com/juanfont/headscale/commit/ac4967105ede94984de65ca9344ea0fdda794409) add newline before return - [`6163291`](https://github.com/juanfont/headscale/commit/6163291c01953e1cf822a781868c63bea60ce482) override func properly ### 📊 Changes **12 files changed** (+60 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `api.go` (+3 -3) 📝 `app.go` (+2 -2) 📝 `cmd/headscale/cli/api_key.go` (+1 -1) 📝 `cmd/headscale/cli/nodes.go` (+1 -1) 📝 `cmd/headscale/cli/preauthkeys.go` (+2 -1) 📝 `cmd/headscale/cli/utils.go` (+18 -0) 📝 `cmd/headscale/headscale.go` (+3 -1) 📝 `config-example.yaml` (+8 -0) 📝 `machine.go` (+1 -1) 📝 `poll.go` (+5 -5) 📝 `preauth_keys.go` (+1 -1) 📝 `utils.go` (+15 -0) </details> ### 📄 Description <!-- Please tick if the following things apply. You… --> - [x] read the [CONTRIBUTING guidelines](README.md#user-content-contributing) - [x] raised a GitHub issue or discussed it on the projects chat beforehand - [ ] added unit tests - [ ] added integration tests - [ ] updated documentation if needed - [ ] updated CHANGELOG.md <!-- If applicable, please reference the issue using `Fixes #XXX` and add tests to cover your new code. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 02:30:17 +01:00
adam closed this issue 2025-12-29 02:30:17 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1495