diff --git a/ApacheDerby/Dockerfile b/ApacheDerby/Dockerfile index c1eb2af..c2e6e1a 100644 --- a/ApacheDerby/Dockerfile +++ b/ApacheDerby/Dockerfile @@ -38,7 +38,7 @@ ENV TOMCAT_SERVER_PORT ${TOMCAT_SERVER_PORT:-18005} ENV TOMCAT_AJP_PORT ${TOMCAT_AJP_PORT:-18009} # Klaros release version, which is used during installation. A list of available releases can be found on the official Klaros Test Management website or on GitHub. -ENV KLAROS_VERSION ${KLAROS_VERSION:-4.12.5} +ENV KLAROS_VERSION ${KLAROS_VERSION:-4.12.6} ENV KLAROS_HOME /data/klaros-home ENV CATALINA_BASE /data/catalina-base diff --git a/Documentation-German.adoc b/Documentation-German.adoc index 1b0da97..b9e770a 100644 --- a/Documentation-German.adoc +++ b/Documentation-German.adoc @@ -12,7 +12,7 @@ endif::[] :sectnums: :toc-title: Inhaltsverzeichnis -image:https://img.shields.io/badge/Version-4.12.5-green.svg[link="https://github.com/klaros-testmanagement/klaros-docker/releases"] +image:https://img.shields.io/badge/Version-4.12.6-green.svg[link="https://github.com/klaros-testmanagement/klaros-docker/releases"] image:https://img.shields.io/badge/License-MIT-green[link="https://github.com/klaros-testmanagement/klaros-docker/blob/master/LICENSE"] image:https://img.shields.io/badge/Community%20Edition-FREE-green[link="https://www.klaros-testmanagement.com/en_US/download"] image:https://img.shields.io/twitter/follow/Klaros_TM?style=social[float="right", link="https://twitter.com/intent/follow?screen_name=Klaros_TM"] diff --git a/Documentation.adoc b/Documentation.adoc index b2bab23..75603ba 100644 --- a/Documentation.adoc +++ b/Documentation.adoc @@ -11,7 +11,7 @@ endif::[] :toc: macro :sectnums: -image:https://img.shields.io/badge/Version-4.12.5-green.svg[link="https://github.com/klaros-testmanagement/klaros-docker/releases"] +image:https://img.shields.io/badge/Version-4.12.6-green.svg[link="https://github.com/klaros-testmanagement/klaros-docker/releases"] image:https://img.shields.io/badge/License-MIT-green[link="https://github.com/klaros-testmanagement/klaros-docker/blob/master/LICENSE"] image:https://img.shields.io/badge/Community%20Edition-FREE-green[link="https://www.klaros-testmanagement.com/en_US/download"] image:https://img.shields.io/twitter/follow/Klaros_TM?style=social[float="right", link="https://twitter.com/intent/follow?screen_name=Klaros_TM"] diff --git a/MariaDB/db/000_init_user_db.sh b/MariaDB/db/000_init_user_db.sh deleted file mode 100644 index f97c2cd..0000000 --- a/MariaDB/db/000_init_user_db.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -echo "Start Init_Database" - -chmod 700 /data/mysql-data -chown mysql:mysql /data/mysql-data - -mysql -h "localhost" -u "$MYSQL_USER" "-p$(MYSQL_PASSWORD)" "$MYSQL_DATABASE" <" - CREATE TABLESPACE klarosspace LOCATION '/data/mysql-data'; - CREATE role $MYSQL_USER LOGIN PASSWORD '$MYSQL_PASSWORD'; - CREATE DATABASE $MYSQL_DATABASE OWNER $MYSQL_USER TABLESPACE klarosspace; - GRANT ALL PRIVILEGES ON DATABASE $MYSQL_DATABASE TO $MYSQL_USER;" - -echo "End of Init_Database" diff --git a/MariaDB/db/001_print_version.sql b/MariaDB/db/001_print_version.sql deleted file mode 100644 index de46afa..0000000 --- a/MariaDB/db/001_print_version.sql +++ /dev/null @@ -1 +0,0 @@ -select @@version diff --git a/MariaDB/db/002_tune_database.sql b/MariaDB/db/002_tune_database.sql deleted file mode 100644 index a990831..0000000 --- a/MariaDB/db/002_tune_database.sql +++ /dev/null @@ -1,13 +0,0 @@ -EXEC sys.sp_configure N'show advanced options', N'1' RECONFIGURE WITH OVERRIDE -GO -EXEC sys.sp_configure N'cost threshold for parallelism', N'60' -GO -EXEC sys.sp_configure N'max degree of parallelism', N'3' -GO -EXEC sys.sp_configure N'optimize for ad hoc workloads', N'1' -GO -RECONFIGURE WITH OVERRIDE -GO -EXEC sys.sp_configure N'show advanced options', N'0' RECONFIGURE WITH OVERRIDE -GO - diff --git a/MariaDB/db/003_create_database.sql b/MariaDB/db/003_create_database.sql deleted file mode 100644 index 6408035..0000000 --- a/MariaDB/db/003_create_database.sql +++ /dev/null @@ -1,13 +0,0 @@ -if not exists(SELECT 1 FROM sys.databases WHERE name = N'@@MYSQL_DATABASE@@') -begin - CREATE DATABASE [@@MYSQL_DATABASE@@] Collate SQL_Latin1_General_CP1_CI_AS - ALTER DATABASE [@@MYSQL_DATABASE@@] MODIFY FILE (NAME = '@@MYSQL_DATABASE@@', SIZE = 500 MB, FILEGROWTH = 10%) - ALTER DATABASE [@@MYSQL_DATABASE@@] MODIFY FILE (NAME = '@@MYSQL_DATABASE@@_log', SIZE = 500 MB, FILEGROWTH = 10%) - ALTER DATABASE [@@MYSQL_DATABASE@@] SET AUTO_SHRINK OFF WITH NO_WAIT - ALTER DATABASE [@@MYSQL_DATABASE@@] SET AUTO_CREATE_STATISTICS ON WITH NO_WAIT - ALTER DATABASE [@@MYSQL_DATABASE@@] SET AUTO_UPDATE_STATISTICS ON WITH NO_WAIT - ALTER DATABASE [@@MYSQL_DATABASE@@] SET AUTO_UPDATE_STATISTICS_ASYNC OFF WITH NO_WAIT - ALTER DATABASE [@@MYSQL_DATABASE@@] SET RECOVERY SIMPLE - ALTER DATABASE [@@MYSQL_DATABASE@@] SET COMPATIBILITY_LEVEL = 130 -end -GO diff --git a/MariaDB/db/Dockerfile b/MariaDB/db/Dockerfile index fa22ca8..c1297da 100644 --- a/MariaDB/db/Dockerfile +++ b/MariaDB/db/Dockerfile @@ -1,4 +1,4 @@ -FROM verit/klaros-mariadb_db:4.12.5 +FROM verit/klaros-mariadb_db:4.12.6 LABEL maintainer "BreadSpoon " COPY *.cnf /etc/mysql/mariadb.conf.d diff --git a/MariaDB/db/docker-entrypoint.sh b/MariaDB/db/docker-entrypoint.sh deleted file mode 100644 index 62111e1..0000000 --- a/MariaDB/db/docker-entrypoint.sh +++ /dev/null @@ -1,328 +0,0 @@ -#!/bin/bash -set -eo pipefail -shopt -s nullglob - -# logging functions -mysql_log() { - local type="$1"; shift - printf '%s [%s] [Entrypoint]: %s\n' "$(date --rfc-3339=seconds)" "$type" "$*" -} -mysql_note() { - mysql_log Note "$@" -} -mysql_warn() { - mysql_log Warn "$@" >&2 -} -mysql_error() { - mysql_log ERROR "$@" >&2 - exit 1 -} - -# usage: file_env VAR [DEFAULT] -# ie: file_env 'XYZ_DB_PASSWORD' 'example' -# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of -# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) -file_env() { - local var="$1" - local fileVar="${var}_FILE" - local def="${2:-}" - if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then - mysql_error "Both $var and $fileVar are set (but are exclusive)" - fi - local val="$def" - if [ "${!var:-}" ]; then - val="${!var}" - elif [ "${!fileVar:-}" ]; then - val="$(< "${!fileVar}")" - fi - export "$var"="$val" - unset "$fileVar" -} - -# check to see if this file is being run or sourced from another script -_is_sourced() { - # https://unix.stackexchange.com/a/215279 - [ "${#FUNCNAME[@]}" -ge 2 ] \ - && [ "${FUNCNAME[0]}" = '_is_sourced' ] \ - && [ "${FUNCNAME[1]}" = 'source' ] -} - -# usage: docker_process_init_files [file [file [...]]] -# ie: docker_process_init_files /always-initdb.d/* -# process initializer files, based on file extensions -docker_process_init_files() { - # mysql here for backwards compatibility "${mysql[@]}" - mysql=( docker_process_sql ) - - echo - local f - for f; do - case "$f" in - *.sh) mysql_note "$0: running $f"; . "$f" ;; - *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; - *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; - *) mysql_warn "$0: ignoring $f" ;; - esac - echo - done -} - -mysql_check_config() { - local toRun=( "$@" --verbose --help --log-bin-index="$(mktemp -u)" ) errors - if ! errors="$("${toRun[@]}" 2>&1 >/dev/null)"; then - mysql_error $'mysqld failed while attempting to check config\n\tcommand was: '"${toRun[*]}"$'\n\t'"$errors" - fi -} - -# Fetch value from server config -# We use mysqld --verbose --help instead of my_print_defaults because the -# latter only show values present in config files, and not server defaults -mysql_get_config() { - local conf="$1"; shift - "$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null \ - | awk -v conf="$conf" '$1 == conf && /^[^ \t]/ { sub(/^[^ \t]+[ \t]+/, ""); print; exit }' - # match "datadir /some/path with/spaces in/it here" but not "--xyz=abc\n datadir (xyz)" -} - -# Do a temporary startup of the MySQL server, for init purposes -docker_temp_server_start() { - "$@" --skip-networking --socket="${SOCKET}" & - mysql_note "Waiting for server startup" - local i - for i in {30..0}; do - # only use the root password if the database has already been initializaed - # so that it won't try to fill in a password file when it hasn't been set yet - extraArgs=() - if [ -z "$DATABASE_ALREADY_EXISTS" ]; then - extraArgs+=( '--dont-use-mysql-root-password' ) - fi - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then - break - fi - sleep 1 - done - if [ "$i" = 0 ]; then - mysql_error "Unable to start server." - fi -} - -# Stop the server. When using a local socket file mysqladmin will block until -# the shutdown is complete. -docker_temp_server_stop() { - if ! mysqladmin --defaults-extra-file=<( _mysql_passfile ) shutdown -uroot --socket="${SOCKET}"; then - mysql_error "Unable to shut down server." - fi -} - -# Verify that the minimally required password settings are set for new databases. -docker_verify_minimum_env() { - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - mysql_error $'Database is uninitialized and password option is not specified\n\tYou need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' - fi -} - -# creates folders for the database -# also ensures permission for user mysql of run as root -docker_create_db_directories() { - local user; user="$(id -u)" - - # see https://github.com/docker-library/mysql/issues/562 - mkdir -p "$DATADIR" - - if [ "$user" = "0" ]; then - # this will cause less disk access than `chown -R` - find "$DATADIR" \! -user mysql -exec chown mysql '{}' + - fi -} - -# initializes the database directory -docker_init_database_dir() { - mysql_note "Initializing database files" - installArgs=( --datadir="$DATADIR" --rpm ) - if { mysql_install_db --help || :; } | grep -q -- '--auth-root-authentication-method'; then - # beginning in 10.4.3, install_db uses "socket" which only allows system user root to connect, switch back to "normal" to allow mysql root without a password - # see https://github.com/MariaDB/server/commit/b9f3f06857ac6f9105dc65caae19782f09b47fb3 - # (this flag doesn't exist in 10.0 and below) - installArgs+=( --auth-root-authentication-method=normal ) - fi - # "Other options are passed to mysqld." (so we pass all "mysqld" arguments directly here) - mysql_install_db "${installArgs[@]}" "${@:2}" - mysql_note "Database files initialized" -} - -# Loads various settings that are used elsewhere in the script -# This should be called after mysql_check_config, but before any other functions -docker_setup_env() { - # Get config - declare -g DATADIR SOCKET - DATADIR="$(mysql_get_config 'datadir' "$@")" - SOCKET="$(mysql_get_config 'socket' "$@")" - - # Initialize values that might be stored in a file - file_env 'MYSQL_ROOT_HOST' '%' - file_env 'MYSQL_DATABASE' - file_env 'MYSQL_USER' - file_env 'MYSQL_PASSWORD' - file_env 'MYSQL_ROOT_PASSWORD' - - declare -g DATABASE_ALREADY_EXISTS - if [ -d "$DATADIR/mysql" ]; then - DATABASE_ALREADY_EXISTS='true' - fi -} - -# Execute sql script, passed via stdin -# usage: docker_process_sql [--dont-use-mysql-root-password] [mysql-cli-args] -# ie: docker_process_sql --database=mydb <<<'INSERT ...' -# ie: docker_process_sql --dont-use-mysql-root-password --database=mydb " ENV MSSQL_MASTER_DATA_FILE /data/mssql-data/master.mdf diff --git a/Microsoft SQL Server/klaros/Dockerfile b/Microsoft SQL Server/klaros/Dockerfile index 96df453..d0a607a 100644 --- a/Microsoft SQL Server/klaros/Dockerfile +++ b/Microsoft SQL Server/klaros/Dockerfile @@ -32,7 +32,7 @@ ENV TOMCAT_SERVER_PORT ${TOMCAT_SERVER_PORT:-18005} ENV TOMCAT_AJP_PORT ${TOMCAT_AJP_PORT:-18009} # Klaros release version, which is used during installation. A list of available releases can be found on the official Klaros Test Management website or on GitHub. -ENV KLAROS_VERSION ${KLAROS_VERSION:-4.12.5} +ENV KLAROS_VERSION ${KLAROS_VERSION:-4.12.6} ENV KLAROS_HOME /data/klaros-home ENV CATALINA_BASE /data/catalina-base diff --git a/MySQL/db/000_init_user_db.sh b/MySQL/db/000_init_user_db.sh deleted file mode 100644 index f97c2cd..0000000 --- a/MySQL/db/000_init_user_db.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -echo "Start Init_Database" - -chmod 700 /data/mysql-data -chown mysql:mysql /data/mysql-data - -mysql -h "localhost" -u "$MYSQL_USER" "-p$(MYSQL_PASSWORD)" "$MYSQL_DATABASE" <" - CREATE TABLESPACE klarosspace LOCATION '/data/mysql-data'; - CREATE role $MYSQL_USER LOGIN PASSWORD '$MYSQL_PASSWORD'; - CREATE DATABASE $MYSQL_DATABASE OWNER $MYSQL_USER TABLESPACE klarosspace; - GRANT ALL PRIVILEGES ON DATABASE $MYSQL_DATABASE TO $MYSQL_USER;" - -echo "End of Init_Database" diff --git a/MySQL/db/001_print_version.sql b/MySQL/db/001_print_version.sql deleted file mode 100644 index de46afa..0000000 --- a/MySQL/db/001_print_version.sql +++ /dev/null @@ -1 +0,0 @@ -select @@version diff --git a/MySQL/db/002_tune_database.sql b/MySQL/db/002_tune_database.sql deleted file mode 100644 index a990831..0000000 --- a/MySQL/db/002_tune_database.sql +++ /dev/null @@ -1,13 +0,0 @@ -EXEC sys.sp_configure N'show advanced options', N'1' RECONFIGURE WITH OVERRIDE -GO -EXEC sys.sp_configure N'cost threshold for parallelism', N'60' -GO -EXEC sys.sp_configure N'max degree of parallelism', N'3' -GO -EXEC sys.sp_configure N'optimize for ad hoc workloads', N'1' -GO -RECONFIGURE WITH OVERRIDE -GO -EXEC sys.sp_configure N'show advanced options', N'0' RECONFIGURE WITH OVERRIDE -GO - diff --git a/MySQL/db/003_create_database.sql b/MySQL/db/003_create_database.sql deleted file mode 100644 index 6408035..0000000 --- a/MySQL/db/003_create_database.sql +++ /dev/null @@ -1,13 +0,0 @@ -if not exists(SELECT 1 FROM sys.databases WHERE name = N'@@MYSQL_DATABASE@@') -begin - CREATE DATABASE [@@MYSQL_DATABASE@@] Collate SQL_Latin1_General_CP1_CI_AS - ALTER DATABASE [@@MYSQL_DATABASE@@] MODIFY FILE (NAME = '@@MYSQL_DATABASE@@', SIZE = 500 MB, FILEGROWTH = 10%) - ALTER DATABASE [@@MYSQL_DATABASE@@] MODIFY FILE (NAME = '@@MYSQL_DATABASE@@_log', SIZE = 500 MB, FILEGROWTH = 10%) - ALTER DATABASE [@@MYSQL_DATABASE@@] SET AUTO_SHRINK OFF WITH NO_WAIT - ALTER DATABASE [@@MYSQL_DATABASE@@] SET AUTO_CREATE_STATISTICS ON WITH NO_WAIT - ALTER DATABASE [@@MYSQL_DATABASE@@] SET AUTO_UPDATE_STATISTICS ON WITH NO_WAIT - ALTER DATABASE [@@MYSQL_DATABASE@@] SET AUTO_UPDATE_STATISTICS_ASYNC OFF WITH NO_WAIT - ALTER DATABASE [@@MYSQL_DATABASE@@] SET RECOVERY SIMPLE - ALTER DATABASE [@@MYSQL_DATABASE@@] SET COMPATIBILITY_LEVEL = 130 -end -GO diff --git a/MySQL/db/Dockerfile b/MySQL/db/Dockerfile index 77ea104..8dccfe0 100644 --- a/MySQL/db/Dockerfile +++ b/MySQL/db/Dockerfile @@ -1,4 +1,4 @@ -FROM verit/klaros-mysql_db:4.12.5 +FROM verit/klaros-mysql_db:4.12.6 LABEL maintainer "BreadSpoon " COPY *.cnf /etc/mysql/mysql.conf.d diff --git a/MySQL/db/docker-entrypoint.sh b/MySQL/db/docker-entrypoint.sh deleted file mode 100644 index 6a5c7e8..0000000 --- a/MySQL/db/docker-entrypoint.sh +++ /dev/null @@ -1,368 +0,0 @@ -#!/bin/bash -set -eo pipefail -shopt -s nullglob - -# logging functions -mysql_log() { - local type="$1"; shift - printf '%s [%s] [Entrypoint]: %s\n' "$(date --rfc-3339=seconds)" "$type" "$*" -} -mysql_note() { - mysql_log Note "$@" -} -mysql_warn() { - mysql_log Warn "$@" >&2 -} -mysql_error() { - mysql_log ERROR "$@" >&2 - exit 1 -} - -# usage: file_env VAR [DEFAULT] -# ie: file_env 'XYZ_DB_PASSWORD' 'example' -# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of -# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) -file_env() { - local var="$1" - local fileVar="${var}_FILE" - local def="${2:-}" - if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then - mysql_error "Both $var and $fileVar are set (but are exclusive)" - fi - local val="$def" - if [ "${!var:-}" ]; then - val="${!var}" - elif [ "${!fileVar:-}" ]; then - val="$(< "${!fileVar}")" - fi - export "$var"="$val" - unset "$fileVar" -} - -# check to see if this file is being run or sourced from another script -_is_sourced() { - # https://unix.stackexchange.com/a/215279 - [ "${#FUNCNAME[@]}" -ge 2 ] \ - && [ "${FUNCNAME[0]}" = '_is_sourced' ] \ - && [ "${FUNCNAME[1]}" = 'source' ] -} - -# usage: docker_process_init_files [file [file [...]]] -# ie: docker_process_init_files /always-initdb.d/* -# process initializer files, based on file extensions -docker_process_init_files() { - # mysql here for backwards compatibility "${mysql[@]}" - mysql=( docker_process_sql ) - - echo - local f - for f; do - case "$f" in - *.sh) mysql_note "$0: running $f"; . "$f" ;; - *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; - *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; - *) mysql_warn "$0: ignoring $f" ;; - esac - echo - done -} - -mysql_check_config() { - local toRun=( "$@" --verbose --help ) errors - if ! errors="$("${toRun[@]}" 2>&1 >/dev/null)"; then - mysql_error $'mysqld failed while attempting to check config\n\tcommand was: '"${toRun[*]}"$'\n\t'"$errors" - fi -} - -# Fetch value from server config -# We use mysqld --verbose --help instead of my_print_defaults because the -# latter only show values present in config files, and not server defaults -mysql_get_config() { - local conf="$1"; shift - "$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null \ - | awk -v conf="$conf" '$1 == conf && /^[^ \t]/ { sub(/^[^ \t]+[ \t]+/, ""); print; exit }' - # match "datadir /some/path with/spaces in/it here" but not "--xyz=abc\n datadir (xyz)" -} - -# Do a temporary startup of the MySQL server, for init purposes -docker_temp_server_start() { - if [ "${MYSQL_MAJOR}" = '5.6' ] || [ "${MYSQL_MAJOR}" = '5.7' ]; then - "$@" --skip-networking --socket="${SOCKET}" & - mysql_note "Waiting for server startup" - local i - for i in {30..0}; do - # only use the root password if the database has already been initializaed - # so that it won't try to fill in a password file when it hasn't been set yet - extraArgs=() - if [ -z "$DATABASE_ALREADY_EXISTS" ]; then - extraArgs+=( '--dont-use-mysql-root-password' ) - fi - if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then - break - fi - sleep 1 - done - if [ "$i" = 0 ]; then - mysql_error "Unable to start server." - fi - else - # For 5.7+ the server is ready for use as soon as startup command unblocks - if ! "$@" --daemonize --skip-networking --socket="${SOCKET}"; then - mysql_error "Unable to start server." - fi - fi -} - -# Stop the server. When using a local socket file mysqladmin will block until -# the shutdown is complete. -docker_temp_server_stop() { - if ! mysqladmin --defaults-extra-file=<( _mysql_passfile ) shutdown -uroot --socket="${SOCKET}"; then - mysql_error "Unable to shut down server." - fi -} - -# Verify that the minimally required password settings are set for new databases. -docker_verify_minimum_env() { - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - mysql_error $'Database is uninitialized and password option is not specified\n\tYou need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' - fi -} - -# creates folders for the database -# also ensures permission for user mysql of run as root -docker_create_db_directories() { - local user; user="$(id -u)" - - # see https://github.com/docker-library/mysql/issues/562 - mkdir -p "$DATADIR" - - if [ "$user" = "0" ]; then - # this will cause less disk access than `chown -R` - find "$DATADIR" \! -user mysql -exec chown mysql '{}' + - fi -} - -# initializes the database directory -docker_init_database_dir() { - mysql_note "Initializing database files" - if [ "$MYSQL_MAJOR" = '5.6' ]; then - mysql_install_db --datadir="$DATADIR" --rpm --keep-my-cnf "${@:2}" - else - "$@" --initialize-insecure - fi - mysql_note "Database files initialized" - - if command -v mysql_ssl_rsa_setup > /dev/null && [ ! -e "$DATADIR/server-key.pem" ]; then - # https://github.com/mysql/mysql-server/blob/23032807537d8dd8ee4ec1c4d40f0633cd4e12f9/packaging/deb-in/extra/mysql-systemd-start#L81-L84 - mysql_note "Initializing certificates" - mysql_ssl_rsa_setup --datadir="$DATADIR" - mysql_note "Certificates initialized" - fi -} - -# Loads various settings that are used elsewhere in the script -# This should be called after mysql_check_config, but before any other functions -docker_setup_env() { - # Get config - declare -g DATADIR SOCKET - DATADIR="$(mysql_get_config 'datadir' "$@")" - SOCKET="$(mysql_get_config 'socket' "$@")" - - # Initialize values that might be stored in a file - file_env 'MYSQL_ROOT_HOST' '%' - file_env 'MYSQL_DATABASE' - file_env 'MYSQL_USER' - file_env 'MYSQL_PASSWORD' - file_env 'MYSQL_ROOT_PASSWORD' - - declare -g DATABASE_ALREADY_EXISTS - if [ -d "$DATADIR/mysql" ]; then - DATABASE_ALREADY_EXISTS='true' - fi -} - -# Execute sql script, passed via stdin -# usage: docker_process_sql [--dont-use-mysql-root-password] [mysql-cli-args] -# ie: docker_process_sql --database=mydb <<<'INSERT ...' -# ie: docker_process_sql --dont-use-mysql-root-password --database=mydb >/data/postgres-data/pg_hba.conf - -set -e - -psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL - CREATE TABLESPACE klarosspace LOCATION '/data/postgres-data'; - CREATE role $POSTGRES_USER LOGIN PASSWORD '$POSTGRES_PASSWORD'; - CREATE DATABASE $POSTGRES_DB OWNER $POSTGRES_USER TABLESPACE klarosspace; - GRANT ALL PRIVILEGES ON DATABASE $POSTGRES_DB TO $POSTGRES_USER; -\q -EOSQL - -echo "End of Init_Database" diff --git a/PostgreSQL/db/001_print_version.sql b/PostgreSQL/db/001_print_version.sql deleted file mode 100644 index de46afa..0000000 --- a/PostgreSQL/db/001_print_version.sql +++ /dev/null @@ -1 +0,0 @@ -select @@version diff --git a/PostgreSQL/db/002_tune_database.sql b/PostgreSQL/db/002_tune_database.sql deleted file mode 100644 index a990831..0000000 --- a/PostgreSQL/db/002_tune_database.sql +++ /dev/null @@ -1,13 +0,0 @@ -EXEC sys.sp_configure N'show advanced options', N'1' RECONFIGURE WITH OVERRIDE -GO -EXEC sys.sp_configure N'cost threshold for parallelism', N'60' -GO -EXEC sys.sp_configure N'max degree of parallelism', N'3' -GO -EXEC sys.sp_configure N'optimize for ad hoc workloads', N'1' -GO -RECONFIGURE WITH OVERRIDE -GO -EXEC sys.sp_configure N'show advanced options', N'0' RECONFIGURE WITH OVERRIDE -GO - diff --git a/PostgreSQL/db/Dockerfile b/PostgreSQL/db/Dockerfile index b705028..39958a8 100644 --- a/PostgreSQL/db/Dockerfile +++ b/PostgreSQL/db/Dockerfile @@ -1,2 +1,2 @@ -FROM verit/klaros-postgresql_db:4.12.5 +FROM verit/klaros-postgresql_db:4.12.6 LABEL maintainer "BreadSpoon " \ No newline at end of file diff --git a/PostgreSQL/db/docker-entrypoint.sh b/PostgreSQL/db/docker-entrypoint.sh deleted file mode 100644 index 3ef2df5..0000000 --- a/PostgreSQL/db/docker-entrypoint.sh +++ /dev/null @@ -1,176 +0,0 @@ -#!/usr/bin/env bash -set -Eeo pipefail - -# usage: file_env VAR [DEFAULT] -# ie: file_env 'XYZ_DB_PASSWORD' 'example' -# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of -# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) -file_env() { - local var="$1" - local fileVar="${var}_FILE" - local def="${2:-}" - if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then - echo >&2 "error: both $var and $fileVar are set (but are exclusive)" - exit 1 - fi - local val="$def" - if [ "${!var:-}" ]; then - val="${!var}" - elif [ "${!fileVar:-}" ]; then - val="$(< "${!fileVar}")" - fi - export "$var"="$val" - unset "$fileVar" -} - -if [ "${1:0:1}" = '-' ]; then - set -- postgres "$@" -fi - -# allow the container to be started with `--user` -if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then - mkdir -p "$PGDATA" - chown -R postgres "$PGDATA" - chmod 700 "$PGDATA" - - mkdir -p /var/run/postgresql - chown -R postgres /var/run/postgresql - chmod 775 /var/run/postgresql - - # Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user - if [ "$POSTGRES_INITDB_WALDIR" ]; then - mkdir -p "$POSTGRES_INITDB_WALDIR" - chown -R postgres "$POSTGRES_INITDB_WALDIR" - chmod 700 "$POSTGRES_INITDB_WALDIR" - fi - - exec su-exec postgres "$BASH_SOURCE" "$@" -fi - -if [ "$1" = 'postgres' ]; then - mkdir -p "$PGDATA" - chown -R "$(id -u)" "$PGDATA" 2>/dev/null || : - chmod 700 "$PGDATA" 2>/dev/null || : - - # look specifically for PG_VERSION, as it is expected in the DB dir - if [ ! -s "$PGDATA/PG_VERSION" ]; then - # "initdb" is particular about the current user existing in "/etc/passwd", so we use "nss_wrapper" to fake that if necessary - # see https://github.com/docker-library/postgres/pull/253, https://github.com/docker-library/postgres/issues/359, https://cwrap.org/nss_wrapper.html - if ! getent passwd "$(id -u)" &> /dev/null && [ -e /usr/lib/libnss_wrapper.so ]; then - export LD_PRELOAD='/usr/lib/libnss_wrapper.so' - export NSS_WRAPPER_PASSWD="$(mktemp)" - export NSS_WRAPPER_GROUP="$(mktemp)" - echo "postgres:x:$(id -u):$(id -g):PostgreSQL:$PGDATA:/bin/false" > "$NSS_WRAPPER_PASSWD" - echo "postgres:x:$(id -g):" > "$NSS_WRAPPER_GROUP" - fi - - file_env 'POSTGRES_USER' 'postgres' - file_env 'POSTGRES_PASSWORD' - - file_env 'POSTGRES_INITDB_ARGS' - if [ "$POSTGRES_INITDB_WALDIR" ]; then - export POSTGRES_INITDB_ARGS="$POSTGRES_INITDB_ARGS --waldir $POSTGRES_INITDB_WALDIR" - fi - eval 'initdb --username="$POSTGRES_USER" --pwfile=<(echo "$POSTGRES_PASSWORD") '"$POSTGRES_INITDB_ARGS" - - # unset/cleanup "nss_wrapper" bits - if [ "${LD_PRELOAD:-}" = '/usr/lib/libnss_wrapper.so' ]; then - rm -f "$NSS_WRAPPER_PASSWD" "$NSS_WRAPPER_GROUP" - unset LD_PRELOAD NSS_WRAPPER_PASSWD NSS_WRAPPER_GROUP - fi - - # check password first so we can output the warning before postgres - # messes it up - if [ -n "$POSTGRES_PASSWORD" ]; then - authMethod=md5 - - if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then - cat >&2 <<-'EOWARN' - - WARNING: The supplied POSTGRES_PASSWORD is 100+ characters. - - This will not work if used via PGPASSWORD with "psql". - - https://www.postgresql.org/message-id/flat/E1Rqxp2-0004Qt-PL%40wrigleys.postgresql.org (BUG #6412) - https://github.com/docker-library/postgres/issues/507 - - EOWARN - fi - else - # The - option suppresses leading tabs but *not* spaces. :) - cat >&2 <<-'EOWARN' - **************************************************** - WARNING: No password has been set for the database. - This will allow anyone with access to the - Postgres port to access your database. In - Docker's default configuration, this is - effectively any other container on the same - system. - - Use "-e POSTGRES_PASSWORD=password" to set - it in "docker run". - **************************************************** - EOWARN - - authMethod=trust - fi - - { - echo - echo "host all all all $authMethod" - } >> "$PGDATA/pg_hba.conf" - - # internal start of server in order to allow set-up using psql-client - # does not listen on external TCP/IP and waits until start finishes - PGUSER="${PGUSER:-$POSTGRES_USER}" \ - pg_ctl -D "$PGDATA" \ - -o "-c listen_addresses=''" \ - -w start - - file_env 'POSTGRES_DB' "$POSTGRES_USER" - - export PGPASSWORD="${PGPASSWORD:-$POSTGRES_PASSWORD}" - psql=( psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --no-password ) - - if [ "$POSTGRES_DB" != 'postgres' ]; then - "${psql[@]}" --dbname postgres --set db="$POSTGRES_DB" <<-'EOSQL' - CREATE DATABASE :"db" ; - EOSQL - echo - fi - psql+=( --dbname "$POSTGRES_DB" ) - - echo - for f in /docker-entrypoint-initdb.d/*; do - case "$f" in - *.sh) - # https://github.com/docker-library/postgres/issues/450#issuecomment-393167936 - # https://github.com/docker-library/postgres/pull/452 - if [ -x "$f" ]; then - echo "$0: running $f" - "$f" - else - echo "$0: sourcing $f" - . "$f" - fi - ;; - *.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;; - *.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;; - *) echo "$0: ignoring $f" ;; - esac - echo - done - - PGUSER="${PGUSER:-$POSTGRES_USER}" \ - pg_ctl -D "$PGDATA" -m fast -w stop - - unset PGPASSWORD - - echo - echo 'PostgreSQL init process complete; ready for start up.' - echo - fi -fi - -exec "$@" - diff --git a/PostgreSQL/klaros/Dockerfile b/PostgreSQL/klaros/Dockerfile index 96df453..d0a607a 100644 --- a/PostgreSQL/klaros/Dockerfile +++ b/PostgreSQL/klaros/Dockerfile @@ -32,7 +32,7 @@ ENV TOMCAT_SERVER_PORT ${TOMCAT_SERVER_PORT:-18005} ENV TOMCAT_AJP_PORT ${TOMCAT_AJP_PORT:-18009} # Klaros release version, which is used during installation. A list of available releases can be found on the official Klaros Test Management website or on GitHub. -ENV KLAROS_VERSION ${KLAROS_VERSION:-4.12.5} +ENV KLAROS_VERSION ${KLAROS_VERSION:-4.12.6} ENV KLAROS_HOME /data/klaros-home ENV CATALINA_BASE /data/catalina-base diff --git a/README-German.adoc b/README-German.adoc index 6602439..94b3202 100644 --- a/README-German.adoc +++ b/README-German.adoc @@ -12,7 +12,7 @@ endif::[] :sectnums: :toc-title: Inhaltsverzeichnis -image:https://img.shields.io/badge/Version-4.12.5-green.svg[link="https://github.com/klaros-testmanagement/klaros-docker/releases"] +image:https://img.shields.io/badge/Version-4.12.6-green.svg[link="https://github.com/klaros-testmanagement/klaros-docker/releases"] image:https://img.shields.io/badge/License-MIT-green[link="https://github.com/klaros-testmanagement/klaros-docker/blob/master/LICENSE"] image:https://img.shields.io/badge/Community%20Edition-FREE-green[link="https://www.klaros-testmanagement.com/en_US/download"] image:https://img.shields.io/twitter/follow/Klaros_TM?style=social[float="right", link="https://twitter.com/intent/follow?screen_name=Klaros_TM"] diff --git a/README.adoc b/README.adoc index 710b590..5eb8465 100644 --- a/README.adoc +++ b/README.adoc @@ -11,7 +11,7 @@ endif::[] :toc: macro :sectnums: -image:https://img.shields.io/badge/Version-4.12.5-green.svg[link="https://github.com/klaros-testmanagement/klaros-docker/releases"] +image:https://img.shields.io/badge/Version-4.12.6-green.svg[link="https://github.com/klaros-testmanagement/klaros-docker/releases"] image:https://img.shields.io/badge/License-MIT-green[link="https://github.com/klaros-testmanagement/klaros-docker/blob/master/LICENSE"] image:https://img.shields.io/badge/Community%20Edition-FREE-green[link="https://www.klaros-testmanagement.com/en_US/download"] image:https://img.shields.io/twitter/follow/Klaros_TM?style=social[float="right", link="https://twitter.com/intent/follow?screen_name=Klaros_TM"]