Skip to content

Commit eded651

Browse files
committed
refactor: only add ARANGO SSL env variables to .env file if generate_env is called with ssl flag.
1 parent 752a4fe commit eded651

File tree

4 files changed

+24
-15
lines changed

4 files changed

+24
-15
lines changed

compose/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,14 @@ the ArangoDB container can mount it and locate the necessary certificate files.
6262
If not using SSL with Arango, omit this flag so that the container will run
6363
over TCP (HTTP).
6464

65-
WARNING - If you do not want to run with HTTPS be sure to remove
66-
datafed-arango.key, datafed-arango.pem, datafed-arango.crt from
67-
(DataFed/compose/metadata|all/keys) folder.
65+
WARNING - If you do not want to run with HTTPS but it was previously run with
66+
HTTPS turned on, be sure to remove datafed-arango.key, datafed-arango.pem,
67+
datafed-arango.crt from (DataFed/compose/metadata|all/keys) folder. In
68+
addition, you may need to remove, the below variables from your .env file
69+
70+
   DATAFED_ARANGO_CERT_PATH
71+
   DATAFED_ARANGO_KEY_PATH
72+
   DATAFED_ARANGO_PEM_PATH
6873

6974
### 2. Fill in the needed .env variables for the Metadata Core Services
7075

compose/all/compose.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,6 @@ services:
158158
- ./logs:${DATAFED_CONTAINER_LOG_PATH}
159159
- ${DATAFED_HOST_COLLECTION_MOUNT}:${DATAFED_GCS_COLLECTION_ROOT_PATH}/${DATAFED_REPO_ID_AND_DIR}
160160

161-
# ports:
162-
# - "8081:443" # This must be the same port that is mapped to the host for redirects to work
163-
# - "50000-50100:50000-50100"
164-
165161
volumes:
166162
foxx_tmp:
167163
arango_db:

docker/entrypoint_foxx.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fi
4242
# we may want to keep the existing state and not overwrite the database.
4343
install_flag="/tmp/.foxx_is_installed"
4444
if [ ! -f "$install_flag" ]; then
45-
echo "Installing foxx."
45+
echo "INFO - Installing foxx."
4646
log_path="$DATAFED_DEFAULT_LOG_PATH"
4747
if [ ! -d "${log_path}" ]; then
4848
mkdir -p "${log_path}" datafed
@@ -81,9 +81,6 @@ if [ ! -f "$install_flag" ]; then
8181

8282
"${DATAFED_DEPENDENCIES_INSTALL_PATH}/bin/cmake" --build build
8383

84-
# Give arango container a minute to initialize
85-
# should be replaced with health check at some point
86-
sleep 5
8784
"${DATAFED_DEPENDENCIES_INSTALL_PATH}/bin/cmake" --build build --target install
8885

8986
if [ "$ENABLE_FOXX_TESTS" == "TRUE" ]; then
@@ -97,11 +94,12 @@ if [ ! -f "$install_flag" ]; then
9794
# Create flag to indicate container has done its job
9895
touch "$install_flag"
9996
else
100-
echo "$install_flag has been found skipping reinstall"
97+
echo "INFO - $install_flag has been found skipping reinstall"
10198
fi
10299

103100
# Keep container alive for a little bit, the CI pipelines check that the
104101
# container actually runs. If the container runs to fast the pipeline check
105102
# might fail because it wasn't able to determine if the container actually
106103
# ran.
107104
sleep 60
105+
echo "INFO - Initialization of Database has completed successfully."

scripts/compose_generate_env.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,24 @@ DATAFED_GLOBUS_APP_ID=${local_DATAFED_GLOBUS_APP_ID}
312312
DATAFED_ZEROMQ_SESSION_SECRET=${local_DATAFED_ZEROMQ_SESSION_SECRET}
313313
DATAFED_WEB_CERT_PATH=${local_DATAFED_WEB_CERT_PATH}
314314
DATAFED_WEB_KEY_PATH=${local_DATAFED_WEB_KEY_PATH}
315-
DATAFED_ARANGO_CERT_PATH=${local_DATAFED_ARANGO_CERT_PATH}
316-
DATAFED_ARANGO_KEY_PATH=${local_DATAFED_ARANGO_KEY_PATH}
317-
DATAFED_ARANGO_PEM_PATH=${local_DATAFED_ARANGO_PEM_PATH}
318315
DATAFED_DATABASE_PASSWORD=${local_DATAFED_DATABASE_PASSWORD}
319316
DATAFED_DATABASE_IP_ADDRESS=${local_DATAFED_DATABASE_IP_ADDRESS}
320317
DATAFED_DATABASE_PORT=${local_DATAFED_DATABASE_PORT}
321318
DATAFED_ENABLE_FOXX_TESTS=${local_DATAFED_ENABLE_FOXX_TESTS}
322319
EOF
320+
321+
if [[ -n "${local_DATAFED_ARANGO_KEY_PATH}" || "${ARANGO_USE_SSL}" == "TRUE" ]]
322+
then
323+
echo "DATAFED_ARANGO_KEY_PATH=${local_DATAFED_ARANGO_KEY_PATH}" >> $ENV_FILE_PATH
324+
fi
325+
if [[ -n "${local_DATAFED_ARANGO_CERT_PATH}" || "${ARANGO_USE_SSL}" == "TRUE" ]]
326+
then
327+
echo "DATAFED_ARANGO_CERT_PATH=${local_DATAFED_ARANGO_CERT_PATH}" >> $ENV_FILE_PATH
328+
fi
329+
if [[ -n "${local_DATAFED_ARANGO_PEM_PATH}" || "${ARANGO_USE_SSL}" == "TRUE" ]]
330+
then
331+
echo "DATAFED_ARANGO_PEM_PATH=${local_DATAFED_ARANGO_PEM_PATH}" >> $ENV_FILE_PATH
332+
fi
323333
fi
324334

325335
if [ "${BUILD_REPO}" == "TRUE" ]; then

0 commit comments

Comments
 (0)