From b8f3dc097bec8ba178983426c4f8a7f113a6b0f4 Mon Sep 17 00:00:00 2001 From: Gavin Morris Date: Thu, 18 May 2023 15:48:49 -0400 Subject: [PATCH 01/12] Matomo upgrade to version 4.14.2 and added geolocation database --- matomo/Dockerfile | 24 ++++++++++++++++++------ matomo/README.md | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/matomo/Dockerfile b/matomo/Dockerfile index 5a442573..d22309b4 100644 --- a/matomo/Dockerfile +++ b/matomo/Dockerfile @@ -3,15 +3,21 @@ FROM nginx ARG TARGETARCH -ARG MATOMO_VERSION=4.13.0 +ARG MATOMO_VERSION=4.14.2 ARG MATOMO_FILE=${MATOMO_VERSION}.tar.gz ARG MATOMO_URL=https://builds.matomo.org/matomo-${MATOMO_FILE} -ARG MATOMO_SHA256=59614fbfa870d354f8abc634cc21dbbebda2b9fde31592df8c813c39e1dff981 +ARG MATOMO_SHA256=8cfb3fe1b82ded5a9e4a878b9f01ebf85238dba84087088ff117224033700a9a -ARG EXTRA_TOOLS_VERSION=4.0.1-beta4 +ARG EXTRA_TOOLS_VERSION=4.1.0-beta5 ARG EXTRA_TOOLS_FILE=${EXTRA_TOOLS_VERSION}.tar.gz ARG EXTRA_TOOLS_URL=https://github.com/digitalist-se/extratools/archive/refs/tags/${EXTRA_TOOLS_FILE} -ARG EXTRA_TOOLS_SHA256=1d04ee7b871c76c9f875da100e20e9472059b2a4fe7c52830360e90f205779e2 +ARG EXTRA_TOOLS_SHA256=ce9c9f1d01aaf04e3dfded21d6b9080c1fda633535295dc1c8cd0427bcdc826f + +# IP to City Lite - opensource monthly geolocation database +ARG IP_TO_CITY_VERSION=2023-05 +ARG IP_TO_CITY_FILE=dbip-city-lite-${IP_TO_CITY_VERSION}.mmdb.gz +ARG IP_TO_CITY_URL=https://download.db-ip.com/free/${IP_TO_CITY_FILE} +ARG IP_TO_CITY_SHA256=048942a57652e8dcefd8c1ea6a834513152b00dc935ca1abcdc3d6e8863b21b9 EXPOSE 8000 @@ -30,14 +36,20 @@ RUN --mount=type=cache,id=matomo-downloads-${TARGETARCH},sharing=locked,target=/ wget --directory-prefix=/var/www/matomo "https://raw.githubusercontent.com/matomo-org/matomo/${MATOMO_VERSION}/composer.json" && \ wget --directory-prefix=/var/www/matomo "https://raw.githubusercontent.com/matomo-org/matomo/${MATOMO_VERSION}/composer.lock" && \ composer require -d /var/www/matomo symfony/yaml:~2.6.0 && \ - composer require -d /var/www/matomo symfony/process:^3.4 && \ + composer require -d /var/www/matomo symfony/process:^5.4 && \ composer install -d /var/www/matomo && \ download.sh \ --url "${EXTRA_TOOLS_URL}" \ --sha256 "${EXTRA_TOOLS_SHA256}" \ --strip \ --dest /var/www/matomo/plugins/ExtraTools && \ - cleanup.sh + cleanup.sh && \ + # Download geolocation database for later use + download.sh \ + --url "${IP_TO_CITY_URL}" \ + --sha256 "${IP_TO_CITY_SHA256}" \ + --strip \ + --dest /tmp \ # The driver is given explicitly to prevent accidentially overriding as Matomo # only supports MySQL. diff --git a/matomo/README.md b/matomo/README.md index 036d60ba..2b258efa 100644 --- a/matomo/README.md +++ b/matomo/README.md @@ -1,6 +1,6 @@ # Matomo -Docker image for [Matomo] version 4.13.0. +Docker image for [Matomo] version 4.14.2. Please refer to the [Matomo Documentation] for more in-depth information. From 7fccbc179ea15cf63c3996ab6a34964cb812b671 Mon Sep 17 00:00:00 2001 From: Gavin Morris Date: Thu, 18 May 2023 16:07:35 -0400 Subject: [PATCH 02/12] Updated paths --- matomo/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matomo/Dockerfile b/matomo/Dockerfile index d22309b4..5cb1db59 100644 --- a/matomo/Dockerfile +++ b/matomo/Dockerfile @@ -43,13 +43,13 @@ RUN --mount=type=cache,id=matomo-downloads-${TARGETARCH},sharing=locked,target=/ --sha256 "${EXTRA_TOOLS_SHA256}" \ --strip \ --dest /var/www/matomo/plugins/ExtraTools && \ - cleanup.sh && \ # Download geolocation database for later use download.sh \ --url "${IP_TO_CITY_URL}" \ --sha256 "${IP_TO_CITY_SHA256}" \ --strip \ - --dest /tmp \ + --dest /var/www/matomo/misc && \ + cleanup.sh # The driver is given explicitly to prevent accidentially overriding as Matomo # only supports MySQL. From 32d07cbc6df7a397f19cfe3d52a0984d1e337994 Mon Sep 17 00:00:00 2001 From: Gavin Morris Date: Thu, 18 May 2023 16:32:59 -0400 Subject: [PATCH 03/12] Gunzip added to base image for download.sh --- base/Dockerfile | 1 + base/rootfs/usr/local/bin/download.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/base/Dockerfile b/base/Dockerfile index 150d7c64..7aa0974b 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -29,6 +29,7 @@ RUN --mount=type=cache,id=base-apk-${TARGETARCH},sharing=locked,target=/var/cach curl \ git \ gnupg \ + gzip \ jq \ mariadb-client \ mysql-client \ diff --git a/base/rootfs/usr/local/bin/download.sh b/base/rootfs/usr/local/bin/download.sh index 829c0a8c..16f1cb62 100755 --- a/base/rootfs/usr/local/bin/download.sh +++ b/base/rootfs/usr/local/bin/download.sh @@ -112,6 +112,9 @@ function unpack { args+=("--strip-components" "1") fi case "${file}" in + *.gz | *.gzip) + gunzip -fq "${file}" -c "${dest}" "${args[@]}" + ;; *.tar.xz | *.txz) tar -xf "${file}" -C "${dest}" "${args[@]}" ;; From 63c8018839a6ed5fdfa958d1a954fda964bac265 Mon Sep 17 00:00:00 2001 From: Gavin Morris Date: Fri, 19 May 2023 09:11:16 -0400 Subject: [PATCH 04/12] Removing the strip functions for gunzip --- base/rootfs/usr/local/bin/download.sh | 2 +- matomo/Dockerfile | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/base/rootfs/usr/local/bin/download.sh b/base/rootfs/usr/local/bin/download.sh index 16f1cb62..7bc386b8 100755 --- a/base/rootfs/usr/local/bin/download.sh +++ b/base/rootfs/usr/local/bin/download.sh @@ -113,7 +113,7 @@ function unpack { fi case "${file}" in *.gz | *.gzip) - gunzip -fq "${file}" -c "${dest}" "${args[@]}" + gunzip -fq "${file}" -c "${dest}" ;; *.tar.xz | *.txz) tar -xf "${file}" -C "${dest}" "${args[@]}" diff --git a/matomo/Dockerfile b/matomo/Dockerfile index 5cb1db59..af8e5633 100644 --- a/matomo/Dockerfile +++ b/matomo/Dockerfile @@ -47,7 +47,6 @@ RUN --mount=type=cache,id=matomo-downloads-${TARGETARCH},sharing=locked,target=/ download.sh \ --url "${IP_TO_CITY_URL}" \ --sha256 "${IP_TO_CITY_SHA256}" \ - --strip \ --dest /var/www/matomo/misc && \ cleanup.sh From dac5bccda4708d408cc75f357b3073ec98fc25fb Mon Sep 17 00:00:00 2001 From: Gavin Morris Date: Fri, 19 May 2023 11:13:15 -0400 Subject: [PATCH 05/12] Working matomo image --- base/rootfs/usr/local/bin/download.sh | 3 --- matomo/Dockerfile | 8 +++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/base/rootfs/usr/local/bin/download.sh b/base/rootfs/usr/local/bin/download.sh index 7bc386b8..829c0a8c 100755 --- a/base/rootfs/usr/local/bin/download.sh +++ b/base/rootfs/usr/local/bin/download.sh @@ -112,9 +112,6 @@ function unpack { args+=("--strip-components" "1") fi case "${file}" in - *.gz | *.gzip) - gunzip -fq "${file}" -c "${dest}" - ;; *.tar.xz | *.txz) tar -xf "${file}" -C "${dest}" "${args[@]}" ;; diff --git a/matomo/Dockerfile b/matomo/Dockerfile index af8e5633..964ea880 100644 --- a/matomo/Dockerfile +++ b/matomo/Dockerfile @@ -44,10 +44,8 @@ RUN --mount=type=cache,id=matomo-downloads-${TARGETARCH},sharing=locked,target=/ --strip \ --dest /var/www/matomo/plugins/ExtraTools && \ # Download geolocation database for later use - download.sh \ - --url "${IP_TO_CITY_URL}" \ - --sha256 "${IP_TO_CITY_SHA256}" \ - --dest /var/www/matomo/misc && \ + wget "${IP_TO_CITY_URL}" -P /var/www/matomo/misc && \ + gunzip -f /var/www/matomo/misc/"${IP_TO_CITY_FILE}" && \ cleanup.sh # The driver is given explicitly to prevent accidentially overriding as Matomo @@ -71,4 +69,4 @@ ENV \ COPY --link rootfs / -RUN chown -R nginx:nginx /var/www +RUN chown -R nginx:nginx /var/www \ No newline at end of file From 07e57fa73352115c55f7007973f3ff97b28f0b8d Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Wed, 24 May 2023 00:15:10 +0100 Subject: [PATCH 06/12] Use download.sh for geoip database. --- base/rootfs/usr/local/bin/download.sh | 7 ++++++- matomo/Dockerfile | 8 +++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/base/rootfs/usr/local/bin/download.sh b/base/rootfs/usr/local/bin/download.sh index 829c0a8c..77bc1ed5 100755 --- a/base/rootfs/usr/local/bin/download.sh +++ b/base/rootfs/usr/local/bin/download.sh @@ -21,7 +21,7 @@ function usage { -u --url The url of the file to download. -c --sha256 The sha256 checksum to use to validate the download. -d --dest The location to unpack file into (optional). - -s --strip Exclude the root folder when unpacking (optional). + -s --strip Exclude the root folder when unpacking (optional, not supported with gzip or jar). -h --help Show this help. -x --debug Debug this script. @@ -107,10 +107,12 @@ function unpack { local file="${1}" local dest="${2}" local args=() + local filename= mkdir -p "${dest}" if [[ -v STRIP ]]; then args+=("--strip-components" "1") fi + filename=$(basename "${file}") case "${file}" in *.tar.xz | *.txz) tar -xf "${file}" -C "${dest}" "${args[@]}" @@ -118,6 +120,9 @@ function unpack { *.tar.gz | *.tgz) tar -xzf "${file}" -C "${dest}" "${args[@]}" ;; + *.gz | *.gzip) + gunzip "${file}" -f -c > "${dest}/${filename%.*}" + ;; *.zip | *.war) if [[ -v STRIP ]]; then mkdir -p /tmp/unpack diff --git a/matomo/Dockerfile b/matomo/Dockerfile index 964ea880..af8e5633 100644 --- a/matomo/Dockerfile +++ b/matomo/Dockerfile @@ -44,8 +44,10 @@ RUN --mount=type=cache,id=matomo-downloads-${TARGETARCH},sharing=locked,target=/ --strip \ --dest /var/www/matomo/plugins/ExtraTools && \ # Download geolocation database for later use - wget "${IP_TO_CITY_URL}" -P /var/www/matomo/misc && \ - gunzip -f /var/www/matomo/misc/"${IP_TO_CITY_FILE}" && \ + download.sh \ + --url "${IP_TO_CITY_URL}" \ + --sha256 "${IP_TO_CITY_SHA256}" \ + --dest /var/www/matomo/misc && \ cleanup.sh # The driver is given explicitly to prevent accidentially overriding as Matomo @@ -69,4 +71,4 @@ ENV \ COPY --link rootfs / -RUN chown -R nginx:nginx /var/www \ No newline at end of file +RUN chown -R nginx:nginx /var/www From 76cb246c2ed95c32498a2db43357742d0226f3d5 Mon Sep 17 00:00:00 2001 From: Gavin Morris Date: Wed, 7 Jun 2023 11:08:36 -0400 Subject: [PATCH 07/12] Revamped geoip download no hardcode values --- matomo/Dockerfile | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/matomo/Dockerfile b/matomo/Dockerfile index af8e5633..ccb1aa4a 100644 --- a/matomo/Dockerfile +++ b/matomo/Dockerfile @@ -13,12 +13,6 @@ ARG EXTRA_TOOLS_FILE=${EXTRA_TOOLS_VERSION}.tar.gz ARG EXTRA_TOOLS_URL=https://github.com/digitalist-se/extratools/archive/refs/tags/${EXTRA_TOOLS_FILE} ARG EXTRA_TOOLS_SHA256=ce9c9f1d01aaf04e3dfded21d6b9080c1fda633535295dc1c8cd0427bcdc826f -# IP to City Lite - opensource monthly geolocation database -ARG IP_TO_CITY_VERSION=2023-05 -ARG IP_TO_CITY_FILE=dbip-city-lite-${IP_TO_CITY_VERSION}.mmdb.gz -ARG IP_TO_CITY_URL=https://download.db-ip.com/free/${IP_TO_CITY_FILE} -ARG IP_TO_CITY_SHA256=048942a57652e8dcefd8c1ea6a834513152b00dc935ca1abcdc3d6e8863b21b9 - EXPOSE 8000 WORKDIR /var/www/matomo @@ -26,6 +20,7 @@ WORKDIR /var/www/matomo # Composer require statements are for supporting the Extra Tools plugin. # # Platform agnostic does not require arch specific identifier. +# IP to City Lite - opensource monthly geolocation database - expires after three months - will be refreshed with latest upon every build RUN --mount=type=cache,id=matomo-downloads-${TARGETARCH},sharing=locked,target=/opt/downloads \ download.sh \ --url "${MATOMO_URL}" \ @@ -43,11 +38,9 @@ RUN --mount=type=cache,id=matomo-downloads-${TARGETARCH},sharing=locked,target=/ --sha256 "${EXTRA_TOOLS_SHA256}" \ --strip \ --dest /var/www/matomo/plugins/ExtraTools && \ - # Download geolocation database for later use - download.sh \ - --url "${IP_TO_CITY_URL}" \ - --sha256 "${IP_TO_CITY_SHA256}" \ - --dest /var/www/matomo/misc && \ + curl https://download.db-ip.com/free/dbip-city-lite-`date +%Y`-`date +%m`.mmdb.gz > /tmp/dbip.mmdb.gz && \ + gunzip -f /tmp/dbip.mmdb.gz && \ + mv /tmp/dbip.mmdb /var/www/matomo/misc/DBIP-City.mmdb && \ cleanup.sh # The driver is given explicitly to prevent accidentially overriding as Matomo From c0b45df11da2bd210eeb351fd468bc8f361893d2 Mon Sep 17 00:00:00 2001 From: Gavin Morris Date: Fri, 4 Aug 2023 15:42:17 -0400 Subject: [PATCH 08/12] Upgraded matomo and extra tools --- matomo/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/matomo/Dockerfile b/matomo/Dockerfile index ccb1aa4a..9971f352 100644 --- a/matomo/Dockerfile +++ b/matomo/Dockerfile @@ -3,15 +3,15 @@ FROM nginx ARG TARGETARCH -ARG MATOMO_VERSION=4.14.2 +ARG MATOMO_VERSION=4.15.1 ARG MATOMO_FILE=${MATOMO_VERSION}.tar.gz ARG MATOMO_URL=https://builds.matomo.org/matomo-${MATOMO_FILE} -ARG MATOMO_SHA256=8cfb3fe1b82ded5a9e4a878b9f01ebf85238dba84087088ff117224033700a9a +ARG MATOMO_SHA256=cd397fe3e6e04563f7cbe869cbc25cb61f0b1548f8b45245ae4a2f46ba861f61 -ARG EXTRA_TOOLS_VERSION=4.1.0-beta5 +ARG EXTRA_TOOLS_VERSION=5.0.0-beta3 ARG EXTRA_TOOLS_FILE=${EXTRA_TOOLS_VERSION}.tar.gz ARG EXTRA_TOOLS_URL=https://github.com/digitalist-se/extratools/archive/refs/tags/${EXTRA_TOOLS_FILE} -ARG EXTRA_TOOLS_SHA256=ce9c9f1d01aaf04e3dfded21d6b9080c1fda633535295dc1c8cd0427bcdc826f +ARG EXTRA_TOOLS_SHA256=96190d6392bc45332eb9033216ea4c436e71496b48ee9a23d4647934d8051cae EXPOSE 8000 From 106ade27484ec32ff7bc48d0689a0ec24f684433 Mon Sep 17 00:00:00 2001 From: Gavin Morris Date: Fri, 4 Aug 2023 15:44:18 -0400 Subject: [PATCH 09/12] Upgraded matomo and extra tools --- matomo/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matomo/README.md b/matomo/README.md index 2b258efa..7d2be5c4 100644 --- a/matomo/README.md +++ b/matomo/README.md @@ -1,6 +1,6 @@ # Matomo -Docker image for [Matomo] version 4.14.2. +Docker image for [Matomo] version 4.15.1 Please refer to the [Matomo Documentation] for more in-depth information. From b3b7fd8ea6b350ac9b43ccaf85180cc4a53d2861 Mon Sep 17 00:00:00 2001 From: Gavin Morris Date: Fri, 4 Aug 2023 21:33:48 -0400 Subject: [PATCH 10/12] Wrong SHA. Fixed --- matomo/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matomo/Dockerfile b/matomo/Dockerfile index 9971f352..309ffdc6 100644 --- a/matomo/Dockerfile +++ b/matomo/Dockerfile @@ -6,7 +6,7 @@ ARG TARGETARCH ARG MATOMO_VERSION=4.15.1 ARG MATOMO_FILE=${MATOMO_VERSION}.tar.gz ARG MATOMO_URL=https://builds.matomo.org/matomo-${MATOMO_FILE} -ARG MATOMO_SHA256=cd397fe3e6e04563f7cbe869cbc25cb61f0b1548f8b45245ae4a2f46ba861f61 +ARG MATOMO_SHA256=5e77e2a6b18ba8542a3e4df481c0152dd059de960c49d04f7e789c9bb5753d27 ARG EXTRA_TOOLS_VERSION=5.0.0-beta3 ARG EXTRA_TOOLS_FILE=${EXTRA_TOOLS_VERSION}.tar.gz From bf7a473cdbd19b2b6883584eb9031401d5f976a2 Mon Sep 17 00:00:00 2001 From: Gavin Morris Date: Thu, 10 Aug 2023 14:24:39 -0400 Subject: [PATCH 11/12] Extratools needs parity with matomo version, use 4.x with 4.x --- matomo/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matomo/Dockerfile b/matomo/Dockerfile index 309ffdc6..81cbdd4d 100644 --- a/matomo/Dockerfile +++ b/matomo/Dockerfile @@ -8,10 +8,10 @@ ARG MATOMO_FILE=${MATOMO_VERSION}.tar.gz ARG MATOMO_URL=https://builds.matomo.org/matomo-${MATOMO_FILE} ARG MATOMO_SHA256=5e77e2a6b18ba8542a3e4df481c0152dd059de960c49d04f7e789c9bb5753d27 -ARG EXTRA_TOOLS_VERSION=5.0.0-beta3 +ARG EXTRA_TOOLS_VERSION=4.1.0-beta5 ARG EXTRA_TOOLS_FILE=${EXTRA_TOOLS_VERSION}.tar.gz ARG EXTRA_TOOLS_URL=https://github.com/digitalist-se/extratools/archive/refs/tags/${EXTRA_TOOLS_FILE} -ARG EXTRA_TOOLS_SHA256=96190d6392bc45332eb9033216ea4c436e71496b48ee9a23d4647934d8051cae +ARG EXTRA_TOOLS_SHA256=ce9c9f1d01aaf04e3dfded21d6b9080c1fda633535295dc1c8cd0427bcdc826f EXPOSE 8000 From 1ebea50ae6d9fc2bcc6fc6897c1cabfb611a6e61 Mon Sep 17 00:00:00 2001 From: Gavin Morris Date: Sun, 29 Oct 2023 19:04:58 -0400 Subject: [PATCH 12/12] Removed citylite db download in Dockerfile --- matomo/Dockerfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/matomo/Dockerfile b/matomo/Dockerfile index 81cbdd4d..dc2f1104 100644 --- a/matomo/Dockerfile +++ b/matomo/Dockerfile @@ -20,7 +20,6 @@ WORKDIR /var/www/matomo # Composer require statements are for supporting the Extra Tools plugin. # # Platform agnostic does not require arch specific identifier. -# IP to City Lite - opensource monthly geolocation database - expires after three months - will be refreshed with latest upon every build RUN --mount=type=cache,id=matomo-downloads-${TARGETARCH},sharing=locked,target=/opt/downloads \ download.sh \ --url "${MATOMO_URL}" \ @@ -38,9 +37,6 @@ RUN --mount=type=cache,id=matomo-downloads-${TARGETARCH},sharing=locked,target=/ --sha256 "${EXTRA_TOOLS_SHA256}" \ --strip \ --dest /var/www/matomo/plugins/ExtraTools && \ - curl https://download.db-ip.com/free/dbip-city-lite-`date +%Y`-`date +%m`.mmdb.gz > /tmp/dbip.mmdb.gz && \ - gunzip -f /tmp/dbip.mmdb.gz && \ - mv /tmp/dbip.mmdb /var/www/matomo/misc/DBIP-City.mmdb && \ cleanup.sh # The driver is given explicitly to prevent accidentially overriding as Matomo