Skip to content

chore: simplify timezone and database CLI setup#660

Merged
herlesupreeth merged 4 commits into
herlesupreeth:masterfrom
FlyGoat:fix-etc-timezone
Jun 27, 2026
Merged

chore: simplify timezone and database CLI setup#660
herlesupreeth merged 4 commits into
herlesupreeth:masterfrom
FlyGoat:fix-etc-timezone

Conversation

@FlyGoat

@FlyGoat FlyGoat commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR removes host-specific timezone assumptions and makes Open5GS database tooling work from an exec shell without entrypoint patching.

Changes included:

  • Remove /etc/timezone:/etc/timezone:ro bind mounts from all Docker Compose YAML files.
  • Keep /etc/localtime:/etc/localtime:ro, which is sufficient for glibc to read local timezone data.
  • Move DB_URI=mongodb://${MONGO_IP}/open5gs into Docker Compose service environments for database-backed components.
  • Drop the HSS init workarounds that symlinked mongo to mongosh and patched open5gs-dbctl from localhost to $MONGO_IP.
  • Update the README CLI provisioning example to run open5gs-dbctl from the webui container and include APN setup commands.

Rationale

/etc/timezone is not portable across Linux distributions. It may be missing or may not be a regular file on RHEL-family systems, which can make Docker fail during bind mount setup. A similar CentOS failure is documented in wekan/wekan#5123.

Since glibc can determine timezone rules from the tzfile data in /etc/localtime, the extra /etc/timezone bind mount is not required.

Putting DB_URI in Compose makes it part of the configured container environment. That means shells started with docker exec, including interactive bash sessions, inherit the database URI directly and can run open5gs-dbctl without runtime script edits.

Validation

  • Confirmed no /etc/timezone references remain in Compose YAML files.
  • Confirmed no script-level export DB_URI entries remain.
  • Confirmed HSS init scripts no longer create the mongo to mongosh symlink or patch open5gs-dbctl.
  • Ran bash -n on both modified HSS init scripts.
  • Ran docker compose -f <file> config -q for every modified Compose file.
  • Rendered 4g-volte-deploy.yaml and confirmed DB_URI resolves to mongodb://172.22.0.2/open5gs for services such as webui and hss.

/etc/timezone is not present or not a regular file on all hosts, including RHEL-family systems, and Docker can fail container startup when the bind mount source has the wrong type. See wekan/wekan#5123 for a CentOS example.

Keep the /etc/localtime bind mount. glibc can determine the local timezone from the tzfile data in /etc/localtime, so mounting /etc/timezone is not required.
@FlyGoat FlyGoat changed the title [codex] Remove /etc/timezone compose mounts chore: Remove /etc/timezone compose mounts Jun 25, 2026
@FlyGoat
FlyGoat marked this pull request as ready for review June 25, 2026 11:30
Set DB_URI in Docker Compose service environments for components that use the Open5GS database. This lets docker exec shells inherit DB_URI directly, so tools like open5gs-dbctl can be run without relying on entrypoint-only exports.
@FlyGoat FlyGoat changed the title chore: Remove /etc/timezone compose mounts chore: Remove /etc/timezone mounts and expose DB_URI Jun 25, 2026
@FlyGoat
FlyGoat marked this pull request as draft June 25, 2026 11:38
FlyGoat added 2 commits June 25, 2026 13:01
DB_URI is now supplied by Docker Compose, so HSS init no longer needs to create a mongo-to-mongosh symlink or patch open5gs-dbctl from localhost to MONGO_IP.
Use the webui container for open5gs-dbctl and document APN provisioning commands now that DB_URI is supplied by Docker Compose.
@FlyGoat FlyGoat changed the title chore: Remove /etc/timezone mounts and expose DB_URI chore: simplify timezone and database CLI setup Jun 25, 2026
@FlyGoat
FlyGoat marked this pull request as ready for review June 25, 2026 12:07
@FlyGoat

FlyGoat commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Hi @herlesupreeth, apologise for the noise on editing the issue, I was trying to ask LLM agent to do some tree wide fixes but it went to far on creating the PR automatically.

The change is in a good shape now, please review.

Thanks

@herlesupreeth herlesupreeth left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Many thanks for this PR!!

@herlesupreeth
herlesupreeth merged commit 3685b58 into herlesupreeth:master Jun 27, 2026
17 checks passed
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