diff --git a/README.md b/README.md index ea2e9d4..4f03f12 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,11 @@ The JPO ITS utilities repository serves as a central location for deploying open - [Configuration](#configuration) - [Configure Kafka Connector Creation](#configure-kafka-connector-creation) - [Quick Run](#quick-run-2) - - [5. Deduplicator](#5-jpo-Deduplicator) - - [Deduplication Configuration](#deduplication-config) - - [Github Token Generation](#generate-a-github-token) + - [5. jpo-deduplicator](#5-jpo-deduplicator) + - [Deduplication Config](#deduplication-config) + - [Generate a Github Token](#generate-a-github-token) - [Quick Run](#quick-run-3) + - [Security Notice](#security-notice) @@ -256,3 +257,12 @@ For local development the following steps are also required 4. You should now see only one copy of the map message sent. [Back to top](#toc) + +## Security Notice + +While default passwords are provided for development convenience, it is **strongly recommended** to: + +1. Change all passwords before deploying to any environment +2. Never use default passwords in production +3. Use secure password generation and management practices +4. Consider using Docker secrets or environment management tools for production deployments diff --git a/docker-compose-deduplicator.yml b/docker-compose-deduplicator.yml index 5c315d7..c1e7410 100644 --- a/docker-compose-deduplicator.yml +++ b/docker-compose-deduplicator.yml @@ -7,14 +7,14 @@ services: context: jpo-deduplicator dockerfile: Dockerfile args: - MAVEN_GITHUB_TOKEN: ${MAVEN_GITHUB_TOKEN:?error} - MAVEN_GITHUB_ORG: ${MAVEN_GITHUB_ORG:?error} + MAVEN_GITHUB_TOKEN: ${MAVEN_GITHUB_TOKEN} + MAVEN_GITHUB_ORG: ${MAVEN_GITHUB_ORG} image: jpo-deduplicator:latest restart: ${RESTART_POLICY} environment: DOCKER_HOST_IP: ${DOCKER_HOST_IP} - KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_BOOTSTRAP_SERVERS:?error} - spring.kafka.bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVERS:?error} + KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_BOOTSTRAP_SERVERS} + spring.kafka.bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVERS} enableProcessedMapDeduplication: ${ENABLE_PROCESSED_MAP_DEDUPLICATION} enableProcessedMapWktDeduplication: ${ENABLE_PROCESSED_MAP_WKT_DEDUPLICATION} enableOdeMapDeduplication: ${ENABLE_ODE_MAP_DEDUPLICATION} @@ -22,9 +22,6 @@ services: enableOdeRawEncodedTimDeduplication: ${ENABLE_ODE_RAW_ENCODED_TIM_DEDUPLICATION} enableProcessedSpatDeduplication: ${ENABLE_PROCESSED_SPAT_DEDUPLICATION} enableOdeBsmDeduplication: ${ENABLE_ODE_BSM_DEDUPLICATION} - - - healthcheck: test: ["CMD", "java", "-version"] interval: 10s diff --git a/jpo-deduplicator/Dockerfile b/jpo-deduplicator/Dockerfile index 6228e45..2631f79 100644 --- a/jpo-deduplicator/Dockerfile +++ b/jpo-deduplicator/Dockerfile @@ -8,17 +8,8 @@ ARG MAVEN_GITHUB_ORG ENV MAVEN_GITHUB_TOKEN=$MAVEN_GITHUB_TOKEN ENV MAVEN_GITHUB_ORG=$MAVEN_GITHUB_ORG -# COPY ./jpo-conflictmonitor/pom.xml ./jpo-conflictmonitor/ -# COPY ./settings.xml ./jpo-conflictmonitor/ - -# # Copy and Build Conflict Monitor -# # Download dependencies alone to cache them first -# WORKDIR /home/jpo-conflictmonitor -# RUN mvn -s settings.xml dependency:resolve - -# # Copy the source code and build the conflict monitor -# COPY ./jpo-conflictmonitor/src ./src -# RUN mvn -s settings.xml install -DskipTests -Ppackage-jar +RUN test -n "$MAVEN_GITHUB_TOKEN" || (echo "Error: MAVEN_GITHUB_TOKEN cannot be empty" && exit 1) +RUN test -n "$MAVEN_GITHUB_ORG" || (echo "Error: MAVEN_GITHUB_ORG cannot be empty" && exit 1) # Copy and Build Deduplicator WORKDIR /home diff --git a/sample.env b/sample.env index 797d2aa..a67d94f 100644 --- a/sample.env +++ b/sample.env @@ -62,19 +62,19 @@ MONGO_DB_NAME=CV # Generate a random string for the MongoDB keyfile using the following command: # $ openssl rand -base64 32 -MONGO_DB_KEYFILE_STRING= +MONGO_DB_KEYFILE_STRING=replace_me MONGO_ADMIN_DB_USER=admin -MONGO_ADMIN_DB_PASS= +MONGO_ADMIN_DB_PASS=replace_me MONGO_READ_WRITE_USER=ode -MONGO_READ_WRITE_PASS= +MONGO_READ_WRITE_PASS=replace_me MONGO_READ_USER=user -MONGO_READ_PASS= +MONGO_READ_PASS=replace_me MONGO_EXPORTER_USERNAME=export -MONGO_EXPORTER_PASSWORD= +MONGO_EXPORTER_PASSWORD=replace_me MONGO_EXPRESS_USER=${MONGO_ADMIN_DB_USER} MONGO_EXPRESS_PASS=${MONGO_ADMIN_DB_PASS}