Skip to content

build: default TZ to UTC instead of Europe/Dublin (#970) - #1001

Open
ismisepaul wants to merge 2 commits into
devfrom
dev#970-tz-utc
Open

ismisepaul wants to merge 2 commits into
devfrom
dev#970-tz-utc

Conversation

@ismisepaul

@ismisepaul ismisepaul commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

⚠️ Manual testing required before merging

This changes the default timezone of all three containers. The upgrade behaviour and the CTF schedule can only be checked on a running stack.

Please run this branch, follow the steps, and comment on this PR with the result: pass, or the step that failed and what you saw.

Branch: dev#970-tz-utc

Set up. Use a machine where the Shepherd Docker volumes can be thrown away: down -v deletes their data. JDK 17 and Maven 3.9.2+ are needed.

git fetch origin
git checkout 'dev#970-tz-utc'
mvn -Pdocker clean install -DskipTests
docker compose down -v
docker compose up -d --build
  1. Open https://localhost, accept the self-signed certificate warning, log in as admin / password and set a new password when asked.

Test

  1. Run docker exec secshep_tomcat date and docker exec secshep_mongo date. Both should report UTC.
  2. Run docker exec secshep_mariadb sh -c 'mariadb -uroot -p"$MYSQL_ROOT_PASSWORD" -e "SELECT @@system_time_zone, NOW(), UTC_TIMESTAMP()"'. NOW() and UTC_TIMESTAMP() should be the same.
  3. Optional upgrade check: set TZ=Europe/Dublin in .env, run docker compose up -d --build, and check that date reports Irish time again.

It's broken if: any container still reports Irish time (IST/GMT) with the default .env, or NOW() differs from UTC_TIMESTAMP().


Fixes #970.

What

.env shipped TZ=Europe/Dublin, and docker compose passes it to the MariaDB, Tomcat and MongoDB containers. Dublin moves an hour twice a year. On the last Sunday of October, 01:00–02:00 happens twice, so suspension times and results written in that hour can't be told apart. Nothing told operators the setting existed either.

  • .env: TZ=UTC, with a comment saying what it sets and that it takes any IANA zone.
  • README.md: a new Timezone section under the Docker setup. It covers:
    • the default and how to change it;
    • that stored timestamps and the CTF start/lock/end times use this zone;
    • an upgrade note for installs that never changed TZ: what moves to UTC, and how to keep Europe/Dublin.

This doesn't fix the timezone-dependent code paths themselves (#841, #843). Operators can still set any TZ, so the code has to keep working when it isn't UTC. Showing the server timezone next to the CTF schedule fields, the optional item in the issue, is not included.

Checked

  • docker compose config gives TZ: UTC for all three services.
  • mariadb:12.3, tomcat:11.0-jre17-temurin and mongo all report UTC with TZ=UTC, and IST with TZ=Europe/Dublin, so the variable takes effect in each image.
  • Every step of test.yml passed locally (lint, build, PGP check, compose build, Tomcat config check, unit tests, integration tests).

🤖 Generated with Claude Code

.env set TZ=Europe/Dublin for the database, Tomcat and MongoDB
containers. Dublin moves an hour twice a year, so timestamps stored in
the repeated hour can't be told apart, and nothing told operators the
setting existed. UTC has no gaps or repeats and matches CI and a plain
mariadb container. Operators can still set any IANA zone.

Document the setting, what it affects (stored timestamps and the CTF
schedule), and what changes for an existing install that didn't change
TZ.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ismisepaul ismisepaul added this to the 4.0.0 milestone Oct 25, 2026
Copilot AI balanced review requested due to automatic review settings October 25, 2026 00:19
@ismisepaul ismisepaul moved this from Backlog to Next Release Backlog in Security Shepherd Oct 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The upgrade guidance incorrectly assures operators that expired suspensions are unaffected, although recently expired suspensions can temporarily block login again.

1 open issue
What changed in this PR

Changes the Docker stack’s default timezone to UTC to avoid daylight-saving gaps and repeated hours, while preserving operator-configurable timezones. The underlying timezone-dependent code paths remain out of scope.

Changes:

  • Defaults TZ to UTC and documents supported timezone values.
  • Explains timezone effects on stored timestamps, CTF schedules, and upgrades.
File Description
README.md Adds timezone configuration and upgrade guidance.
.env Defaults container timezones to UTC with explanatory comments.

Review effort: Balanced

Comment thread README.md Outdated
Review follow-up on #970: a suspension stored during Irish summer time is
read an hour later in UTC, so one that ended less than an hour before the
switch applies again until that hour has passed. The upgrade note said
expired suspensions were unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 25, 2026 04:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused configuration and documentation changes are consistent with the existing container setup and have no unresolved findings.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@ismisepaul ismisepaul added the Needs Manual Testing Must be tested by hand from the PR's branch (steps in the PR) before merging label Oct 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Enhancement Needs Manual Testing Must be tested by hand from the PR's branch (steps in the PR) before merging Platform

Projects

Status: Next Release Backlog

Development

Successfully merging this pull request may close these issues.

Default TZ to UTC instead of Europe/Dublin

2 participants