Skip to content

Commit 0e3df3b

Browse files
committed
fix(kopia): instead of setting env var, provide custom ca to s3 command
1 parent 578d543 commit 0e3df3b

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

mover-kopia/entry.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,9 @@ echo ""
179179

180180
KOPIA=("kopia" "--config-file=${KOPIA_CACHE_DIR}/kopia.config" "--log-dir=${KOPIA_CACHE_DIR}/logs" "--file-log-level=${KOPIA_FILE_LOG_LEVEL}" "--log-dir-max-files=${KOPIA_LOG_DIR_MAX_FILES}" "--log-dir-max-age=${KOPIA_LOG_DIR_MAX_AGE}")
181181
if [[ -n "${CUSTOM_CA}" ]]; then
182-
echo "Using custom CA."
183-
export KOPIA_CA_CERT="${CUSTOM_CA}"
182+
echo "Using custom CA certificate at: ${CUSTOM_CA}"
183+
# Note: Custom CA is now handled via --root-ca-pem-path flag in S3 connect/create commands
184+
# The KOPIA_CA_CERT environment variable is not used by Kopia for S3 connections
184185
fi
185186

186187
echo "=== Kopia Version ==="
@@ -872,6 +873,12 @@ function connect_repository {
872873
S3_CONNECT_CMD+=(--disable-tls)
873874
fi
874875

876+
# Add custom CA certificate if specified
877+
if [[ -n "${CUSTOM_CA}" ]] && [[ -f "${CUSTOM_CA}" ]]; then
878+
echo "Adding custom CA certificate for S3 connection: ${CUSTOM_CA}"
879+
S3_CONNECT_CMD+=(--root-ca-pem-path="${CUSTOM_CA}")
880+
fi
881+
875882
# Add username/hostname overrides if specified
876883
add_user_overrides S3_CONNECT_CMD
877884

@@ -1085,6 +1092,12 @@ function create_repository {
10851092
S3_CREATE_CMD+=(--disable-tls)
10861093
fi
10871094

1095+
# Add custom CA certificate if specified
1096+
if [[ -n "${CUSTOM_CA}" ]] && [[ -f "${CUSTOM_CA}" ]]; then
1097+
echo "Adding custom CA certificate for S3 repository creation: ${CUSTOM_CA}"
1098+
S3_CREATE_CMD+=(--root-ca-pem-path="${CUSTOM_CA}")
1099+
fi
1100+
10881101
# Add username/hostname overrides if specified
10891102
add_user_overrides S3_CREATE_CMD
10901103

0 commit comments

Comments
 (0)