Giter Club home page Giter Club logo

Comments (9)

simonmicro avatar simonmicro commented on August 30, 2024

something like this might be required to define TZ in the entrypoint, still working on it....

#Change timzeone if set
[[ -n ${TZ} ]] && [[ -f /usr/share/zoneinfo/${TZ} ]] && [[ -w /etc/localtime ]] && ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime
#use UTC if not
[[ ! -f /etc/localtime ]] && ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime

-> #3 (comment)

from py-kms.

edgd1er avatar edgd1er commented on August 30, 2024

well,

That should be ok, provided TZ was defined as env var.

#Change timzeone if set
[[ "DEBUG" == ${LOGLEVEL} ]] && ls -al /etc/localtime
if [[ -n ${TZ} ]] && [[ -f /usr/share/zoneinfo/${TZ} ]]; then
  # if file is RO then skip.
  if [[ ! -f /etc/localtime ]] || [[ -w /etc/localtime ]]; then
    ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime
  fi
fi
#use UTC if not
[[ ! -f /etc/localtime ]] && ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime

from py-kms.

simonmicro avatar simonmicro commented on August 30, 2024

Hey, could you post the error logs? These are my logs (therefore non-critical):

                                   _mnPad: {12}
                                   mnPad: {b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'}

/usr/lib/python3.8/site-packages/tzlocal/unix.py:164: UserWarning: Can not find any timezone configuration, defaulting to UTC.
  warnings.warn('Can not find any timezone configuration, defaulting to UTC.')
Wed, 13 Oct 2021 20:07:33 INFO     Machine Name: H6kuYYI1nXxaPuxOvbZ1IJS3LD4444fSwHbMuZ5p43G0aN

from py-kms.

edgd1er avatar edgd1er commented on August 30, 2024
kms       |                                    mnPad: {b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
kms       |                                    00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
kms       |                                    00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'}
kms       | 
kms       | /usr/lib/python3.9/site-packages/tzlocal/unix.py:164: UserWarning: Can not find any timezone configuration, defaulting to UTC.
kms       |   warnings.warn('Can not find any timezone configuration, defaulting to UTC.')
kms       | Wed, 13 Oct 2021 19:43:45 WARNING  With count = 26, activated client could be detected as not genuine !
kms       | Wed, 13 Oct 2021 19:43:45 INFO     Machine Name: l2i4VortWdGJbbyReaK7tWrKq6jnr

if /etc/localtime is not defined, you have these lines.
As a temporary fix, you can mount your local localtime: -v /etc/localtime:/etc/localtime:ro

the bash snipped should/could be added in the entrypoint when still running as root.( root privileges needed to change /etc/ content)

PS: i'm always using a container to run py-kms.

from py-kms.

Matthew-Beckett avatar Matthew-Beckett commented on August 30, 2024

I will need to add this as a fix to the Helm chart

from py-kms.

simonmicro avatar simonmicro commented on August 30, 2024

I worked-around it in the base docker image. Please try the newest version and feel free to reopen this issue in case that didn't work.

from py-kms.

edgd1er avatar edgd1er commented on August 30, 2024

Well, it would be nice to have the TZ based on a ENV variable.

from py-kms.

simonmicro avatar simonmicro commented on August 30, 2024

I tried that, but any TZ var was ignored by the build-in library. Ofc we could try to respect an environment variable in py-kms, so feel free to implement it :)

from py-kms.

edgd1er avatar edgd1er commented on August 30, 2024

I have TZ ok (through env var)+ log for client on stdout.
I try to change now uid/gid of user as I need to have specific id/gid on mounted volume and drop root privileges after having set TZ and UID/GID.. without any luck til now. I might have to split entrypoint in 2. My fork might be already to different from yours.

from py-kms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.