From 1a03442864f93389662785be41a36488dfc4ef46 Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Tue, 21 Nov 2017 14:59:39 +0000 Subject: [PATCH] 3.2.1-r2 release phpBB expects an existing database to be configured with. --- bitnami/phpbb/3/Dockerfile | 28 +++-- bitnami/phpbb/3/docker-compose.yml | 8 ++ bitnami/phpbb/3/rootfs/app-entrypoint.sh | 4 +- bitnami/phpbb/3/rootfs/init.sh | 29 +++++ .../phpbb/3/rootfs/mysql-client-inputs.json | 11 ++ bitnami/phpbb/3/rootfs/phpbb-inputs.json | 5 +- bitnami/phpbb/README.md | 105 ++++++++++++++---- bitnami/phpbb/circle.yml | 2 - 8 files changed, 154 insertions(+), 38 deletions(-) create mode 100644 bitnami/phpbb/3/rootfs/init.sh create mode 100644 bitnami/phpbb/3/rootfs/mysql-client-inputs.json diff --git a/bitnami/phpbb/3/Dockerfile b/bitnami/phpbb/3/Dockerfile index 31c47f2e87af..a48edf0f2fbd 100644 --- a/bitnami/phpbb/3/Dockerfile +++ b/bitnami/phpbb/3/Dockerfile @@ -1,25 +1,33 @@ -FROM bitnami/minideb-extras:jessie-r21 +FROM bitnami/minideb-extras:jessie-r22 LABEL maintainer "Bitnami " # Install required system packages and dependencies RUN install_packages libapr1 libaprutil1 libbz2-1.0 libc6 libcomerr2 libcurl3 libexpat1 libffi6 libfreetype6 libgcc1 libgcrypt20 libgmp10 libgnutls-deb0-28 libgpg-error0 libgssapi-krb5-2 libhogweed2 libicu52 libidn11 libjpeg62-turbo libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 liblzma5 libmcrypt4 libncurses5 libnettle4 libp11-kit0 libpcre3 libpng12-0 libpq5 libreadline6 librtmp1 libsasl2-2 libssh2-1 libssl1.0.0 libstdc++6 libsybdb5 libtasn1-6 libtidy-0.99-0 libtinfo5 libuuid1 libxml2 libxslt1.1 zlib1g -RUN bitnami-pkg unpack apache-2.4.27-0 --checksum 27b8591b6564856428e2a3480949d549316e2f7e5bd207faa7b8c6e3a9bb9cc0 -RUN bitnami-pkg unpack php-7.0.22-0 --checksum 205c9587157116d8842e50a3e23d147fb06f495e61e22c8a96974eb3d7deae51 -RUN bitnami-pkg install mysql-client-10.1.26-0 --checksum 731e07b76a06c8b7f2a0b79d528f2f1f37e49142f682ab27ab8f4edfc9176d83 -RUN bitnami-pkg install libphp-7.0.22-0 --checksum 3fcf344e454baf0c0e7c94798f22aa823033891224a10d59883756ebd12bdf79 -RUN bitnami-pkg unpack phpbb-3.2.1-0 --checksum 2efeed8b3285c14cc2fdc4eadba0123eb71af14ac805cdeb929f92849d1c05f5 +RUN bitnami-pkg unpack apache-2.4.29-0 --checksum 38af9f5ee6088655536238d9f70f4ce7fd6047e1c84fd5b02fa351efbc4f60c6 +RUN bitnami-pkg unpack php-7.0.25-0 --checksum 06b7eec17da189e1d7c4768d2a8ccc22aeae42b2261af52956c49f32840910ac +RUN bitnami-pkg unpack mysql-client-10.1.29-0 --checksum 4b29436697f5fcdf38f3c9713a27208304fe36b858afc5aa5a7a4d3f17d84bac +RUN bitnami-pkg install libphp-7.0.25-0 --checksum 830adc5002b70b4000921b85590ef70390189e1b7b498e4c71515c9ba8af2a70 +RUN bitnami-pkg unpack phpbb-3.2.1-1 --checksum 53a3a6b2a70929ee56526252d6571ea4ad1af9b4a9f2cb9d74217097b79da6be COPY rootfs / -ENV APACHE_HTTPS_PORT_NUMBER="443" \ +ENV ALLOW_EMPTY_PASSWORD="no" \ + APACHE_HTTPS_PORT_NUMBER="443" \ APACHE_HTTP_PORT_NUMBER="80" \ BITNAMI_APP_NAME="phpbb" \ - BITNAMI_IMAGE_VERSION="3.2.1-r1" \ + BITNAMI_IMAGE_VERSION="3.2.1-r2" \ MARIADB_HOST="mariadb" \ - MARIADB_PASSWORD="" \ MARIADB_PORT_NUMBER="3306" \ - MARIADB_USER="root" \ + 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="" \ PATH="/opt/bitnami/apache/bin:/opt/bitnami/php/bin:/opt/bitnami/mysql/bin:$PATH" \ + 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" \ diff --git a/bitnami/phpbb/3/docker-compose.yml b/bitnami/phpbb/3/docker-compose.yml index feafef240486..2e0d57d9e22b 100644 --- a/bitnami/phpbb/3/docker-compose.yml +++ b/bitnami/phpbb/3/docker-compose.yml @@ -4,12 +4,20 @@ services: image: 'bitnami/mariadb:latest' environment: - ALLOW_EMPTY_PASSWORD=yes + - MARIADB_USER=bn_phpbb + - MARIADB_DATABASE=bitnami_phpbb volumes: - 'mariadb_data:/bitnami' phpbb: image: 'bitnami/phpbb:3' labels: kompose.service.type: nodeport + 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' diff --git a/bitnami/phpbb/3/rootfs/app-entrypoint.sh b/bitnami/phpbb/3/rootfs/app-entrypoint.sh index 0dc479a0319c..3a634f1aae49 100755 --- a/bitnami/phpbb/3/rootfs/app-entrypoint.sh +++ b/bitnami/phpbb/3/rootfs/app-entrypoint.sh @@ -4,10 +4,10 @@ . /opt/bitnami/base/helpers print_welcome_page -check_for_updates & if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "/init.sh" ]]; then - nami_initialize apache php phpbb + . /init.sh + nami_initialize apache php mysql-client phpbb info "Starting phpbb... " fi diff --git a/bitnami/phpbb/3/rootfs/init.sh b/bitnami/phpbb/3/rootfs/init.sh new file mode 100644 index 000000000000..74d66dc85fbf --- /dev/null +++ b/bitnami/phpbb/3/rootfs/init.sh @@ -0,0 +1,29 @@ +## +## @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/rootfs/mysql-client-inputs.json b/bitnami/phpbb/3/rootfs/mysql-client-inputs.json new file mode 100644 index 000000000000..6a20ec0837a0 --- /dev/null +++ b/bitnami/phpbb/3/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/rootfs/phpbb-inputs.json b/bitnami/phpbb/3/rootfs/phpbb-inputs.json index 04578801e7d9..a0409b51e311 100644 --- a/bitnami/phpbb/3/rootfs/phpbb-inputs.json +++ b/bitnami/phpbb/3/rootfs/phpbb-inputs.json @@ -1,8 +1,9 @@ { - "databaseAdminPassword": "{{$global.env.MARIADB_PASSWORD}}", - "databaseAdminUser": "{{$global.env.MARIADB_USER}}", + "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}}", diff --git a/bitnami/phpbb/README.md b/bitnami/phpbb/README.md index e31217afdafd..9244d2102540 100644 --- a/bitnami/phpbb/README.md +++ b/bitnami/phpbb/README.md @@ -51,16 +51,25 @@ This is the recommended way to run phpBB. You can use the following docker compo ```yaml version: '2' - services: mariadb: image: 'bitnami/mariadb:latest' environment: - ALLOW_EMPTY_PASSWORD=yes + - MARIADB_USER=bn_phpbb + - MARIADB_DATABASE=bitnami_phpbb volumes: - 'mariadb_data:/bitnami' phpbb: - image: 'bitnami/phpbb:latest' + image: 'bitnami/phpbb:3' + labels: + kompose.service.type: nodeport + 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' @@ -68,7 +77,6 @@ services: - 'phpbb_data:/bitnami' depends_on: - mariadb - volumes: mariadb_data: driver: local @@ -86,21 +94,35 @@ If you want to run the application manually instead of using docker-compose, the $ docker network create phpbb_network ``` -2. Start a MariaDB database in the network generated: +2. Create a volume for MariaDB persistence and create a MariaDB container ```bash - $ docker run -d --name mariadb -e ALLOW_EMPTY_PASSWORD=yes --net=phpbb_network bitnami/mariadb + $ docker volume create --name mariadb_data + $ docker run -d --name mariadb \ + -e ALLOW_EMPTY_PASSWORD=yes \ + -e MARIADB_USER=bn_phpbb \ + -e MARIADB_DATABASE=bitnami_phpbb \ + --net phpbb-tier \ + --volume mariadb_data:/bitnami \ + bitnami/mariadb:latest ``` *Note:* You need to give the container a name in order to phpBB to resolve the host -3. Run the phpBB container: +3. Create volumes for phpBB persistence and launch the container ```bash - $ docker run -d -p 80:80 -p 443:443 --name phpbb --net=phpbb_network bitnami/phpbb + $ docker volume create --name phpbb_data + $ docker run -d --name phpbb -p 80:80 -p 443:443 \ + -e ALLOW_EMPTY_PASSWORD=yes \ + -e PHPBB_DATABASE_USER=bn_phpbb \ + -e PHPBB_DATABASE_NAME=bitnami_phpbb \ + --net phpbb-tier \ + --volume phpbb_data:/bitnami \ + bitnami/phpbb:latest ``` -Then you can access your application at http://your-ip/ +Access your application at http://your-ip/ ## Persisting your application @@ -124,6 +146,8 @@ services: image: 'bitnami/mariadb:latest' environment: - ALLOW_EMPTY_PASSWORD=yes + - MARIADB_USER=bn_phpbb + - MARIADB_DATABASE=bitnami_phpbb volumes: - '/path/to/your/local/mariadb_data:/bitnami' phpbb: @@ -133,6 +157,10 @@ services: ports: - '80:80' - '443:443' + environment: + - PHPBB_DATABASE_USER=bn_phpbb + - PHPBB_DATABASE_NAME=bitnami_phpbb + - ALLOW_EMPTY_PASSWORD=yes volumes: - '/path/to/phpbb-persistence:/bitnami' ``` @@ -150,7 +178,10 @@ In this case you need to specify the directories to mount on the run command. Th 2. Create a MariaDB container with host volume: ```bash - $ docker run -d --name mariadb -e ALLOW_EMPTY_PASSWORD=yes \ + $ docker run -d --name mariadb \ + -e ALLOW_EMPTY_PASSWORD=yes \ + -e MARIADB_USER=bn_phpbb \ + -e MARIADB_DATABASE=bitnami_phpbb \ --net phpbb-tier \ --volume /path/to/mariadb-persistence:/bitnami \ bitnami/mariadb:latest @@ -162,6 +193,9 @@ In this case you need to specify the directories to mount on the run command. Th ```bash $ docker run -d --name phpbb -p 80:80 -p 443:443 \ + -e ALLOW_EMPTY_PASSWORD=yes \ + -e PHPBB_DATABASE_USER=bn_phpbb \ + -e PHPBB_DATABASE_NAME=bitnami_phpbb \ --net phpbb-tier \ --volume /path/to/phpbb-persistence:/bitnami \ bitnami/phpbb:latest @@ -231,23 +265,46 @@ When you start the phpbb image, you can adjust the configuration of the instance Available variables: - - `PHPBB_USERNAME`: phpBB application username. Default: **user** - - `PHPBB_PASSWORD`: phpBB application password. Default: **bitnami** - - `PHPBB_EMAIL`: phpBB application email. Default: **user@example.com** - - `MARIADB_USER`: Root user for the MariaDB database. Default: **root** - - `MARIADB_PASSWORD`: Root password for the MariaDB. - - `MARIADB_HOST`: Hostname for MariaDB server. Default: **mariadb** - - `MARIADB_PORT_NUMBER`: Port used by MariaDB server. Default: **3306** +##### User and Site configuration -### SMTP Configuration +- `PHPBB_USERNAME`: phpBB application username. Default: **user** +- `PHPBB_PASSWORD`: phpBB application password. Default: **bitnami** +- `PHPBB_FIRST_NAME`: Fist name of the user of the application. Default: **User** +- `PHPBB_LAST_NAME`: Last name of the user of the application. Default: **Name** +- `PHPBB_FORUM_NAME`: Forum Name. Default: **My forum** +- `PHPBB_FORUM_DESCRIPTION`: Forum Description. Default: **A little text to describe your forum** +- `PHPBB_EMAIL`: phpBB application email. Default: **user@example.com** +- `PHPBB_HOST`: phpBB application email. No defaults. + +##### Use an existing database + +- `MARIADB_HOST`: Hostname for MariaDB server. Default: **mariadb** +- `MARIADB_PORT_NUMBER`: Port used by MariaDB server. Default: **3306** +- `PHPBB_DATABASE_NAME`: Database name that phpBB will use to connect with the database. Default: **bitnami_phpbb** +- `PHPBB_DATABASE_USER`: Database user that phpBB will use to connect with the database. Default: **bn_phpbb** +- `PHPBB_DATABASE_PASSWORD`: Database password that Phpbb will use to connect with the database. No defaults. +- `ALLOW_EMPTY_PASSWORD`: It can be used to allow blank passwords. Default: **no** + +##### Create a database for phpBB using mysql-client + +- `MARIADB_HOST`: Hostname for MariaDB server. Default: **mariadb** +- `MARIADB_PORT_NUMBER`: Port used by MariaDB server. Default: **3306** +- `MARIADB_ROOT_USER`: Database admin user. Default: **root** +- `MARIADB_ROOT_PASSWORD`: Database password for the `MARIADB_ROOT_USER` user. No defaults. +- `MYSQL_CLIENT_CREATE_DATABASE_NAME`: New database to be created by the mysql client module. No defaults. +- `MYSQL_CLIENT_CREATE_DATABASE_USER`: New database user to be created by the mysql client module. No defaults. +- `MYSQL_CLIENT_CREATE_DATABASE_PASSWORD`: Database password for the `MYSQL_CLIENT_CREATE_DATABASE_USER` user. No defaults. +- `ALLOW_EMPTY_PASSWORD`: It can be used to allow blank passwords. Default: **no** + +##### SMTP Configuration To configure phpBB to send email using SMTP you can set the following environment variables: - - `SMTP_HOST`: SMTP host. - - `SMTP_PORT`: SMTP port. - - `SMTP_USER`: SMTP account user. - - `SMTP_PASSWORD`: SMTP account password. - - `SMTP_PROTOCOL`: SMTP protocol. +- `SMTP_HOST`: SMTP host. +- `SMTP_PORT`: SMTP port. +- `SMTP_USER`: SMTP account user. +- `SMTP_PASSWORD`: SMTP account password. +- `SMTP_PROTOCOL`: SMTP protocol. This would be an example of SMTP configuration using a GMail account: @@ -260,6 +317,8 @@ This would be an example of SMTP configuration using a GMail account: - 80:80 - 443:443 environment: + - PHPBB_DATABASE_USER=bn_phpbb + - PHPBB_DATABASE_NAME=bitnami_phpbb - SMTP_HOST=smtp.gmail.com - SMTP_PORT=587 - SMTP_USER=your_email@gmail.com @@ -270,6 +329,8 @@ This would be an example of SMTP configuration using a GMail account: ```bash $ docker run -d -p 80:80 -p 443:443 --name phpbb \ + -e PHPBB_DATABASE_USER=bn_phpbb \ + -e PHPBB_DATABASE_NAME=bitnami_phpbb \ -e SMTP_HOST=smtp.gmail.com \ -e SMTP_PORT=587 \ -e SMTP_USER=your_email@gmail.com \ diff --git a/bitnami/phpbb/circle.yml b/bitnami/phpbb/circle.yml index 1e92d2d439fc..68a59dbc9db6 100644 --- a/bitnami/phpbb/circle.yml +++ b/bitnami/phpbb/circle.yml @@ -8,8 +8,6 @@ jobs: RELEASE_SERIES_LIST: "3" LATEST_STABLE: "3" IMAGE_NAME: phpbb - CHART_NAME: phpbb - CHART_REPO: https://github.com/kubernetes/charts DOCKER_PROJECT: bitnami QUAY_PROJECT: bitnami GCLOUD_PROJECT: bitnami-containers