Skip to content

Conversation

iconoclasthero
Copy link
Contributor

@iconoclasthero iconoclasthero commented Oct 3, 2025

Patch logger for ISO8601 timestamps with local TZ offset and fix Docker build failure on Alpine.

References discussion: https://github.com/orgs/fosrl/discussions/1025

Note: timestamps default to +00:00 (UTC) unless TZ env is set and match timestamp format of traefik

Optional future improvement: include tzdata in container for shell/date consistency.

By creating this pull request, I grant the project maintainers an unlimited, perpetual license to use, modify, and redistribute these contributions under any terms they choose, including both the AGPLv3 and the Fossorial Commercial license terms. I represent that I have the right to grant this license for all contributed content.

- server/logger.ts: timestamps now use local TZ offset instead of Z
- Dockerfile: replaced 'npm ci --omit=dev' with 'npm install --omit=dev' to fix Alpine build failure
- References discussion: https://github.com/orgs/fosrl/discussions/1025
- Note: timestamps default to +00:00 (UTC) unless the user sets environment: TZ=<timezone> in docker-compose.yaml

Optional future improvement: include tzdata in the container for shell/date consistency.
- server/logger.ts: timestamps now use local TZ offset instead of Z
- Dockerfile: replaced 'npm ci --omit=dev' with 'npm install --omit=dev' to fix Alpine build failure
- References discussion: https://github.com/orgs/fosrl/discussions/1025
- Note: timestamps default to +00:00 (UTC) unless the user sets environment: TZ=<timezone> in docker-compose.yaml

Optional future improvement: include tzdata in the container for shell/date consistency.
@oschwartz10612
Copy link
Member

Thanks for this! I think the Dockerfile should stay the same like I commented above but otherwise fix seems good thanks for this so much!

Please also include the CLA in the text of your pull request or comment it down below. For convenience:

By creating this pull request, I grant the project maintainers an unlimited, perpetual license to use, modify, and redistribute these contributions under any terms they choose, including both the AGPLv3 and the Fossorial Commercial license terms. I represent that I have the right to grant this license for all contributed content.

@iconoclasthero
Copy link
Contributor Author

Thanks for this! I think the Dockerfile should stay the same like I commented above but otherwise fix seems good thanks for this so much!

Please also include the CLA in the text of your pull request or comment it down below. For convenience:

By creating this pull request, I grant the project maintainers an unlimited, perpetual license to use, modify, and redistribute these contributions under any terms they choose, including both the AGPLv3 and the Fossorial Commercial license terms. I represent that I have the right to grant this license for all contributed content.

I added above in the first comments; I assume that is sufficient? And you're welcome. It looks like gerbil's log format should also be adjusted to match, but at least I can get that in local timezone.

FWIW, and I'm not sure this was clear:
Because the default Alpine image doesn't include /usr/share/zoneinfo/tzdata, the container itself will report the time in UTC from # date. I believe that in order to change this, either tzdata needs to be added to the Alpine image OR the workaround I discussed in #1025 needs to be employed. Not sure how much bigger you want the docker image to get; how big the tzdata package is; and if it actually matters since I don't see a strong need to be exec -it pangolin /bin/shing into the container shell...

$ sdocker exec -it pangolin /bin/sh 
/app # date
Sun Oct  5 14:02:12 UTC 2025
/app # ls /usr/share/
apk     man     misc    udhcpc

@oschwartz10612 oschwartz10612 merged commit 2298725 into fosrl:main Oct 5, 2025
@oschwartz10612
Copy link
Member

This seems to work! I dont think adding the tzdata in is really a problem so I went ahead and included that.

@oschwartz10612
Copy link
Member

@iconoclasthero maybe you could include some documentation in the docs? I think maybe under advanced configuration?

@iconoclasthero
Copy link
Contributor Author

@iconoclasthero maybe you could include some documentation in the docs? I think maybe under advanced configuration?

@oschwartz10612
fosrl/docs-v2#17

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

Successfully merging this pull request may close these issues.

2 participants