diff --git a/.github/workflows/push-to-dockerhub.yml b/.github/workflows/push-to-dockerhub.yml index b3ec7b1..ef95a78 100644 --- a/.github/workflows/push-to-dockerhub.yml +++ b/.github/workflows/push-to-dockerhub.yml @@ -20,7 +20,7 @@ jobs: context_path: "simplerisk" dockerfile_path: "simplerisk/Dockerfile" image_name: "simplerisk/simplerisk" - version: "20260422-001" + version: "20260519-001" os_version: "jammy" build_args: "ubuntu_version_code=jammy" secrets: inherit @@ -31,7 +31,7 @@ jobs: context_path: "simplerisk" dockerfile_path: "simplerisk/Dockerfile" image_name: "simplerisk/simplerisk" - version: "20260422-001" + version: "20260519-001" os_version: "noble" main_image: true build_args: "ubuntu_version_code=noble" @@ -43,7 +43,7 @@ jobs: context_path: "simplerisk-minimal" dockerfile_path: "simplerisk-minimal/Dockerfile" image_name: "simplerisk/simplerisk-minimal" - version: "20260422-001" + version: "20260519-001" os_version: "php83" build_args: "php_version=8.3" platforms: linux/amd64,linux/arm64 @@ -55,7 +55,7 @@ jobs: context_path: "simplerisk-minimal" dockerfile_path: "simplerisk-minimal/Dockerfile" image_name: "simplerisk/simplerisk-minimal" - version: "20260422-001" + version: "20260519-001" os_version: "php84" main_image: true build_args: "php_version=8.4" diff --git a/.github/workflows/push-to-gh-pkgs.yml b/.github/workflows/push-to-gh-pkgs.yml index e46c98e..63e5a7f 100644 --- a/.github/workflows/push-to-gh-pkgs.yml +++ b/.github/workflows/push-to-gh-pkgs.yml @@ -20,7 +20,7 @@ jobs: context_path: "simplerisk" dockerfile_path: "simplerisk/Dockerfile" image_name: "simplerisk" - version: "20260422-001" + version: "20260519-001" os_version: "jammy" build_args: "ubuntu_version_code=jammy" secrets: inherit @@ -31,7 +31,7 @@ jobs: context_path: "simplerisk" dockerfile_path: "simplerisk/Dockerfile" image_name: "simplerisk" - version: "20260422-001" + version: "20260519-001" os_version: "noble" main_image: true build_args: "ubuntu_version_code=noble" @@ -43,7 +43,7 @@ jobs: context_path: "simplerisk-minimal" dockerfile_path: "simplerisk-minimal/Dockerfile" image_name: "simplerisk-minimal" - version: "20260422-001" + version: "20260519-001" os_version: "php83" build_args: "php_version=8.3" secrets: inherit @@ -54,7 +54,7 @@ jobs: context_path: "simplerisk-minimal" dockerfile_path: "simplerisk-minimal/Dockerfile" image_name: "simplerisk-minimal" - version: "20260422-001" + version: "20260519-001" os_version: "php84" main_image: true build_args: "php_version=8.4" diff --git a/simplerisk-minimal/Dockerfile b/simplerisk-minimal/Dockerfile index 5ee68bf..b62dd3c 100644 --- a/simplerisk-minimal/Dockerfile +++ b/simplerisk-minimal/Dockerfile @@ -6,13 +6,13 @@ FROM alpine/curl:8.12.1 AS downloader SHELL [ "/bin/ash", "-eo", "pipefail", "-c" ] RUN mkdir -p /var/www && \ - curl -sL https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-20260422-001.tgz | tar xz -C /var/www + curl -sL https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-20260519-001.tgz | tar xz -C /var/www FROM php:${php_version}-apache LABEL maintainer="SimpleRisk " -ENV version=20260422-001 +ENV version=20260519-001 WORKDIR /var/www diff --git a/simplerisk-minimal/README.md b/simplerisk-minimal/README.md index 89357c6..9ba6eaf 100644 --- a/simplerisk-minimal/README.md +++ b/simplerisk-minimal/README.md @@ -2,9 +2,7 @@ [![Try in PWD](https://raw.githubusercontent.com/play-with-docker/stacks/master/assets/images/button.png)](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/simplerisk/docker/master/simplerisk-minimal/stack.yml) -This image is intended to run SimpleRisk in a 'microservices' approach (database is not included). It uses PHP 8.X with -Apache as a base image. Also has the capability of setting properties of the `config.php` file through environment -variables. +This image is intended to run SimpleRisk in a 'microservices' approach (database is not included). It uses PHP 8.X with Apache as a base image. Also has the capability of setting properties of the `config.php` file through environment variables. For any of the executions, it is recommended to map the 80 and 443 ports to be able to access the application. @@ -19,37 +17,28 @@ VERSION=8.X docker build -f php$VERSION/Dockerfile -t simplerisk/simplerisk-minimal:$VERSION . ``` -## Run +## Run There are two ways to run this container: ### Database Setup (Optional) -If this is the first time running the application, the MySQL database needs to be set up with the SimpleRisk schema. You -have two options to set it up: +If this is the first time running the application, the MySQL database needs to be set up with the SimpleRisk schema. You have two options to set it up: #### New Installer (GUI) -Since the `20220306-001` release, SimpleRisk offers a graphical installation method. You will need to run the container -without the `DB_SETUP` variable: - +Since the `20220306-001` release, SimpleRisk offers a graphical installation method. You will need to run the container the following way: ``` -docker run -d --name simplerisk -p 80:80 -p 443:443 simplerisk/simplerisk-minimal +docker run -d --name simplerisk -e DB_SETUP=manual -p 80:80 -p 443:443 simplerisk/simplerisk-minimal ``` #### Docker Setup (CLI) -You must provide the environment variable `DB_SETUP=automatic|automatic-only` and optionally provide any of the -variables from the **Environment variables** section that start with `AUTO_DB_SETUP_*` to customize the setup. The only -difference between the `DB_SETUP` values shown before is that `automatic` will configure the database and leave the -container running until it stops, while `automatic-stop` will stop the container after configuring the database. The -latter might be helpful in a situation where you only want to configure the database. +You must provide the environment variable `DB_SETUP=automatic|automatic-only` and optionally provide any of the variables from the **Environment variables** section that start with `AUTO_DB_SETUP_*` to customize the setup. The only difference between the `DB_SETUP` values shown before is that `automatic` will configure the database and leave the container running until it stops, while `automatic-stop` will stop the container after configuring the database. The latter might be helpful in a situation where you only want to configure the database. -Another detail to consider is that if the database set up is being executed and the `SIMPLERISK_DB_PASSWORD` variable is -not provided, the application will generate a random password and show it on the container logs. +Another detail to consider is that if the database set up is being executed and the `SIMPLERISK_DB_PASSWORD` variable is not provided, the application will generate a random password and show it on the container logs. The way to run the container on this mode are the following: - ```bash # Automatic setup (set database and keep running) docker run -d --name simplerisk -e DB_SETUP=automatic -e DB_SETUP_PASS=test -e SIMPLERISK_DB_HOSTNAME=172.17.0.2 -p 80:80 -p 443:443 simplerisk/simplerisk-minimal @@ -60,54 +49,49 @@ docker run -d --name simplerisk -e DB_SETUP=automatic-only -e DB_SETUP_PASS=test ### Normal execution -If the database is already set up for SimpleRisk to use it, there is no need to use the `DB_SETUP` variable; you can run -the container by just providing the `SIMPLERISK_DB_*` options. For example, if the database is located at -`db-server.example.com` on port 45329, the command to run the container would be: - +If the database is already set up for SimpleRisk to use it, there is no need to use the `DB_SETUP` variable; you can run the container by just providing the `SIMPLERISK_DB_*` options. For example, if the database is located at `db-server.example.com` on port 45329, the command to run the container would be: ``` docker run -d --name simplerisk -e SIMPLERISK_DB_PASSWORD=pass -e SIMPLERISK_DB_HOSTNAME=db-server.example.com -e SIMPLERISK_DB_PORT=45329 -p 80:80 -p 443:443 simplerisk/simplerisk-minimal ``` ## Environment variables -| Variable Name | Default Value | Purpose | -| :---------------------------: | :------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `DB_SETUP` | `null` (Accepts any value) | The container will start as if the database has not been set up. The valid options here are `automatic` (in case you want the container to configure the database), `automatic-only` (the same as `automatic`, but stops the container after finishing the setup) or `delete` (removes the SimpleRisk database and user from MySQL). If not provided, it will show the installer. | -| `DB_SETUP_USER` | `root` | Used when `DB_SETUP=automatic\|automatic-only\|delete`. User name of database privileged user to install SimpleRisk schema and other components | -| `DB_SETUP_PASS` | `root` | Used when `DB_SETUP=automatic\|automatic-only\|delete`. Password for database privileged user to install SimpleRisk schema and other components | -| `DB_SETUP_WAIT` | 20 | Used when `DB_SETUP=automatic\|automatic-only`. Time, in seconds, the application is going to wait to set up the database. Useful if you are deploying the database and SimpleRisk at the same time | -| `SIMPLERISK_DB_HOSTNAME` | `localhost` | Hostname of the database server | -| `SIMPLERISK_DB_PORT` | 3306 | Port to contact the database | -| `SIMPLERISK_DB_USERNAME` | `simplerisk` | User name to be used to access the SimpleRisk database | -| `SIMPLERISK_DB_PASSWORD` | `simplerisk` | Password to be used to access the SimpleRisk database. If not provided while setting up the database, a random password will be generated and shown on the container logs | -| `SIMPLERISK_DB_DATABASE` | `simplerisk` | Database name where all SimpleRisk objects are stored | -| `SIMPLERISK_DB_FOR_SESSIONS` | `true` | Indicator that the application will store all sessions on the configured database | -| `SIMPLERISK_DB_SSL_CERT_PATH` | Empty string (`''`) | Path where SSL certificates, to contact the database, are located | -| `SIMPLERISK_CRON_SETUP` | `enabled` | Install the cron job to run in this Docker container | -| `SIMPLERISK_CSRF_SECRET` | Auto-generated | Override the auto-generated CSRF secret | -| `ADMIN_USERNAME` | — | Username for an initial admin user created once during `DB_SETUP`. Requires `ADMIN_PASSWORD` and `ADMIN_EMAIL`. Skipped if the username already exists | -| `ADMIN_PASSWORD` | — | Password for the initial admin user | -| `ADMIN_EMAIL` | — | Email address for the initial admin user | -| `ADMIN_NAME` | `Administrator` | Display name for the initial admin user | +| Variable Name | Default Value | Purpose | +|:-------------:|:-------------:|:--------| +| `DB_SETUP` | `null` (Accepts any value) | The container will start as if the database has not been set up. The valid options here are `automatic` (in case you want the container to configure the database), `automatic-only` (the same as `automatic`, but stops the container after finishing the setup), `delete` (removes the SimpleRisk database and user from MySQL) or `manual` (allows the user to run the manual installation) | +| `DB_SETUP_USER` | `root` | Used when `DB_SETUP=automatic\|automatic-only\|delete`. User name of database privileged user to install SimpleRisk schema and other components | +| `DB_SETUP_PASS` | `root` | Used when `DB_SETUP=automatic\|automatic-only\|delete`. Password for database privileged user to install SimpleRisk schema and other components | +| `DB_SETUP_WAIT` | 20 | Used when `DB_SETUP=automatic\|automatic-only`. Time, in seconds, the application is going to wait to set up the database. Useful if you are deploying the database and SimpleRisk at the same time | +| `SIMPLERISK_DB_HOSTNAME` | `localhost` | Hostname of the database server | +| `SIMPLERISK_DB_PORT` | 3306 | Port to contact the database | +| `SIMPLERISK_DB_USERNAME` |`simplerisk` | User name to be used to access the SimpleRisk database | +| `SIMPLERISK_DB_PASSWORD` | `simplerisk` | Password to be used to access the SimpleRisk database. If not provided while setting up the database, a random password will be generated and shown on the container logs | +| `SIMPLERISK_DB_DATABASE` | `simplerisk` | Database name where all SimpleRisk objects are stored | +| `SIMPLERISK_DB_FOR_SESSIONS` | `true` | Indicator that the application will store all sessions on the configured database | +| `SIMPLERISK_DB_SSL_CERT_PATH` | Empty string (`''`) | Path where SSL certificates, to contact the database, are located | +| `SIMPLERISK_CRON_SETUP` | `enabled` | Install the cron job to run in this Docker container | +| `SIMPLERISK_CSRF_SECRET` | Auto-generated | Override the auto-generated CSRF secret | +| `ADMIN_USERNAME` | — | Username for an initial admin user created once during `DB_SETUP`. Requires `ADMIN_PASSWORD` and `ADMIN_EMAIL`. Skipped if the username already exists | +| `ADMIN_PASSWORD` | — | Password for the initial admin user | +| `ADMIN_EMAIL` | — | Email address for the initial admin user | +| `ADMIN_NAME` | `Administrator` | Display name for the initial admin user | ## Mail settings -The following environment variables configure the outbound mail settings stored in the SimpleRisk database (`settings` -table). They are applied on every container start, so changing a value and restarting the container is all that is -needed to update the configuration. Invalid values are silently skipped with a warning in the container logs. - -| Variable Name | Default Value | Purpose | -| :------------------: | :-----------: | :--------------------------------------------------------- | -| `MAIL_TRANSPORT` | — | Transport to use: `smtp` or `sendmail` | -| `MAIL_FROM_EMAIL` | — | Sender email address (must be a valid email) | -| `MAIL_FROM_NAME` | — | Sender display name | -| `MAIL_REPLYTO_EMAIL` | — | Reply-to email address (must be a valid email) | -| `MAIL_REPLYTO_NAME` | — | Reply-to display name | -| `MAIL_HOST` | — | SMTP server hostname | -| `MAIL_PORT` | — | SMTP server port (must be numeric) | -| `MAIL_ENCRYPTION` | — | Encryption method: `none`, `tls`, or `ssl` | -| `MAIL_SMTPAUTH` | — | Whether SMTP authentication is required: `true` or `false` | -| `MAIL_SMTPAUTOTLS` | — | Whether to automatically use TLS: `true` or `false` | -| `MAIL_USERNAME` | — | SMTP authentication username | -| `MAIL_PASSWORD` | — | SMTP authentication password (not applied if empty) | -| `MAIL_PREPEND` | — | Prefix string prepended to all outbound email subjects | +The following environment variables configure the outbound mail settings stored in the SimpleRisk database (`settings` table). They are applied on every container start, so changing a value and restarting the container is all that is needed to update the configuration. Invalid values are silently skipped with a warning in the container logs. + +| Variable Name | Default Value | Purpose | +|:-------------:|:-------------:|:--------| +| `MAIL_TRANSPORT` | — | Transport to use: `smtp` or `sendmail` | +| `MAIL_FROM_EMAIL` | — | Sender email address (must be a valid email) | +| `MAIL_FROM_NAME` | — | Sender display name | +| `MAIL_REPLYTO_EMAIL` | — | Reply-to email address (must be a valid email) | +| `MAIL_REPLYTO_NAME` | — | Reply-to display name | +| `MAIL_HOST` | — | SMTP server hostname | +| `MAIL_PORT` | — | SMTP server port (must be numeric) | +| `MAIL_ENCRYPTION` | — | Encryption method: `none`, `tls`, or `ssl` | +| `MAIL_SMTPAUTH` | — | Whether SMTP authentication is required: `true` or `false` | +| `MAIL_SMTPAUTOTLS` | — | Whether to automatically use TLS: `true` or `false` | +| `MAIL_USERNAME` | — | SMTP authentication username | +| `MAIL_PASSWORD` | — | SMTP authentication password (not applied if empty) | +| `MAIL_PREPEND` | — | Prefix string prepended to all outbound email subjects | diff --git a/simplerisk-minimal/common/entrypoint.sh b/simplerisk-minimal/common/entrypoint.sh index caf9129..1d875d3 100644 --- a/simplerisk-minimal/common/entrypoint.sh +++ b/simplerisk-minimal/common/entrypoint.sh @@ -48,12 +48,14 @@ validate_db_setup(){ print_log "initial_info:setup" "Setting database through the automatic process";; automatic-only) print_log "initial_info:setup" "Setting database through the automatic process and removing container";; + manual) + print_log "initial_info:setup" "Database will be set manually";; delete) print_log "initial_info:setup" "Perform deletion of database";; "") print_log "initial_info:setup" "Database is already set";; *) - fatal_error "The provided option for DB_SETUP is invalid. It must be automatic, automatic-only or delete.";; + fatal_error "The provided option for DB_SETUP is invalid. It must be automatic, automatic-only or manual.";; esac } diff --git a/simplerisk-minimal/stack.yml b/simplerisk-minimal/stack.yml index 734b0b6..6f43a7b 100644 --- a/simplerisk-minimal/stack.yml +++ b/simplerisk-minimal/stack.yml @@ -6,9 +6,9 @@ services: simplerisk: environment: - DB_SETUP=automatic - - DB_SETUP_PASS=sl0EXIGhIemuuNHKdN4yY + - DB_SETUP_PASS=Q29xIQhisPq8rDzjbzZKd - SIMPLERISK_DB_HOSTNAME=mysql - image: simplerisk/simplerisk-minimal:20260422-001 + image: simplerisk/simplerisk-minimal:20260519-001 ports: - "80:80" - "443:443" @@ -16,7 +16,7 @@ services: mysql: command: mysqld --sql_mode="NO_ENGINE_SUBSTITUTION" environment: - - MYSQL_ROOT_PASSWORD=sl0EXIGhIemuuNHKdN4yY + - MYSQL_ROOT_PASSWORD=Q29xIQhisPq8rDzjbzZKd image: mysql:8.0 smtp: diff --git a/simplerisk/Dockerfile b/simplerisk/Dockerfile index 26b5450..c5e6a0a 100644 --- a/simplerisk/Dockerfile +++ b/simplerisk/Dockerfile @@ -8,13 +8,13 @@ ARG DB_LANG=en SHELL [ "/bin/ash", "-eo", "pipefail", "-c" ] RUN mkdir -p /var/www && \ - curl -sL https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-20260422-001.tgz | tar xz -C /var/www && \ - curl -sL "https://github.com/simplerisk/database/raw/master/simplerisk-$DB_LANG-20260422-001.sql" > /simplerisk.sql + curl -sL https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-20260519-001.tgz | tar xz -C /var/www && \ + curl -sL "https://github.com/simplerisk/database/raw/master/simplerisk-$DB_LANG-20260519-001.sql" > /simplerisk.sql # Using Ubuntu image FROM ubuntu:${ubuntu_version_code} -ENV version=20260422-001 +ENV version=20260519-001 # Maintained by SimpleRisk LABEL maintainer="Simplerisk "