Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package geoipupdate for openSUSE:Factory checked in at 2025-03-10 18:07:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/geoipupdate (Old) and /work/SRC/openSUSE:Factory/.geoipupdate.new.19136 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "geoipupdate" Mon Mar 10 18:07:14 2025 rev:28 rq:1251805 version:7.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/geoipupdate/geoipupdate.changes 2024-05-07 18:04:42.153340531 +0200 +++ /work/SRC/openSUSE:Factory/.geoipupdate.new.19136/geoipupdate.changes 2025-03-10 18:07:35.572248570 +0100 @@ -1,0 +2,42 @@ +Mon Mar 10 09:53:16 UTC 2025 - [email protected] + +- 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 + +------------------------------------------------------------------- Old: ---- geoipupdate-7.0.1.tar.gz New: ---- geoipupdate-7.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ geoipupdate.spec ++++++ --- /var/tmp/diff_new_pack.kCsm99/_old 2025-03-10 18:07:36.592291362 +0100 +++ /var/tmp/diff_new_pack.kCsm99/_new 2025-03-10 18:07:36.592291362 +0100 @@ -1,7 +1,7 @@ # # spec file for package geoipupdate # -# Copyright (c) 2024 SUSE LLC +# 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 @@ -17,7 +17,7 @@ Name: geoipupdate -Version: 7.0.1 +Version: 7.1.0 Release: 0 Summary: GeoIP update client code License: Apache-2.0 OR MIT ++++++ _service ++++++ --- /var/tmp/diff_new_pack.kCsm99/_old 2025-03-10 18:07:36.648293711 +0100 +++ /var/tmp/diff_new_pack.kCsm99/_new 2025-03-10 18:07:36.652293879 +0100 @@ -2,7 +2,7 @@ <service name="tar_scm" mode="disabled"> <param name="scm">git</param> <param name="url">https://github.com/maxmind/geoipupdate</param> - <param name="revision">v7.0.1</param> + <param name="revision">v7.1.0</param> <param name="exclude">.git</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.kCsm99/_old 2025-03-10 18:07:36.672294718 +0100 +++ /var/tmp/diff_new_pack.kCsm99/_new 2025-03-10 18:07:36.676294886 +0100 @@ -1,7 +1,7 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/maxmind/geoipupdate</param> - <param name="changesrevision">0df16c46069da6157a6e00ac7b9c552f037d906a</param> + <param name="changesrevision">662daf8302f51f112d2c347234cf7a6c8eb7bb23</param> </service> </servicedata> (No newline at EOF) ++++++ geoipupdate-7.0.1.tar.gz -> geoipupdate-7.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/.github/workflows/codeql-analysis.yml new/geoipupdate-7.1.0/.github/workflows/codeql-analysis.yml --- old/geoipupdate-7.0.1/.github/workflows/codeql-analysis.yml 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/.github/workflows/codeql-analysis.yml 2024-11-18 18:41:36.000000000 +0100 @@ -1,13 +1,13 @@ name: "Code scanning - action" on: - push: - branches-ignore: - - 'dependabot/**' pull_request: schedule: - cron: '0 11 * * 2' +permissions: + security-events: write # Used by this action. + jobs: CodeQL-Build: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/.github/workflows/golangci-lint.yml new/geoipupdate-7.1.0/.github/workflows/golangci-lint.yml --- old/geoipupdate-7.0.1/.github/workflows/golangci-lint.yml 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/.github/workflows/golangci-lint.yml 2024-11-18 18:41:36.000000000 +0100 @@ -13,6 +13,6 @@ steps: - uses: actions/checkout@v4 - name: golangci-lint - uses: golangci/golangci-lint-action@v4 + uses: golangci/golangci-lint-action@v6 with: version: latest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/.github/workflows/modver.yml new/geoipupdate-7.1.0/.github/workflows/modver.yml --- old/geoipupdate-7.0.1/.github/workflows/modver.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/geoipupdate-7.1.0/.github/workflows/modver.yml 2024-11-18 18:41:36.000000000 +0100 @@ -0,0 +1,21 @@ +name: modver + +on: + pull_request: + +permissions: + contents: read # This gets granted by default, so keep granting it. + packages: read # This gets granted by default, so keep granting it. + pull-requests: write # Needed to comment on the PR. + +jobs: + modver: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: bobg/[email protected] + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + pull_request_url: https://github.com/${{ github.repository }}/pull/${{ github.event.number }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/.gitignore new/geoipupdate-7.1.0/.gitignore --- old/geoipupdate-7.0.1/.gitignore 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/.gitignore 2024-11-18 18:41:36.000000000 +0100 @@ -1,5 +1,6 @@ *.swp /build +/dist /cmd/geoipupdate/geoipupdate /vendor .idea diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/.golangci.toml new/geoipupdate-7.1.0/.golangci.toml --- old/geoipupdate-7.0.1/.golangci.toml 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/.golangci.toml 2024-11-18 18:41:36.000000000 +0100 @@ -9,6 +9,11 @@ [linters] enable-all = true disable = [ + # The canonical form is not always the most common form for some headers + # and there is a small chance that switching existing strings could + # break something. + "canonicalheader", + "cyclop", "dogsled", "dupl", @@ -17,8 +22,8 @@ # that would need to be addressed. "dupword", - # This doesn't seem to know about CTEs or DELETEs with RETURNING - "execinquery", + # We don't follow its policy about not defining dynamic errors. + "err113", # We often don't initialize all of the struct fields. This is fine # generally @@ -41,9 +46,7 @@ "gochecksumtype", "gocognit", - "goerr113", "godox", - "gomnd", # This only "caught" one thing, and it seemed like a reasonable use # of Han script. Generally, I don't think we want to prevent the use @@ -65,6 +68,10 @@ # what to allow. "maintidx", + # Using a const for every number doesn't necessarily increase code clarity, + # and it would be a ton of work to move everything to that. + "mnd", + # Causes panics, e.g., when processing mmerrors "musttag", @@ -99,18 +106,6 @@ # This would probably be good, but we would need to configure it. "wsl", - # These are all deprecated - "deadcode", - "exhaustivestruct", - "golint", - "ifshort", - "interfacer", - "maligned", - "nosnakecase", - "scopelint", - "structcheck", - "varcheck", - # Require Go 1.22 "copyloopvar", "intrange", @@ -154,11 +149,6 @@ 'os.RemoveAll', ] -# Ignoring Close so that we don't have to have a bunch of -# `defer func() { _ = r.Close() }()` constructs when we -# don't actually care about the error. -ignore = "Close,fmt:.*" - [linters-settings.errorlint] errorf = true asserts = true @@ -608,6 +598,16 @@ [[issues.exclude-rules]] linters = [ + "errcheck", +] +# There are many cases where we want to just close resources and ignore the +# error (e.g., for defer f.Close on a read). errcheck removed its built-in +# wildcard ignore. I tried listing all of the cases, but it was too many +# and some were very specific. +source = "\\.Close" + +[[issues.exclude-rules]] +linters = [ "stylecheck", ] # ST1016 - methods on the same type should have the same receiver name. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/.goreleaser.yml new/geoipupdate-7.1.0/.goreleaser.yml --- old/geoipupdate-7.0.1/.goreleaser.yml 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/.goreleaser.yml 2024-11-18 18:41:36.000000000 +0100 @@ -1,4 +1,5 @@ project_name: 'geoipupdate' +version: 2 archives: - id: 'archives-unix' builds: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/CHANGELOG.md new/geoipupdate-7.1.0/CHANGELOG.md --- old/geoipupdate-7.0.1/CHANGELOG.md 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/CHANGELOG.md 2024-11-18 18:41:36.000000000 +0100 @@ -1,5 +1,15 @@ # CHANGELOG +## 7.1.0 (2024-11-18) + +* Allow the `Host` configuration directive and the `GEOIPUPDATE_HOST` + environment variable to accept a value with the scheme set. If not set, it + will continue to default to `https://`. Pull request by Gabe Cook. GitHub + #310. +* Export `HTTPError` to enable fine-grained error handling for users of + `github.com/maxmind/geoipupdate/client`. Pull request by Ryan Davis. GitHub + #341. + ## 7.0.1 (2024-04-08) * The 7.0.0 release was broken and has been retracted. This release updates the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/client/client.go new/geoipupdate-7.1.0/client/client.go --- old/geoipupdate-7.0.1/client/client.go 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/client/client.go 2024-11-18 18:41:36.000000000 +0100 @@ -10,6 +10,8 @@ // Client downloads GeoIP2 and GeoLite2 MMDB databases. // // After creation, it is valid for concurrent use. +// +//nolint:recvcheck // changing this would be a breaking change. type Client struct { accountID int endpoint string diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/client/download.go new/geoipupdate-7.1.0/client/download.go --- old/geoipupdate-7.0.1/client/download.go 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/client/download.go 2024-11-18 18:41:36.000000000 +0100 @@ -17,6 +17,11 @@ "github.com/maxmind/geoipupdate/v7/internal/vars" ) +// HTTPError is an error from performing an HTTP request and receiving a non-200 status code. +// +// See https://dev.maxmind.com/geoip/docs/web-services/responses/#errors for more details. +type HTTPError = internal.HTTPError + // DownloadResponse describes the result of a Download call. type DownloadResponse struct { // LastModified is the date that the database was last modified. It will @@ -55,6 +60,9 @@ // // If the current MD5 checksum matches what the server currently has, no // download is performed. +// +// Returns an [HTTPError] if the server returns a non-200 status code. This +// can be used to identify problems with license. func (c Client) Download( ctx context.Context, editionID, @@ -125,7 +133,7 @@ // TODO(horgh): Should we fully consume the body? //nolint:errcheck // we are already returning an error. buf, _ := io.ReadAll(io.LimitReader(response.Body, 256)) - httpErr := internal.HTTPError{ + httpErr := HTTPError{ Body: string(buf), StatusCode: response.StatusCode, } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/client/download_test.go new/geoipupdate-7.1.0/client/download_test.go --- old/geoipupdate-7.0.1/client/download_test.go 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/client/download_test.go 2024-11-18 18:41:36.000000000 +0100 @@ -12,6 +12,7 @@ "testing" "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -37,7 +38,7 @@ w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) _, err := w.Write([]byte(jsonData)) - require.NoError(t, err) + assert.NoError(t, err) }) tests := []struct { @@ -61,18 +62,26 @@ } err := tw.WriteHeader(header) - require.NoError(t, err) + if !assert.NoError(t, err) { + return + } _, err = tw.Write([]byte(dbContent)) - require.NoError(t, err) + if !assert.NoError(t, err) { + return + } - require.NoError(t, tw.Close()) - require.NoError(t, gw.Close()) + if !assert.NoError(t, tw.Close()) { + return + } + if !assert.NoError(t, gw.Close()) { + return + } w.Header().Set("Content-Type", "application/gzip") w.Header().Set("Content-Disposition", "attachment; filename=test.tar.gz") w.Header().Set("Last-Modified", lastModified.Format(time.RFC1123)) _, err = io.Copy(w, &buf) - require.NoError(t, err) + assert.NoError(t, err) }) server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -128,7 +137,7 @@ w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) _, err := w.Write([]byte(jsonData)) - require.NoError(t, err) + assert.NoError(t, err) })) return server }, @@ -145,13 +154,17 @@ var buf bytes.Buffer gw := gzip.NewWriter(&buf) tw := tar.NewWriter(gw) - require.NoError(t, tw.Close()) - require.NoError(t, gw.Close()) + if !assert.NoError(t, tw.Close()) { + return + } + if !assert.NoError(t, gw.Close()) { + return + } w.Header().Set("Content-Type", "application/gzip") w.Header().Set("Content-Disposition", "attachment; filename=test.tar.gz") _, err := io.Copy(w, &buf) - require.NoError(t, err) + assert.NoError(t, err) }) server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -185,17 +198,25 @@ } err := tw.WriteHeader(header) - require.NoError(t, err) + if !assert.NoError(t, err) { + return + } _, err = tw.Write([]byte(dbContent)) - require.NoError(t, err) + if !assert.NoError(t, err) { + return + } - require.NoError(t, tw.Close()) - require.NoError(t, gw.Close()) + if !assert.NoError(t, tw.Close()) { + return + } + if !assert.NoError(t, gw.Close()) { + return + } w.Header().Set("Content-Type", "application/gzip") w.Header().Set("Content-Disposition", "attachment; filename=test.tar.gz") _, err = io.Copy(w, &buf) - require.NoError(t, err) + assert.NoError(t, err) }) server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/client/metadata.go new/geoipupdate-7.1.0/client/metadata.go --- old/geoipupdate-7.0.1/client/metadata.go 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/client/metadata.go 2024-11-18 18:41:36.000000000 +0100 @@ -9,7 +9,6 @@ "net/url" "strconv" - "github.com/maxmind/geoipupdate/v7/internal" "github.com/maxmind/geoipupdate/v7/internal/vars" ) @@ -51,7 +50,7 @@ } if response.StatusCode != http.StatusOK { - httpErr := internal.HTTPError{ + httpErr := HTTPError{ Body: string(responseBody), StatusCode: response.StatusCode, } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/client/metadata_test.go new/geoipupdate-7.1.0/client/metadata_test.go --- old/geoipupdate-7.0.1/client/metadata_test.go 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/client/metadata_test.go 2024-11-18 18:41:36.000000000 +0100 @@ -6,6 +6,7 @@ "net/http/httptest" "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -32,7 +33,7 @@ w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) _, err := w.Write([]byte(jsonData)) - require.NoError(t, err) + assert.NoError(t, err) })) return server }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/cmd/geoipupdate/end_to_end_test.go new/geoipupdate-7.1.0/cmd/geoipupdate/end_to_end_test.go --- old/geoipupdate-7.0.1/cmd/geoipupdate/end_to_end_test.go 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/cmd/geoipupdate/end_to_end_test.go 2024-11-18 18:41:36.000000000 +0100 @@ -15,6 +15,7 @@ "testing" "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/maxmind/geoipupdate/v7/internal/geoipupdate" @@ -43,7 +44,9 @@ // mock metadata handler. metadataHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { queryParams, err := url.ParseQuery(r.URL.RawQuery) - require.NoError(t, err) + if !assert.NoError(t, err) { + return + } var jsonData string switch queryParams.Get("edition_id") { @@ -74,7 +77,7 @@ w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) _, err = w.Write([]byte(jsonData)) - require.NoError(t, err) + assert.NoError(t, err) }) // mock download handler. @@ -92,18 +95,26 @@ } err := tw.WriteHeader(header) - require.NoError(t, err) + if !assert.NoError(t, err) { + return + } _, err = tw.Write([]byte(content)) - require.NoError(t, err) + if !assert.NoError(t, err) { + return + } - require.NoError(t, tw.Close()) - require.NoError(t, gw.Close()) + if !assert.NoError(t, tw.Close()) { + return + } + if !assert.NoError(t, gw.Close()) { + return + } w.Header().Set("Content-Type", "application/gzip") w.Header().Set("Content-Disposition", "attachment; filename=test.tar.gz") w.Header().Set("Last-Modified", lastModified.Format(time.RFC1123)) _, err = io.Copy(w, &buf) - require.NoError(t, err) + assert.NoError(t, err) }) // create test server. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/conf/GeoIP.conf.default new/geoipupdate-7.1.0/conf/GeoIP.conf.default --- old/geoipupdate-7.0.1/conf/GeoIP.conf.default 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/conf/GeoIP.conf.default 2024-11-18 18:41:36.000000000 +0100 @@ -17,8 +17,8 @@ # The directory to store the database files. Defaults to DATADIR # DatabaseDirectory DATADIR -# The server to use. Defaults to "updates.maxmind.com". -# Host updates.maxmind.com +# The server to use. Defaults to "https://updates.maxmind.com". +# Host https://updates.maxmind.com # The proxy host name or IP address. You may optionally specify a # port number, e.g., 127.0.0.1:8888. If no port number is specified, 1080 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/dev-bin/release.sh new/geoipupdate-7.1.0/dev-bin/release.sh --- old/geoipupdate-7.0.1/dev-bin/release.sh 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/dev-bin/release.sh 2024-11-18 18:41:36.000000000 +0100 @@ -37,6 +37,11 @@ tag="v$version" +if ! grep -q "^module github.com/maxmind/geoipupdate/$(echo "$tag" |cut -d . -f 1)" go.mod; then + echo "Tag version does not match go.mod version!" + exit 1; +fi + perl -pi -e "s/(?<=Version = \").+?(?=\")/$version/g" internal/vars/version.go echo $'\nRelease notes:' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/doc/GeoIP.conf.md new/geoipupdate-7.1.0/doc/GeoIP.conf.md --- old/geoipupdate-7.0.1/doc/GeoIP.conf.md 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/doc/GeoIP.conf.md 2024-11-18 18:41:36.000000000 +0100 @@ -45,7 +45,7 @@ `Host` -: The host name of the server to use. The default is `updates.maxmind.com`. +: The host name of the server to use. The default is `https://updates.maxmind.com`. This can be overridden at run time by the `GEOIPUPDATE_HOST` environment variable. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/doc/docker.md new/geoipupdate-7.1.0/doc/docker.md --- old/geoipupdate-7.0.1/doc/docker.md 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/doc/docker.md 2024-11-18 18:41:36.000000000 +0100 @@ -30,7 +30,7 @@ * `GEOIPUPDATE_FREQUENCY` - The number of hours between `geoipupdate` runs. If this is not set or is set to `0`, `geoipupdate` will run once and exit. * `GEOIPUPDATE_HOST` - The host name of the server to use. The default is - `updates.maxmind.com`. + `https://updates.maxmind.com`. * `GEOIPUPDATE_PROXY` - The proxy host name or IP address. You may optionally specify a port number, e.g., 127.0.0.1:8888. If no port number is specified, 1080 will be used. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/doc/geoipupdate.md new/geoipupdate-7.1.0/doc/geoipupdate.md --- old/geoipupdate-7.0.1/doc/geoipupdate.md 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/doc/geoipupdate.md 2024-11-18 18:41:36.000000000 +0100 @@ -62,18 +62,14 @@ # NOTES -Typically you should run `geoipupdate` weekly. On most Unix-like systems, -this can be achieved by using cron. Below is a sample crontab file that -runs `geoipupdate` on each Wednesday at noon: - - # top of crontab - - [email protected] - - 0 12 * * 3 geoipupdate - - # end of crontab - +Typically you should run `geoipupdate` at least twice a week. Consult +our +[database release schedule](https://support.maxmind.com/hc/en-us/articles/4408216129947-Download-and-Update-Databases#h_01G3XX402XKD3J1CMWKNKMDYYZ) +for more information. + +On most Unix-like systems, this can be achieved by using cron. You can +find +[an example crontab file on our Developer Portal](https://dev.maxmind.com/geoip/updating-databases#3-run-geoip-update). To use with a proxy server, update your `GeoIP.conf` file as specified in the `GeoIP.conf` man page. Alternatively, set the `GEOIPUPDATE_PROXY` or diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/go.mod new/geoipupdate-7.1.0/go.mod --- old/geoipupdate-7.0.1/go.mod 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/go.mod 2024-11-18 18:41:36.000000000 +0100 @@ -1,24 +1,25 @@ module github.com/maxmind/geoipupdate/v7 -go 1.20 +go 1.21.0 + +toolchain go1.22.3 require ( github.com/cenkalti/backoff/v4 v4.3.0 - github.com/gofrs/flock v0.8.1 + github.com/gofrs/flock v0.12.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 - golang.org/x/net v0.24.0 - golang.org/x/sync v0.7.0 + golang.org/x/net v0.31.0 + golang.org/x/sync v0.9.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect - gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/text v0.20.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/go.sum new/geoipupdate-7.1.0/go.sum --- old/geoipupdate-7.0.1/go.sum 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/go.sum 2024-11-18 18:41:36.000000000 +0100 @@ -3,30 +3,30 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= +github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= +golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/internal/geoipupdate/config.go new/geoipupdate-7.1.0/internal/geoipupdate/config.go --- old/geoipupdate-7.0.1/internal/geoipupdate/config.go 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/internal/geoipupdate/config.go 2024-11-18 18:41:36.000000000 +0100 @@ -15,6 +15,8 @@ "github.com/maxmind/geoipupdate/v7/internal/vars" ) +const schemeHTTPS = "https" + // Config is a parsed configuration file. type Config struct { // AccountID is the account ID. @@ -231,7 +233,14 @@ keysSeen["EditionIDs"] = struct{}{} keysSeen["ProductIds"] = struct{}{} case "Host": - config.URL = "https://" + value + u, err := url.Parse(value) + if err != nil { + return fmt.Errorf("failed to parse Host: %w", err) + } + if u.Scheme == "" { + u.Scheme = schemeHTTPS + } + config.URL = u.String() case "LicenseKey": config.LicenseKey = value case "LockFile": @@ -307,7 +316,14 @@ } if value, ok := os.LookupEnv("GEOIPUPDATE_HOST"); ok { - config.URL = "https://" + value + u, err := url.Parse(value) + if err != nil { + return fmt.Errorf("failed to parse GEOIPUPDATE_HOST: %w", err) + } + if u.Scheme == "" { + u.Scheme = schemeHTTPS + } + config.URL = u.String() } if value, ok := os.LookupEnv("GEOIPUPDATE_LICENSE_KEY"); ok { @@ -425,7 +441,7 @@ } else { scheme := strings.ToLower(matches[1]) // The http package only supports http, https, and socks5. - if scheme != "http" && scheme != "https" && scheme != "socks5" { + if scheme != "http" && scheme != schemeHTTPS && scheme != "socks5" { return nil, fmt.Errorf("unsupported proxy type: %s", scheme) } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/internal/geoipupdate/config_test.go new/geoipupdate-7.1.0/internal/geoipupdate/config_test.go --- old/geoipupdate-7.0.1/internal/geoipupdate/config_test.go 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/internal/geoipupdate/config_test.go 2024-11-18 18:41:36.000000000 +0100 @@ -464,6 +464,20 @@ Verbose: true, }, }, + { + Description: "Host scheme is used", + Input: "AccountID\t\t123\nLicenseKey\t\t456\nEditionIDs\t\tGeoIP2-City\nHost\t\thttp://test", + Output: &Config{ + AccountID: 123, + DatabaseDirectory: filepath.Clean(vars.DefaultDatabaseDirectory), + EditionIDs: []string{"GeoIP2-City"}, + LicenseKey: "456", + LockFile: filepath.Clean(filepath.Join(vars.DefaultDatabaseDirectory, ".geoipupdate.lock")), + RetryFor: 5 * time.Minute, + Parallelism: 1, + URL: "http://test", + }, + }, } for _, test := range tests { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/internal/geoipupdate/database/reader.go new/geoipupdate-7.1.0/internal/geoipupdate/database/reader.go --- old/geoipupdate-7.0.1/internal/geoipupdate/database/reader.go 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/internal/geoipupdate/database/reader.go 2024-11-18 18:41:36.000000000 +0100 @@ -23,14 +23,18 @@ } // MarshalJSON is a custom json marshaler that strips out zero time fields. -func (r ReadResult) MarshalJSON() ([]byte, error) { +func (r *ReadResult) MarshalJSON() ([]byte, error) { + if r == nil { + return []byte("null"), nil + } + type partialResult ReadResult s := &struct { partialResult ModifiedAt int64 `json:"modified_at,omitempty"` CheckedAt int64 `json:"checked_at,omitempty"` }{ - partialResult: partialResult(r), + partialResult: partialResult(*r), ModifiedAt: 0, CheckedAt: 0, } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/internal/geoipupdate/geoip_updater_test.go new/geoipupdate-7.1.0/internal/geoipupdate/geoip_updater_test.go --- old/geoipupdate-7.0.1/internal/geoipupdate/geoip_updater_test.go 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/internal/geoipupdate/geoip_updater_test.go 2024-11-18 18:41:36.000000000 +0100 @@ -146,7 +146,7 @@ `{"databases":[{"edition_id":"foo-db-name",` + `"md5":"83e01ba43c2a66e30cb3007c1a300c78","date":"2023-04-27"}]}`) _, err := w.Write(metadata) - require.NoError(t, err) + assert.NoError(t, err) return } @@ -163,12 +163,16 @@ size: 1000, } header, err := tar.FileInfoHeader(info, info.Name()) - require.NoError(t, err) + if !assert.NoError(t, err) { + return + } header.Name = "foo-db-name.mmdb" // Create a tar Header from the FileInfo data err = tarWriter.WriteHeader(header) - require.NoError(t, err) + if !assert.NoError(t, err) { + return + } bytesToWrite := 1000 if try == 0 { @@ -179,7 +183,9 @@ for i := 0; i < bytesToWrite; i++ { _, err = tarWriter.Write([]byte("t")) - require.NoError(t, err) + if !assert.NoError(t, err) { + return + } } try++ })) @@ -277,7 +283,7 @@ return nil } -func (w mockWriter) GetHash(editionID string) (string, error) { +func (w *mockWriter) GetHash(editionID string) (string, error) { return w.md5s[editionID], nil } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geoipupdate-7.0.1/internal/vars/version.go new/geoipupdate-7.1.0/internal/vars/version.go --- old/geoipupdate-7.0.1/internal/vars/version.go 2024-04-08 23:30:02.000000000 +0200 +++ new/geoipupdate-7.1.0/internal/vars/version.go 2024-11-18 18:41:36.000000000 +0100 @@ -2,4 +2,4 @@ package vars // Version defines the current geoipupdate version. -var Version = "7.0.1" +var Version = "7.1.0" ++++++ vendor.tar.gz ++++++ ++++ 46640 lines of diff (skipped)
