From 5047c567a34faff5a1c7a76fcd3d44732ea23b2a Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Fri, 24 Jan 2020 01:47:06 +0000 Subject: [PATCH] 3.3.0-debian-10-r0 release --- bitnami/phpbb/3/debian-10/Dockerfile | 52 +++++ bitnami/phpbb/3/debian-10/docker-compose.yml | 30 +++ .../prebuildfs/build/bitnami-user.sh | 6 + .../prebuildfs/build/install-gosu.sh | 10 + .../prebuildfs/build/install-nami.sh | 7 + .../prebuildfs/build/install-tini.sh | 17 ++ .../prebuildfs/opt/bitnami/base/functions | 121 ++++++++++ .../prebuildfs/opt/bitnami/base/helpers | 40 ++++ .../debian-10/prebuildfs/usr/sbin/bitnami-pkg | 211 ++++++++++++++++++ .../phpbb/3/debian-10/rootfs/apache-init.sh | 27 +++ .../3/debian-10/rootfs/app-entrypoint.sh | 15 ++ .../debian-10/rootfs/mysql-client-inputs.json | 11 + .../phpbb/3/debian-10/rootfs/phpbb-init.sh | 31 +++ .../3/debian-10/rootfs/phpbb-inputs.json | 19 ++ bitnami/phpbb/3/debian-10/rootfs/post-init.sh | 46 ++++ bitnami/phpbb/README.md | 2 +- 16 files changed, 644 insertions(+), 1 deletion(-) create mode 100644 bitnami/phpbb/3/debian-10/Dockerfile create mode 100644 bitnami/phpbb/3/debian-10/docker-compose.yml create mode 100755 bitnami/phpbb/3/debian-10/prebuildfs/build/bitnami-user.sh create mode 100755 bitnami/phpbb/3/debian-10/prebuildfs/build/install-gosu.sh create mode 100755 bitnami/phpbb/3/debian-10/prebuildfs/build/install-nami.sh create mode 100755 bitnami/phpbb/3/debian-10/prebuildfs/build/install-tini.sh create mode 100644 bitnami/phpbb/3/debian-10/prebuildfs/opt/bitnami/base/functions create mode 100644 bitnami/phpbb/3/debian-10/prebuildfs/opt/bitnami/base/helpers create mode 100755 bitnami/phpbb/3/debian-10/prebuildfs/usr/sbin/bitnami-pkg create mode 100644 bitnami/phpbb/3/debian-10/rootfs/apache-init.sh create mode 100755 bitnami/phpbb/3/debian-10/rootfs/app-entrypoint.sh create mode 100644 bitnami/phpbb/3/debian-10/rootfs/mysql-client-inputs.json create mode 100644 bitnami/phpbb/3/debian-10/rootfs/phpbb-init.sh create mode 100644 bitnami/phpbb/3/debian-10/rootfs/phpbb-inputs.json create mode 100644 bitnami/phpbb/3/debian-10/rootfs/post-init.sh diff --git a/bitnami/phpbb/3/debian-10/Dockerfile b/bitnami/phpbb/3/debian-10/Dockerfile new file mode 100644 index 000000000000..fa0de299a079 --- /dev/null +++ b/bitnami/phpbb/3/debian-10/Dockerfile @@ -0,0 +1,52 @@ +FROM bitnami/minideb:buster +LABEL maintainer "Bitnami " + +ENV PATH="/opt/bitnami/apache/bin:/opt/bitnami/php/bin:/opt/bitnami/php/sbin:/opt/bitnami/mysql/bin:/opt/bitnami/nami/bin:$PATH" + +COPY prebuildfs / +# Install required system packages and dependencies +RUN install_packages ca-certificates curl dirmngr gnupg libbz2-1.0 libc6 libcom-err2 libcurl4 libexpat1 libffi6 libfreetype6 libgcc1 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libgssapi-krb5-2 libhogweed4 libicu63 libidn2-0 libjpeg62-turbo libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 liblzma5 libmemcached11 libmemcachedutil2 libncurses6 libnettle6 libnghttp2-14 libp11-kit0 libpcre3 libpng16-16 libpq5 libpsl5 libreadline7 librtmp1 libsasl2-2 libsqlite3-0 libssh2-1 libssl1.1 libstdc++6 libsybdb5 libtasn1-6 libtidy5deb1 libtinfo6 libunistring2 libxml2 libxslt1.1 procps sudo unzip zlib1g +RUN /build/bitnami-user.sh && \ + /build/install-nami.sh +RUN bitnami-pkg unpack apache-2.4.41-0 --checksum 0364e80e08a89fda2d2d302609f813d5d497b6cb6bcf6643d2770b825abbc0fb +RUN bitnami-pkg unpack php-7.2.26-0 --checksum 41557e836a7c0cb30d793f8a3ac658b46e5eb470b5b528c00e3ca9d5fee427c1 +RUN bitnami-pkg unpack mysql-client-10.3.21-0 --checksum 0c9df289473b7db87f6c0c076d9bdedcf48795b90c6e7588090b6dbb91538514 +RUN bitnami-pkg install libphp-7.2.26-0 --checksum 1e5bf6dbd3bc6e875c998b6efc84eb2cd582aa8a6146e2d6e020d485abd471ed +RUN bitnami-pkg unpack phpbb-3.3.0-0 --checksum f4954a15f0b01613defe21836eb0a8b9bce08868c040817824302745f97e8310 +RUN apt-get update && apt-get upgrade && \ + rm -r /var/lib/apt/lists /var/cache/apt/archives +RUN /build/install-gosu.sh +RUN /build/install-tini.sh + +COPY rootfs / +ENV ALLOW_EMPTY_PASSWORD="no" \ + BITNAMI_APP_NAME="phpbb" \ + BITNAMI_IMAGE_VERSION="3.3.0-debian-10-r0" \ + MARIADB_HOST="mariadb" \ + MARIADB_PORT_NUMBER="3306" \ + MARIADB_ROOT_PASSWORD="" \ + MARIADB_ROOT_USER="root" \ + MYSQL_CLIENT_CREATE_DATABASE_NAME="" \ + MYSQL_CLIENT_CREATE_DATABASE_PASSWORD="" \ + MYSQL_CLIENT_CREATE_DATABASE_PRIVILEGES="ALL" \ + MYSQL_CLIENT_CREATE_DATABASE_USER="" \ + PHPBB_DATABASE_NAME="bitnami_phpbb" \ + PHPBB_DATABASE_PASSWORD="" \ + PHPBB_DATABASE_USER="bn_phpbb" \ + PHPBB_EMAIL="user@example.com" \ + PHPBB_FIRST_NAME="User" \ + PHPBB_FORUM_DESCRIPTION="A little text to describe your forum" \ + PHPBB_FORUM_NAME="My forum" \ + PHPBB_HOST="" \ + PHPBB_LAST_NAME="Name" \ + PHPBB_PASSWORD="bitnami" \ + PHPBB_USERNAME="user" \ + SMTP_HOST="" \ + SMTP_PASSWORD="" \ + SMTP_PORT="" \ + SMTP_USER="" + +EXPOSE 80 443 + +ENTRYPOINT [ "/app-entrypoint.sh" ] +CMD [ "nami", "start", "--foreground", "apache" ] diff --git a/bitnami/phpbb/3/debian-10/docker-compose.yml b/bitnami/phpbb/3/debian-10/docker-compose.yml new file mode 100644 index 000000000000..3f46dfa82d69 --- /dev/null +++ b/bitnami/phpbb/3/debian-10/docker-compose.yml @@ -0,0 +1,30 @@ +version: '2' +services: + mariadb: + image: 'bitnami/mariadb:10.3' + environment: + - ALLOW_EMPTY_PASSWORD=yes + - MARIADB_USER=bn_phpbb + - MARIADB_DATABASE=bitnami_phpbb + volumes: + - 'mariadb_data:/bitnami' + phpbb: + image: 'bitnami/phpbb:3' + environment: + - MARIADB_HOST=mariadb + - MARIADB_PORT_NUMBER=3306 + - PHPBB_DATABASE_USER=bn_phpbb + - PHPBB_DATABASE_NAME=bitnami_phpbb + - ALLOW_EMPTY_PASSWORD=yes + ports: + - '80:80' + - '443:443' + volumes: + - 'phpbb_data:/bitnami' + depends_on: + - mariadb +volumes: + mariadb_data: + driver: local + phpbb_data: + driver: local diff --git a/bitnami/phpbb/3/debian-10/prebuildfs/build/bitnami-user.sh b/bitnami/phpbb/3/debian-10/prebuildfs/build/bitnami-user.sh new file mode 100755 index 000000000000..ab84296bcdfa --- /dev/null +++ b/bitnami/phpbb/3/debian-10/prebuildfs/build/bitnami-user.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +useradd -ms /bin/bash bitnami +mkdir -p /opt/bitnami && chown bitnami:bitnami /opt/bitnami +sed -i -e 's/\s*Defaults\s*secure_path\s*=/# Defaults secure_path=/' /etc/sudoers +echo 'bitnami ALL=NOPASSWD: ALL' >> /etc/sudoers diff --git a/bitnami/phpbb/3/debian-10/prebuildfs/build/install-gosu.sh b/bitnami/phpbb/3/debian-10/prebuildfs/build/install-gosu.sh new file mode 100755 index 000000000000..1756700daa89 --- /dev/null +++ b/bitnami/phpbb/3/debian-10/prebuildfs/build/install-gosu.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +VERSION="1.11" +SHA256="0b843df6d86e270c5b0f5cbd3c326a04e18f4b7f9b8457fa497b0454c4b138d7" + +curl --silent -L "https://github.com/tianon/gosu/releases/download/${VERSION}/gosu-amd64" > "/usr/local/bin/gosu" +echo "$SHA256" "/usr/local/bin/gosu" | sha256sum --check +chmod u+x "/usr/local/bin/gosu" +mkdir -p "/opt/bitnami/licenses" +curl --silent -L "https://raw.githubusercontent.com/tianon/gosu/master/LICENSE" > "/opt/bitnami/licenses/gosu-${VERSION}.txt" diff --git a/bitnami/phpbb/3/debian-10/prebuildfs/build/install-nami.sh b/bitnami/phpbb/3/debian-10/prebuildfs/build/install-nami.sh new file mode 100755 index 000000000000..d8a59c381f6d --- /dev/null +++ b/bitnami/phpbb/3/debian-10/prebuildfs/build/install-nami.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +curl --silent -L https://nami-prod.s3.amazonaws.com/tools/nami/releases/nami-1.0.0-1-linux-x64.tar.gz > /tmp/nami-linux-x64.tar.gz +echo "80488279b056d5e9c183fe34097c5f496715ab16a602afcc9f78d59f15139a16 /tmp/nami-linux-x64.tar.gz" | sha256sum --check +mkdir -p /opt/bitnami/nami /opt/bitnami/licenses +tar xzf /tmp/nami-linux-x64.tar.gz --strip 1 -C /opt/bitnami/nami && rm /tmp/nami-linux-x64.tar.gz +curl --silent -L https://raw.githubusercontent.com/bitnami/nami/master/COPYING > /opt/bitnami/licenses/nami-1.0.0-1.txt diff --git a/bitnami/phpbb/3/debian-10/prebuildfs/build/install-tini.sh b/bitnami/phpbb/3/debian-10/prebuildfs/build/install-tini.sh new file mode 100755 index 000000000000..8376a36aee5f --- /dev/null +++ b/bitnami/phpbb/3/debian-10/prebuildfs/build/install-tini.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +GPG_KEY="595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7" +GPG_KEY_FINGERPRINT="6380 DC42 8747 F6C3 93FE ACA5 9A84 159D 7001 A4E5" +SERVERS=("ha.pool.sks-keyservers.net" "hkp://p80.pool.sks-keyservers.net:80" "keyserver.ubuntu.com" "hkp://keyserver.ubuntu.com:80" "pgp.mit.edu") +VERSION="0.13.2" + +for server in "${SERVERS[@]}"; do + gpg --keyserver "$server" --recv-keys "$GPG_KEY" && break || : +done +gpg --fingerprint "$GPG_KEY" | grep -q "$GPG_KEY_FINGERPRINT" +curl --silent -L "https://github.com/krallin/tini/releases/download/v${VERSION}/tini.asc" > "/tmp/tini.asc" +curl --silent -L "https://github.com/krallin/tini/releases/download/v${VERSION}/tini" > "/usr/local/bin/tini" +gpg --verify "/tmp/tini.asc" "/usr/local/bin/tini" +chmod +x "/usr/local/bin/tini" +mkdir -p "/opt/bitnami/licenses" +curl --silent -L "https://raw.githubusercontent.com/krallin/tini/master/LICENSE" > "/opt/bitnami/licenses/tini-${VERSION}.txt" diff --git a/bitnami/phpbb/3/debian-10/prebuildfs/opt/bitnami/base/functions b/bitnami/phpbb/3/debian-10/prebuildfs/opt/bitnami/base/functions new file mode 100644 index 000000000000..6e9168c5577b --- /dev/null +++ b/bitnami/phpbb/3/debian-10/prebuildfs/opt/bitnami/base/functions @@ -0,0 +1,121 @@ +#!/bin/bash + +[[ ${BASH_DEBUG:-false} = true ]] && set -x + +# Constants +MODULE="$(basename "$0")" +BITNAMI_PREFIX=/opt/bitnami + +# Color Palette +RESET='\033[0m' +BOLD='\033[1m' + +## Foreground +BLACK='\033[38;5;0m' +RED='\033[38;5;1m' +GREEN='\033[38;5;2m' +YELLOW='\033[38;5;3m' +BLUE='\033[38;5;4m' +MAGENTA='\033[38;5;5m' +CYAN='\033[38;5;6m' +WHITE='\033[38;5;7m' + +## Background +ON_BLACK='\033[48;5;0m' +ON_RED='\033[48;5;1m' +ON_GREEN='\033[48;5;2m' +ON_YELLOW='\033[48;5;3m' +ON_BLUE='\033[48;5;4m' +ON_MAGENTA='\033[48;5;5m' +ON_CYAN='\033[48;5;6m' +ON_WHITE='\033[48;5;7m' + +# Functions + +######################## +# Print to STDERR +# Arguments: +# Message to print +# Returns: +# None +######################### +stderr_print() { + printf "%b\\n" "${*}" >&2 +} + +######################## +# Log message +# Arguments: +# Message to log +# Returns: +# None +######################### +log() { + stderr_print "${NAMI_DEBUG:+${CYAN}${MODULE:-} ${MAGENTA}$(date "+%T.%2N ")}${RESET}${*}" +} +######################## +# Log an 'info' message +# Arguments: +# Message to log +# Returns: +# None +######################### +info() { + log "${GREEN}INFO ${RESET} ==> ${*}" +} +######################## +# Log message +# Arguments: +# Message to log +# Returns: +# None +######################### +warn() { + log "${YELLOW}WARN ${RESET} ==> ${*}" +} +######################## +# Log an 'error' message +# Arguments: +# Message to log +# Returns: +# None +######################### +error() { + log "${RED}ERROR${RESET} ==> ${*}" +} +######################## +# Print the welcome page +# Globals: +# DISABLE_WELCOME_MESSAGE +# BITNAMI_APP_NAME +# Arguments: +# None +# Returns: +# None +######################### +print_welcome_page() { + if [[ -z "${DISABLE_WELCOME_MESSAGE:-}" ]]; then + if [[ -n "$BITNAMI_APP_NAME" ]]; then + print_image_welcome_page + fi + fi +} +######################## +# Print the welcome page for a Bitnami Docker image +# Globals: +# BITNAMI_APP_NAME +# Arguments: +# None +# Returns: +# None +######################### +print_image_welcome_page() { + local github_url="https://github.com/bitnami/bitnami-docker-${BITNAMI_APP_NAME}" + + log "" + log "${BOLD}Welcome to the Bitnami ${BITNAMI_APP_NAME} container${RESET}" + log "Subscribe to project updates by watching ${BOLD}${github_url}${RESET}" + log "Submit issues and feature requests at ${BOLD}${github_url}/issues${RESET}" + log "Send us your feedback at ${BOLD}containers@bitnami.com${RESET}" + log "" +} diff --git a/bitnami/phpbb/3/debian-10/prebuildfs/opt/bitnami/base/helpers b/bitnami/phpbb/3/debian-10/prebuildfs/opt/bitnami/base/helpers new file mode 100644 index 000000000000..da35a1975ec6 --- /dev/null +++ b/bitnami/phpbb/3/debian-10/prebuildfs/opt/bitnami/base/helpers @@ -0,0 +1,40 @@ +#!/bin/bash + +. /opt/bitnami/base/functions + +######################## +# Helper function to initialize a single nami module +# Arguments: +# Module to initialize +# Returns: +# None +# Description: +# Initialize an unpacked nami module with the `nami initialize` command. +# Command arguments can be specified as function argumnts after the module name. +# `--log-level trace` flag is added to the command if `NAMI_DEBUG` env variable exists. +# The log level can be overriden using the `NAMI_LOG_LEVEL` env variable. +######################### +nami_initialize_one() { + local module="${1:?module not specified}" + if nami inspect $module | grep -q '"lifecycle": "unpacked"'; then + local inputs= + if [[ -f "/${module}-inputs.json" ]]; then + inputs="--inputs-file=/${module}-inputs.json" + fi + nami ${NAMI_DEBUG:+--log-level ${NAMI_LOG_LEVEL:-trace}} initialize $module $inputs "${@:2}" + fi +} + +######################## +# Helper function to initialize one or more nami modules +# Arguments: +# Module to initialize +# Returns: +# None +######################### +nami_initialize() { + local module="${1:?module not specified}" + for module in "${@}"; do + nami_initialize_one $module + done +} diff --git a/bitnami/phpbb/3/debian-10/prebuildfs/usr/sbin/bitnami-pkg b/bitnami/phpbb/3/debian-10/prebuildfs/usr/sbin/bitnami-pkg new file mode 100755 index 000000000000..3d934df5585a --- /dev/null +++ b/bitnami/phpbb/3/debian-10/prebuildfs/usr/sbin/bitnami-pkg @@ -0,0 +1,211 @@ +#!/bin/bash -e +. /opt/bitnami/base/functions + +print_usage() { + log "Usage: bitnami-pkg - [OPTIONS] -- [ARGS]" + log "" + log "Download and install Bitnami packages" + log "" + log "Commands:" + log " install Download and install a package." + log " unpack Download and unpack a package." + log "" + log "Options:" + log " -b, --bucket Package release bucket (default: stacksmith)." + log " -c, --checksum SHA256 verification checksum." + log " -h, --help Show this help message and exit." + log "" + log "If the package is already available in the /tmp/bitnami/pkg/cache/" + log "directory, the download will be skipped. If there is a corresponding" + log "file of the same name post-fixed with .sha256 in the directory," + log "that sha will be used instead of the --checksum option." + log "" + log "Examples:" + log " - Unpack package" + log " \$ bitnami-pkg unpack nginx-1.9.10-0" + log "" + log " - Verify and Install package" + log " \$ bitnami-pkg install nginx-1.9.10-0 --checksum 15565d06b18c2e3710fc08e579ddb3d0e39aa663264a0f7404f0743cb4cdb58d" + log "" + log " - Install package with arguments" + log " \$ bitnami-pkg install mariadb-10.1.11-0 -- --password bitnami" + log "" + log " - Install package from testing" + log " \$ bitnami-pkg install mariadb-10.1.11-0 --bucket testing" + log "" +} + +identify_distro() { + distro="${IMAGE_OS:-unknown}" + if [ "${distro}" == "unknown" -a -f /etc/os-release ]; then + distro="$(grep "^ID=" /etc/os-release | cut -d'=' -f2 | cut -d'"' -f2)-$(grep "^VERSION_ID=" /etc/os-release | cut -d'=' -f2 | cut -d'"' -f2 | cut -d'.' -f1)" + fi + echo "$distro" +} + +identify_arch() { + local arch=$(uname -m) + + case "${arch}" in + ppc64le) + ;; # no-op + x86_64) + case $(identify_distro) in + debian-*) + arch=amd64 + ;; + ol-*) + arch=x86_64 + ;; + centos-*) + arch=x86_64 + ;; + rhel-*) + arch=x86_64 + ;; + photon-*) + arch=x86_64 + ;; + esac + ;; + *) + arch="unknown" + ;; + esac + echo $arch +} + +# break up command line for easy parsing and check legal options +ARGS=$(getopt -o b:c:h -l "bucket:,checksum:,help" -n "bitnami-pkg" -- "$@") +if [ $? -ne 0 ]; +then + exit 1 +fi + +eval set -- "$ARGS"; +while true; do + case "$1" in + -b|--bucket) + shift + if [ -n "$1" ]; then + RELEASE_BUCKET=$1 + shift + fi + ;; + -c|--checksum) + shift + if [ -n "$1" ]; then + PACKAGE_SHA256=$1 + shift + fi + ;; + -h|--help) + print_usage + exit 0 + ;; + --) + shift + break + ;; + esac +done + +# weed out unrecognized commands +case "$1" in + install|unpack) ;; + *) + error "Unrecognized command: $1" + print_usage + exit 1 + ;; +esac + +# install/unpack command need to be supplied a package name +if [ $# -lt 2 ]; then + print_usage + exit 1 +fi + +INSTALL_ROOT=/tmp/bitnami/pkg/install +CACHE_ROOT=/tmp/bitnami/pkg/cache + +PACKAGE="$2-linux-$(identify_arch)-$(identify_distro)" +PACKAGE_ARGS=${@:3} +PACKAGE_NAME=$(echo $PACKAGE | sed 's/-[0-9].*//') +RELEASE_BUCKET=${RELEASE_BUCKET:-stacksmith} + +mkdir -p $INSTALL_ROOT +cd $INSTALL_ROOT + +info "Downloading $PACKAGE package" +if [ -f $CACHE_ROOT/$PACKAGE.tar.gz ]; then + info "$CACHE_ROOT/$PACKAGE.tar.gz already exists, skipping download." + cp $CACHE_ROOT/$PACKAGE.tar.gz . + if [ -f $CACHE_ROOT/$PACKAGE.tar.gz.sha256 ]; then + info "Using the local sha256 from $CACHE_ROOT/$PACKAGE.tar.gz.sha256" + PACKAGE_SHA256=$(cat $CACHE_ROOT/$PACKAGE.tar.gz.sha256) + fi +else + # display cURL progress bar when a tty is attached + if tty -s; then + CURL_ARGS="-#" + else + CURL_ARGS="-sS" + fi + if ! curl $CURL_ARGS -LOf "https://downloads.bitnami.com/files/$RELEASE_BUCKET/$PACKAGE.tar.gz"; then + warn "Package name '$PACKAGE' does not exist, will try '${PACKAGE%-$(identify_distro)}'..." + if curl $CURL_ARGS -LOf "https://downloads.bitnami.com/files/$RELEASE_BUCKET/${PACKAGE%-$(identify_distro)}.tar.gz"; then + PACKAGE="${PACKAGE%-$(identify_distro)}" + else + error "Could not find the requested package..." + exit 1 + fi + fi +fi + +if ! tar tzf $PACKAGE.tar.gz >/dev/null 2>&1; then + error "Invalid or corrupt '$PACKAGE' package." + exit 1 +fi + +if [ "$PACKAGE_SHA256" ]; then + info "Verifying package integrity" + echo "$PACKAGE_SHA256 $PACKAGE.tar.gz" | sha256sum -c - +fi + +# If the tarball has too many files, it can trigger a bug +# in overlayfs when using tar. Install bsdtar in the container image +# to workaround it. As the overhead is too big (~40 MB), it is not added by +# default. Source: https://github.com/coreos/bugs/issues/1095 +if which bsdtar > /dev/null; then + bsdtar -xf $PACKAGE.tar.gz +else + tar xzf $PACKAGE.tar.gz +fi + +case "$1" in + install) info "Installing $PACKAGE" ;; + unpack) info "Unpacking $PACKAGE" ;; +esac +nami $1 $PACKAGE $PACKAGE_ARGS + +rm -rf $INSTALL_ROOT + +if [ "$BITNAMI_PKG_EXTRA_DIRS" ]; then + info "Creating extra directories" + for i in ${BITNAMI_PKG_EXTRA_DIRS}; do + mkdir -p $i + done +fi + +if [ "$BITNAMI_PKG_CHMOD" ]; then + DIRS="/.nami /bitnami $BITNAMI_PKG_EXTRA_DIRS" + if ! [[ $PACKAGE_NAME =~ .*-client ]]; then + mkdir -p /bitnami/$PACKAGE_NAME + fi + # We need to be in $HOME in order to nami inspect works + cd $HOME + DIRS+=" $(nami inspect $PACKAGE_NAME | grep -e 'installdir' | cut -f4 -d\")" + info "Fixing permissions: chmod $BITNAMI_PKG_CHMOD $DIRS" + chmod $BITNAMI_PKG_CHMOD $DIRS +fi diff --git a/bitnami/phpbb/3/debian-10/rootfs/apache-init.sh b/bitnami/phpbb/3/debian-10/rootfs/apache-init.sh new file mode 100644 index 000000000000..940efb6d8576 --- /dev/null +++ b/bitnami/phpbb/3/debian-10/rootfs/apache-init.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Check whether Apache ports must be configured +if [[ -n "${APACHE_HTTP_PORT_NUMBER:-}" ]]; then + export APACHE_SET_HTTP_PORT="yes" +fi +if [[ -n "${APACHE_HTTPS_PORT_NUMBER:-}" ]]; then + export APACHE_SET_HTTPS_PORT="yes" +fi + +# Copy vhosts file +if [[ "$(ls -A /vhosts 2>/dev/null)" ]]; then + info "Found vhost definitions in /vhosts. Copying them to /opt/bitnami/apache/conf/vhosts" + cp -r /vhosts/* /opt/bitnami/apache/conf/vhosts +fi + +# Mount certificate files +if [[ -d "/opt/bitnami/apache/certs" ]]; then + warn "The directory '/opt/bitnami/apache/certs' was externally mounted. This is a legacy configuration and will be deprecated soon. Please mount certificate files at '/opt/bitnami/apache/conf/bitnami/certs' instead. Find an example at: https://github.com/bitnami/bitnami-docker-apache#using-custom-ssl-certificates" + warn "Restoring certificates at '/opt/bitnami/apache/certs' to '/opt/bitnami/apache/conf/bitnami/certs'..." + rm -rf /opt/bitnami/apache/conf/bitnami/certs + ln -sf /opt/bitnami/apache/certs /opt/bitnami/apache/conf/bitnami/certs +elif [ "$(ls -A /certs 2>/dev/null)" ]; then + info "Mounting certificates files from /certs..." + rm -rf /opt/bitnami/apache/conf/bitnami/certs + ln -sf /certs /opt/bitnami/apache/conf/bitnami/certs +fi diff --git a/bitnami/phpbb/3/debian-10/rootfs/app-entrypoint.sh b/bitnami/phpbb/3/debian-10/rootfs/app-entrypoint.sh new file mode 100755 index 000000000000..81d0b4c1a994 --- /dev/null +++ b/bitnami/phpbb/3/debian-10/rootfs/app-entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/bash -e + +. /opt/bitnami/base/functions +. /opt/bitnami/base/helpers + +print_welcome_page + +if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "/init.sh" ]]; then + . /phpbb-init.sh + nami_initialize apache php mysql-client phpbb + info "Starting phpbb... " + . /post-init.sh +fi + +exec tini -- "$@" diff --git a/bitnami/phpbb/3/debian-10/rootfs/mysql-client-inputs.json b/bitnami/phpbb/3/debian-10/rootfs/mysql-client-inputs.json new file mode 100644 index 000000000000..6a20ec0837a0 --- /dev/null +++ b/bitnami/phpbb/3/debian-10/rootfs/mysql-client-inputs.json @@ -0,0 +1,11 @@ +{ + "allowEmptyPassword": "{{$global.env.ALLOW_EMPTY_PASSWORD}}", + "createDatabaseName": "{{$global.env.MYSQL_CLIENT_CREATE_DATABASE_NAME}}", + "createDatabasePassword": "{{$global.env.MYSQL_CLIENT_CREATE_DATABASE_PASSWORD}}", + "createDatabasePrivileges": "{{$global.env.MYSQL_CLIENT_CREATE_DATABASE_PRIVILEGES}}", + "createDatabaseUser": "{{$global.env.MYSQL_CLIENT_CREATE_DATABASE_USER}}", + "host": "{{$global.env.MARIADB_HOST}}", + "port": "{{$global.env.MARIADB_PORT_NUMBER}}", + "rootPassword": "{{$global.env.MARIADB_ROOT_PASSWORD}}", + "rootUser": "{{$global.env.MARIADB_ROOT_USER}}" +} \ No newline at end of file diff --git a/bitnami/phpbb/3/debian-10/rootfs/phpbb-init.sh b/bitnami/phpbb/3/debian-10/rootfs/phpbb-init.sh new file mode 100644 index 000000000000..e944726d9f70 --- /dev/null +++ b/bitnami/phpbb/3/debian-10/rootfs/phpbb-init.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +## +## @brief Helper function to show an error when a password is empty and exit +## param $1 Input name +## +empty_password_error() { + error "The $1 environment variable is empty or not set. Set the environment variable ALLOW_EMPTY_PASSWORD=yes to allow the container to be started with blank passwords. This is recommended only for development." + exit 1 +} + +## +## @brief Helper function to show a warning when the ALLOW_EMPTY_PASSWORD flag is enabled +## +empty_password_enabled_warn() { + warn "You set the environment variable ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD}. For safety reasons, do not use this flag in a production environment." +} + +# Validate passwords +if [[ "$ALLOW_EMPTY_PASSWORD" =~ ^(yes|Yes|YES)$ ]]; then + empty_password_enabled_warn +else + # Database creation by MySQL client + if [[ -n "$MYSQL_CLIENT_CREATE_DATABASE_USER" && -z "$MYSQL_CLIENT_CREATE_DATABASE_PASSWORD" ]]; then + empty_password_error MYSQL_CLIENT_CREATE_DATABASE_PASSWORD + fi + # phpBB database + if [[ -z "$PHPBB_DATABASE_PASSWORD" ]]; then + empty_password_error PHPBB_DATABASE_PASSWORD + fi +fi diff --git a/bitnami/phpbb/3/debian-10/rootfs/phpbb-inputs.json b/bitnami/phpbb/3/debian-10/rootfs/phpbb-inputs.json new file mode 100644 index 000000000000..a0409b51e311 --- /dev/null +++ b/bitnami/phpbb/3/debian-10/rootfs/phpbb-inputs.json @@ -0,0 +1,19 @@ +{ + "databaseName": "{{$global.env.PHPBB_DATABASE_NAME}}", + "databasePassword": "{{$global.env.PHPBB_DATABASE_PASSWORD}}", + "databaseServerHost": "{{$global.env.MARIADB_HOST}}", + "databaseServerPort": "{{$global.env.MARIADB_PORT_NUMBER}}", + "databaseUser": "{{$global.env.PHPBB_DATABASE_USER}}", + "email": "{{$global.env.PHPBB_EMAIL}}", + "firstName": "{{$global.env.PHPBB_FIRST_NAME}}", + "forumDescription": "{{$global.env.PHPBB_FORUM_DESCRIPTION}}", + "forumName": "{{$global.env.PHPBB_FORUM_NAME}}", + "host": "{{$global.env.PHPBB_HOST}}", + "lastName": "{{$global.env.PHPBB_LAST_NAME}}", + "password": "{{$global.env.PHPBB_PASSWORD}}", + "smtpHost": "{{$global.env.SMTP_HOST}}", + "smtpPassword": "{{$global.env.SMTP_PASSWORD}}", + "smtpPort": "{{$global.env.SMTP_PORT}}", + "smtpUser": "{{$global.env.SMTP_USER}}", + "username": "{{$global.env.PHPBB_USERNAME}}" +} \ No newline at end of file diff --git a/bitnami/phpbb/3/debian-10/rootfs/post-init.sh b/bitnami/phpbb/3/debian-10/rootfs/post-init.sh new file mode 100644 index 000000000000..d6a96bd2ac85 --- /dev/null +++ b/bitnami/phpbb/3/debian-10/rootfs/post-init.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +. /opt/bitnami/base/functions + +if [[ -d /docker-entrypoint-init.d ]] && [[ ! -f /bitnami/"$BITNAMI_APP_NAME"/.user_scripts_initialized ]]; then + for f in /docker-entrypoint-init.d/*; do + failure=0 + case "$f" in + *.sh) + if [[ -x "$f" ]]; then + info "Executing $f"; "$f" || failure=$? + else + info "Sourcing $f"; . "$f" + fi + ;; + + *.php) + info "Executing $f with PHP interpreter" + php "$f" || failure=$? + ;; + + *.sql|*.sql.gz) + info "Executing $f" + mysql_cmd=( mysql -h "$MARIADB_HOST" -P "$MARIADB_PORT_NUMBER" -u "$MARIADB_ROOT_USER" ) + if [[ "${ALLOW_EMPTY_PASSWORD:-no}" != "yes" ]]; then + mysql_cmd+=( -p"$MARIADB_ROOT_PASSWORD" ) + fi + if [[ "$f" == *".sql" ]]; then + "${mysql_cmd[@]}" < "$f" || failure=$? + elif [[ "$f" == *".sql.gz" ]]; then + gunzip -c "$f" | "${mysql_cmd[@]}" || failure=$? + fi + ;; + + *) + info "Ignoring $f" + ;; + esac + if [[ "$failure" -ne 0 ]]; then + error "Failed to execute $f" + exit "$failure" + fi + done + info "Custom scripts were executed" + touch /bitnami/"$BITNAMI_APP_NAME"/.user_scripts_initialized +fi diff --git a/bitnami/phpbb/README.md b/bitnami/phpbb/README.md index 98a01590de92..2d29ad02c932 100644 --- a/bitnami/phpbb/README.md +++ b/bitnami/phpbb/README.md @@ -39,7 +39,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t * [`3-ol-7`, `3.3.0-ol-7-r19` (3/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-phpbb/blob/3.3.0-ol-7-r19/3/ol-7/Dockerfile) -* [`3-debian-10`, `0.0.0-debian-10-r0`, `3`, `0.0.0`, `0.0.0-r0`, `latest` (3/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-phpbb/blob/0.0.0-debian-10-r0/3/debian-10/Dockerfile) +* [`3-debian-10`, `3.3.0-debian-10-r0`, `3`, `3.3.0`, `3.3.0-r0`, `latest` (3/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-phpbb/blob/3.3.0-debian-10-r0/3/debian-10/Dockerfile) Subscribe to project updates by watching the [bitnami/phpbb GitHub repo](https://github.com/bitnami/bitnami-docker-phpbb).