diff --git a/docker/pg-public-beta/Dockerfile b/docker/pg-public-beta/Dockerfile index 6e46ca9..625b01c 100644 --- a/docker/pg-public-beta/Dockerfile +++ b/docker/pg-public-beta/Dockerfile @@ -33,6 +33,7 @@ RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setop python3-pip \ python3-psycopg2 \ git \ + clang \ patchutils \ binutils \ make \ diff --git a/docker/postgres-gis/Dockerfile b/docker/postgres-gis/Dockerfile index 433f085..de08080 100644 --- a/docker/postgres-gis/Dockerfile +++ b/docker/postgres-gis/Dockerfile @@ -43,6 +43,7 @@ RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setop make \ cmake \ gcc \ + clang \ pam-devel \ wget \ mlocate \ @@ -62,14 +63,6 @@ RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setop # install etcdctl RUN curl -L https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-${ARCH}.tar.gz | tar xz -C /bin --strip=1 --wildcards --no-anchored --no-same-owner etcdctl etcd; -# Install Patroni -RUN pip3 install 'PyYAML<6.0' setuptools pystache loader dumb-init kazoo meld3 boto -#swiftclient -RUN ${PACKAGER} -y install python3-etcd python3-consul \ - python3-gevent python3-greenlet python3-cachetools \ - python3-rsa python3-pyasn1-modules python3-cffi \ - && ${PACKAGER} -y clean all; - ENV PATHBACKUP = $PATH RUN wget https://smarden.org/runit/runit-2.1.2.tar.gz -P /package/ diff --git a/docker/postgres/Dockerfile b/docker/postgres/Dockerfile index 1ce5e9f..b1837c0 100644 --- a/docker/postgres/Dockerfile +++ b/docker/postgres/Dockerfile @@ -42,6 +42,7 @@ RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setop make \ cmake \ gcc \ + clang \ pam-devel \ wget \ mlocate \ diff --git a/launcher/pgbouncer/launch.sh b/launcher/pgbouncer/launch.sh index 135cdff..52375d2 100755 --- a/launcher/pgbouncer/launch.sh +++ b/launcher/pgbouncer/launch.sh @@ -13,17 +13,19 @@ if [ "$PGUSER" = "postgres" ]; then echo "You need to fix this as soon as possible." fi +mkdir -p /tmp/pgbouncer/certs + if [ -z "${CONNECTION_POOLER_CLIENT_TLS_CRT}" ]; then openssl req -nodes -new -x509 -subj /CN=spilo.dummy.org \ - -keyout /etc/pgbouncer/certs/pgbouncer.key \ - -out /etc/pgbouncer/certs/pgbouncer.crt + -keyout /tmp/pgbouncer/certs/pgbouncer.key \ + -out /tmp/pgbouncer/certs/pgbouncer.crt # -keyout /etc/ssl/certs/pgbouncer.key \ # -out /etc/ssl/certs/pgbouncer.crt else - ln -s ${CONNECTION_POOLER_CLIENT_TLS_CRT} /etc/pgbouncer/certs/pgbouncer.crt - ln -s ${CONNECTION_POOLER_CLIENT_TLS_KEY} /etc/pgbouncer/certs/pgbouncer.key + ln -s ${CONNECTION_POOLER_CLIENT_TLS_CRT} /tmp/pgbouncer/certs/pgbouncer.crt + ln -s ${CONNECTION_POOLER_CLIENT_TLS_KEY} /tmp/pgbouncer/certs/pgbouncer.key if [ ! -z "${CONNECTION_POOLER_CLIENT_CA_FILE}" ]; then - ln -s ${CONNECTION_POOLER_CLIENT_CA_FILE} /etc/pgbouncer/certs/ca.crt + ln -s ${CONNECTION_POOLER_CLIENT_CA_FILE} /tmp/pgbouncer/certs/ca.crt fi # ln -s ${CONNECTION_POOLER_CLIENT_TLS_CRT} /etc/ssl/certs/pgbouncer.crt # ln -s ${CONNECTION_POOLER_CLIENT_TLS_KEY} /etc/ssl/certs/pgbouncer.key @@ -35,9 +37,9 @@ fi if [ "$ADDITIONAL_PGBOUNCER_CONFIG" ]; then bouncerConfigPath="$ADDITIONAL_PGBOUNCER_CONFIG" else - envsubst < /etc/pgbouncer/pgbouncer.ini.tmpl > /etc/pgbouncer/pgbouncer.ini - envsubst < /etc/pgbouncer/auth_file.txt.tmpl > /etc/pgbouncer/auth_file.txt - bouncerConfigPath="/etc/pgbouncer/pgbouncer.ini" + envsubst < /etc/pgbouncer/pgbouncer.ini.tmpl > /tmp/pgbouncer/pgbouncer.ini + envsubst < /etc/pgbouncer/auth_file.txt.tmpl > /tmp/pgbouncer/auth_file.txt + bouncerConfigPath="/tmp/pgbouncer/pgbouncer.ini" fi ./bin/pgbouncer $bouncerConfigPath diff --git a/scripts/pgbouncer/pgbouncer.ini.tmpl b/scripts/pgbouncer/pgbouncer.ini.tmpl index e8c1e2a..c2678c5 100644 --- a/scripts/pgbouncer/pgbouncer.ini.tmpl +++ b/scripts/pgbouncer/pgbouncer.ini.tmpl @@ -9,7 +9,7 @@ pool_mode = $CONNECTION_POOLER_MODE listen_port = $CONNECTION_POOLER_PORT listen_addr = * auth_type = scram-sha-256 -auth_file = /etc/pgbouncer/auth_file.txt +auth_file = /tmp/pgbouncer/auth_file.txt auth_dbname = postgres admin_users = $PGUSER auth_query = SELECT * FROM $PGSCHEMA.user_lookup($1) @@ -17,11 +17,11 @@ logfile = /dev/stdout pidfile = /tmp/pgbouncer.pid server_tls_sslmode = require -server_tls_ca_file = /etc/pgbouncer/certs/pgbouncer.crt +server_tls_ca_file = /tmp/pgbouncer/certs/pgbouncer.crt server_tls_protocols = secure client_tls_sslmode = require -client_tls_key_file = /etc/pgbouncer/certs/pgbouncer.key -client_tls_cert_file = /etc/pgbouncer/certs/pgbouncer.crt +client_tls_key_file = /tmp/pgbouncer/certs/pgbouncer.key +client_tls_cert_file = /tmp/pgbouncer/certs/pgbouncer.crt log_connections = 0 log_disconnections = 0 diff --git a/scripts/postgres/move_wal_dir.sh b/scripts/postgres/move_wal_dir.sh new file mode 100644 index 0000000..adb9b8e --- /dev/null +++ b/scripts/postgres/move_wal_dir.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +stopPostgreSQL(pgData){ + +} + +startPostgreSQL(pgData){ + +} + +moveWalDir(){ + local oldPath=$1 + local newPath=$2 + local pgData=$3 + + # check if folder already exist + if [[ -d "$newPath" ]]; then + # Check if folder is empty + if [[ ! -z "$(ls -A "$newPath")" ]]; then + output_error "The defined new directory is not empty" + exit 1 + else + + fi +} + +source "/scripts/postgres/shell_lib.sh" +output_info "The defined new directory is not empty" + + +if [[ -z "$WALDIR" && -z "$OLD_WALDIR" ]]; then + echo "Umgebungsvariable $env_name ist nicht gesetzt." + else + echo "Umgebungsvariable $env_name ist gesetzt auf: $env_value" + fi \ No newline at end of file