From 78a03f3e3c6102e08cf1c95252a3c90e4990f6f00d8f00e101783e249deb9bc1 Mon Sep 17 00:00:00 2001 From: Paolo Stivanin Date: Mon, 10 Mar 2025 13:31:51 +0000 Subject: [PATCH] Update to version 7.1.0 OBS-URL: https://build.opensuse.org/package/show/Application:Geo/geoipupdate?expand=0&rev=58 --- .gitattributes | 23 ++ .gitignore | 1 + README.SUSE | 75 ++++++ _service | 20 ++ _servicedata | 6 + disable-pandoc.patch | 25 ++ geoipupdate-7.0.1.tar.gz | 3 + geoipupdate-7.1.0.tar.gz | 3 + geoipupdate-legacy | 52 +++++ geoipupdate.changes | 483 +++++++++++++++++++++++++++++++++++++++ geoipupdate.service | 22 ++ geoipupdate.spec | 113 +++++++++ geoipupdate.timer | 12 + vendor.tar.gz | 3 + 14 files changed, 841 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 README.SUSE create mode 100644 _service create mode 100644 _servicedata create mode 100644 disable-pandoc.patch create mode 100644 geoipupdate-7.0.1.tar.gz create mode 100644 geoipupdate-7.1.0.tar.gz create mode 100644 geoipupdate-legacy create mode 100644 geoipupdate.changes create mode 100644 geoipupdate.service create mode 100644 geoipupdate.spec create mode 100644 geoipupdate.timer create mode 100644 vendor.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/README.SUSE b/README.SUSE new file mode 100644 index 0000000..5a15f33 --- /dev/null +++ b/README.SUSE @@ -0,0 +1,75 @@ +Automatically fetching GeoIP "free" databases +============================================== + +On January 2, 2019, Maxmind, the company behind the geoip database, +discontinued the GeoLite Legacy databases, which are no longer +available for download. +(https://support.maxmind.com/geolite-legacy-discontinuation-notice/) + +Free geolocation data is still available through the GeoLite2 databases. +However, due to some legal changes +(https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/) +starting December 30, 2019, the Geolite2 database users are required to +register for a MaxMind account and obtain a license key in +order to download GeoLite2 databases. + +The following packages are introduced to work with the new database format +and distribution: + +libmaxminddb is the library for working with the geolite2 format. It doesn't +download any data, just works with a local .mmdb database. + +geoipupdate is the official Maxmind's tool for downloading the +geo database. Users need to fill in its configuration file with their +Maxmind account details. It's possible to generate the entire config +from the Maxmind web page, once one has an account. + +geolite2legacy is a script for converting geolite2 data to the old +geoip format. Accepts only the CSV format as input. + +We also ship a geoipupdate-legacy subpackage, which is a wrapper around +geoipupdate. It downloads the data and converts them to the old format +using geolite2legacy. The data will be stored at the usual place +(/var/lib/GeoIP), so this should be transparent to existing applications. +It's basically a re-implementation of geoip-fetch which was shipped +within GeoIP package (but no longer works). + +How to get the latest GeoIP data +================================ + +(1) Register a MaxMind account at https://www.maxmind.com/en/geolite2/signup + +(2) Fill in the account information in /etc/GeoIP.conf + +(3) Install geoipupdate package + +# zypper in geoipupdate + +(4) Download the latest GeoIP data + +# geoipupdate + +Local libmaxminddb is up-to-date and packages are to work with the geo data. + +Optional: + +(5) Install geoipupdate-legacy package + +# zypper in geoipupdate-legacy + +(6) Download and export the data to the old format + +# geoipupdate-legacy + +Local GeoIP database is up-to-date and packages are ready to work with +the new geo data using the old GeoIP library. + +Tips +==== + +These databases can become out-of-date quite quickly unless +the user manually fetches and replaces them regularly. +Maxmind generally release updates every couple of weeks. + +Script can be called manually (as root), but the best solution is to add +a crontab entry or a systemd timer such as the one shipped with the package. diff --git a/_service b/_service new file mode 100644 index 0000000..b72c4d2 --- /dev/null +++ b/_service @@ -0,0 +1,20 @@ + + + git + https://github.com/maxmind/geoipupdate + v7.1.0 + .git + @PARENT_TAG@ + enable + v(.*) + + + + *.tar + gz + + + + + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..107cc2e --- /dev/null +++ b/_servicedata @@ -0,0 +1,6 @@ + + + https://github.com/maxmind/geoipupdate + 662daf8302f51f112d2c347234cf7a6c8eb7bb23 + + \ No newline at end of file diff --git a/disable-pandoc.patch b/disable-pandoc.patch new file mode 100644 index 0000000..ee8bdb2 --- /dev/null +++ b/disable-pandoc.patch @@ -0,0 +1,25 @@ +--- a/Makefile.orig 2020-03-04 10:14:17.209181344 +0100 ++++ b/Makefile 2020-03-04 10:14:37.189282590 +0100 +@@ -33,9 +33,7 @@ + data: \ + $(BUILDDIR)/GeoIP.conf \ + $(BUILDDIR)/GeoIP.conf.md \ +- $(BUILDDIR)/geoipupdate.md \ +- $(BUILDDIR)/GeoIP.conf.5 \ +- $(BUILDDIR)/geoipupdate.1 ++ $(BUILDDIR)/geoipupdate.md + + $(BUILDDIR): + mkdir -p $(BUILDDIR) +@@ -53,11 +51,6 @@ + $(BUILDDIR)/geoipupdate.md: $(BUILDDIR) doc/geoipupdate.md + sed -e 's|CONFFILE|$(CONFFILE)|g' -e 's|DATADIR|$(DATADIR)|g' -e 's|$$|$(MAYBE_CR)|g' doc/geoipupdate.md > $(BUILDDIR)/geoipupdate.md + +-$(BUILDDIR)/GeoIP.conf.5: $(BUILDDIR)/GeoIP.conf.md $(BUILDDIR)/geoipupdate.md +- dev-bin/make-man-pages.pl "$(BUILDDIR)" +- +-$(BUILDDIR)/geoipupdate.1: $(BUILDDIR)/GeoIP.conf.5 +- + clean: + rm -rf $(BUILDDIR)/GeoIP.conf \ + $(BUILDDIR)/GeoIP.conf.md \ diff --git a/geoipupdate-7.0.1.tar.gz b/geoipupdate-7.0.1.tar.gz new file mode 100644 index 0000000..5402665 --- /dev/null +++ b/geoipupdate-7.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b982eb02ca27261d0b22990543cc74fb2580a0897336a6990c7d5b6203156aa +size 53955 diff --git a/geoipupdate-7.1.0.tar.gz b/geoipupdate-7.1.0.tar.gz new file mode 100644 index 0000000..23d3011 --- /dev/null +++ b/geoipupdate-7.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c829e3104737ece336714a849ef6574ec3b7a57dcbaf4c4cffd4e7d4db732f68 +size 54596 diff --git a/geoipupdate-legacy b/geoipupdate-legacy new file mode 100644 index 0000000..0c0e9fd --- /dev/null +++ b/geoipupdate-legacy @@ -0,0 +1,52 @@ +#!/bin/bash +geoip_conf='/etc/GeoIP.conf' + +function conf_value() +{ + key=$1 + value=$(grep $key $geoip_conf | sed -e 's:#.*::' -e "s:$key::") + if [ -z $value ]; then + echo $key not configured in $geoip_conf + exit 1 + fi + echo $value +} + +function download_geodata_csv() +{ + csv_product=$1 + echo ">>> Downloading $csv_product.zip" + curl -L "https://download.maxmind.com/app/geoip_download?edition_id=$csv_product&license_key=$license_key&suffix=zip" \ + -o $database_directory/$csv_product.zip +} + +function geolite_to_legacy() +{ + csv_product=$1 + echo ">>> Converting $csv_product.zip to legacy format" + if ! which geolite2legacy >/dev/null 2>&1; then + echo 'geolite2legacy program required' + return + fi + + pushd $database_directory + if [ ! -f $csv_product.zip ]; then + echo $database_directory/$csv_product.zip not found + return + fi + + geolite2legacy -i $csv_product.zip + geolite2legacy -i $csv_product.zip -6 + popd +} + +license_key=$(conf_value 'LicenseKey') +database_directory=$(conf_value 'DatabaseDirectory') + +download_geodata_csv GeoLite2-ASN-CSV +geolite_to_legacy GeoLite2-ASN-CSV +download_geodata_csv GeoLite2-City-CSV +geolite_to_legacy GeoLite2-City-CSV +download_geodata_csv GeoLite2-Country-CSV +geolite_to_legacy GeoLite2-Country-CSV + diff --git a/geoipupdate.changes b/geoipupdate.changes new file mode 100644 index 0000000..e92137f --- /dev/null +++ b/geoipupdate.changes @@ -0,0 +1,483 @@ +------------------------------------------------------------------- +Mon Mar 10 09:53:16 UTC 2025 - valentin.lefebvre@suse.com + +- Update to version 7.1.0: + * Update for v7.1.0 + * Set release date + * Bump bobg/modver from 2.10.1 to 2.10.2 + * Don't mix receiver type + * Remove deactivated linters + * Bump golang.org/x/net from 0.30.0 to 0.31.0 + * Export HTTPError + * Bump golang.org/x/net from 0.29.0 to 0.30.0 + * Bump bobg/modver from 2.10.0 to 2.10.1 + * Bump golang.org/x/net from 0.28.0 to 0.29.0 + * Bump bobg/modver from 2.9.0 to 2.10.0 + * Bump golang.org/x/net from 0.27.0 to 0.28.0 + * Bump golang.org/x/sync from 0.7.0 to 0.8.0 + * Bump github.com/gofrs/flock from 0.12.0 to 0.12.1 + * Bump golang.org/x/net from 0.26.0 to 0.27.0 + * Bump github.com/gofrs/flock from 0.11.0 to 0.12.0 + * Bump bobg/modver from 2.8.1 to 2.9.0 + * Bump github.com/gofrs/flock from 0.9.0 to 0.11.0 + * Run go mod tidy + * Bump github.com/gofrs/flock from 0.8.1 to 0.9.0 + * Updates for GoReleaser v2 + * Add permission for scheduled CodeQL run + * Add modver action + * Do not run CodeQL on push + * Remove example crontab file + * Update frequency references database release schedule + * Bump golang.org/x/net from 0.25.0 to 0.26.0 + * Update golangci-lint config + * Do not require from HTTP handlers + * Bump golangci/golangci-lint-action from 5 to 6 + * Bump golang.org/x/net from 0.24.0 to 0.25.0 + * Update golangci-lint config + * Bump golangci/golangci-lint-action from 4 to 5 + * Add change-log item for #310 + * Respect host scheme if set + * Add check to verify that tag matches go.mod + * Ignore dist dir + +------------------------------------------------------------------- +Mon May 06 14:36:34 UTC 2024 - valentin.lefebvre@suse.com + +- geoipupdate-legacy: update the curl command +- Update to version 7.0.1: + * Update module path version +- Update to version v7.0.0: + * BREAKING CHANGE: Improvements to the HTTP download API. + The client now calls two new endpoints: + * `/geoip/updates/metadata` which is responsible for getting information + about a database edition. + * `/geoip/databases/{edition-id}/download` which is responsible for + downloading the content of a database edition. This new endpoint redirects + downloads to R2 presigned URLs, so systems running `geoipupdate` need to + be able to reach + `mm-prod-geoip-databases.a2649acb697e2c09b632799562c076f2.r2.cloudflarestorage.com` + in addition to `updates.maxmind.com`. + * BREAKING CHANGE: The public package API has been redesigned. The previous + API was not easy to use and had become a maintenance burden. We now + expose a `Client` at `github.com/maxmind/geoipupdate/client` with a + `Download()` method. The intention is to expose less of the `geoipupdate` + internals and provide a simpler and easier to use package. Many + previously exposed methods and types are now either internal only or have + been removed. + * BREAKING CHANGE: If set, `GEOIPUPDATE_VERBOSE` must either be `0` or `1`. + All other values will return an error. + * Setting `GEOIPUPDATE_VERBOSE` to `1` now works as expected. In the 6.0.0 and + 6.1.0 releases, the flag was ignored. Reported by pmcevoy. GitHub #298. + * `geoipupdate` now supports retrying on more types of errors + such as HTTP2 INTERNAL_ERROR. + * Now `geoipupdate` doesn't requires the user to specify the config file + even if all the other arguments are set via the environment variables. + Reported by jsf84ksnf. GitHub #284. + +------------------------------------------------------------------- +Thu Feb 22 17:05:34 UTC 2024 - Valentin Lefebvre + +- Use autosetup to prepare for RPM 4.20. + +------------------------------------------------------------------- +Wed Feb 21 08:11:49 UTC 2024 - valentin.lefebvre@suse.com + +- Update to version 6.1.0: + * Update indirect dependencies + * Bump golang.org/x/sync from 0.5.0 to 0.6.0 + * Bump github/codeql-action from 2 to 3 + * Bump actions/setup-go from 4 to 5 + * Bump golang.org/x/sync from 0.4.0 to 0.5.0 + * Resync golangci-lint config and fix several small issues + * Update changelog after fixing #262 + * Trim white spaces when reading from secret files + * Bump golang.org/x/sync from 0.3.0 to 0.4.0 + * Set API client version to the same as the binary version + * Use https URLs + * Bump actions/checkout from 3 to 4 + * Update Go version in go.mod + +------------------------------------------------------------------- +Thu Aug 24 08:03:51 UTC 2023 - valentin.lefebvre@suse.com + +- Update to 6.0.0: + * geoipupdate now supports configuration via environment variables. Any + configuration set this way will override any value from the config file, + but still be overridden by any associated command line option (if any). + * Changed the signature of NewConfig in pkg/geoipupdate to no longer accept + a positional config file path argument, which can now be passed in using the + option from WithConfigFile along with the other optional parameters. + * geoipupdate and NewConfig no longer require a config file to exist. + * The --stack-trace flag has been removed. This flag has been broken since + 4.11.0. + +------------------------------------------------------------------- +Wed Jun 21 09:48:29 UTC 2023 - Valentin Lefebvre + +- Update to 5.1.1: + * Based on feedback, the change to use a non-root user in 5.1.0 when using + the Docker image has been reverted. There are no non-Docker changes in this + release. See GitHub #233. + +- Update to 5.1.0: + * Fixed the Docker health-check script to use the correct time of the last + update attempt. Reported by cford1080. GitHub #225. + * Added new --output flag to print JSON to standard output describing the + result of the run. + * Compilation with Go versions before 1.19 is no longer supported. + * When using the provided Docker images, geoipupdate no longer runs as root + in the container. Based on pull request by Andreas Grünenfelder. GitHub + #200. + +- Update to 5.0.4: + * On releases 4.9.0 through 5.0.3, the incorrect commit was tagged. This + release attempts to fix the release process to prevent this issue. There + are no code changes to the binaries provided by MaxMind, either on the + GitHub Release page or the MaxMind PPA. + +------------------------------------------------------------------- +Mon Apr 17 09:18:15 UTC 2023 - Valentin Lefebvre + +- Update to 5.0.3: + * The directory /usr/local/share/GeoIP was being used rather than + /usr/share/GeoIP. + +- Update to 5.0.2: + * "Database ... up to date" messages are now only shown if the verbose +flag is set. + +- Update to 5.0.1: + * set the file permissions on downloaded databases to 0600. + +- Update to 5.0.0 + * Redefined the Reader and Writer interface apis in + pkg/geoipupdate/database + * Changed the signature of NewConfig in pkg/geoipupdate to accept + optional parameters. + * Introduced Parallelism as a new flag and config option to enable + concurrent database updates. + +------------------------------------------------------------------- +Tue Mar 21 07:56:45 UTC 2023 - Paolo Stivanin + +- Update to 4.11.1: + * github.com/pkg/errors is no longer used to wrap errors. + * Docker secrets are now supported for the MaxMind account ID and license key. + * The Dockerfile now has a Healthcheck that makes sure the modification date of + the database directory is within the update period. + * Removed extra underscore in script variables preventing the Docker secret + support added in 4.11.0 from working as expected. + +------------------------------------------------------------------- +Wed Nov 9 10:35:24 UTC 2022 - Paolo Stivanin + +- Update to version 4.10.0: + * HTTPS proxies are now supported. + * An HTTP request to get the filename for the edition ID + has been removed. This was previously required as the GeoIP + Legacy edition IDs bore little relation to the name of + the database on disk. + +------------------------------------------------------------------- +Tue Mar 1 15:20:57 UTC 2022 - Paolo Stivanin + +- Update to version 4.9.0: + * The client now sets the User-Agent header. + * The error handling has been improved. + * The goreleaser configuration has been consolidated. There is now + one checksum file for all builds. + +------------------------------------------------------------------- +Mon Nov 08 15:51:20 UTC 2021 - info@paolostivanin.com + +- Update to version 4.8.0: + * The Docker container now supports the following new environment +variables: GEOIPUPDATE_CONF_FILE and GEOIPUPDATE_DB_DIR + +------------------------------------------------------------------- +Mon Sep 20 07:05:44 UTC 2021 - Johannes Segitz + +- Added hardening to systemd service(s) (bsc#1181400). Modified: + * geoipupdate.service + +------------------------------------------------------------------- +Fri Apr 23 14:36:31 UTC 2021 - Paolo Stivanin + +- Update to 4.7.1: + * In verbose mode, we now print a message before each HTTP request. + Previously we would not print anything for retried requests. + * Expected response errors no longer cause request retries. For example, we + no longer retry the download request if the database subscription has + lapsed. + * When running with GEOIPUPDATE_FREQUENCY set, the Docker image will now + stop when sent a SIGTERM instead of waiting for a SIGKILL. Pull request + by Maxence POULAIN. GitHub #135. + +------------------------------------------------------------------- +Wed Dec 16 12:19:29 UTC 2020 - Paolo Stivanin + +- Update to 4.6.0 + * Show version number in verbose output. + * Retry downloads in more scenarios. Previously we would not retry + failures occurring when reading the response body, but now we do. + +------------------------------------------------------------------- +Wed Nov 4 15:54:26 UTC 2020 - Paolo Stivanin + +- Update to version 4.5.0: +* We no longer use a third party library for exponential backoff +* The edition ID is now included when there is a failure retrieving + a database +* The Docker image no longer prints the generated GeoIP.conf when + starting up. This prevents a possible leak of the account's + license key +* The minimum Go version is now 1.11. +* Failing HTTP requests are now retried using an exponential backoff. + The period to keep retrying any failed request is set to 5 minutes + by default and can be adjusted using the new RetryFor + configuration option. +* When using the go package rather than the command-line tool, the + null value for RetryFor will be 0 seconds, which means no retries + will be performed. To change that, set RetryFor explicitly in the + Config you provide, or obtain your Config value via + geoipupdate.NewConfig. + +------------------------------------------------------------------- +Thu May 07 08:06:55 UTC 2020 - Paolo Stivanin + +- Update to version 4.3.0: + * Set release date + * Push multiple versions with different tags + * Use correct org name + * Add a less-strict .yamllintrc + * Test on go 1.14.x + * Shows location of GeoIP.conf when issue in file + * Remove extra space + * Fix typo in config file generation + * Make the edition IDs list format clearer + +------------------------------------------------------------------- +Fri Apr 17 12:35:42 UTC 2020 - Vítězslav Čížek + +- Fix license, it's actually Apache-2.0 or MIT (bsc#1169766) + +------------------------------------------------------------------- +Thu Mar 26 10:21:28 UTC 2020 - Vítězslav Čížek + +- Make /etc/GeoIP.conf readable only by root as it contains MaxMind + account information now +- Add README.SUSE with description how to get the latest data + (jsc#SLE-11184, jsc#ECO-1405) + +------------------------------------------------------------------- +Fri Mar 13 10:40:08 UTC 2020 - pgajdos@suse.com + +- introduce geoipupdate-legacy script [bsc#1156194] +- added sources + + geoipupdate-legacy + +------------------------------------------------------------------- +Wed Mar 04 07:24:45 UTC 2020 - info@paolostivanin.com + +- Update to version 4.2.2: + * Prepare for 4.2.2 + * Use go get on 1.10 + * Only use debug.ReadBuildInfo on 1.12+ + * Update changelog + * Set required Go version to 1.10 + * Test back to Go 1.10 + * Do not unnecessarily use errors.Is + * Add changelog for #76 + * Update for GoReleaser nfpm section change + * Bump copyright year + +- Add disable-pandoc.patch + +------------------------------------------------------------------- +Wed Mar 04 07:23:56 UTC 2020 - info@paolostivanin.com + +- Update to version 4.2.2: + * Prepare for 4.2.2 + * Use go get on 1.10 + * Only use debug.ReadBuildInfo on 1.12+ + * Update changelog + * Set required Go version to 1.10 + * Test back to Go 1.10 + * Do not unnecessarily use errors.Is + * Add changelog for #76 + * Update for GoReleaser nfpm section change + * Bump copyright year + +------------------------------------------------------------------- +Tue Mar 03 15:31:26 UTC 2020 - info@paolostivanin.com + +- Update to version 4.2.2: + * Prepare for 4.2.2 + * Use go get on 1.10 + * Only use debug.ReadBuildInfo on 1.12+ + * Update changelog + * Set required Go version to 1.10 + * Test back to Go 1.10 + * Do not unnecessarily use errors.Is + * Add changelog for #76 + * Update for GoReleaser nfpm section change + * Bump copyright year + +------------------------------------------------------------------- +Tue Mar 3 13:47:31 UTC 2020 - Paolo Stivanin + +- Update to 4.2.2 + A lot of changes since last release. Please have a look at + https://github.com/maxmind/geoipupdate/releases for more info + +------------------------------------------------------------------- +Thu Jun 20 05:35:01 UTC 2019 - Wolfgang Rosenauer + +- added systemd timer for weekly updates + (needs to be enabled by admin) + +------------------------------------------------------------------- +Wed Jun 19 10:34:53 UTC 2019 - Johannes Weberhofer + +- Fixed build + +- Update to version 3.1.1 + + * This version now allows parsing of license keys longer than 12 + characters. + +- Update to version 3.1.0 + + * This version restores the ability to use the `AccountID` / `UserId` + 999999 along with an all-zero license key when downloading free + databases. However, the use of this combination is not recommended + and may break in future versions. + * When printing verbose output, only the first four character of the + `LicenseKey` will now be displayed. + +- Update to version 3.0.1 + + * When there were no updates available, 3.0.0 incorrectly returned an + exit code of 1 instead of 0. This release reverts to the pre-3.0.0 + behavior, returning an exit code of 0 in this case. + +- Update to version 3.0.0 + + * BREAKING CHANGE: When downloading the free databases without a + MaxMind account, you must either not have `AccountID`, `UserId`, + or `LicenseKey` set in your configuration file or they must be set + to the zero values previously recommended in our documentation. Any + other value will cause an authorization error. + * BREAKING CHANGE: The configuration options `Protocol`, + `SkipPeerVerification`, and `SkipHostnameVerification` are no longer + supported. If they are present in the configuration file, they will + be ignored. HTTPS with peer and hostname verification will be used + on all requests. + * BREAKING CHANGE: The configuration file must have the `AccountID` + or the deprecated `UserId` when downloading a paid database. + Previously, when downloading the GeoIP Legacy Country database, you + were able to only provide the `LicenseKey`. + * IMPORTANT: `geoipupdate-pureperl.pl` has been removed and will no + longer be distributed with `geoipupdate`. This Perl script had known + issues and did not have feature parity with the C implementation. If + you were using the Perl version, we recommend that you switch to the + C version. If you are not able to do this, you may continue using the + Perl version distributed with 2.5.0. + * This program no longer uses the following endpoints: + `/app/update_getipaddr`, `/app/update`, and `/app/update_secure`. + `/geoip/databases/{edition_id}/update` is now used instead. + * Fixed issue in `gu_strnlen()` dereferencing a pointer before checking + that it was in array bounds. Issue found by fcntl. + * We now update the default GeoIP.conf during installation so that + directory paths match build parameters. Previously this config always + said the data directory was under /usr/local/share which was not always + accurate. + * Improve the error checking and display the underlying reason for the + error when possible. Reported by Jonathan Kosgei. GitHub #82. + * Document that the `LockFile` is not removed from the filesystem after + a successful exit from the program. GitHub issue #79. + * Make default configuration directory agree with default installation + directory. + +------------------------------------------------------------------- +Thu Nov 16 09:09:29 UTC 2017 - mpluskal@suse.com + +- Update to version 2.5.0: + * Document the LockFile option in the GeoIP.conf man page. + * Remove unused base64 library. + * Add the new configuration option PreserveFileTimes. If set, the + downloaded files will get the same modification times as their + original on the server. Default is 0 (unset). + * Use the correct types when calling curl_easy_setopt(). + * In GeoIP.conf, the UserId option was renamed to AccountID and + the ProductIds option was renamed to EditionIDs. The old + options will continue to work, but upgrading to the new names + is recommended for forward compatibility. +- Cleanup previous changelog entry +- Run tests during build + +------------------------------------------------------------------- +Mon Oct 16 15:35:45 UTC 2017 - Mathias.Homann@opensuse.org + +- Update to version 2.4.0: + * geoipupdate now checks that the database directory is writable. + If it is not, it reports the problem and aborts. + * geoipupdate now acquires a lock when starting up to ensure only + one instance may run at a time. A new option, LockFile, exists + to set the file to use as a lock. By default, LockFile is the + file .geoipupdate.lock in the database directory. + * geoipupdate now prints out additional information from the + server when a download request results in something other than + HTTP status 2xx. This provides more information when the API + does not respond with a database file. In conjunction with + changes to the download service itself, errors such as lacking + a subscription no longer show up with the message "not a valid + gzip file". + * ${datarootdir}/GeoIP is now created on make install. + +------------------------------------------------------------------- +Thu Jan 5 15:40:45 UTC 2017 - mpluskal@suse.com + +- Update to version 2.3.1: + * geoipupdate now uses TCP keep-alive when compiled with cURL + 7.25 or greater. + * Previously, on an invalid gzip file, geoipupdate would output + binary data to stderr. It now displays an appropriate error + message. + * Install README, ChangeLog, GeoIP.conf.default etc into docdir. + * $(sysconfdir) is now created if it doesn't exist. + * The sample config file is now usable. + +------------------------------------------------------------------- +Fri Jul 1 17:31:03 UTC 2016 - toddrme2178@gmail.com + +- Fix Group tag. + +------------------------------------------------------------------- +Thu Feb 4 20:17:08 UTC 2016 - mpluskal@suse.com + +- Update to version 2.2.2 + * geoipupdate now calls fsync on the database directory after a + rename to make it durable in the event of a crash. + +------------------------------------------------------------------- +Sun Nov 8 13:56:31 UTC 2015 - p.drouand@gmail.com + +- Update to version 2.2.1 + * Version bump to fix PPA issue +- Changes from version 2.2.0 + * geoipupdate now verifies the MD5 of the new database before + deploying it. If the database MD5 does not match the expected MD5, + geoipupdate will exit with an error. + * The copy of base64.c and base64.h was switched to a version under + GPL 2+ to prevent a license conflict. + * The LICENSE file was added to the distribution. + * Several issues in the documentation were fixed. +- Remove gpl-2.0.txt; now included in the tarball +- Perform a spec-cleaner + +------------------------------------------------------------------- +Sat Feb 21 11:07:53 UTC 2015 - mpluskal@suse.com + +- Initial packaging + diff --git a/geoipupdate.service b/geoipupdate.service new file mode 100644 index 0000000..f7b2bbd --- /dev/null +++ b/geoipupdate.service @@ -0,0 +1,22 @@ +[Unit] +Description=Update GeoIP databases +Documentation=man:geoipupdate(1) man:GeoIP.conf(5) + +[Service] +# added automatically, for details please see +# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort +ProtectSystem=full +ProtectHome=true +PrivateDevices=true +ProtectHostname=true +ProtectClock=true +ProtectKernelTunables=true +ProtectKernelModules=true +ProtectKernelLogs=true +ProtectControlGroups=true +RestrictRealtime=true +# end of automatic additions +Type=oneshot +WorkingDirectory=/var/lib/GeoIP + +ExecStart=/usr/bin/geoipupdate diff --git a/geoipupdate.spec b/geoipupdate.spec new file mode 100644 index 0000000..6342011 --- /dev/null +++ b/geoipupdate.spec @@ -0,0 +1,113 @@ +# +# spec file for package geoipupdate +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: geoipupdate +Version: 7.1.0 +Release: 0 +Summary: GeoIP update client code +License: Apache-2.0 OR MIT +Group: Productivity/Networking/Other +URL: https://github.com/maxmind/geoipupdate +Source0: %{name}-%{version}.tar.gz +# go mod vendor && tar cf vendor.tar.gz vendor/ +Source1: vendor.tar.gz +Source2: geoipupdate.timer +Source3: geoipupdate.service +Source4: geoipupdate-legacy +Source5: README.SUSE +Patch0: disable-pandoc.patch +%if 0%{?suse_version} >= 1500 +# Build-time parameters +BuildRequires: go >= 1.20 +# Manpage +BuildRequires: perl%{?suse_version:-base} +%endif + +%description +The GeoIP Update program performs automatic updates of GeoIP2 and GeoIP Legacy +binary databases. Currently the program only supports Linux and other +Unix-like systems. + +%package legacy +Summary: GeoIP Lagacy Format Updater +Group: Productivity/Networking/Other +Requires: geoipupdate +Requires: geolite2legacy + +%description legacy +Script for updating data in GeoIP Legacy format. + +%prep +%autosetup -p1 -a1 + +%build +%if 0%{?suse_version} >= 1500 +export GOCACHE=$(pwd -P)/.gocache +export GOTRACEBACK=crash +export GOFLAGS='-a -mod=vendor -buildmode=pie -gcflags=all=-dwarf=false -ldflags=all=-s -ldflags=all=-w' +%make_build \ + CONFFILE=%{_sysconfdir}/GeoIP.conf \ + DATADIR=%{_localstatedir}/lib/GeoIP \ + VERSION=%{version} +%endif + +%install +%if 0%{?suse_version} >= 1500 +install -D -m0644 %{SOURCE2} %{buildroot}%{_unitdir}/geoipupdate.timer +install -D -m0644 %{SOURCE3} %{buildroot}%{_unitdir}/geoipupdate.service +install -D -m0755 build/geoipupdate %{buildroot}%{_bindir}/geoipupdate +%endif +install -D -m0755 %{SOURCE4} %{buildroot}%{_bindir}/geoipupdate-legacy +install -D -m0644 %{SOURCE5} %{buildroot}%{_docdir}/geoipupdate/README.SUSE +install -D -m0644 conf/GeoIP.conf.default %{buildroot}%{_sysconfdir}/GeoIP.conf +install -d -m0755 %{buildroot}%{_localstatedir}/lib/GeoIP +sed -ri \ + -e 's|YOUR_ACCOUNT_ID_HERE|999999|' \ + -e 's|YOUR_LICENSE_KEY_HERE|000000000000|' \ + -e '/^(#\s*)?DatabaseDirectory/ s|^(#\s*)?(\w+\s*).+$|\2%{_localstatedir}/lib/GeoIP|' \ + %{buildroot}%{_sysconfdir}/GeoIP.conf + +%if 0%{?suse_version} >= 1500 +%pre +%service_add_pre %{name}.service + +%post +%service_add_post %{name}.service + +%preun +%service_del_preun %{name}.service + +%postun +%service_del_postun %{name}.service +%endif + +%files +%license LICENSE-* +%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/GeoIP.conf +%dir %{_localstatedir}/lib/GeoIP +%if 0%{?suse_version} >= 1500 +%doc README.md README.SUSE build/geoipupdate.md build/GeoIP.conf.md +%{_bindir}/geoipupdate +%{_unitdir}/%{name}.service +%{_unitdir}/%{name}.timer +%endif + +%files legacy +%{_bindir}/geoipupdate-legacy + +%changelog diff --git a/geoipupdate.timer b/geoipupdate.timer new file mode 100644 index 0000000..42dd542 --- /dev/null +++ b/geoipupdate.timer @@ -0,0 +1,12 @@ +[Unit] +Description=Weekly update of GeoLite2 databases +Documentation=man:geoipupdate(1) man:GeoIP.conf(5) + +[Timer] +OnUnitInactiveSec=1w +OnStartupSec=1h +AccuracySec=1h + +[Install] +WantedBy=timers.target + diff --git a/vendor.tar.gz b/vendor.tar.gz new file mode 100644 index 0000000..5f3a3a7 --- /dev/null +++ b/vendor.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79033fb52b551e07ee4fcf271ce8a1947b4cb31b7ad59b7ac422533369c7078c +size 2559154