4.2.6-debian-10-r12 release

This commit is contained in:
Bitnami Bot
2022-01-11 14:32:53 +00:00
parent 3199812416
commit 738c2c9b4a
9 changed files with 137 additions and 116 deletions

View File

@@ -9,24 +9,17 @@ ENV HOME="/" \
COPY prebuildfs /
# Install required system packages and dependencies
RUN install_packages acl ca-certificates curl gzip ldap-utils libaudit1 libbsd0 libc6 libcap-ng0 libedit2 libffi6 libgcc1 libgmp10 libgnutls30 libhogweed4 libicu63 libidn2-0 libldap-2.4-2 liblzma5 libnettle6 libnss-ldapd libp11-kit0 libpam-ldapd libpam0g libsasl2-2 libssl1.1 libstdc++6 libtasn1-6 libtinfo6 libunistring2 libuuid1 libxml2 libxslt1.1 nslcd procps tar zlib1g
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "postgresql-client" "10.19.0-0" --checksum f32958c288efd50fb29133d614ce19dc46ff40add10fc82254b29c8a46df324c
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "wait-for-port" "1.0.1-1" --checksum 28dc75dff64df07e67b711d20859c24ebc996db0eaac06138553341d0f769299
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "postgresql-client" "10.19.0-1" --checksum 53e64e567d4563efaea05f4e9e9eead3a3fbec1213a05528a5eeec2d2f8e8a43
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "wait-for-port" "1.0.1-5" --checksum 1e34030c18f0ec2467fa5f1b1fbad24add217f671c3a61628f7b8671391f9676
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "pgpool" "4.2.6-0" --checksum e22cd041f9a0ec1009fdafec3fbabeea47db2f87597df4de29bf8b0ebb2d763d
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "gosu" "1.14.0-0" --checksum 3e6fc37ca073b10a73a804d39c2f0c028947a1a596382a4f8ebe43dfbaa3a25e
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "gosu" "1.14.0-1" --checksum 16f1a317859b06ae82e816b30f98f28b4707d18fe6cc3881bff535192a7715dc
RUN chmod g+rwX /opt/bitnami
COPY rootfs /
RUN /opt/bitnami/scripts/pgpool/postunpack.sh
ENV BITNAMI_APP_NAME="pgpool" \
BITNAMI_IMAGE_VERSION="4.2.6-debian-10-r11" \
PATH="/opt/bitnami/postgresql/bin:/opt/bitnami/common/bin:/opt/bitnami/pgpool/bin:$PATH" \
POSTGRESQL_CLIENT_CREATE_DATABASE_NAME="" \
POSTGRESQL_CLIENT_CREATE_DATABASE_PASSWORD="" \
POSTGRESQL_CLIENT_CREATE_DATABASE_USERNAME="" \
POSTGRESQL_HOST="postgresql" \
POSTGRESQL_PORT_NUMBER="5432" \
POSTGRESQL_ROOT_PASSWORD="" \
POSTGRESQL_ROOT_USER="postgres"
BITNAMI_IMAGE_VERSION="4.2.6-debian-10-r12" \
PATH="/opt/bitnami/postgresql/bin:/opt/bitnami/common/bin:/opt/bitnami/pgpool/bin:$PATH"
EXPOSE 5432

View File

@@ -14,7 +14,7 @@ services:
- POSTGRESQL_NUM_SYNCHRONOUS_REPLICAS=1
- REPMGR_PASSWORD=repmgrpassword
- REPMGR_PRIMARY_HOST=pg-0
- REPMGR_PARTNER_NODES=pg-0,pg-1
- REPMGR_PARTNER_NODES=pg-1,pg-0
- REPMGR_NODE_NAME=pg-0
- REPMGR_NODE_NETWORK_NAME=pg-0
pg-1:

View File

@@ -1,10 +1,10 @@
{
"gosu": {
"arch": "amd64",
"digest": "3e6fc37ca073b10a73a804d39c2f0c028947a1a596382a4f8ebe43dfbaa3a25e",
"digest": "16f1a317859b06ae82e816b30f98f28b4707d18fe6cc3881bff535192a7715dc",
"distro": "debian-10",
"type": "NAMI",
"version": "1.14.0-0"
"version": "1.14.0-1"
},
"pgpool": {
"arch": "amd64",
@@ -15,16 +15,16 @@
},
"postgresql-client": {
"arch": "amd64",
"digest": "f32958c288efd50fb29133d614ce19dc46ff40add10fc82254b29c8a46df324c",
"digest": "53e64e567d4563efaea05f4e9e9eead3a3fbec1213a05528a5eeec2d2f8e8a43",
"distro": "debian-10",
"type": "NAMI",
"version": "10.19.0-0"
"version": "10.19.0-1"
},
"wait-for-port": {
"arch": "amd64",
"digest": "28dc75dff64df07e67b711d20859c24ebc996db0eaac06138553341d0f769299",
"digest": "1e34030c18f0ec2467fa5f1b1fbad24add217f671c3a61628f7b8671391f9676",
"distro": "debian-10",
"type": "NAMI",
"version": "1.0.1-1"
"version": "1.0.1-5"
}
}

View File

@@ -26,7 +26,7 @@ component_unpack() {
local base_name="${name}-${version}-${OS_NAME}-${OS_ARCH}-${OS_FLAVOUR}"
local package_sha256=""
local directory="/opt/bitnami"
# Validate arguments
shift 2
while [ "$#" -gt 0 ]; do
@@ -54,11 +54,11 @@ component_unpack() {
rm "${CACHE_ROOT}/${base_name}.tar.gz.sha256"
fi
else
curl --remote-name --silent "${DOWNLOAD_URL}/${base_name}.tar.gz"
curl --remote-name --silent --show-error --fail "${DOWNLOAD_URL}/${base_name}.tar.gz"
fi
if [ -n "$package_sha256" ]; then
echo "Verifying package integrity"
echo "$package_sha256 ${base_name}.tar.gz" | sha256sum --check -
echo "$package_sha256 ${base_name}.tar.gz" | sha256sum --check - || exit "$?"
fi
tar --directory "${directory}" --extract --gunzip --file "${base_name}.tar.gz" --no-same-owner --strip-components=2 "${base_name}/files/"
rm "${base_name}.tar.gz"

View File

@@ -20,8 +20,13 @@
owned_by() {
local path="${1:?path is missing}"
local owner="${2:?owner is missing}"
local group="${3:-}"
chown "$owner":"$owner" "$path"
if [[ -n $group ]]; then
chown "$owner":"$group" "$path"
else
chown "$owner":"$owner" "$path"
fi
}
########################
@@ -34,11 +39,12 @@ owned_by() {
#########################
ensure_dir_exists() {
local dir="${1:?directory is missing}"
local owner="${2:-}"
local owner_user="${2:-}"
local owner_group="${3:-}"
mkdir -p "${dir}"
if [[ -n $owner ]]; then
owned_by "$dir" "$owner"
if [[ -n $owner_user ]]; then
owned_by "$dir" "$owner_user" "$owner_group"
fi
}

View File

@@ -7,6 +7,7 @@
# Load Generic Libraries
. /opt/bitnami/scripts/liblog.sh
. /opt/bitnami/scripts/libfs.sh
. /opt/bitnami/scripts/libvalidations.sh
# Functions
@@ -53,17 +54,17 @@ ensure_group_exists() {
shift 1
while [ "$#" -gt 0 ]; do
case "$1" in
-i|--gid)
shift
gid="${1:?missing gid}"
;;
-s|--system)
is_system_user=true
;;
*)
echo "Invalid command line flag $1" >&2
return 1
;;
-i | --gid)
shift
gid="${1:?missing gid}"
;;
-s | --system)
is_system_user=true
;;
*)
echo "Invalid command line flag $1" >&2
return 1
;;
esac
shift
done
@@ -71,7 +72,7 @@ ensure_group_exists() {
if ! group_exists "$group"; then
local -a args=("$group")
if [[ -n "$gid" ]]; then
if group_exists "$gid" ; then
if group_exists "$gid"; then
error "The GID $gid is already in use." >&2
return 1
fi
@@ -107,29 +108,29 @@ ensure_user_exists() {
shift 1
while [ "$#" -gt 0 ]; do
case "$1" in
-i|--uid)
shift
uid="${1:?missing uid}"
;;
-g|--group)
shift
group="${1:?missing group}"
;;
-a|--append-groups)
shift
append_groups="${1:?missing append_groups}"
;;
-h|--home)
shift
home="${1:?missing home directory}"
;;
-s|--system)
is_system_user=true
;;
*)
echo "Invalid command line flag $1" >&2
return 1
;;
-i | --uid)
shift
uid="${1:?missing uid}"
;;
-g | --group)
shift
group="${1:?missing group}"
;;
-a | --append-groups)
shift
append_groups="${1:?missing append_groups}"
;;
-h | --home)
shift
home="${1:?missing home directory}"
;;
-s | --system)
is_system_user=true
;;
*)
echo "Invalid command line flag $1" >&2
return 1
;;
esac
shift
done
@@ -137,7 +138,7 @@ ensure_user_exists() {
if ! user_exists "$user"; then
local -a user_args=("-N" "$user")
if [[ -n "$uid" ]]; then
if user_exists "$uid" ; then
if user_exists "$uid"; then
error "The UID $uid is already in use."
return 1
fi
@@ -157,7 +158,7 @@ ensure_user_exists() {
if [[ -n "$append_groups" ]]; then
local -a groups
read -ra groups <<< "$(tr ',;' ' ' <<< "$append_groups")"
read -ra groups <<<"$(tr ',;' ' ' <<<"$append_groups")"
for group in "${groups[@]}"; do
ensure_group_exists "$group"
usermod -aG "$group" "$user" >/dev/null 2>&1
@@ -210,21 +211,22 @@ get_os_metadata() {
)
}
case "$flag_name" in
--id)
get_os_release_metadata ID
;;
--version)
get_os_release_metadata VERSION_ID
;;
--branch)
get_os_release_metadata VERSION_ID | sed 's/\..*//'
;;
--codename)
get_os_release_metadata VERSION_CODENAME
;;
*)
error "Unknown flag ${flag_name}"
return 1
--id)
get_os_release_metadata ID
;;
--version)
get_os_release_metadata VERSION_ID
;;
--branch)
get_os_release_metadata VERSION_ID | sed 's/\..*//'
;;
--codename)
get_os_release_metadata VERSION_CODENAME
;;
*)
error "Unknown flag ${flag_name}"
return 1
;;
esac
}
@@ -255,14 +257,14 @@ get_machine_size() {
# Validate arguments
while [[ "$#" -gt 0 ]]; do
case "$1" in
--memory)
shift
memory="${1:?missing memory}"
;;
*)
echo "Invalid command line flag $1" >&2
return 1
;;
--memory)
shift
memory="${1:?missing memory}"
;;
*)
echo "Invalid command line flag $1" >&2
return 1
;;
esac
shift
done
@@ -314,7 +316,7 @@ convert_to_mb() {
size="${BASH_REMATCH[1]}"
unit="${BASH_REMATCH[2]}"
if [[ "$unit" = "g" || "$unit" = "G" ]]; then
amount="$((size * 1024))"
amount="$((size * 1024))"
else
amount="$size"
fi
@@ -322,7 +324,6 @@ convert_to_mb() {
echo "$amount"
}
#########################
# Redirects output to /dev/null if debug mode is disabled
# Globals:
@@ -333,7 +334,7 @@ convert_to_mb() {
# None
#########################
debug_execute() {
if ${BITNAMI_DEBUG:-false}; then
if is_boolean_yes "${BITNAMI_DEBUG:-false}"; then
"$@"
else
"$@" >/dev/null 2>&1
@@ -355,8 +356,8 @@ retry_while() {
local sleep_time="${3:-5}"
local return_value=1
read -r -a command <<< "$cmd"
for ((i = 1 ; i <= retries ; i+=1 )); do
read -r -a command <<<"$cmd"
for ((i = 1; i <= retries; i += 1)); do
"${command[@]}" && return_value=0 && break
sleep "$sleep_time"
done
@@ -383,35 +384,36 @@ generate_random_string() {
# Validate arguments
while [[ "$#" -gt 0 ]]; do
case "$1" in
-t|--type)
shift
type="$1"
;;
-c|--count)
shift
count="$1"
;;
*)
echo "Invalid command line flag $1" >&2
return 1
;;
-t | --type)
shift
type="$1"
;;
-c | --count)
shift
count="$1"
;;
*)
echo "Invalid command line flag $1" >&2
return 1
;;
esac
shift
done
# Validate type
case "$type" in
ascii)
filter="[:print:]"
;;
alphanumeric)
filter="a-zA-Z0-9"
;;
numeric)
filter="0-9"
;;
*)
ascii)
filter="[:print:]"
;;
alphanumeric)
filter="a-zA-Z0-9"
;;
numeric)
filter="0-9"
;;
*)
echo "Invalid type ${type}" >&2
return 1
;;
esac
# Obtain count + 10 lines from /dev/urandom to ensure that the resulting string has the expected size
# Note there is a very small chance of strings starting with EOL character
@@ -446,3 +448,19 @@ generate_sha_hash() {
echo -n "$str" | "sha${algorithm}sum" | awk '{print $1}'
}
########################
# Converts a string to its hexadecimal representation
# Arguments:
# $1 - string
# Returns:
# hexadecimal representation of the string
#########################
convert_to_hex() {
local -r str=${1:?missing input string}
local -i iterator
local char
for ((iterator = 0; iterator < ${#str}; iterator++)); do
char=${str:iterator:1}
printf '%x' "'${char}"
done
}

View File

@@ -177,6 +177,8 @@ web_server_reload() {
# --document-root - Path to document root directory
# Apache-specific flags:
# --apache-additional-configuration - Additional vhost configuration (no default)
# --apache-additional-http-configuration - Additional HTTP vhost configuration (no default)
# --apache-additional-https-configuration - Additional HTTPS vhost configuration (no default)
# --apache-before-vhost-configuration - Configuration to add before the <VirtualHost> directive (no default)
# --apache-allow-override - Whether to allow .htaccess files (only allowed when --move-htaccess is set to 'no' and type is not defined)
# --apache-extra-directory-configuration - Extra configuration for the document root directory
@@ -224,6 +226,8 @@ ensure_web_server_app_configuration_exists() {
# Specific Apache flags
--apache-additional-configuration \
| --apache-additional-http-configuration \
| --apache-additional-https-configuration \
| --apache-before-vhost-configuration \
| --apache-allow-override \
| --apache-extra-directory-configuration \