]> gitweb.michael.orlitzky.com - geoipyupdate.git/log
geoipyupdate.git
6 months agopyproject.toml: update version to 0.0.4 master 0.0.4
Michael Orlitzky [Fri, 4 Apr 2025 01:51:40 +0000 (21:51 -0400)]
pyproject.toml: update version to 0.0.4

6 months agosrc/geoipyupdate/__init__.py: try os.replace() before shutil.move()
Michael Orlitzky [Fri, 4 Apr 2025 01:45:39 +0000 (21:45 -0400)]
src/geoipyupdate/__init__.py: try os.replace() before shutil.move()

It turns out that shutil.move() is not atomic, which can lead to
issues when replacing the database under heavy load. There is an
alternative in os.replace() that *is* atomic, but does not work across
filesystems. For the best of both worlds, we now try os.replace(), and
fall back to shutil.move() if it fails.

Testing shows that os.replace() raises an OSError across multiple
filesystems, so that's what we catch. The documentation doesn't
specify one way or the other.

Thanks to Paulo Magalhães for report.

7 months agopyproject.toml: update version to 0.0.3 0.0.3
Michael Orlitzky [Sun, 23 Mar 2025 13:30:30 +0000 (09:30 -0400)]
pyproject.toml: update version to 0.0.3

7 months agopyproject.toml: undo PEP639 license change
Michael Orlitzky [Sun, 23 Mar 2025 13:28:16 +0000 (09:28 -0400)]
pyproject.toml: undo PEP639 license change

What an absolute circus. Although the documentation recommends them
and sdist warns about the old format, the new bare license strings
aren't actually supported by anything yet.

7 months agopyproject.toml: update to version 0.0.2 0.0.2
Michael Orlitzky [Sat, 22 Mar 2025 15:19:33 +0000 (11:19 -0400)]
pyproject.toml: update to version 0.0.2

7 months agopyproject.toml: update license classifiers
Michael Orlitzky [Sat, 22 Mar 2025 15:38:39 +0000 (11:38 -0400)]
pyproject.toml: update license classifiers

Getting a lot of loud complaints about this while making an sdist.

7 months agosrc/geoipyupdate/__init__.py: respect umask for the database
Michael Orlitzky [Sat, 22 Mar 2025 15:11:36 +0000 (11:11 -0400)]
src/geoipyupdate/__init__.py: respect umask for the database

All python temporary files are created with mode 600, and that
includes the temporary files that we use to download/decompress the
database. When we eventually move the database to its destination, it
retains these permissions and needs to be chmod'ed. This leads to a
race condition where web applications can raise permission errors in
the instant that the database is unreadable.

The solution to this is obvious, we should just respect the umask.
But python makes this very hard to do: the tempfile module ignores the
umask, and you can't obtain the umask without changing it, and
changing it affects other threads... anyway, it can be done, if
carefully. This commit uses os.chmod() on the database file to make it
world readable and group writable, minus whatever permissions the user
has masked.

18 months agoREADME.rst: reword a bullet point
Michael Orlitzky [Thu, 18 Apr 2024 22:51:57 +0000 (18:51 -0400)]
README.rst: reword a bullet point

18 months agopyproject.toml: use semver for our versioning scheme 0.0.1
Michael Orlitzky [Thu, 18 Apr 2024 22:41:14 +0000 (18:41 -0400)]
pyproject.toml: use semver for our versioning scheme

18 months agodoc/man1/geoipyupdate.1: new man page
Michael Orlitzky [Thu, 18 Apr 2024 22:29:56 +0000 (18:29 -0400)]
doc/man1/geoipyupdate.1: new man page

18 months agoInitial commit.
Michael Orlitzky [Wed, 17 Apr 2024 23:08:22 +0000 (19:08 -0400)]
Initial commit.

Everything except the man page is here. It seems to work.  What more
do you want?