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

Docker: Timezone #7123

Closed
2 of 7 tasks
noboevbo opened this issue Jun 4, 2019 · 7 comments
Closed
2 of 7 tasks

Docker: Timezone #7123

noboevbo opened this issue Jun 4, 2019 · 7 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality
Milestone

Comments

@noboevbo
Copy link

noboevbo commented Jun 4, 2019

  • Gitea version (or commit ref): 1.8.2
  • Git version: 2.20.1
  • Operating system: Docker (Official Image)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

There seems to be a problem with the time zone for OpenSSH. In principle I pass the time zone as environment variable via Docker-Compose (- TZ=Europe/Berlin). The gitea logs have the correct timestamp. The SSH logs have a different timestamp, which causes problems when using fail2ban.

Example output:

`

docker logs gitea
Jun 4 11:19:06 syslogd started: BusyBox v1.29.3
Jun 4 09:19:06 sshd[19]: Server listening on :: port 22.
Jun 4 09:19:06 sshd[19]: Server listening on 0.0.0.0 port 22.
2019/06/04 11:19:06 [T] AppPath: /app/gitea/gitea
`

I already tried to set the timezone manually on top of the entrypoint script like this:
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && /usr/bin/entrypoint
The date is set correctly (e.h. when executing date), but the sshd log is still showing the wrong time. Does anyone have any idea what else could be wrong with that? Is the timezone possibly not taken over correctly by s6?

@lunny lunny added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Jun 4, 2019
@stale
Copy link

stale bot commented Aug 3, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Aug 3, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Aug 4, 2019
@stale stale bot removed the issue/stale label Aug 4, 2019
@lunny
Copy link
Member

lunny commented Aug 15, 2019

I think #7792 will fix this that you can set your Location on app.ini

@lafriks lafriks added this to the 1.10.0 milestone Aug 15, 2019
@lafriks lafriks added type/enhancement An improvement of existing functionality and removed type/question Issue needs no code to be fixed, only a description on how to fix it yourself. labels Aug 15, 2019
@sapk
Copy link
Member

sapk commented Aug 15, 2019

@lunny I think this is openssh logging so it is not related to gitea.
@noboevbo I haven't tested how openssh get his information on timezone but you may need to forward or set file
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"

@lunny
Copy link
Member

lunny commented Aug 15, 2019

@sapk you are right. This is unrelated with #7792

@sapk
Copy link
Member

sapk commented Aug 23, 2019

@noboevbo does my comment resolve your issue ? Can we close it ?

@noboevbo
Copy link
Author

@sapk sorry for the delay. I just tested it and the timezone issue is fixed! I had to forward the timezone set files like you've suggested. Thanks!

@sapk
Copy link
Member

sapk commented Aug 24, 2019

Perfect. Enjoy using gitea.

@sapk sapk closed this as completed Aug 24, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

4 participants