Skip to content

docs/install-with-docker/ fail2ban timezone issue #6421

Closed
@stavae

Description

@stavae
  • Gitea version (or commit ref):
    Go1.12.1 (running in docker; using docker-compose)
  • Operating system:
    Ubuntu 18.10
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

The docker installation by default (at least for me) has a different timezone than the host OS. Meaning that fail2ban won't ban anything because the 'find time' window has already expired.

Check command

date && docker exec -ti <docker_container> sh -c "date" the output should be the same

Fix

I fixed this by following this comment link

(copied comment for your convenience)

The easiest solution would be share volume in docker-compose.yml like this

volumes:
    - "/etc/localtime:/etc/localtime:ro"

ro - means container can only read from /etc/localtime of host-machine.

Suggested changes

This is not discussed in any gitea documentation (that could find at least). So I think this should be added to either: install-with-docker or fail2ban-setup.
I personally think adding it to install-with-docker would be preferable, as I can't think of a reason to NOT have the same timezone for docker containers as the host OS.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions