Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timezone in container #96

Closed
PMA-Servizi opened this issue Sep 5, 2024 · 5 comments
Closed

timezone in container #96

PMA-Servizi opened this issue Sep 5, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@PMA-Servizi
Copy link

hello!

would it be possible to include alpine package tzdata in the Dockerfile?
This way one could set environment variable TZ to the desired timezone and have logs with correct timestamp.

thx~

@PMA-Servizi PMA-Servizi added the enhancement New feature or request label Sep 5, 2024
@9001
Copy link
Owner

9001 commented Sep 5, 2024

I have some bad news -- the log output from copyparty is not affected by TZ and is always UTC :-)

if we want this feature, it would be a new option to the program arguments, so it wouldn't be docker specific. But this sounds like a good idea and I'll take a look.

But just in case I've misunderstood you, could you include an example line from the log, just so we're sure we're talking about the same timestamp?

@PMA-Servizi
Copy link
Author

fresh logs, coming right up:

WARNING: Unable to store config in [/cfg/copyparty] due to OSError(30, 'Read-only file system'). Unable to store config in [/root/.config] due to FileNotFoundError(2, 'No such file or directory'). Using [/tmp/copyparty] for config; filekeys/dirkeys will change on every restart. Consider setting XDG_CONFIG_HOME or giving the unix-user a ~/.config/
copyparty v1.14.4 "one step forward" (2024-09-02)
  CPython v3.12.3 on Linux64  [GCC 13.2.1 20240309]
   sqlite 3.45.3*1 | jinja 3.1.4 | pyftpd 1.5.10 | tftp 0.4.0
2024-09-05
12:21:35.962 auth                  discovered config files in /cfg => ['copyparty.conf']
12:21:35.962 auth                  loaded 2 config files:
└/z/initcfg
 └/cfg/..2024_09_05_12_21_34.3721355257/copyparty.conf
12:21:35.962 auth                  volumes and permissions:
"/"  /data
|    read:  admin
|   write:  admin
|    move:  admin
|  delete:  admin
|    dots:  --none--
|     get:  --none--
|   upGet:  --none--
|    html:  --none--
|  uadmin:  admin
12:21:35.962 root                  max clients: 1024
12:21:35.966 tcpsrv                available @  http://127.0.0.1:3923/  (1-lo)
12:21:35.966 tcpsrv                available @  http://[::1]:3923/  (1-lo)
12:21:35.966 tcpsrv                available @  http://10.42.0.82:3923/  (2-eth0, external)
12:21:35.968 dependencies          OK: sqlite, pillow, pillow-webp, ffmpeg, ffprobe, argon2, NG: vips, mutagen, pillow-heif, pillow-avif, see --deps
12:21:35.968 thumb                 decoder preference: pil, ff
12:21:36.052 tcpsrv                listening @ [::]:3923  f3 p1
12:21:36.052 hsrv                  subscribed @ [::]:3923  f3 p1
12:21:36.053 root                  workers OK
12:21:36.054 up2k                  / all-default
12:21:36.066 up2k                    /data/.hist/up2k.db |0|
12:21:36.066 mtag                  could not load Mutagen, trying FFprobe instead
12:21:36.066 up2k                  uploads temporarily blocked due to indexing
12:21:36.066 up2k                  uploads are now possible
12:21:36.066 up2k                  online (reading tags) [/data]
12:21:36.067 up2k                  1 volumes in 0.01 sec
12:21:36.067 up2k                  mtp finished in 0.00 sec (0:00)

@9001
Copy link
Owner

9001 commented Sep 5, 2024

yup, that's what i hoped you meant. I'll see if I can add an option to change the timezone; the reason I don't want to do that based on TZ is because that has many surprising side-effects into shared libraries.

Thanks for the idea :>

@9001 9001 closed this as completed in b599fba Sep 5, 2024
@9001
Copy link
Owner

9001 commented Sep 5, 2024

talked to some friends, turns out I was being a bit too paranoid about TZ... so the next version will use TZ for logs by default :-)

and all docker image flavors except for copyparty/min will have tzdata starting from the next release, so that should be all good 👍

the old behavior of forcing UTC can be restored by specifying --log-utc, and that is a tiny bit faster than using TZ/Localtime -- but I also noticed some optimization opportunities while adding this, so the next version will always be a bit faster than the current/previous versions regardless.

I think the next release will be this weekend; need to fix something else first, and that's gonna require writing a lot of tests, so we'll see...

thx again for the idea 😁

@PMA-Servizi
Copy link
Author

that's great! thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants