Closed Tha-Fox closed 6 months ago
For timezones in Kubernetes, it gets a bit complicated, but setting the TZ
variable is definitely always the first step. Unfortunately, when it comes to nginx specifically, I haven't actually tried setting the timezone there, but personally, I use k8tz to inject timezones to the bulk of my k8s resources that need it. This also helps tackle things like cronjobs that are a bit harder to control in k8s.
Open to any other community members chatting about what they use as well :)
Oh, sorry, missed that this was a feature request. :pray: If you'd like a feature in the nextcloud docker container specifically, you need to go to the upstream repo: nextcloud/docker. That repo has a separate set of maintainers.
Sorry to ping you a third time @Tha-Fox but I found something in the nextcloud server docs!
Perhaps you can use this the above default_timezone parameter using the nextcloud.configs.myconfigfile.php feature?
This is untested, but perhaps something like this would be helpful?
nextcloud:
configs:
timezone.config.php: |-
<?php
$CONFIG = array (
'default_timezone' => 'Europe/Berlin',
);
Sorry, I've had covid for like a week now and my brain is slow, so I have to just ride any moment of clarity I have :sweat_smile: I apologize for all the confusion :pray:
@provokateurin do we want to provide a timezone feature in the helm chart to automatically set this? :)
I'd say the config.php way is enough :thinking: If the docker image provides an env variable then we should support that.
Yeah, I couldn't find on for the docker image. :shrug: It would be nice to have the env var upstream though. If any community members would like to do that PR to nextcloud/docker, please let us know here and we will also review a PR here for accommodating that in this repo as well.
Thank you both for your replies!
Perhaps you can use this the above default_timezone parameter using the nextcloud.configs.myconfigfile.php feature?
My Nextcloud instance has correct timezone applied via extraEnv
, so that is not a problem. Timezone is incorrect only within nextcloud-nginx
container.
I have no skills with Helm charts, so from my perspective this issue can be closed. I'll add your excellent suggestion, k8tz
, to my toolchain and fix the timezone that way.
Description of the change
Currently I can set the timezone for
nextcloud
container viaextraEnv
and installingtzdata
inpostStartCommand
. However, I can't find any similar setting fornextcloud-nginx
container in the Helm chart. This leads to situation, wherenextcloud
container is two hours "ahead" compared tonextcloud-nginx
container.I think the most straightforward way to add this feature would be adding similar
extraEnv
fornextcloud-nginx
as there already is fornextcloud
container, but I've got to admit that I'm no expert when it comes to Helm charts.Benefits
Troubleshooting is easier, when both containers have the same timezone.
Additional information
I'm currently running Nextcloud with this configuration:
I noticed that by default the timezone is UTC, but if I run manually
export TZ=Europe/Helsinki
insidenextcloud-nginx
container, I get the correct time withdate
.