azukaar / Cosmos-Server

☁️ The Most Secure and Easy Selfhosted Home Server. Take control of your data and privacy without sacrificing security and stability (Authentication, anti-DDOS, anti-bot)
https://cosmos-cloud.io
Other
3.65k stars 130 forks source link

[FEAT]: set timezone #328

Closed TasyDevilsky closed 1 month ago

TasyDevilsky commented 1 month ago

Feature Description

As a user I want to be able to set timezone, Because docker logs are in UTZ. I have set using timedatectl correct timezone, but cosmos-cloud didn't respect that in UI ... When I start container with environment variable TZ=Europe/Berlin it works correctly in this specific container when you interactively mount into it, but cosmos-cloud UI still shows logs in UTZ.

azukaar commented 1 month ago
TasyDevilsky commented 1 month ago

That's not entirely true, If you set your timezone on server using: timedatectl set-timezone "Europe/Berlin" cosmos-server container will ignore that. If you try to rewrite in /var/lib/cosmos/cosmos.docker-compose.yml environmental value to - TZ=Europe/Berlin than when you restart your server the value will dissapear, probably because docker container still using it...

So I stopped cosmos-server container, removed it, edited cosmos.docker-compose.yml with timezone, and after that started container cosmos-server again, but it will delete the timezone value again.

So now I'm unsure where to change the timezone value so that the container doesn't overwrite it again.

azukaar commented 1 month ago

cosmos-server container will ignore that.

How do you establish "ignore that"? If you are looking at other containers' logs the timestamp will still be wrong because those container have different TZ variables

If you try to rewrite in /var/lib/cosmos/cosmos.docker-compose.yml environmental value to - TZ=Europe/Berlin than when you restart your server the value will dissapear, probably because docker container still using it...

You cannot edit the container this way that's why, it's a backup it does not control the container. you cannot edit the container by editing this file

TasyDevilsky commented 1 month ago

My server have timezone set to Europe/Berlin (CEST, +0200) (by package timedatectl)

In overall I suppose that I need to change timezone in cosmos-server to be able to show correct timezone in webUI.

azukaar commented 1 month ago

Set the TZ to Europe/Berlin on the Cosmos container (inside the contianer it cannot read the host's TZ itself) then every app you install on the market will be given the right TZ automatically

Dont edit the backup, those are backups it's not gonna do anything.

To edit the Cosmos container simply destroy it and re-run the docker run command