From 5bbfae3df7c82f7d453a95aa6b7bce89a3b76100 Mon Sep 17 00:00:00 2001 From: benemart <62019029+benemart@users.noreply.github.com> Date: Wed, 12 Feb 2025 13:31:16 +0100 Subject: [PATCH] [bitnami/matomo] Exclude matomo.js from being rsynced (issue #76460) (#77036) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [bitnami/matomo] Exclude matomo.js from being rsynced (issue #76460) Signed-off-by: Bénédicte Martinez * [bitnami/matomo] Exclude matomo.js from being rsynced (issue #76460) Signed-off-by: Bénédicte Martinez * Signed-off-by: Bénédicte Martinez benedicte.martinez@cea.fr Remove MATOMO_TRACKER_FILE variable * Remove trailing space in ReadMe.md Signed-off-by: Bénédicte Martinez benedicte.martinez@cea.fr * [bitnami/acmesolver] Release acmesolver-1.17.0-debian-12-r1 (#76860) Signed-off-by: Bitnami Bot Signed-off-by: Bénédicte Martinez * [bitnami/matomo] Exclude matomo.js from being rsynced (issue #76460) Signed-off-by: Bénédicte Martinez Signed-off-by: Bénédicte Martinez * [bitnami/matomo] Exclude matomo.js from being rsynced (issue #76460) Signed-off-by: Bénédicte Martinez * Signed-off-by: Bénédicte Martinez benedicte.martinez@cea.fr Remove MATOMO_TRACKER_FILE variable Signed-off-by: Bénédicte Martinez * Remove trailing space in ReadMe.md Signed-off-by: Bénédicte Martinez benedicte.martinez@cea.fr Signed-off-by: Bénédicte Martinez * [bitnami/cassandra] Release cassandra-5.0.3-debian-12-r0 (#76855) Signed-off-by: Bitnami Bot Signed-off-by: Bénédicte Martinez * [bitnami/argo-cd] Release argo-cd-2.14.1-debian-12-r0 (#76856) Signed-off-by: Bitnami Bot Signed-off-by: Bénédicte Martinez * [bitnami/concourse] Release concourse-7.12.1-debian-12-r1 (#76857) Signed-off-by: Bitnami Bot Signed-off-by: Bénédicte Martinez * [bitnami/minio-client] Release minio-client-2025.2.4-debian-12-r0 (#76858) Signed-off-by: Bitnami Bot Signed-off-by: Bénédicte Martinez * [bitnami/minio] Release minio-2025.2.3-debian-12-r0 (#76859) Signed-off-by: Bitnami Bot Signed-off-by: Bénédicte Martinez * [bitnami/acmesolver] Release acmesolver-1.17.0-debian-12-r1 (#76860) Signed-off-by: Bitnami Bot Signed-off-by: Bénédicte Martinez * [bitnami/matomo] Exclude matomo.js from being rsynced (issue #76460) Signed-off-by: Bénédicte Martinez Signed-off-by: Bénédicte Martinez * [bitnami/matomo] Exclude matomo.js from being rsynced (issue #76460) Signed-off-by: Bénédicte Martinez Signed-off-by: Bénédicte Martinez * Signed-off-by: Bénédicte Martinez benedicte.martinez@cea.fr Remove MATOMO_TRACKER_FILE variable Signed-off-by: Bénédicte Martinez * Remove trailing space in ReadMe.md Signed-off-by: Bénédicte Martinez benedicte.martinez@cea.fr Signed-off-by: Bénédicte Martinez * Change name variable Signed-off-by: Bénédicte Martinez --------- Signed-off-by: Bitnami Bot Signed-off-by: Bénédicte Martinez Co-authored-by: Bitnami Bot --- .../5/debian-12/rootfs/opt/bitnami/scripts/libmatomo.sh | 9 ++++++++- .../5/debian-12/rootfs/opt/bitnami/scripts/matomo-env.sh | 3 +++ bitnami/matomo/README.md | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bitnami/matomo/5/debian-12/rootfs/opt/bitnami/scripts/libmatomo.sh b/bitnami/matomo/5/debian-12/rootfs/opt/bitnami/scripts/libmatomo.sh index c3d906398459..5dda2f00e2ae 100644 --- a/bitnami/matomo/5/debian-12/rootfs/opt/bitnami/scripts/libmatomo.sh +++ b/bitnami/matomo/5/debian-12/rootfs/opt/bitnami/scripts/libmatomo.sh @@ -218,7 +218,14 @@ EOF else info "Persisted Matomo installation detected" info "Updating Matomo files in persisted data" - rsync -a "$MATOMO_BASE_DIR"/* "$MATOMO_VOLUME_DIR" --exclude "$(realpath --relative-to="$MATOMO_BASE_DIR" "$MATOMO_CONF_FILE")" + rsync_args=("-a" "$MATOMO_BASE_DIR"/* "$MATOMO_VOLUME_DIR" "--exclude" "$(realpath --relative-to="$MATOMO_BASE_DIR" "$MATOMO_CONF_FILE")") + if [[ -n "$MATOMO_EXCLUDED_DATA_FROM_UPDATE" ]]; then + for file in $MATOMO_EXCLUDED_DATA_FROM_UPDATE; do + rsync_args+=("--exclude") + rsync_args+=("$(realpath --relative-to="$MATOMO_BASE_DIR" "$file")") + done + fi + rsync "${rsync_args[@]}" info "Restoring Matomo installation" restore_persisted_app "$app_name" "$MATOMO_DATA_TO_PERSIST" info "Trying to connect to the database server" diff --git a/bitnami/matomo/5/debian-12/rootfs/opt/bitnami/scripts/matomo-env.sh b/bitnami/matomo/5/debian-12/rootfs/opt/bitnami/scripts/matomo-env.sh index 605e3d8034b0..bfb7d8243483 100644 --- a/bitnami/matomo/5/debian-12/rootfs/opt/bitnami/scripts/matomo-env.sh +++ b/bitnami/matomo/5/debian-12/rootfs/opt/bitnami/scripts/matomo-env.sh @@ -25,6 +25,7 @@ export BITNAMI_DEBUG="${BITNAMI_DEBUG:-false}" # variable will be overridden with the value specified in that file matomo_env_vars=( MATOMO_DATA_TO_PERSIST + MATOMO_EXCLUDED_DATA_FROM_UPDATE MATOMO_SKIP_BOOTSTRAP MATOMO_PROXY_HOST_HEADER MATOMO_PROXY_CLIENT_HEADER @@ -86,6 +87,8 @@ export MATOMO_CONF_FILE="${MATOMO_CONF_DIR}/config.ini.php" # Matomo persistence configuration export MATOMO_VOLUME_DIR="${BITNAMI_VOLUME_DIR}/matomo" export MATOMO_DATA_TO_PERSIST="${MATOMO_DATA_TO_PERSIST:-$MATOMO_BASE_DIR}" +export MATOMO_EXCLUDED_DATA_FROM_UPDATE="${MATOMO_EXCLUDED_DATA_FROM_UPDATE:-}" + # Matomo configuration export MATOMO_SKIP_BOOTSTRAP="${MATOMO_SKIP_BOOTSTRAP:-}" # only used during the first initialization diff --git a/bitnami/matomo/README.md b/bitnami/matomo/README.md index bf5e387860f0..a406a2187916 100644 --- a/bitnami/matomo/README.md +++ b/bitnami/matomo/README.md @@ -278,6 +278,7 @@ Bitnami provides up-to-date versions of MariaDB and Matomo, including security p | Name | Description | Default Value | |----------------------------------------|------------------------------------------------------------------------------------------------------------------------------|---------------------------------| | `MATOMO_DATA_TO_PERSIST` | Files to persist relative to the Matomo installation directory. To provide multiple values, separate them with a whitespace. | `$MATOMO_BASE_DIR` | +| `MATOMO_EXCLUDED_DATA_FROM_UPDATE` | Files to exclude from being updated relative to the Matomo installation directory (same as config.ini.php). To provide multiple values, separate them with a whitespace. No defaults. | `nil` | | `MATOMO_SKIP_BOOTSTRAP` | Whether to perform initial bootstrapping for the application. | `nil` | | `MATOMO_PROXY_HOST_HEADER` | Specify the host IP HTTP Header. Usually HTTP_X_FORWARDED_HOST. No defaults. | `nil` | | `MATOMO_PROXY_CLIENT_HEADER` | Specify the client IP HTTP Header. Usually HTTP_X_FORWARDED_FOR. | `nil` |