Skip to content

Commit a2dd7b5

Browse files
committed
chore: improve minio tls
1 parent 35ea77a commit a2dd7b5

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

addons/minio/scripts/startup.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,27 @@
22

33
replicas_history_file="/minio-config/MINIO_REPLICAS_HISTORY"
44
bucket_dir="/data"
5+
writable_certs_path="/data/.minio/certs"
56

67
setup_tls_certs() {
78
if [ "$TLS_ENABLED" = "true" ] && [ -f ${CERTS_PATH}/ca.pem ]; then
8-
echo "Setting up TLS CA certificate for MinIO..."
9-
mkdir -p ${CERTS_PATH}/CAs
10-
cp -L ${CERTS_PATH}/ca.pem ${CERTS_PATH}/CAs/ca.crt
11-
echo "TLS CA certificate setup completed"
9+
echo "Setting up TLS certificates for MinIO..."
10+
11+
# Create writable certs directory
12+
mkdir -p ${writable_certs_path}/CAs
13+
14+
# Copy certificates from read-only mount to writable location
15+
cp -L ${CERTS_PATH}/public.crt ${writable_certs_path}/public.crt
16+
cp -L ${CERTS_PATH}/private.key ${writable_certs_path}/private.key
17+
cp -L ${CERTS_PATH}/ca.pem ${writable_certs_path}/CAs/ca.crt
18+
19+
# Set proper permissions
20+
chmod 600 ${writable_certs_path}/private.key
21+
22+
# Override CERTS_PATH to use writable location
23+
export CERTS_PATH=${writable_certs_path}
24+
25+
echo "TLS certificates setup completed at ${writable_certs_path}"
1226
fi
1327
}
1428

0 commit comments

Comments
 (0)