2
0
mirror of https://github.com/VinylDNS/vinyldns synced 2025-08-31 14:25:30 +00:00

Fix for running locally

- Fix issues with SQS and the Localstack external name
This commit is contained in:
Ryan Emerle
2021-12-15 10:42:32 -05:00
parent dd8c15e365
commit 7f90042c2c
10 changed files with 48 additions and 48 deletions

View File

@@ -176,15 +176,15 @@ vinyldns {
# assumes a docker or mysql instance running locally # assumes a docker or mysql instance running locally
name = "vinyldns" name = "vinyldns"
name = ${?DATABASE_NAME} name = ${?DATABASE_NAME}
driver = "org.h2.Driver" driver = "org.mariadb.jdbc.Driver"
driver = ${?JDBC_DRIVER} driver = ${?JDBC_DRIVER}
migration-url = "jdbc:h2:mem:vinyldns;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE;IGNORECASE=TRUE;INIT=RUNSCRIPT FROM 'classpath:test/ddl.sql'" migration-url = "jdbc:mariadb://localhost:19002/?user=root&password=pass"
migration-url = ${?JDBC_MIGRATION_URL} migration-url = ${?JDBC_MIGRATION_URL}
url = "jdbc:h2:mem:vinyldns;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE;IGNORECASE=TRUE;INIT=RUNSCRIPT FROM 'classpath:test/ddl.sql'" url = "jdbc:mariadb://localhost:19002/vinyldns?user=root&password=pass"
url = ${?JDBC_URL} url = ${?JDBC_URL}
user = "sa" user = "root"
user = ${?JDBC_USER} user = ${?JDBC_USER}
password = "" password = "pass"
password = ${?JDBC_PASSWORD} password = ${?JDBC_PASSWORD}
} }

View File

@@ -176,15 +176,15 @@ vinyldns {
# assumes a docker or mysql instance running locally # assumes a docker or mysql instance running locally
name = "vinyldns" name = "vinyldns"
name = ${?DATABASE_NAME} name = ${?DATABASE_NAME}
driver = "org.h2.Driver" driver = "org.mariadb.jdbc.Driver"
driver = ${?JDBC_DRIVER} driver = ${?JDBC_DRIVER}
migration-url = "jdbc:h2:mem:vinyldns;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE;IGNORECASE=TRUE;INIT=RUNSCRIPT FROM 'classpath:test/ddl.sql'" migration-url = "jdbc:mariadb://localhost:19002/?user=root&password=pass"
migration-url = ${?JDBC_MIGRATION_URL} migration-url = ${?JDBC_MIGRATION_URL}
url = "jdbc:h2:mem:vinyldns;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE;IGNORECASE=TRUE;INIT=RUNSCRIPT FROM 'classpath:test/ddl.sql'" url = "jdbc:mariadb://localhost:19002/vinyldns?user=root&password=pass"
url = ${?JDBC_URL} url = ${?JDBC_URL}
user = "sa" user = "root"
user = ${?JDBC_USER} user = ${?JDBC_USER}
password = "" password = "pass"
password = ${?JDBC_PASSWORD} password = ${?JDBC_PASSWORD}
} }

View File

@@ -176,15 +176,15 @@ vinyldns {
# assumes a docker or mysql instance running locally # assumes a docker or mysql instance running locally
name = "vinyldns" name = "vinyldns"
name = ${?DATABASE_NAME} name = ${?DATABASE_NAME}
driver = "org.h2.Driver" driver = "org.mariadb.jdbc.Driver"
driver = ${?JDBC_DRIVER} driver = ${?JDBC_DRIVER}
migration-url = "jdbc:h2:mem:vinyldns;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE;IGNORECASE=TRUE;INIT=RUNSCRIPT FROM 'classpath:test/ddl.sql'" migration-url = "jdbc:mariadb://localhost:19002/?user=root&password=pass"
migration-url = ${?JDBC_MIGRATION_URL} migration-url = ${?JDBC_MIGRATION_URL}
url = "jdbc:h2:mem:vinyldns;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE;IGNORECASE=TRUE;INIT=RUNSCRIPT FROM 'classpath:test/ddl.sql'" url = "jdbc:mariadb://localhost:19002/vinyldns?user=root&password=pass"
url = ${?JDBC_URL} url = ${?JDBC_URL}
user = "sa" user = "root"
user = ${?JDBC_USER} user = ${?JDBC_USER}
password = "" password = "pass"
password = ${?JDBC_PASSWORD} password = ${?JDBC_PASSWORD}
} }

View File

@@ -185,15 +185,15 @@ vinyldns {
# assumes a docker or mysql instance running locally # assumes a docker or mysql instance running locally
name = "vinyldns" name = "vinyldns"
name = ${?DATABASE_NAME} name = ${?DATABASE_NAME}
driver = "org.h2.Driver" driver = "org.mariadb.jdbc.Driver"
driver = ${?JDBC_DRIVER} driver = ${?JDBC_DRIVER}
migration-url = "jdbc:h2:mem:vinyldns;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE;IGNORECASE=TRUE;INIT=RUNSCRIPT FROM 'classpath:test/ddl.sql'" migration-url = "jdbc:mariadb://localhost:19002/?user=root&password=pass"
migration-url = ${?JDBC_MIGRATION_URL} migration-url = ${?JDBC_MIGRATION_URL}
url = "jdbc:h2:mem:vinyldns;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE;IGNORECASE=TRUE;INIT=RUNSCRIPT FROM 'classpath:test/ddl.sql'" url = "jdbc:mariadb://localhost:19002/vinyldns?user=root&password=pass"
url = ${?JDBC_URL} url = ${?JDBC_URL}
user = "sa" user = "root"
user = ${?JDBC_USER} user = ${?JDBC_USER}
password = "" password = "pass"
password = ${?JDBC_PASSWORD} password = ${?JDBC_PASSWORD}
} }

View File

@@ -176,15 +176,15 @@ vinyldns {
# assumes a docker or mysql instance running locally # assumes a docker or mysql instance running locally
name = "vinyldns" name = "vinyldns"
name = ${?DATABASE_NAME} name = ${?DATABASE_NAME}
driver = "org.h2.Driver" driver = "org.mariadb.jdbc.Driver"
driver = ${?JDBC_DRIVER} driver = ${?JDBC_DRIVER}
migration-url = "jdbc:h2:mem:vinyldns;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE;IGNORECASE=TRUE;INIT=RUNSCRIPT FROM 'classpath:test/ddl.sql'" migration-url = "jdbc:mariadb://localhost:19002/?user=root&password=pass"
migration-url = ${?JDBC_MIGRATION_URL} migration-url = ${?JDBC_MIGRATION_URL}
url = "jdbc:h2:mem:vinyldns;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE;IGNORECASE=TRUE;INIT=RUNSCRIPT FROM 'classpath:test/ddl.sql'" url = "jdbc:mariadb://localhost:19002/vinyldns?user=root&password=pass"
url = ${?JDBC_URL} url = ${?JDBC_URL}
user = "sa" user = "root"
user = ${?JDBC_USER} user = ${?JDBC_USER}
password = "" password = "pass"
password = ${?JDBC_PASSWORD} password = ${?JDBC_PASSWORD}
} }

View File

@@ -23,7 +23,7 @@ LDAP {
securityAuthentication = ${?LDAP_SECURITY_AUTH} securityAuthentication = ${?LDAP_SECURITY_AUTH}
# Note: The following assumes a purely docker setup, using container_name = vinyldns-ldap # Note: The following assumes a purely docker setup, using container_name = vinyldns-ldap
providerUrl = "ldap://vinyldns-ldap:19004" providerUrl = "ldap://localhost:19004"
providerUrl = ${?LDAP_PROVIDER_URL} providerUrl = ${?LDAP_PROVIDER_URL}
} }

View File

@@ -12,7 +12,7 @@ services:
# Integration image hosting r53, sns, sqs, bind, and mysql # Integration image hosting r53, sns, sqs, bind, and mysql
integration: integration:
container_name: "vinyldns-api-integration" container_name: "vinyldns-api-integration"
hostname: &integration_hostname "vinyldns-integration" hostname: "vinyldns-integration"
image: "vinyldns/build:base-test-integration-${VINYLDNS_IMAGE_VERSION}" image: "vinyldns/build:base-test-integration-${VINYLDNS_IMAGE_VERSION}"
build: build:
context: ../ context: ../
@@ -21,7 +21,7 @@ services:
VINYLDNS_BASE_VERSION: "${VINYLDNS_BASE_VERSION}" VINYLDNS_BASE_VERSION: "${VINYLDNS_BASE_VERSION}"
environment: environment:
RUN_SERVICES: "deps-only tail-logs" RUN_SERVICES: "deps-only tail-logs"
LOCALSTACK_EXT_HOSTNAME: *integration_hostname LOCALSTACK_EXT_HOSTNAME: "${LOCALSTACK_EXT_HOSTNAME:-vinyldns-integration}"
env_file: env_file:
.env .env
ports: ports:

View File

@@ -21,9 +21,9 @@ function usage() {
echo -e "options:" echo -e "options:"
echo -e "\t-a, --api-only do not start up the VinylDNS Portal" echo -e "\t-a, --api-only do not start up the VinylDNS Portal"
echo -e "\t-b, --build force a rebuild of the Docker images with the local code" echo -e "\t-b, --build force a rebuild of the Docker images with the local code"
echo -e "\t-c, --clean stops all VinylDNS containers" echo -e "\t-c, --clean stops all VinylDNS containers and exits"
echo -e "\t-d, --deps-only only start up the dependencies, not the API or Portal" echo -e "\t-d, --deps-only only start up the dependencies, not the API or Portal"
echo -e "\t-r, --reset reset any the running containers" echo -e "\t-r, --reset stops any the running containers before starting new containers"
echo -e "\t-s, --service specify the service to run" echo -e "\t-s, --service specify the service to run"
echo -e "\t-t, --timeout the time to wait (in seconds) for the Portal and API to start (default: 60)" echo -e "\t-t, --timeout the time to wait (in seconds) for the Portal and API to start (default: 60)"
echo -e "\t-u, --update remove the local quickstart images to force a re-pull from Docker Hub" echo -e "\t-u, --update remove the local quickstart images to force a re-pull from Docker Hub"
@@ -33,7 +33,7 @@ function usage() {
} }
function wait_for_url() { function wait_for_url() {
echo -n "Waiting for ${F_BLUE}$1${F_RESET} at ${URL}.." echo -n "Waiting for ${F_BLUE}$1${F_RESET} at ${URL} .."
RETRY="$TIMEOUT" RETRY="$TIMEOUT"
while [ "$RETRY" -ge 0 ]; do while [ "$RETRY" -ge 0 ]; do
echo -n "." echo -n "."
@@ -101,6 +101,7 @@ while [[ $# -gt 0 ]]; do
shift shift
;; ;;
-d | --deps-only) -d | --deps-only)
export LOCALSTACK_EXT_HOSTNAME="localhost"
SERVICE="integration ldap" SERVICE="integration ldap"
shift shift
;; ;;
@@ -153,14 +154,12 @@ fi
# Update images if requested # Update images if requested
if [[ $UPDATE -eq 1 ]]; then if [[ $UPDATE -eq 1 ]]; then
echo "${F_YELLOW}Removing any local docker containers tagged ${F_RESET}'${VINYLDNS_IMAGE_VERSION}'${F_YELLOW}...${F_RESET}" echo "${F_YELLOW}Removing any running VinylDNS docker containers tagged ${F_RESET}'${VINYLDNS_IMAGE_VERSION}'${F_YELLOW}...${F_RESET}"
"${DIR}/../utils/clean-vinyldns-containers.sh" "${DIR}/../utils/clean-vinyldns-containers.sh" &> /dev/null || true
echo "${F_YELLOW}Removing any local docker images tagged ${F_RESET}'${VINYLDNS_IMAGE_VERSION}'${F_YELLOW}...${F_RESET}" echo "${F_YELLOW}Removing any local VinylDNS Docker images tagged ${F_RESET}'${VINYLDNS_IMAGE_VERSION}'${F_YELLOW}...${F_RESET}"
docker rmi "vinyldns/build:base-test-integration-${VINYLDNS_IMAGE_VERSION}" &> /dev/null || true docker images -a |grep vinyldns | grep "${VINYLDNS_IMAGE_VERSION}" | awk '{print $3}' | xarg docker rmi &> /dev/null || true
docker rmi "vinyldns/portal:${VINYLDNS_IMAGE_VERSION}" &> /dev/null || true echo "${F_GREEN}Successfully removed all local VinylDNS Docker images and running containers tagged ${F_RESET}'${VINYLDNS_IMAGE_VERSION}'${F_YELLOW}...${F_RESET}"
docker rmi "vinyldns/api:${VINYLDNS_IMAGE_VERSION}" &> /dev/null || true
echo "${F_GREEN}Removed all local docker images and containers tagged ${F_RESET}'${VINYLDNS_IMAGE_VERSION}'${F_YELLOW}...${F_RESET}"
fi fi

View File

@@ -121,15 +121,16 @@ vinyldns {
# these must be overridden to use MYSQL for production use # these must be overridden to use MYSQL for production use
# assumes a docker or mysql instance running locally # assumes a docker or mysql instance running locally
name = "vinyldns" name = "vinyldns"
driver = "org.h2.Driver" name = ${?DATABASE_NAME}
driver = "org.mariadb.jdbc.Driver"
driver = ${?JDBC_DRIVER} driver = ${?JDBC_DRIVER}
migration-url = "jdbc:h2:mem:vinyldns;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE;IGNORECASE=TRUE;INIT=RUNSCRIPT FROM 'classpath:test/ddl.sql'" migration-url = "jdbc:mariadb://localhost:19002/?user=root&password=pass"
migration-url = ${?JDBC_MIGRATION_URL} migration-url = ${?JDBC_MIGRATION_URL}
url = "jdbc:h2:mem:vinyldns;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE;IGNORECASE=TRUE;INIT=RUNSCRIPT FROM 'classpath:test/ddl.sql'" url = "jdbc:mariadb://localhost:19002/vinyldns?user=root&password=pass"
url = ${?JDBC_URL} url = ${?JDBC_URL}
user = "sa" user = "root"
user = ${?JDBC_USER} user = ${?JDBC_USER}
password = "" password = "pass"
password = ${?JDBC_PASSWORD} password = ${?JDBC_PASSWORD}
# see https://github.com/brettwooldridge/HikariCP # see https://github.com/brettwooldridge/HikariCP
connection-timeout-millis = 1000 connection-timeout-millis = 1000

View File

@@ -177,15 +177,15 @@ vinyldns {
# assumes a docker or mysql instance running locally # assumes a docker or mysql instance running locally
name = "vinyldns" name = "vinyldns"
name = ${?DATABASE_NAME} name = ${?DATABASE_NAME}
driver = "org.h2.Driver" driver = "org.mariadb.jdbc.Driver"
driver = ${?JDBC_DRIVER} driver = ${?JDBC_DRIVER}
migration-url = "jdbc:h2:mem:vinyldns;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE;IGNORECASE=TRUE;INIT=RUNSCRIPT FROM 'classpath:test/ddl.sql'" migration-url = "jdbc:mariadb://localhost:19002/?user=root&password=pass"
migration-url = ${?JDBC_MIGRATION_URL} migration-url = ${?JDBC_MIGRATION_URL}
url = "jdbc:h2:mem:vinyldns;MODE=MYSQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=TRUE;IGNORECASE=TRUE;INIT=RUNSCRIPT FROM 'classpath:test/ddl.sql'" url = "jdbc:mariadb://localhost:19002/vinyldns?user=root&password=pass"
url = ${?JDBC_URL} url = ${?JDBC_URL}
user = "sa" user = "root"
user = ${?JDBC_USER} user = ${?JDBC_USER}
password = "" password = "pass"
password = ${?JDBC_PASSWORD} password = ${?JDBC_PASSWORD}
# see https://github.com/brettwooldridge/HikariCP # see https://github.com/brettwooldridge/HikariCP
connection-timeout-millis = 1000 connection-timeout-millis = 1000