diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml index 394e282..a5a7e51 100644 --- a/dev/docker-compose.yml +++ b/dev/docker-compose.yml @@ -58,4 +58,4 @@ services: ports: - "${NB_QUERY_PORT_HOST:-3000}:5173" environment: - NB_API_QUERY_URL: ${NB_API_QUERY_URL:-http://localhost:8000/} \ No newline at end of file + NB_API_QUERY_URL: ${NB_API_QUERY_URL} \ No newline at end of file diff --git a/dev/graphdb_setup.sh b/dev/graphdb_setup.sh index 62a16f5..676d18f 100755 --- a/dev/graphdb_setup.sh +++ b/dev/graphdb_setup.sh @@ -128,12 +128,12 @@ echo "Environment variables have been set from ${ENV_FILE_PATH}." # Extract just the database name DB_NAME="${NB_GRAPH_DB#repositories/}" -NB_GRAPH_PORT_HOST=${NB_GRAPH_PORT_HOST:-7200} +NB_GRAPH_PORT=${NB_GRAPH_PORT:-7200} # Get the directory of this script to be able to find the data-config_template.ttl file SCRIPT_DIR=$(dirname "$0") -echo "The GraphDB server is being accessed at http://localhost:${NB_GRAPH_PORT_HOST}." +echo "The GraphDB server is being accessed at http://localhost:${NB_GRAPH_PORT}." ##### First time GraphDB setup ##### @@ -143,14 +143,14 @@ if [ "${RUN_USER_SETUP}" = "on" ]; then # 1. Change database admin password echo "Changing the admin password (note: if you have previously set the admin password, this has no effect)..." # TODO: To change a *previously set* admin password, we need to also provide the current password via -u - curl -X PATCH --header 'Content-Type: application/json' http://localhost:${NB_GRAPH_PORT_HOST}/rest/security/users/admin -d "{\"password\": \""${ADMIN_PASS}"\"}" + curl -X PATCH --header 'Content-Type: application/json' http://localhost:${NB_GRAPH_PORT}/rest/security/users/admin -d "{\"password\": \""${ADMIN_PASS}"\"}" # 2. If security is not enabled, enable it (i.e. allow only authenticated users access) - is_security_enabled=$(curl -s -X GET http://localhost:${NB_GRAPH_PORT_HOST}/rest/security) + is_security_enabled=$(curl -s -X GET http://localhost:${NB_GRAPH_PORT}/rest/security) if [ "${is_security_enabled}" = "false" ]; then echo "Enabling password-based access control to all databases ..." # NOTE: This command fails without credentials once security is enabled - curl -X POST --header 'Content-Type: application/json' -d true http://localhost:${NB_GRAPH_PORT_HOST}/rest/security + curl -X POST --header 'Content-Type: application/json' -d true http://localhost:${NB_GRAPH_PORT}/rest/security else echo "Password-based access control has already been enabled." fi @@ -159,7 +159,7 @@ if [ "${RUN_USER_SETUP}" = "on" ]; then # TODO: Separate this out from the first-time setup? As this can technically be run at any time to create additional users. # NOTE: If user already exists, response will be "An account with the given username already exists." OK for script. echo "Creating a new database user ${NB_GRAPH_USERNAME}..." - curl -X POST --header 'Content-Type: application/json' -u "admin:${ADMIN_PASS}" -d @- http://localhost:${NB_GRAPH_PORT_HOST}/rest/security/users/${NB_GRAPH_USERNAME} < if query tool will only be accessed from its host machine +NB_API_QUERY_URL=http://XX.XX.XX.XX + # Docker image tag of the query tool (default latest) NB_QUERY_TAG=latest + # Port that the query tool will be exposed on the host and likely the network (default 3000) NB_QUERY_PORT_HOST=3000 \ No newline at end of file