From 7f2b49ceb4abd0b5ae191f244f95e6f005a26079 Mon Sep 17 00:00:00 2001 From: vincowl Date: Sat, 4 Feb 2023 14:06:01 +0100 Subject: [PATCH 01/24] Add env var to change php.ini upload size --- Dockerfile.template | 1 + docker-run.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Dockerfile.template b/Dockerfile.template index dda965d..e904cee 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -34,6 +34,7 @@ ENV WWW_GROUP_ID 33 ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M +ENV PHP_INI_UPLOAD_SIZE 40M RUN apt-get update -y \ && apt-get dist-upgrade -y \ diff --git a/docker-run.sh b/docker-run.sh index 7546aaa..590fb99 100755 --- a/docker-run.sh +++ b/docker-run.sh @@ -42,6 +42,8 @@ function initDolibarr() date.timezone = ${PHP_INI_DATE_TIMEZONE} sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} +upload_max_filesize = ${PHP_INI_UPLOAD_SIZE} +post_max_size = ${PHP_INI_UPLOAD_SIZE} EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then From a93453fe03015e5096d38af1c5f80ede40419cfa Mon Sep 17 00:00:00 2001 From: vincowl Date: Mon, 27 Mar 2023 15:33:23 +0200 Subject: [PATCH 02/24] apply requested changes to submitted PR --- Dockerfile.template | 3 ++- README.md | 62 +++++++++++++++++++++++---------------------- docker-run.sh | 4 +-- 3 files changed, 36 insertions(+), 33 deletions(-) diff --git a/Dockerfile.template b/Dockerfile.template index e904cee..e300d33 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -34,7 +34,8 @@ ENV WWW_GROUP_ID 33 ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M -ENV PHP_INI_UPLOAD_SIZE 40M +ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M +ENV PHP_INI_POST_MAX_SIZE 8M RUN apt-get update -y \ && apt-get dist-upgrade -y \ diff --git a/README.md b/README.md index 2161757..a87dba6 100644 --- a/README.md +++ b/README.md @@ -92,36 +92,38 @@ When setup this way, to upgrade version the use of the web interface is mandator ## Environment variables summary -| Variable | Default value | Description | -| ----------------------------- | ------------------------------ | ----------- | -| **DOLI_INSTALL_AUTO** | *1* | 1: The installation will be executed on first boot -| **DOLI_DB_TYPE** | *mysqli* | Type of the DB server (**mysqli**, pgsql) -| **DOLI_DB_HOST** | *mysql* | Host name of the MariaDB/MySQL server -| **DOLI_DB_HOST_PORT** | *3306* | Host port of the MariaDB/MySQL server -| **DOLI_DB_USER** | *doli* | Database user -| **DOLI_DB_PASSWORD** | *doli_pass* | Database user's password -| **DOLI_DB_NAME** | *dolidb* | Database name -| **DOLI_ADMIN_LOGIN** | *admin* | Admin's login create on the first boot -| **DOLI_ADMIN_PASSWORD** | *admin* | Admin'password -| **DOLI_URL_ROOT** | *http://localhost* | Url root of the Dolibarr installation -| **PHP_INI_DATE_TIMEZONE** | *UTC* | Default timezone on PHP -| **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit -| **WWW_USER_ID** | | ID of user www-data. ID will not changed if leave empty. During a development, it is very practical to put the same ID as the host user. -| **WWW_GROUP_ID** | | ID of group www-data. ID will not changed if leave empty. -| **DOLI_AUTH** | *dolibarr* | Which method is used to connect users, change to `ldap` or `ldap, dolibarr` to use LDAP -| **DOLI_LDAP_HOST** | *127.0.0.1* | The host of the LDAP server -| **DOLI_LDAP_PORT** | *389* | The port of the LDAP server -| **DOLI_LDAP_VERSION** | *3* | The version of LDAP to use -| **DOLI_LDAP_SERVER_TYPE** | *openldap* | The type of LDAP server (openLDAP, Active Directory, eGroupWare) -| **DOLI_LDAP_LOGIN_ATTRIBUTE** | *uid* | The attribute used to bind users -| **DOLI_LDAP_DN** | *ou=users,dc=my-domain,dc=com* | The base where to look for users -| **DOLI_LDAP_FILTER** | | The filter to authorise users to connect -| **DOLI_LDAP_BIND_DN** | | The complete DN of the user with read access on users -| **DOLI_LDAP_BIND_PASS** | | The password of the bind user -| **DOLI_LDAP_DEBUG** | *false* | Activate debug mode -| **DOLI_CRON** | *0* | 1: Enable cron service -| **DOLI_CRON_KEY** | | Security key launch cron jobs -| **DOLI_CRON_USER** | | Dolibarr user used for cron jobs +| Variable | Default value | Description | +| ------------------------------- | ------------------------------ | ----------- | +| **DOLI_INSTALL_AUTO** | *1* | 1: The installation will be executed on first boot +| **DOLI_DB_TYPE** | *mysqli* | Type of the DB server (**mysqli**, pgsql) +| **DOLI_DB_HOST** | *mysql* | Host name of the MariaDB/MySQL server +| **DOLI_DB_HOST_PORT** | *3306* | Host port of the MariaDB/MySQL server +| **DOLI_DB_USER** | *doli* | Database user +| **DOLI_DB_PASSWORD** | *doli_pass* | Database user's password +| **DOLI_DB_NAME** | *dolidb* | Database name +| **DOLI_ADMIN_LOGIN** | *admin* | Admin's login create on the first boot +| **DOLI_ADMIN_PASSWORD** | *admin* | Admin'password +| **DOLI_URL_ROOT** | *http://localhost* | Url root of the Dolibarr installation +| **PHP_INI_DATE_TIMEZONE** | *UTC* | Default timezone on PHP +| **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit +| **PHP_INI_UPLOAD_MAX_FILESIZE** | *2M* | PHP Maximum allowed size for uploaded files +| **PHP_INI_POST_MAX_SIZE** | *8M* | PHP Maximum size of POST data that PHP will accept. +| **WWW_USER_ID** | | ID of user www-data. ID will not changed if leave empty. During a development, it is very practical to put the same ID as the host user. +| **WWW_GROUP_ID** | | ID of group www-data. ID will not changed if leave empty. +| **DOLI_AUTH** | *dolibarr* | Which method is used to connect users, change to `ldap` or `ldap, dolibarr` to use LDAP +| **DOLI_LDAP_HOST** | *127.0.0.1* | The host of the LDAP server +| **DOLI_LDAP_PORT** | *389* | The port of the LDAP server +| **DOLI_LDAP_VERSION** | *3* | The version of LDAP to use +| **DOLI_LDAP_SERVER_TYPE** | *openldap* | The type of LDAP server (openLDAP, Active Directory, eGroupWare) +| **DOLI_LDAP_LOGIN_ATTRIBUTE** | *uid* | The attribute used to bind users +| **DOLI_LDAP_DN** | *ou=users,dc=my-domain,dc=com* | The base where to look for users +| **DOLI_LDAP_FILTER** | | The filter to authorise users to connect +| **DOLI_LDAP_BIND_DN** | | The complete DN of the user with read access on users +| **DOLI_LDAP_BIND_PASS** | | The password of the bind user +| **DOLI_LDAP_DEBUG** | *false* | Activate debug mode +| **DOLI_CRON** | *0* | 1: Enable cron service +| **DOLI_CRON_KEY** | | Security key launch cron jobs +| **DOLI_CRON_USER** | | Dolibarr user used for cron jobs Some environment variables are compatible with docker secrets behaviour, just add the `_FILE` suffix to var name and point the value file to read. Environment variables that are compatible with docker secrets: diff --git a/docker-run.sh b/docker-run.sh index 590fb99..427bb06 100755 --- a/docker-run.sh +++ b/docker-run.sh @@ -42,8 +42,8 @@ function initDolibarr() date.timezone = ${PHP_INI_DATE_TIMEZONE} sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} -upload_max_filesize = ${PHP_INI_UPLOAD_SIZE} -post_max_size = ${PHP_INI_UPLOAD_SIZE} +upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} +post_max_size = ${PHP_INI_POST_MAX_SIZE} EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then From 18189fe59e03210ade0337e2a660f5b53493adb5 Mon Sep 17 00:00:00 2001 From: vincowl Date: Mon, 27 Mar 2023 20:48:03 +0200 Subject: [PATCH 03/24] Modify README.template instead of README.md --- README.md | 62 ++++++++++++++++++++++++------------------------- README.template | 62 +++++++++++++++++++++++++------------------------ 2 files changed, 62 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index a87dba6..2161757 100644 --- a/README.md +++ b/README.md @@ -92,38 +92,36 @@ When setup this way, to upgrade version the use of the web interface is mandator ## Environment variables summary -| Variable | Default value | Description | -| ------------------------------- | ------------------------------ | ----------- | -| **DOLI_INSTALL_AUTO** | *1* | 1: The installation will be executed on first boot -| **DOLI_DB_TYPE** | *mysqli* | Type of the DB server (**mysqli**, pgsql) -| **DOLI_DB_HOST** | *mysql* | Host name of the MariaDB/MySQL server -| **DOLI_DB_HOST_PORT** | *3306* | Host port of the MariaDB/MySQL server -| **DOLI_DB_USER** | *doli* | Database user -| **DOLI_DB_PASSWORD** | *doli_pass* | Database user's password -| **DOLI_DB_NAME** | *dolidb* | Database name -| **DOLI_ADMIN_LOGIN** | *admin* | Admin's login create on the first boot -| **DOLI_ADMIN_PASSWORD** | *admin* | Admin'password -| **DOLI_URL_ROOT** | *http://localhost* | Url root of the Dolibarr installation -| **PHP_INI_DATE_TIMEZONE** | *UTC* | Default timezone on PHP -| **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit -| **PHP_INI_UPLOAD_MAX_FILESIZE** | *2M* | PHP Maximum allowed size for uploaded files -| **PHP_INI_POST_MAX_SIZE** | *8M* | PHP Maximum size of POST data that PHP will accept. -| **WWW_USER_ID** | | ID of user www-data. ID will not changed if leave empty. During a development, it is very practical to put the same ID as the host user. -| **WWW_GROUP_ID** | | ID of group www-data. ID will not changed if leave empty. -| **DOLI_AUTH** | *dolibarr* | Which method is used to connect users, change to `ldap` or `ldap, dolibarr` to use LDAP -| **DOLI_LDAP_HOST** | *127.0.0.1* | The host of the LDAP server -| **DOLI_LDAP_PORT** | *389* | The port of the LDAP server -| **DOLI_LDAP_VERSION** | *3* | The version of LDAP to use -| **DOLI_LDAP_SERVER_TYPE** | *openldap* | The type of LDAP server (openLDAP, Active Directory, eGroupWare) -| **DOLI_LDAP_LOGIN_ATTRIBUTE** | *uid* | The attribute used to bind users -| **DOLI_LDAP_DN** | *ou=users,dc=my-domain,dc=com* | The base where to look for users -| **DOLI_LDAP_FILTER** | | The filter to authorise users to connect -| **DOLI_LDAP_BIND_DN** | | The complete DN of the user with read access on users -| **DOLI_LDAP_BIND_PASS** | | The password of the bind user -| **DOLI_LDAP_DEBUG** | *false* | Activate debug mode -| **DOLI_CRON** | *0* | 1: Enable cron service -| **DOLI_CRON_KEY** | | Security key launch cron jobs -| **DOLI_CRON_USER** | | Dolibarr user used for cron jobs +| Variable | Default value | Description | +| ----------------------------- | ------------------------------ | ----------- | +| **DOLI_INSTALL_AUTO** | *1* | 1: The installation will be executed on first boot +| **DOLI_DB_TYPE** | *mysqli* | Type of the DB server (**mysqli**, pgsql) +| **DOLI_DB_HOST** | *mysql* | Host name of the MariaDB/MySQL server +| **DOLI_DB_HOST_PORT** | *3306* | Host port of the MariaDB/MySQL server +| **DOLI_DB_USER** | *doli* | Database user +| **DOLI_DB_PASSWORD** | *doli_pass* | Database user's password +| **DOLI_DB_NAME** | *dolidb* | Database name +| **DOLI_ADMIN_LOGIN** | *admin* | Admin's login create on the first boot +| **DOLI_ADMIN_PASSWORD** | *admin* | Admin'password +| **DOLI_URL_ROOT** | *http://localhost* | Url root of the Dolibarr installation +| **PHP_INI_DATE_TIMEZONE** | *UTC* | Default timezone on PHP +| **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit +| **WWW_USER_ID** | | ID of user www-data. ID will not changed if leave empty. During a development, it is very practical to put the same ID as the host user. +| **WWW_GROUP_ID** | | ID of group www-data. ID will not changed if leave empty. +| **DOLI_AUTH** | *dolibarr* | Which method is used to connect users, change to `ldap` or `ldap, dolibarr` to use LDAP +| **DOLI_LDAP_HOST** | *127.0.0.1* | The host of the LDAP server +| **DOLI_LDAP_PORT** | *389* | The port of the LDAP server +| **DOLI_LDAP_VERSION** | *3* | The version of LDAP to use +| **DOLI_LDAP_SERVER_TYPE** | *openldap* | The type of LDAP server (openLDAP, Active Directory, eGroupWare) +| **DOLI_LDAP_LOGIN_ATTRIBUTE** | *uid* | The attribute used to bind users +| **DOLI_LDAP_DN** | *ou=users,dc=my-domain,dc=com* | The base where to look for users +| **DOLI_LDAP_FILTER** | | The filter to authorise users to connect +| **DOLI_LDAP_BIND_DN** | | The complete DN of the user with read access on users +| **DOLI_LDAP_BIND_PASS** | | The password of the bind user +| **DOLI_LDAP_DEBUG** | *false* | Activate debug mode +| **DOLI_CRON** | *0* | 1: Enable cron service +| **DOLI_CRON_KEY** | | Security key launch cron jobs +| **DOLI_CRON_USER** | | Dolibarr user used for cron jobs Some environment variables are compatible with docker secrets behaviour, just add the `_FILE` suffix to var name and point the value file to read. Environment variables that are compatible with docker secrets: diff --git a/README.template b/README.template index 2eae5d4..ef73a8c 100644 --- a/README.template +++ b/README.template @@ -84,36 +84,38 @@ When setup this way, to upgrade version the use of the web interface is mandator ## Environment variables summary -| Variable | Default value | Description | -| ----------------------------- | ------------------------------ | ----------- | -| **DOLI_INSTALL_AUTO** | *1* | 1: The installation will be executed on first boot -| **DOLI_DB_TYPE** | *mysqli* | Type of the DB server (**mysqli**, pgsql) -| **DOLI_DB_HOST** | *mysql* | Host name of the MariaDB/MySQL server -| **DOLI_DB_HOST_PORT** | *3306* | Host port of the MariaDB/MySQL server -| **DOLI_DB_USER** | *doli* | Database user -| **DOLI_DB_PASSWORD** | *doli_pass* | Database user's password -| **DOLI_DB_NAME** | *dolidb* | Database name -| **DOLI_ADMIN_LOGIN** | *admin* | Admin's login create on the first boot -| **DOLI_ADMIN_PASSWORD** | *admin* | Admin'password -| **DOLI_URL_ROOT** | *http://localhost* | Url root of the Dolibarr installation -| **PHP_INI_DATE_TIMEZONE** | *UTC* | Default timezone on PHP -| **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit -| **WWW_USER_ID** | | ID of user www-data. ID will not changed if leave empty. During a development, it is very practical to put the same ID as the host user. -| **WWW_GROUP_ID** | | ID of group www-data. ID will not changed if leave empty. -| **DOLI_AUTH** | *dolibarr* | Which method is used to connect users, change to `ldap` or `ldap, dolibarr` to use LDAP -| **DOLI_LDAP_HOST** | *127.0.0.1* | The host of the LDAP server -| **DOLI_LDAP_PORT** | *389* | The port of the LDAP server -| **DOLI_LDAP_VERSION** | *3* | The version of LDAP to use -| **DOLI_LDAP_SERVER_TYPE** | *openldap* | The type of LDAP server (openLDAP, Active Directory, eGroupWare) -| **DOLI_LDAP_LOGIN_ATTRIBUTE** | *uid* | The attribute used to bind users -| **DOLI_LDAP_DN** | *ou=users,dc=my-domain,dc=com* | The base where to look for users -| **DOLI_LDAP_FILTER** | | The filter to authorise users to connect -| **DOLI_LDAP_BIND_DN** | | The complete DN of the user with read access on users -| **DOLI_LDAP_BIND_PASS** | | The password of the bind user -| **DOLI_LDAP_DEBUG** | *false* | Activate debug mode -| **DOLI_CRON** | *0* | 1: Enable cron service -| **DOLI_CRON_KEY** | | Security key launch cron jobs -| **DOLI_CRON_USER** | | Dolibarr user used for cron jobs +| Variable | Default value | Description | +| ------------------------------- | ------------------------------ | ----------- | +| **DOLI_INSTALL_AUTO** | *1* | 1: The installation will be executed on first boot +| **DOLI_DB_TYPE** | *mysqli* | Type of the DB server (**mysqli**, pgsql) +| **DOLI_DB_HOST** | *mysql* | Host name of the MariaDB/MySQL server +| **DOLI_DB_HOST_PORT** | *3306* | Host port of the MariaDB/MySQL server +| **DOLI_DB_USER** | *doli* | Database user +| **DOLI_DB_PASSWORD** | *doli_pass* | Database user's password +| **DOLI_DB_NAME** | *dolidb* | Database name +| **DOLI_ADMIN_LOGIN** | *admin* | Admin's login create on the first boot +| **DOLI_ADMIN_PASSWORD** | *admin* | Admin'password +| **DOLI_URL_ROOT** | *http://localhost* | Url root of the Dolibarr installation +| **PHP_INI_DATE_TIMEZONE** | *UTC* | Default timezone on PHP +| **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit +| **PHP_INI_UPLOAD_MAX_FILESIZE** | *2M* | PHP Maximum allowed size for uploaded files +| **PHP_INI_POST_MAX_SIZE** | *8M* | PHP Maximum size of POST data that PHP will accept. +| **WWW_USER_ID** | | ID of user www-data. ID will not changed if leave empty. During a development, it is very practical to put the same ID as the host user. +| **WWW_GROUP_ID** | | ID of group www-data. ID will not changed if leave empty. +| **DOLI_AUTH** | *dolibarr* | Which method is used to connect users, change to `ldap` or `ldap, dolibarr` to use LDAP +| **DOLI_LDAP_HOST** | *127.0.0.1* | The host of the LDAP server +| **DOLI_LDAP_PORT** | *389* | The port of the LDAP server +| **DOLI_LDAP_VERSION** | *3* | The version of LDAP to use +| **DOLI_LDAP_SERVER_TYPE** | *openldap* | The type of LDAP server (openLDAP, Active Directory, eGroupWare) +| **DOLI_LDAP_LOGIN_ATTRIBUTE** | *uid* | The attribute used to bind users +| **DOLI_LDAP_DN** | *ou=users,dc=my-domain,dc=com* | The base where to look for users +| **DOLI_LDAP_FILTER** | | The filter to authorise users to connect +| **DOLI_LDAP_BIND_DN** | | The complete DN of the user with read access on users +| **DOLI_LDAP_BIND_PASS** | | The password of the bind user +| **DOLI_LDAP_DEBUG** | *false* | Activate debug mode +| **DOLI_CRON** | *0* | 1: Enable cron service +| **DOLI_CRON_KEY** | | Security key launch cron jobs +| **DOLI_CRON_USER** | | Dolibarr user used for cron jobs Some environment variables are compatible with docker secrets behaviour, just add the `_FILE` suffix to var name and point the value file to read. Environment variables that are compatible with docker secrets: From f4f2d7d0a5f5090de3c7a30bc27ffc0c7fa45cfa Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Sat, 1 Apr 2023 08:35:53 +0200 Subject: [PATCH 04/24] Update Dolibarr 16.0.5 --- README.md | 2 +- images/{16.0.4-php8.1 => 16.0.5-php8.1}/Dockerfile | 2 +- images/{16.0.4-php8.1 => 16.0.5-php8.1}/docker-run.sh | 0 versions.sh | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename images/{16.0.4-php8.1 => 16.0.5-php8.1}/Dockerfile (98%) rename images/{16.0.4-php8.1 => 16.0.5-php8.1}/docker-run.sh (100%) diff --git a/README.md b/README.md index 2161757..421b5b5 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Docker image for Dolibarr with auto installer on first boot. * 13.0.4-php7.4 13.0.4 13 * 14.0.5-php7.4 14.0.5 14 * 15.0.3-php7.4 15.0.3 15 -* 16.0.4-php8.1 16.0.4 16 +* 16.0.5-php8.1 16.0.5 16 * 17.0.0-php8.1 17.0.0 17 latest * develop diff --git a/images/16.0.4-php8.1/Dockerfile b/images/16.0.5-php8.1/Dockerfile similarity index 98% rename from images/16.0.4-php8.1/Dockerfile rename to images/16.0.5-php8.1/Dockerfile index 652759a..62d3cde 100644 --- a/images/16.0.4-php8.1/Dockerfile +++ b/images/16.0.5-php8.1/Dockerfile @@ -4,7 +4,7 @@ FROM ${ARCH}php:8.1-apache-buster LABEL maintainer="Garcia MICHEL " -ENV DOLI_VERSION 16.0.4 +ENV DOLI_VERSION 16.0.5 ENV DOLI_INSTALL_AUTO 1 ENV DOLI_DB_TYPE mysqli diff --git a/images/16.0.4-php8.1/docker-run.sh b/images/16.0.5-php8.1/docker-run.sh similarity index 100% rename from images/16.0.4-php8.1/docker-run.sh rename to images/16.0.5-php8.1/docker-run.sh diff --git a/versions.sh b/versions.sh index 6110b19..1ce05b6 100644 --- a/versions.sh +++ b/versions.sh @@ -2,5 +2,5 @@ set -e -DOLIBARR_VERSIONS=( "11.0.5" "12.0.5" "13.0.4" "14.0.5" "15.0.3" "16.0.4" "17.0.0" "develop" ) +DOLIBARR_VERSIONS=( "11.0.5" "12.0.5" "13.0.4" "14.0.5" "15.0.3" "16.0.5" "17.0.0" "develop" ) DOLIBARR_LATEST_TAG="17.0.0" From 9c43451d2b51c5c13771ed2fb0cc270b5340e604 Mon Sep 17 00:00:00 2001 From: vincowl Date: Mon, 3 Apr 2023 17:13:02 +0200 Subject: [PATCH 05/24] run update.sh --- README.md | 62 +++++++++++++++--------------- images/11.0.5-php7.4/Dockerfile | 2 + images/11.0.5-php7.4/docker-run.sh | 2 + images/12.0.5-php7.4/Dockerfile | 2 + images/12.0.5-php7.4/docker-run.sh | 2 + images/13.0.4-php7.4/Dockerfile | 2 + images/13.0.4-php7.4/docker-run.sh | 2 + images/14.0.5-php7.4/Dockerfile | 2 + images/14.0.5-php7.4/docker-run.sh | 2 + images/15.0.3-php7.4/Dockerfile | 2 + images/15.0.3-php7.4/docker-run.sh | 2 + images/16.0.4-php8.1/Dockerfile | 2 + images/16.0.4-php8.1/docker-run.sh | 2 + images/17.0.0-php8.1/Dockerfile | 2 + images/17.0.0-php8.1/docker-run.sh | 2 + images/develop/Dockerfile | 2 + images/develop/docker-run.sh | 2 + 17 files changed, 64 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 2161757..a87dba6 100644 --- a/README.md +++ b/README.md @@ -92,36 +92,38 @@ When setup this way, to upgrade version the use of the web interface is mandator ## Environment variables summary -| Variable | Default value | Description | -| ----------------------------- | ------------------------------ | ----------- | -| **DOLI_INSTALL_AUTO** | *1* | 1: The installation will be executed on first boot -| **DOLI_DB_TYPE** | *mysqli* | Type of the DB server (**mysqli**, pgsql) -| **DOLI_DB_HOST** | *mysql* | Host name of the MariaDB/MySQL server -| **DOLI_DB_HOST_PORT** | *3306* | Host port of the MariaDB/MySQL server -| **DOLI_DB_USER** | *doli* | Database user -| **DOLI_DB_PASSWORD** | *doli_pass* | Database user's password -| **DOLI_DB_NAME** | *dolidb* | Database name -| **DOLI_ADMIN_LOGIN** | *admin* | Admin's login create on the first boot -| **DOLI_ADMIN_PASSWORD** | *admin* | Admin'password -| **DOLI_URL_ROOT** | *http://localhost* | Url root of the Dolibarr installation -| **PHP_INI_DATE_TIMEZONE** | *UTC* | Default timezone on PHP -| **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit -| **WWW_USER_ID** | | ID of user www-data. ID will not changed if leave empty. During a development, it is very practical to put the same ID as the host user. -| **WWW_GROUP_ID** | | ID of group www-data. ID will not changed if leave empty. -| **DOLI_AUTH** | *dolibarr* | Which method is used to connect users, change to `ldap` or `ldap, dolibarr` to use LDAP -| **DOLI_LDAP_HOST** | *127.0.0.1* | The host of the LDAP server -| **DOLI_LDAP_PORT** | *389* | The port of the LDAP server -| **DOLI_LDAP_VERSION** | *3* | The version of LDAP to use -| **DOLI_LDAP_SERVER_TYPE** | *openldap* | The type of LDAP server (openLDAP, Active Directory, eGroupWare) -| **DOLI_LDAP_LOGIN_ATTRIBUTE** | *uid* | The attribute used to bind users -| **DOLI_LDAP_DN** | *ou=users,dc=my-domain,dc=com* | The base where to look for users -| **DOLI_LDAP_FILTER** | | The filter to authorise users to connect -| **DOLI_LDAP_BIND_DN** | | The complete DN of the user with read access on users -| **DOLI_LDAP_BIND_PASS** | | The password of the bind user -| **DOLI_LDAP_DEBUG** | *false* | Activate debug mode -| **DOLI_CRON** | *0* | 1: Enable cron service -| **DOLI_CRON_KEY** | | Security key launch cron jobs -| **DOLI_CRON_USER** | | Dolibarr user used for cron jobs +| Variable | Default value | Description | +| ------------------------------- | ------------------------------ | ----------- | +| **DOLI_INSTALL_AUTO** | *1* | 1: The installation will be executed on first boot +| **DOLI_DB_TYPE** | *mysqli* | Type of the DB server (**mysqli**, pgsql) +| **DOLI_DB_HOST** | *mysql* | Host name of the MariaDB/MySQL server +| **DOLI_DB_HOST_PORT** | *3306* | Host port of the MariaDB/MySQL server +| **DOLI_DB_USER** | *doli* | Database user +| **DOLI_DB_PASSWORD** | *doli_pass* | Database user's password +| **DOLI_DB_NAME** | *dolidb* | Database name +| **DOLI_ADMIN_LOGIN** | *admin* | Admin's login create on the first boot +| **DOLI_ADMIN_PASSWORD** | *admin* | Admin'password +| **DOLI_URL_ROOT** | *http://localhost* | Url root of the Dolibarr installation +| **PHP_INI_DATE_TIMEZONE** | *UTC* | Default timezone on PHP +| **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit +| **PHP_INI_UPLOAD_MAX_FILESIZE** | *2M* | PHP Maximum allowed size for uploaded files +| **PHP_INI_POST_MAX_SIZE** | *8M* | PHP Maximum size of POST data that PHP will accept. +| **WWW_USER_ID** | | ID of user www-data. ID will not changed if leave empty. During a development, it is very practical to put the same ID as the host user. +| **WWW_GROUP_ID** | | ID of group www-data. ID will not changed if leave empty. +| **DOLI_AUTH** | *dolibarr* | Which method is used to connect users, change to `ldap` or `ldap, dolibarr` to use LDAP +| **DOLI_LDAP_HOST** | *127.0.0.1* | The host of the LDAP server +| **DOLI_LDAP_PORT** | *389* | The port of the LDAP server +| **DOLI_LDAP_VERSION** | *3* | The version of LDAP to use +| **DOLI_LDAP_SERVER_TYPE** | *openldap* | The type of LDAP server (openLDAP, Active Directory, eGroupWare) +| **DOLI_LDAP_LOGIN_ATTRIBUTE** | *uid* | The attribute used to bind users +| **DOLI_LDAP_DN** | *ou=users,dc=my-domain,dc=com* | The base where to look for users +| **DOLI_LDAP_FILTER** | | The filter to authorise users to connect +| **DOLI_LDAP_BIND_DN** | | The complete DN of the user with read access on users +| **DOLI_LDAP_BIND_PASS** | | The password of the bind user +| **DOLI_LDAP_DEBUG** | *false* | Activate debug mode +| **DOLI_CRON** | *0* | 1: Enable cron service +| **DOLI_CRON_KEY** | | Security key launch cron jobs +| **DOLI_CRON_USER** | | Dolibarr user used for cron jobs Some environment variables are compatible with docker secrets behaviour, just add the `_FILE` suffix to var name and point the value file to read. Environment variables that are compatible with docker secrets: diff --git a/images/11.0.5-php7.4/Dockerfile b/images/11.0.5-php7.4/Dockerfile index cefe395..41fe8fc 100644 --- a/images/11.0.5-php7.4/Dockerfile +++ b/images/11.0.5-php7.4/Dockerfile @@ -34,6 +34,8 @@ ENV WWW_GROUP_ID 33 ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M +ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M +ENV PHP_INI_POST_MAX_SIZE 8M RUN apt-get update -y \ && apt-get dist-upgrade -y \ diff --git a/images/11.0.5-php7.4/docker-run.sh b/images/11.0.5-php7.4/docker-run.sh index 7546aaa..427bb06 100755 --- a/images/11.0.5-php7.4/docker-run.sh +++ b/images/11.0.5-php7.4/docker-run.sh @@ -42,6 +42,8 @@ function initDolibarr() date.timezone = ${PHP_INI_DATE_TIMEZONE} sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} +upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} +post_max_size = ${PHP_INI_POST_MAX_SIZE} EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then diff --git a/images/12.0.5-php7.4/Dockerfile b/images/12.0.5-php7.4/Dockerfile index 7abb300..d26e319 100644 --- a/images/12.0.5-php7.4/Dockerfile +++ b/images/12.0.5-php7.4/Dockerfile @@ -34,6 +34,8 @@ ENV WWW_GROUP_ID 33 ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M +ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M +ENV PHP_INI_POST_MAX_SIZE 8M RUN apt-get update -y \ && apt-get dist-upgrade -y \ diff --git a/images/12.0.5-php7.4/docker-run.sh b/images/12.0.5-php7.4/docker-run.sh index 7546aaa..427bb06 100755 --- a/images/12.0.5-php7.4/docker-run.sh +++ b/images/12.0.5-php7.4/docker-run.sh @@ -42,6 +42,8 @@ function initDolibarr() date.timezone = ${PHP_INI_DATE_TIMEZONE} sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} +upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} +post_max_size = ${PHP_INI_POST_MAX_SIZE} EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then diff --git a/images/13.0.4-php7.4/Dockerfile b/images/13.0.4-php7.4/Dockerfile index 98a87c2..05de5db 100644 --- a/images/13.0.4-php7.4/Dockerfile +++ b/images/13.0.4-php7.4/Dockerfile @@ -34,6 +34,8 @@ ENV WWW_GROUP_ID 33 ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M +ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M +ENV PHP_INI_POST_MAX_SIZE 8M RUN apt-get update -y \ && apt-get dist-upgrade -y \ diff --git a/images/13.0.4-php7.4/docker-run.sh b/images/13.0.4-php7.4/docker-run.sh index 7546aaa..427bb06 100755 --- a/images/13.0.4-php7.4/docker-run.sh +++ b/images/13.0.4-php7.4/docker-run.sh @@ -42,6 +42,8 @@ function initDolibarr() date.timezone = ${PHP_INI_DATE_TIMEZONE} sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} +upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} +post_max_size = ${PHP_INI_POST_MAX_SIZE} EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then diff --git a/images/14.0.5-php7.4/Dockerfile b/images/14.0.5-php7.4/Dockerfile index 83ca823..d5a1b84 100644 --- a/images/14.0.5-php7.4/Dockerfile +++ b/images/14.0.5-php7.4/Dockerfile @@ -34,6 +34,8 @@ ENV WWW_GROUP_ID 33 ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M +ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M +ENV PHP_INI_POST_MAX_SIZE 8M RUN apt-get update -y \ && apt-get dist-upgrade -y \ diff --git a/images/14.0.5-php7.4/docker-run.sh b/images/14.0.5-php7.4/docker-run.sh index 7546aaa..427bb06 100755 --- a/images/14.0.5-php7.4/docker-run.sh +++ b/images/14.0.5-php7.4/docker-run.sh @@ -42,6 +42,8 @@ function initDolibarr() date.timezone = ${PHP_INI_DATE_TIMEZONE} sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} +upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} +post_max_size = ${PHP_INI_POST_MAX_SIZE} EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then diff --git a/images/15.0.3-php7.4/Dockerfile b/images/15.0.3-php7.4/Dockerfile index 8fea033..381be05 100644 --- a/images/15.0.3-php7.4/Dockerfile +++ b/images/15.0.3-php7.4/Dockerfile @@ -34,6 +34,8 @@ ENV WWW_GROUP_ID 33 ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M +ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M +ENV PHP_INI_POST_MAX_SIZE 8M RUN apt-get update -y \ && apt-get dist-upgrade -y \ diff --git a/images/15.0.3-php7.4/docker-run.sh b/images/15.0.3-php7.4/docker-run.sh index 7546aaa..427bb06 100755 --- a/images/15.0.3-php7.4/docker-run.sh +++ b/images/15.0.3-php7.4/docker-run.sh @@ -42,6 +42,8 @@ function initDolibarr() date.timezone = ${PHP_INI_DATE_TIMEZONE} sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} +upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} +post_max_size = ${PHP_INI_POST_MAX_SIZE} EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then diff --git a/images/16.0.4-php8.1/Dockerfile b/images/16.0.4-php8.1/Dockerfile index 652759a..b165ede 100644 --- a/images/16.0.4-php8.1/Dockerfile +++ b/images/16.0.4-php8.1/Dockerfile @@ -34,6 +34,8 @@ ENV WWW_GROUP_ID 33 ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M +ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M +ENV PHP_INI_POST_MAX_SIZE 8M RUN apt-get update -y \ && apt-get dist-upgrade -y \ diff --git a/images/16.0.4-php8.1/docker-run.sh b/images/16.0.4-php8.1/docker-run.sh index 7546aaa..427bb06 100755 --- a/images/16.0.4-php8.1/docker-run.sh +++ b/images/16.0.4-php8.1/docker-run.sh @@ -42,6 +42,8 @@ function initDolibarr() date.timezone = ${PHP_INI_DATE_TIMEZONE} sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} +upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} +post_max_size = ${PHP_INI_POST_MAX_SIZE} EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then diff --git a/images/17.0.0-php8.1/Dockerfile b/images/17.0.0-php8.1/Dockerfile index 3b6b41b..1168f10 100644 --- a/images/17.0.0-php8.1/Dockerfile +++ b/images/17.0.0-php8.1/Dockerfile @@ -34,6 +34,8 @@ ENV WWW_GROUP_ID 33 ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M +ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M +ENV PHP_INI_POST_MAX_SIZE 8M RUN apt-get update -y \ && apt-get dist-upgrade -y \ diff --git a/images/17.0.0-php8.1/docker-run.sh b/images/17.0.0-php8.1/docker-run.sh index 7546aaa..427bb06 100755 --- a/images/17.0.0-php8.1/docker-run.sh +++ b/images/17.0.0-php8.1/docker-run.sh @@ -42,6 +42,8 @@ function initDolibarr() date.timezone = ${PHP_INI_DATE_TIMEZONE} sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} +upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} +post_max_size = ${PHP_INI_POST_MAX_SIZE} EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then diff --git a/images/develop/Dockerfile b/images/develop/Dockerfile index cd7f3e3..de91e91 100644 --- a/images/develop/Dockerfile +++ b/images/develop/Dockerfile @@ -34,6 +34,8 @@ ENV WWW_GROUP_ID 33 ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M +ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M +ENV PHP_INI_POST_MAX_SIZE 8M RUN apt-get update -y \ && apt-get dist-upgrade -y \ diff --git a/images/develop/docker-run.sh b/images/develop/docker-run.sh index 7546aaa..427bb06 100755 --- a/images/develop/docker-run.sh +++ b/images/develop/docker-run.sh @@ -42,6 +42,8 @@ function initDolibarr() date.timezone = ${PHP_INI_DATE_TIMEZONE} sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} +upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} +post_max_size = ${PHP_INI_POST_MAX_SIZE} EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then From 7c91bd51e6a0b6c2d389b772b00b14da3f585842 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Sat, 1 Apr 2023 08:35:53 +0200 Subject: [PATCH 06/24] Update Dolibarr 16.0.5 --- README.md | 2 +- images/{16.0.4-php8.1 => 16.0.5-php8.1}/Dockerfile | 2 +- images/{16.0.4-php8.1 => 16.0.5-php8.1}/docker-run.sh | 0 versions.sh | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename images/{16.0.4-php8.1 => 16.0.5-php8.1}/Dockerfile (99%) rename images/{16.0.4-php8.1 => 16.0.5-php8.1}/docker-run.sh (100%) diff --git a/README.md b/README.md index a87dba6..9bbc032 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Docker image for Dolibarr with auto installer on first boot. * 13.0.4-php7.4 13.0.4 13 * 14.0.5-php7.4 14.0.5 14 * 15.0.3-php7.4 15.0.3 15 -* 16.0.4-php8.1 16.0.4 16 +* 16.0.5-php8.1 16.0.5 16 * 17.0.0-php8.1 17.0.0 17 latest * develop diff --git a/images/16.0.4-php8.1/Dockerfile b/images/16.0.5-php8.1/Dockerfile similarity index 99% rename from images/16.0.4-php8.1/Dockerfile rename to images/16.0.5-php8.1/Dockerfile index b165ede..ccd0e7a 100644 --- a/images/16.0.4-php8.1/Dockerfile +++ b/images/16.0.5-php8.1/Dockerfile @@ -4,7 +4,7 @@ FROM ${ARCH}php:8.1-apache-buster LABEL maintainer="Garcia MICHEL " -ENV DOLI_VERSION 16.0.4 +ENV DOLI_VERSION 16.0.5 ENV DOLI_INSTALL_AUTO 1 ENV DOLI_DB_TYPE mysqli diff --git a/images/16.0.4-php8.1/docker-run.sh b/images/16.0.5-php8.1/docker-run.sh similarity index 100% rename from images/16.0.4-php8.1/docker-run.sh rename to images/16.0.5-php8.1/docker-run.sh diff --git a/versions.sh b/versions.sh index 6110b19..1ce05b6 100644 --- a/versions.sh +++ b/versions.sh @@ -2,5 +2,5 @@ set -e -DOLIBARR_VERSIONS=( "11.0.5" "12.0.5" "13.0.4" "14.0.5" "15.0.3" "16.0.4" "17.0.0" "develop" ) +DOLIBARR_VERSIONS=( "11.0.5" "12.0.5" "13.0.4" "14.0.5" "15.0.3" "16.0.5" "17.0.0" "develop" ) DOLIBARR_LATEST_TAG="17.0.0" From b3bd6c8e77a477837dcc89ae66d2959f1dcb47de Mon Sep 17 00:00:00 2001 From: Florent Poinsaut Date: Tue, 18 Apr 2023 11:51:41 +0200 Subject: [PATCH 07/24] Update image v17 to 17.0.1 --- README.md | 2 +- images/{17.0.0-php8.1 => 17.0.1-php8.1}/Dockerfile | 2 +- images/{17.0.0-php8.1 => 17.0.1-php8.1}/docker-run.sh | 0 versions.sh | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) rename images/{17.0.0-php8.1 => 17.0.1-php8.1}/Dockerfile (99%) rename images/{17.0.0-php8.1 => 17.0.1-php8.1}/docker-run.sh (100%) diff --git a/README.md b/README.md index 9bbc032..8332ee1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Docker image for Dolibarr with auto installer on first boot. * 14.0.5-php7.4 14.0.5 14 * 15.0.3-php7.4 15.0.3 15 * 16.0.5-php8.1 16.0.5 16 -* 17.0.0-php8.1 17.0.0 17 latest +* 17.0.1-php8.1 17.0.1 17 latest * develop **End of support for PHP < 7.4** diff --git a/images/17.0.0-php8.1/Dockerfile b/images/17.0.1-php8.1/Dockerfile similarity index 99% rename from images/17.0.0-php8.1/Dockerfile rename to images/17.0.1-php8.1/Dockerfile index 1168f10..5f7431c 100644 --- a/images/17.0.0-php8.1/Dockerfile +++ b/images/17.0.1-php8.1/Dockerfile @@ -4,7 +4,7 @@ FROM ${ARCH}php:8.1-apache-buster LABEL maintainer="Garcia MICHEL " -ENV DOLI_VERSION 17.0.0 +ENV DOLI_VERSION 17.0.1 ENV DOLI_INSTALL_AUTO 1 ENV DOLI_DB_TYPE mysqli diff --git a/images/17.0.0-php8.1/docker-run.sh b/images/17.0.1-php8.1/docker-run.sh similarity index 100% rename from images/17.0.0-php8.1/docker-run.sh rename to images/17.0.1-php8.1/docker-run.sh diff --git a/versions.sh b/versions.sh index 1ce05b6..6fcb4a8 100644 --- a/versions.sh +++ b/versions.sh @@ -2,5 +2,5 @@ set -e -DOLIBARR_VERSIONS=( "11.0.5" "12.0.5" "13.0.4" "14.0.5" "15.0.3" "16.0.5" "17.0.0" "develop" ) -DOLIBARR_LATEST_TAG="17.0.0" +DOLIBARR_VERSIONS=( "11.0.5" "12.0.5" "13.0.4" "14.0.5" "15.0.3" "16.0.5" "17.0.1" "develop" ) +DOLIBARR_LATEST_TAG="17.0.1" From 90a4088ce984a48fb6e5590b49ed9fd8a43e500f Mon Sep 17 00:00:00 2001 From: Florent Poinsaut <1256948+FlorentPoinsaut@users.noreply.github.com> Date: Tue, 18 Apr 2023 15:53:37 +0200 Subject: [PATCH 08/24] Securize Apache config (#118) --- Dockerfile.template | 6 ++++++ images/11.0.5-php7.4/Dockerfile | 6 ++++++ images/12.0.5-php7.4/Dockerfile | 6 ++++++ images/13.0.4-php7.4/Dockerfile | 6 ++++++ images/14.0.5-php7.4/Dockerfile | 6 ++++++ images/15.0.3-php7.4/Dockerfile | 6 ++++++ images/16.0.5-php8.1/Dockerfile | 6 ++++++ images/17.0.0-php8.1/Dockerfile | 6 ++++++ images/develop/Dockerfile | 6 ++++++ 9 files changed, 54 insertions(+) diff --git a/Dockerfile.template b/Dockerfile.template index e300d33..a06449c 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -37,6 +37,12 @@ ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +RUN sed -i \ + -e 's/^\(ServerSignature On\)$/#\1/g' \ + -e 's/^#\(ServerSignature Off\)$/\1/g' \ + -e 's/^\(ServerTokens\) OS$/\1 Prod/g' \ + /etc/apache2/conf-available/security.conf + RUN apt-get update -y \ && apt-get dist-upgrade -y \ && apt-get install -y --no-install-recommends \ diff --git a/images/11.0.5-php7.4/Dockerfile b/images/11.0.5-php7.4/Dockerfile index 41fe8fc..b22099c 100644 --- a/images/11.0.5-php7.4/Dockerfile +++ b/images/11.0.5-php7.4/Dockerfile @@ -37,6 +37,12 @@ ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +RUN sed -i \ + -e 's/^\(ServerSignature On\)$/#\1/g' \ + -e 's/^#\(ServerSignature Off\)$/\1/g' \ + -e 's/^\(ServerTokens\) OS$/\1 Prod/g' \ + /etc/apache2/conf-available/security.conf + RUN apt-get update -y \ && apt-get dist-upgrade -y \ && apt-get install -y --no-install-recommends \ diff --git a/images/12.0.5-php7.4/Dockerfile b/images/12.0.5-php7.4/Dockerfile index d26e319..7e74f22 100644 --- a/images/12.0.5-php7.4/Dockerfile +++ b/images/12.0.5-php7.4/Dockerfile @@ -37,6 +37,12 @@ ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +RUN sed -i \ + -e 's/^\(ServerSignature On\)$/#\1/g' \ + -e 's/^#\(ServerSignature Off\)$/\1/g' \ + -e 's/^\(ServerTokens\) OS$/\1 Prod/g' \ + /etc/apache2/conf-available/security.conf + RUN apt-get update -y \ && apt-get dist-upgrade -y \ && apt-get install -y --no-install-recommends \ diff --git a/images/13.0.4-php7.4/Dockerfile b/images/13.0.4-php7.4/Dockerfile index 05de5db..cc8b016 100644 --- a/images/13.0.4-php7.4/Dockerfile +++ b/images/13.0.4-php7.4/Dockerfile @@ -37,6 +37,12 @@ ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +RUN sed -i \ + -e 's/^\(ServerSignature On\)$/#\1/g' \ + -e 's/^#\(ServerSignature Off\)$/\1/g' \ + -e 's/^\(ServerTokens\) OS$/\1 Prod/g' \ + /etc/apache2/conf-available/security.conf + RUN apt-get update -y \ && apt-get dist-upgrade -y \ && apt-get install -y --no-install-recommends \ diff --git a/images/14.0.5-php7.4/Dockerfile b/images/14.0.5-php7.4/Dockerfile index d5a1b84..2faa2c5 100644 --- a/images/14.0.5-php7.4/Dockerfile +++ b/images/14.0.5-php7.4/Dockerfile @@ -37,6 +37,12 @@ ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +RUN sed -i \ + -e 's/^\(ServerSignature On\)$/#\1/g' \ + -e 's/^#\(ServerSignature Off\)$/\1/g' \ + -e 's/^\(ServerTokens\) OS$/\1 Prod/g' \ + /etc/apache2/conf-available/security.conf + RUN apt-get update -y \ && apt-get dist-upgrade -y \ && apt-get install -y --no-install-recommends \ diff --git a/images/15.0.3-php7.4/Dockerfile b/images/15.0.3-php7.4/Dockerfile index 381be05..6067698 100644 --- a/images/15.0.3-php7.4/Dockerfile +++ b/images/15.0.3-php7.4/Dockerfile @@ -37,6 +37,12 @@ ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +RUN sed -i \ + -e 's/^\(ServerSignature On\)$/#\1/g' \ + -e 's/^#\(ServerSignature Off\)$/\1/g' \ + -e 's/^\(ServerTokens\) OS$/\1 Prod/g' \ + /etc/apache2/conf-available/security.conf + RUN apt-get update -y \ && apt-get dist-upgrade -y \ && apt-get install -y --no-install-recommends \ diff --git a/images/16.0.5-php8.1/Dockerfile b/images/16.0.5-php8.1/Dockerfile index ccd0e7a..557964c 100644 --- a/images/16.0.5-php8.1/Dockerfile +++ b/images/16.0.5-php8.1/Dockerfile @@ -37,6 +37,12 @@ ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +RUN sed -i \ + -e 's/^\(ServerSignature On\)$/#\1/g' \ + -e 's/^#\(ServerSignature Off\)$/\1/g' \ + -e 's/^\(ServerTokens\) OS$/\1 Prod/g' \ + /etc/apache2/conf-available/security.conf + RUN apt-get update -y \ && apt-get dist-upgrade -y \ && apt-get install -y --no-install-recommends \ diff --git a/images/17.0.0-php8.1/Dockerfile b/images/17.0.0-php8.1/Dockerfile index 1168f10..5da88dd 100644 --- a/images/17.0.0-php8.1/Dockerfile +++ b/images/17.0.0-php8.1/Dockerfile @@ -37,6 +37,12 @@ ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +RUN sed -i \ + -e 's/^\(ServerSignature On\)$/#\1/g' \ + -e 's/^#\(ServerSignature Off\)$/\1/g' \ + -e 's/^\(ServerTokens\) OS$/\1 Prod/g' \ + /etc/apache2/conf-available/security.conf + RUN apt-get update -y \ && apt-get dist-upgrade -y \ && apt-get install -y --no-install-recommends \ diff --git a/images/develop/Dockerfile b/images/develop/Dockerfile index de91e91..95dad94 100644 --- a/images/develop/Dockerfile +++ b/images/develop/Dockerfile @@ -37,6 +37,12 @@ ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +RUN sed -i \ + -e 's/^\(ServerSignature On\)$/#\1/g' \ + -e 's/^#\(ServerSignature Off\)$/\1/g' \ + -e 's/^\(ServerTokens\) OS$/\1 Prod/g' \ + /etc/apache2/conf-available/security.conf + RUN apt-get update -y \ && apt-get dist-upgrade -y \ && apt-get install -y --no-install-recommends \ From f3565220ce25322594bba76ae1825d6fe6a6e70c Mon Sep 17 00:00:00 2001 From: Florent Poinsaut <1256948+FlorentPoinsaut@users.noreply.github.com> Date: Wed, 19 Apr 2023 10:42:37 +0200 Subject: [PATCH 09/24] Add secrets for cron credentials (#98) * Add secrets for cron credentials * Add secrets for cron credentials for all images * Set CRON var to empty by default as noted in the README + Update README.template with these new secrets. --- README.md | 11 +++++++---- README.template | 11 +++++++---- docker-run.sh | 2 ++ images/11.0.5-php7.4/docker-run.sh | 2 ++ images/12.0.5-php7.4/docker-run.sh | 2 ++ images/13.0.4-php7.4/docker-run.sh | 2 ++ images/14.0.5-php7.4/docker-run.sh | 2 ++ images/15.0.3-php7.4/docker-run.sh | 2 ++ images/16.0.5-php8.1/docker-run.sh | 2 ++ images/17.0.1-php8.1/docker-run.sh | 2 ++ images/develop/docker-run.sh | 2 ++ 11 files changed, 32 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8332ee1..18a323c 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,10 @@ When setup this way, to upgrade version the use of the web interface is mandator Some environment variables are compatible with docker secrets behaviour, just add the `_FILE` suffix to var name and point the value file to read. Environment variables that are compatible with docker secrets: - - `DOLI_DB_USER` => `DOLI_DB_USER_FILE` - - `DOLI_DB_PASSWORD` => `DOLI_DB_PASSWORD_FILE` - - `DOLI_ADMIN_LOGIN` => `DOLI_ADMIN_LOGIN_FILE` - - `DOLI_ADMIN_PASSWORD` => `DOLI_ADMIN_PASSWORD_FILE` + +* `DOLI_DB_USER` => `DOLI_DB_USER_FILE` +* `DOLI_DB_PASSWORD` => `DOLI_DB_PASSWORD_FILE` +* `DOLI_ADMIN_LOGIN` => `DOLI_ADMIN_LOGIN_FILE` +* `DOLI_ADMIN_PASSWORD` => `DOLI_ADMIN_PASSWORD_FILE` +* `DOLI_CRON_KEY` => `DOLI_CRON_KEY_FILE` +* `DOLI_CRON_USER` => `DOLI_CRON_USER_FILE` diff --git a/README.template b/README.template index ef73a8c..974502e 100644 --- a/README.template +++ b/README.template @@ -119,7 +119,10 @@ When setup this way, to upgrade version the use of the web interface is mandator Some environment variables are compatible with docker secrets behaviour, just add the `_FILE` suffix to var name and point the value file to read. Environment variables that are compatible with docker secrets: - - `DOLI_DB_USER` => `DOLI_DB_USER_FILE` - - `DOLI_DB_PASSWORD` => `DOLI_DB_PASSWORD_FILE` - - `DOLI_ADMIN_LOGIN` => `DOLI_ADMIN_LOGIN_FILE` - - `DOLI_ADMIN_PASSWORD` => `DOLI_ADMIN_PASSWORD_FILE` + +* `DOLI_DB_USER` => `DOLI_DB_USER_FILE` +* `DOLI_DB_PASSWORD` => `DOLI_DB_PASSWORD_FILE` +* `DOLI_ADMIN_LOGIN` => `DOLI_ADMIN_LOGIN_FILE` +* `DOLI_ADMIN_PASSWORD` => `DOLI_ADMIN_PASSWORD_FILE` +* `DOLI_CRON_KEY` => `DOLI_CRON_KEY_FILE` +* `DOLI_CRON_USER` => `DOLI_CRON_USER_FILE` diff --git a/docker-run.sh b/docker-run.sh index 427bb06..b682b0d 100755 --- a/docker-run.sh +++ b/docker-run.sh @@ -228,6 +228,8 @@ DOLI_DB_USER=$(get_env_value 'DOLI_DB_USER' 'doli') DOLI_DB_PASSWORD=$(get_env_value 'DOLI_DB_PASSWORD' 'doli_pass') DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') +DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') +DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') run diff --git a/images/11.0.5-php7.4/docker-run.sh b/images/11.0.5-php7.4/docker-run.sh index 427bb06..b682b0d 100755 --- a/images/11.0.5-php7.4/docker-run.sh +++ b/images/11.0.5-php7.4/docker-run.sh @@ -228,6 +228,8 @@ DOLI_DB_USER=$(get_env_value 'DOLI_DB_USER' 'doli') DOLI_DB_PASSWORD=$(get_env_value 'DOLI_DB_PASSWORD' 'doli_pass') DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') +DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') +DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') run diff --git a/images/12.0.5-php7.4/docker-run.sh b/images/12.0.5-php7.4/docker-run.sh index 427bb06..b682b0d 100755 --- a/images/12.0.5-php7.4/docker-run.sh +++ b/images/12.0.5-php7.4/docker-run.sh @@ -228,6 +228,8 @@ DOLI_DB_USER=$(get_env_value 'DOLI_DB_USER' 'doli') DOLI_DB_PASSWORD=$(get_env_value 'DOLI_DB_PASSWORD' 'doli_pass') DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') +DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') +DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') run diff --git a/images/13.0.4-php7.4/docker-run.sh b/images/13.0.4-php7.4/docker-run.sh index 427bb06..b682b0d 100755 --- a/images/13.0.4-php7.4/docker-run.sh +++ b/images/13.0.4-php7.4/docker-run.sh @@ -228,6 +228,8 @@ DOLI_DB_USER=$(get_env_value 'DOLI_DB_USER' 'doli') DOLI_DB_PASSWORD=$(get_env_value 'DOLI_DB_PASSWORD' 'doli_pass') DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') +DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') +DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') run diff --git a/images/14.0.5-php7.4/docker-run.sh b/images/14.0.5-php7.4/docker-run.sh index 427bb06..b682b0d 100755 --- a/images/14.0.5-php7.4/docker-run.sh +++ b/images/14.0.5-php7.4/docker-run.sh @@ -228,6 +228,8 @@ DOLI_DB_USER=$(get_env_value 'DOLI_DB_USER' 'doli') DOLI_DB_PASSWORD=$(get_env_value 'DOLI_DB_PASSWORD' 'doli_pass') DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') +DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') +DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') run diff --git a/images/15.0.3-php7.4/docker-run.sh b/images/15.0.3-php7.4/docker-run.sh index 427bb06..b682b0d 100755 --- a/images/15.0.3-php7.4/docker-run.sh +++ b/images/15.0.3-php7.4/docker-run.sh @@ -228,6 +228,8 @@ DOLI_DB_USER=$(get_env_value 'DOLI_DB_USER' 'doli') DOLI_DB_PASSWORD=$(get_env_value 'DOLI_DB_PASSWORD' 'doli_pass') DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') +DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') +DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') run diff --git a/images/16.0.5-php8.1/docker-run.sh b/images/16.0.5-php8.1/docker-run.sh index 427bb06..b682b0d 100755 --- a/images/16.0.5-php8.1/docker-run.sh +++ b/images/16.0.5-php8.1/docker-run.sh @@ -228,6 +228,8 @@ DOLI_DB_USER=$(get_env_value 'DOLI_DB_USER' 'doli') DOLI_DB_PASSWORD=$(get_env_value 'DOLI_DB_PASSWORD' 'doli_pass') DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') +DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') +DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') run diff --git a/images/17.0.1-php8.1/docker-run.sh b/images/17.0.1-php8.1/docker-run.sh index 427bb06..b682b0d 100755 --- a/images/17.0.1-php8.1/docker-run.sh +++ b/images/17.0.1-php8.1/docker-run.sh @@ -228,6 +228,8 @@ DOLI_DB_USER=$(get_env_value 'DOLI_DB_USER' 'doli') DOLI_DB_PASSWORD=$(get_env_value 'DOLI_DB_PASSWORD' 'doli_pass') DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') +DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') +DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') run diff --git a/images/develop/docker-run.sh b/images/develop/docker-run.sh index 427bb06..b682b0d 100755 --- a/images/develop/docker-run.sh +++ b/images/develop/docker-run.sh @@ -228,6 +228,8 @@ DOLI_DB_USER=$(get_env_value 'DOLI_DB_USER' 'doli') DOLI_DB_PASSWORD=$(get_env_value 'DOLI_DB_PASSWORD' 'doli_pass') DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') +DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') +DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') run From 6de8618a8c4b0d4855a271e8d79513dbdf0d5ca1 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Sat, 13 May 2023 10:24:58 +0200 Subject: [PATCH 10/24] Fix #100 #119 enable user module --- Dockerfile.template | 1 + docker-init.php | 6 ++++++ docker-run.sh | 3 +++ images/11.0.5-php7.4/Dockerfile | 1 + images/11.0.5-php7.4/docker-init.php | 6 ++++++ images/11.0.5-php7.4/docker-run.sh | 3 +++ images/12.0.5-php7.4/Dockerfile | 1 + images/12.0.5-php7.4/docker-init.php | 6 ++++++ images/12.0.5-php7.4/docker-run.sh | 3 +++ images/13.0.4-php7.4/Dockerfile | 1 + images/13.0.4-php7.4/docker-init.php | 6 ++++++ images/13.0.4-php7.4/docker-run.sh | 3 +++ images/14.0.5-php7.4/Dockerfile | 1 + images/14.0.5-php7.4/docker-init.php | 6 ++++++ images/14.0.5-php7.4/docker-run.sh | 3 +++ images/15.0.3-php7.4/Dockerfile | 1 + images/15.0.3-php7.4/docker-init.php | 6 ++++++ images/15.0.3-php7.4/docker-run.sh | 3 +++ images/16.0.5-php8.1/Dockerfile | 1 + images/16.0.5-php8.1/docker-init.php | 6 ++++++ images/16.0.5-php8.1/docker-run.sh | 3 +++ images/17.0.1-php8.1/Dockerfile | 1 + images/17.0.1-php8.1/docker-init.php | 6 ++++++ images/17.0.1-php8.1/docker-run.sh | 3 +++ images/develop/Dockerfile | 1 + images/develop/docker-init.php | 6 ++++++ images/develop/docker-run.sh | 3 +++ update.sh | 1 + 28 files changed, 91 insertions(+) create mode 100644 docker-init.php create mode 100644 images/11.0.5-php7.4/docker-init.php create mode 100644 images/12.0.5-php7.4/docker-init.php create mode 100644 images/13.0.4-php7.4/docker-init.php create mode 100644 images/14.0.5-php7.4/docker-init.php create mode 100644 images/15.0.3-php7.4/docker-init.php create mode 100644 images/16.0.5-php8.1/docker-init.php create mode 100644 images/17.0.1-php8.1/docker-init.php create mode 100644 images/develop/docker-init.php diff --git a/Dockerfile.template b/Dockerfile.template index a06449c..8ff376c 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -85,6 +85,7 @@ EXPOSE 80 VOLUME /var/www/documents VOLUME /var/www/html/custom +COPY docker-init.php /var/www/scripts/ COPY docker-run.sh /usr/local/bin/ ENTRYPOINT ["docker-run.sh"] diff --git a/docker-init.php b/docker-init.php new file mode 100644 index 0000000..dc0dea8 --- /dev/null +++ b/docker-init.php @@ -0,0 +1,6 @@ +#!/usr/bin/env php +init(); diff --git a/docker-run.sh b/docker-run.sh index 427bb06..4624e60 100755 --- a/docker-run.sh +++ b/docker-run.sh @@ -160,6 +160,9 @@ function initializeDatabase() mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('SYSTEMTOOLS_MYSQLDUMP', '/usr/bin/mysqldump', 'chaine', 0, '', 0);" > /dev/null 2>&1 + + echo "Enable user module ..." + php /var/www/scripts/docker-init.php } function migrateDatabase() diff --git a/images/11.0.5-php7.4/Dockerfile b/images/11.0.5-php7.4/Dockerfile index b22099c..ffd9f10 100644 --- a/images/11.0.5-php7.4/Dockerfile +++ b/images/11.0.5-php7.4/Dockerfile @@ -85,6 +85,7 @@ EXPOSE 80 VOLUME /var/www/documents VOLUME /var/www/html/custom +COPY docker-init.php /var/www/scripts/ COPY docker-run.sh /usr/local/bin/ ENTRYPOINT ["docker-run.sh"] diff --git a/images/11.0.5-php7.4/docker-init.php b/images/11.0.5-php7.4/docker-init.php new file mode 100644 index 0000000..dc0dea8 --- /dev/null +++ b/images/11.0.5-php7.4/docker-init.php @@ -0,0 +1,6 @@ +#!/usr/bin/env php +init(); diff --git a/images/11.0.5-php7.4/docker-run.sh b/images/11.0.5-php7.4/docker-run.sh index 427bb06..4624e60 100755 --- a/images/11.0.5-php7.4/docker-run.sh +++ b/images/11.0.5-php7.4/docker-run.sh @@ -160,6 +160,9 @@ function initializeDatabase() mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('SYSTEMTOOLS_MYSQLDUMP', '/usr/bin/mysqldump', 'chaine', 0, '', 0);" > /dev/null 2>&1 + + echo "Enable user module ..." + php /var/www/scripts/docker-init.php } function migrateDatabase() diff --git a/images/12.0.5-php7.4/Dockerfile b/images/12.0.5-php7.4/Dockerfile index 7e74f22..a437d4c 100644 --- a/images/12.0.5-php7.4/Dockerfile +++ b/images/12.0.5-php7.4/Dockerfile @@ -85,6 +85,7 @@ EXPOSE 80 VOLUME /var/www/documents VOLUME /var/www/html/custom +COPY docker-init.php /var/www/scripts/ COPY docker-run.sh /usr/local/bin/ ENTRYPOINT ["docker-run.sh"] diff --git a/images/12.0.5-php7.4/docker-init.php b/images/12.0.5-php7.4/docker-init.php new file mode 100644 index 0000000..dc0dea8 --- /dev/null +++ b/images/12.0.5-php7.4/docker-init.php @@ -0,0 +1,6 @@ +#!/usr/bin/env php +init(); diff --git a/images/12.0.5-php7.4/docker-run.sh b/images/12.0.5-php7.4/docker-run.sh index 427bb06..4624e60 100755 --- a/images/12.0.5-php7.4/docker-run.sh +++ b/images/12.0.5-php7.4/docker-run.sh @@ -160,6 +160,9 @@ function initializeDatabase() mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('SYSTEMTOOLS_MYSQLDUMP', '/usr/bin/mysqldump', 'chaine', 0, '', 0);" > /dev/null 2>&1 + + echo "Enable user module ..." + php /var/www/scripts/docker-init.php } function migrateDatabase() diff --git a/images/13.0.4-php7.4/Dockerfile b/images/13.0.4-php7.4/Dockerfile index cc8b016..5ea827d 100644 --- a/images/13.0.4-php7.4/Dockerfile +++ b/images/13.0.4-php7.4/Dockerfile @@ -85,6 +85,7 @@ EXPOSE 80 VOLUME /var/www/documents VOLUME /var/www/html/custom +COPY docker-init.php /var/www/scripts/ COPY docker-run.sh /usr/local/bin/ ENTRYPOINT ["docker-run.sh"] diff --git a/images/13.0.4-php7.4/docker-init.php b/images/13.0.4-php7.4/docker-init.php new file mode 100644 index 0000000..dc0dea8 --- /dev/null +++ b/images/13.0.4-php7.4/docker-init.php @@ -0,0 +1,6 @@ +#!/usr/bin/env php +init(); diff --git a/images/13.0.4-php7.4/docker-run.sh b/images/13.0.4-php7.4/docker-run.sh index 427bb06..4624e60 100755 --- a/images/13.0.4-php7.4/docker-run.sh +++ b/images/13.0.4-php7.4/docker-run.sh @@ -160,6 +160,9 @@ function initializeDatabase() mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('SYSTEMTOOLS_MYSQLDUMP', '/usr/bin/mysqldump', 'chaine', 0, '', 0);" > /dev/null 2>&1 + + echo "Enable user module ..." + php /var/www/scripts/docker-init.php } function migrateDatabase() diff --git a/images/14.0.5-php7.4/Dockerfile b/images/14.0.5-php7.4/Dockerfile index 2faa2c5..3e52b2d 100644 --- a/images/14.0.5-php7.4/Dockerfile +++ b/images/14.0.5-php7.4/Dockerfile @@ -85,6 +85,7 @@ EXPOSE 80 VOLUME /var/www/documents VOLUME /var/www/html/custom +COPY docker-init.php /var/www/scripts/ COPY docker-run.sh /usr/local/bin/ ENTRYPOINT ["docker-run.sh"] diff --git a/images/14.0.5-php7.4/docker-init.php b/images/14.0.5-php7.4/docker-init.php new file mode 100644 index 0000000..dc0dea8 --- /dev/null +++ b/images/14.0.5-php7.4/docker-init.php @@ -0,0 +1,6 @@ +#!/usr/bin/env php +init(); diff --git a/images/14.0.5-php7.4/docker-run.sh b/images/14.0.5-php7.4/docker-run.sh index 427bb06..4624e60 100755 --- a/images/14.0.5-php7.4/docker-run.sh +++ b/images/14.0.5-php7.4/docker-run.sh @@ -160,6 +160,9 @@ function initializeDatabase() mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('SYSTEMTOOLS_MYSQLDUMP', '/usr/bin/mysqldump', 'chaine', 0, '', 0);" > /dev/null 2>&1 + + echo "Enable user module ..." + php /var/www/scripts/docker-init.php } function migrateDatabase() diff --git a/images/15.0.3-php7.4/Dockerfile b/images/15.0.3-php7.4/Dockerfile index 6067698..3eac48c 100644 --- a/images/15.0.3-php7.4/Dockerfile +++ b/images/15.0.3-php7.4/Dockerfile @@ -85,6 +85,7 @@ EXPOSE 80 VOLUME /var/www/documents VOLUME /var/www/html/custom +COPY docker-init.php /var/www/scripts/ COPY docker-run.sh /usr/local/bin/ ENTRYPOINT ["docker-run.sh"] diff --git a/images/15.0.3-php7.4/docker-init.php b/images/15.0.3-php7.4/docker-init.php new file mode 100644 index 0000000..dc0dea8 --- /dev/null +++ b/images/15.0.3-php7.4/docker-init.php @@ -0,0 +1,6 @@ +#!/usr/bin/env php +init(); diff --git a/images/15.0.3-php7.4/docker-run.sh b/images/15.0.3-php7.4/docker-run.sh index 427bb06..4624e60 100755 --- a/images/15.0.3-php7.4/docker-run.sh +++ b/images/15.0.3-php7.4/docker-run.sh @@ -160,6 +160,9 @@ function initializeDatabase() mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('SYSTEMTOOLS_MYSQLDUMP', '/usr/bin/mysqldump', 'chaine', 0, '', 0);" > /dev/null 2>&1 + + echo "Enable user module ..." + php /var/www/scripts/docker-init.php } function migrateDatabase() diff --git a/images/16.0.5-php8.1/Dockerfile b/images/16.0.5-php8.1/Dockerfile index 557964c..1139e29 100644 --- a/images/16.0.5-php8.1/Dockerfile +++ b/images/16.0.5-php8.1/Dockerfile @@ -85,6 +85,7 @@ EXPOSE 80 VOLUME /var/www/documents VOLUME /var/www/html/custom +COPY docker-init.php /var/www/scripts/ COPY docker-run.sh /usr/local/bin/ ENTRYPOINT ["docker-run.sh"] diff --git a/images/16.0.5-php8.1/docker-init.php b/images/16.0.5-php8.1/docker-init.php new file mode 100644 index 0000000..dc0dea8 --- /dev/null +++ b/images/16.0.5-php8.1/docker-init.php @@ -0,0 +1,6 @@ +#!/usr/bin/env php +init(); diff --git a/images/16.0.5-php8.1/docker-run.sh b/images/16.0.5-php8.1/docker-run.sh index 427bb06..4624e60 100755 --- a/images/16.0.5-php8.1/docker-run.sh +++ b/images/16.0.5-php8.1/docker-run.sh @@ -160,6 +160,9 @@ function initializeDatabase() mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('SYSTEMTOOLS_MYSQLDUMP', '/usr/bin/mysqldump', 'chaine', 0, '', 0);" > /dev/null 2>&1 + + echo "Enable user module ..." + php /var/www/scripts/docker-init.php } function migrateDatabase() diff --git a/images/17.0.1-php8.1/Dockerfile b/images/17.0.1-php8.1/Dockerfile index 695ad1a..9644205 100644 --- a/images/17.0.1-php8.1/Dockerfile +++ b/images/17.0.1-php8.1/Dockerfile @@ -85,6 +85,7 @@ EXPOSE 80 VOLUME /var/www/documents VOLUME /var/www/html/custom +COPY docker-init.php /var/www/scripts/ COPY docker-run.sh /usr/local/bin/ ENTRYPOINT ["docker-run.sh"] diff --git a/images/17.0.1-php8.1/docker-init.php b/images/17.0.1-php8.1/docker-init.php new file mode 100644 index 0000000..dc0dea8 --- /dev/null +++ b/images/17.0.1-php8.1/docker-init.php @@ -0,0 +1,6 @@ +#!/usr/bin/env php +init(); diff --git a/images/17.0.1-php8.1/docker-run.sh b/images/17.0.1-php8.1/docker-run.sh index 427bb06..4624e60 100755 --- a/images/17.0.1-php8.1/docker-run.sh +++ b/images/17.0.1-php8.1/docker-run.sh @@ -160,6 +160,9 @@ function initializeDatabase() mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('SYSTEMTOOLS_MYSQLDUMP', '/usr/bin/mysqldump', 'chaine', 0, '', 0);" > /dev/null 2>&1 + + echo "Enable user module ..." + php /var/www/scripts/docker-init.php } function migrateDatabase() diff --git a/images/develop/Dockerfile b/images/develop/Dockerfile index 95dad94..c79bc2b 100644 --- a/images/develop/Dockerfile +++ b/images/develop/Dockerfile @@ -85,6 +85,7 @@ EXPOSE 80 VOLUME /var/www/documents VOLUME /var/www/html/custom +COPY docker-init.php /var/www/scripts/ COPY docker-run.sh /usr/local/bin/ ENTRYPOINT ["docker-run.sh"] diff --git a/images/develop/docker-init.php b/images/develop/docker-init.php new file mode 100644 index 0000000..dc0dea8 --- /dev/null +++ b/images/develop/docker-init.php @@ -0,0 +1,6 @@ +#!/usr/bin/env php +init(); diff --git a/images/develop/docker-run.sh b/images/develop/docker-run.sh index 427bb06..4624e60 100755 --- a/images/develop/docker-run.sh +++ b/images/develop/docker-run.sh @@ -160,6 +160,9 @@ function initializeDatabase() mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('SYSTEMTOOLS_MYSQLDUMP', '/usr/bin/mysqldump', 'chaine', 0, '', 0);" > /dev/null 2>&1 + + echo "Enable user module ..." + php /var/www/scripts/docker-init.php } function migrateDatabase() diff --git a/update.sh b/update.sh index da7f2ad..8eebec3 100755 --- a/update.sh +++ b/update.sh @@ -58,6 +58,7 @@ for dolibarrVersion in "${DOLIBARR_VERSIONS[@]}"; do sed 's/%DOLI_VERSION%/'"${dolibarrVersion}"'/;' \ > "${dir}/Dockerfile" + cp "${BASE_DIR}/docker-init.php" "${dir}/docker-init.php" cp "${BASE_DIR}/docker-run.sh" "${dir}/docker-run.sh" if [ "${DOCKER_BUILD}" = "1" ]; then From 0c439499d839e181d8743602c48a2508069021ee Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Sat, 13 May 2023 10:30:41 +0200 Subject: [PATCH 11/24] Add docker compose plugin support --- test.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/test.sh b/test.sh index 20ccab4..cd31f76 100755 --- a/test.sh +++ b/test.sh @@ -23,20 +23,26 @@ for directory in $(find "${BASE_DIR}/images" -maxdepth 1 -mindepth 1 -type d -pr fi done +if which docker-compose > /dev/null; then + dockerComposeBin="docker-compose" +else + dockerComposeBin="docker compose" +fi + echo "Testing for:" echo " - Dolibarr ${DOLI_VER}" if [ "${PHP_VER}" = "" ]; then echo " - PHP most recent" echo "Building image ..." - DOLI_VERSION=${DOLI_VER} PHP_VERSION="" docker-compose -f "${BASE_DIR}/docker-compose.yml" down 1> /dev/null 2>/dev/null - DOLI_VERSION=${DOLI_VER} PHP_VERSION="" docker-compose -f "${BASE_DIR}/docker-compose.yml" build web - DOLI_VERSION=${DOLI_VER} PHP_VERSION="" docker-compose -f "${BASE_DIR}/docker-compose.yml" up --force-recreate web cron - DOLI_VERSION=${DOLI_VER} PHP_VERSION="" docker-compose -f "${BASE_DIR}/docker-compose.yml" down + DOLI_VERSION=${DOLI_VER} PHP_VERSION="" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" down 1> /dev/null 2>/dev/null + DOLI_VERSION=${DOLI_VER} PHP_VERSION="" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" build web + DOLI_VERSION=${DOLI_VER} PHP_VERSION="" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" up --force-recreate web cron + DOLI_VERSION=${DOLI_VER} PHP_VERSION="" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" down else echo " - PHP ${PHP_VER}" echo "Building image ..." - DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" docker-compose -f "${BASE_DIR}/docker-compose.yml" down 1> /dev/null - DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" docker-compose -f "${BASE_DIR}/docker-compose.yml" build web - DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" docker-compose -f "${BASE_DIR}/docker-compose.yml" up --force-recreate web cron - DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" docker-compose -f "${BASE_DIR}/docker-compose.yml" down + DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" down 1> /dev/null + DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" build web + DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" up --force-recreate web cron + DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" down fi From eb5e44feb939401ffa1b047f583f39c2dcb5803d Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Wed, 31 May 2023 08:09:50 +0200 Subject: [PATCH 12/24] Add doli 17.0.2 --- README.md | 2 +- images/{17.0.1-php8.1 => 17.0.2-php8.1}/Dockerfile | 2 +- images/{17.0.1-php8.1 => 17.0.2-php8.1}/docker-init.php | 0 images/{17.0.1-php8.1 => 17.0.2-php8.1}/docker-run.sh | 0 versions.sh | 4 ++-- 5 files changed, 4 insertions(+), 4 deletions(-) rename images/{17.0.1-php8.1 => 17.0.2-php8.1}/Dockerfile (99%) rename images/{17.0.1-php8.1 => 17.0.2-php8.1}/docker-init.php (100%) rename images/{17.0.1-php8.1 => 17.0.2-php8.1}/docker-run.sh (100%) diff --git a/README.md b/README.md index 18a323c..fc79f60 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Docker image for Dolibarr with auto installer on first boot. * 14.0.5-php7.4 14.0.5 14 * 15.0.3-php7.4 15.0.3 15 * 16.0.5-php8.1 16.0.5 16 -* 17.0.1-php8.1 17.0.1 17 latest +* 17.0.2-php8.1 17.0.2 17 latest * develop **End of support for PHP < 7.4** diff --git a/images/17.0.1-php8.1/Dockerfile b/images/17.0.2-php8.1/Dockerfile similarity index 99% rename from images/17.0.1-php8.1/Dockerfile rename to images/17.0.2-php8.1/Dockerfile index 9644205..d6870d5 100644 --- a/images/17.0.1-php8.1/Dockerfile +++ b/images/17.0.2-php8.1/Dockerfile @@ -4,7 +4,7 @@ FROM ${ARCH}php:8.1-apache-buster LABEL maintainer="Garcia MICHEL " -ENV DOLI_VERSION 17.0.1 +ENV DOLI_VERSION 17.0.2 ENV DOLI_INSTALL_AUTO 1 ENV DOLI_DB_TYPE mysqli diff --git a/images/17.0.1-php8.1/docker-init.php b/images/17.0.2-php8.1/docker-init.php similarity index 100% rename from images/17.0.1-php8.1/docker-init.php rename to images/17.0.2-php8.1/docker-init.php diff --git a/images/17.0.1-php8.1/docker-run.sh b/images/17.0.2-php8.1/docker-run.sh similarity index 100% rename from images/17.0.1-php8.1/docker-run.sh rename to images/17.0.2-php8.1/docker-run.sh diff --git a/versions.sh b/versions.sh index 6fcb4a8..e870ddc 100644 --- a/versions.sh +++ b/versions.sh @@ -2,5 +2,5 @@ set -e -DOLIBARR_VERSIONS=( "11.0.5" "12.0.5" "13.0.4" "14.0.5" "15.0.3" "16.0.5" "17.0.1" "develop" ) -DOLIBARR_LATEST_TAG="17.0.1" +DOLIBARR_VERSIONS=( "11.0.5" "12.0.5" "13.0.4" "14.0.5" "15.0.3" "16.0.5" "17.0.2" "develop" ) +DOLIBARR_LATEST_TAG="17.0.2" From ae48687b0f28edd0d1269dec6048a99fbb2659ed Mon Sep 17 00:00:00 2001 From: Thomas Couacault Date: Wed, 14 Jun 2023 19:12:36 +0200 Subject: [PATCH 13/24] fix: Set database image as mysql in with-mysql example (#124) --- examples/with-mysql/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/with-mysql/docker-compose.yml b/examples/with-mysql/docker-compose.yml index e1b0318..d077471 100644 --- a/examples/with-mysql/docker-compose.yml +++ b/examples/with-mysql/docker-compose.yml @@ -32,7 +32,7 @@ services: - external-pod mysql: - image: library/mariadb:latest + image: mysql:latest environment: MYSQL_DATABASE: "dolibarr" MYSQL_USER: "dolibarr" From 437df7c5c8445041e81d2368daf60364cfcc06dd Mon Sep 17 00:00:00 2001 From: Adrian Bach <65734063+realDayaa@users.noreply.github.com> Date: Wed, 28 Jun 2023 21:14:46 +0200 Subject: [PATCH 14/24] Address security concerns (#126) * fix: address some security concerns * feat: add new DOLI_PROD env variable --- Dockerfile.template | 1 + README.md | 1 + README.template | 1 + docker-run.sh | 4 ++++ images/11.0.5-php7.4/Dockerfile | 1 + images/11.0.5-php7.4/docker-run.sh | 4 ++++ images/12.0.5-php7.4/Dockerfile | 1 + images/12.0.5-php7.4/docker-run.sh | 4 ++++ images/13.0.4-php7.4/Dockerfile | 1 + images/13.0.4-php7.4/docker-run.sh | 4 ++++ images/14.0.5-php7.4/Dockerfile | 1 + images/14.0.5-php7.4/docker-run.sh | 4 ++++ images/15.0.3-php7.4/Dockerfile | 1 + images/15.0.3-php7.4/docker-run.sh | 4 ++++ images/16.0.5-php8.1/Dockerfile | 1 + images/16.0.5-php8.1/docker-run.sh | 4 ++++ images/17.0.2-php8.1/Dockerfile | 1 + images/17.0.2-php8.1/docker-run.sh | 4 ++++ images/develop/Dockerfile | 1 + images/develop/docker-run.sh | 4 ++++ 20 files changed, 47 insertions(+) diff --git a/Dockerfile.template b/Dockerfile.template index 8ff376c..29455c9 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -6,6 +6,7 @@ LABEL maintainer="Garcia MICHEL " ENV DOLI_VERSION %DOLI_VERSION% ENV DOLI_INSTALL_AUTO 1 +ENV DOLI_PROD 1 ENV DOLI_DB_TYPE mysqli ENV DOLI_DB_HOST mysql diff --git a/README.md b/README.md index fc79f60..543f8c6 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ When setup this way, to upgrade version the use of the web interface is mandator | Variable | Default value | Description | | ------------------------------- | ------------------------------ | ----------- | | **DOLI_INSTALL_AUTO** | *1* | 1: The installation will be executed on first boot +| **DOLI_PROD** | *1* | 1: Dolibarr will be run in production mode | **DOLI_DB_TYPE** | *mysqli* | Type of the DB server (**mysqli**, pgsql) | **DOLI_DB_HOST** | *mysql* | Host name of the MariaDB/MySQL server | **DOLI_DB_HOST_PORT** | *3306* | Host port of the MariaDB/MySQL server diff --git a/README.template b/README.template index 974502e..ef1ce0c 100644 --- a/README.template +++ b/README.template @@ -87,6 +87,7 @@ When setup this way, to upgrade version the use of the web interface is mandator | Variable | Default value | Description | | ------------------------------- | ------------------------------ | ----------- | | **DOLI_INSTALL_AUTO** | *1* | 1: The installation will be executed on first boot +| **DOLI_PROD** | *1* | 1: Dolibarr will be run in production mode | **DOLI_DB_TYPE** | *mysqli* | Type of the DB server (**mysqli**, pgsql) | **DOLI_DB_HOST** | *mysql* | Host name of the MariaDB/MySQL server | **DOLI_DB_HOST_PORT** | *3306* | Host port of the MariaDB/MySQL server diff --git a/docker-run.sh b/docker-run.sh index 8aa7db3..ca8d5f5 100755 --- a/docker-run.sh +++ b/docker-run.sh @@ -44,6 +44,9 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} +allow_url_fopen = 0 +session.use_strict_mode = 1 +disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then @@ -63,6 +66,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_db_pass='${DOLI_DB_PASSWORD}'; \$dolibarr_main_db_type='${DOLI_DB_TYPE}'; \$dolibarr_main_authentication='${DOLI_AUTH}'; +\$dolibarr_main_prod=${DOLI_PROD}; EOF if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." diff --git a/images/11.0.5-php7.4/Dockerfile b/images/11.0.5-php7.4/Dockerfile index ffd9f10..8b3c3f9 100644 --- a/images/11.0.5-php7.4/Dockerfile +++ b/images/11.0.5-php7.4/Dockerfile @@ -6,6 +6,7 @@ LABEL maintainer="Garcia MICHEL " ENV DOLI_VERSION 11.0.5 ENV DOLI_INSTALL_AUTO 1 +ENV DOLI_PROD 1 ENV DOLI_DB_TYPE mysqli ENV DOLI_DB_HOST mysql diff --git a/images/11.0.5-php7.4/docker-run.sh b/images/11.0.5-php7.4/docker-run.sh index 8aa7db3..ca8d5f5 100755 --- a/images/11.0.5-php7.4/docker-run.sh +++ b/images/11.0.5-php7.4/docker-run.sh @@ -44,6 +44,9 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} +allow_url_fopen = 0 +session.use_strict_mode = 1 +disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then @@ -63,6 +66,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_db_pass='${DOLI_DB_PASSWORD}'; \$dolibarr_main_db_type='${DOLI_DB_TYPE}'; \$dolibarr_main_authentication='${DOLI_AUTH}'; +\$dolibarr_main_prod=${DOLI_PROD}; EOF if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." diff --git a/images/12.0.5-php7.4/Dockerfile b/images/12.0.5-php7.4/Dockerfile index a437d4c..f5ff07f 100644 --- a/images/12.0.5-php7.4/Dockerfile +++ b/images/12.0.5-php7.4/Dockerfile @@ -6,6 +6,7 @@ LABEL maintainer="Garcia MICHEL " ENV DOLI_VERSION 12.0.5 ENV DOLI_INSTALL_AUTO 1 +ENV DOLI_PROD 1 ENV DOLI_DB_TYPE mysqli ENV DOLI_DB_HOST mysql diff --git a/images/12.0.5-php7.4/docker-run.sh b/images/12.0.5-php7.4/docker-run.sh index 8aa7db3..ca8d5f5 100755 --- a/images/12.0.5-php7.4/docker-run.sh +++ b/images/12.0.5-php7.4/docker-run.sh @@ -44,6 +44,9 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} +allow_url_fopen = 0 +session.use_strict_mode = 1 +disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then @@ -63,6 +66,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_db_pass='${DOLI_DB_PASSWORD}'; \$dolibarr_main_db_type='${DOLI_DB_TYPE}'; \$dolibarr_main_authentication='${DOLI_AUTH}'; +\$dolibarr_main_prod=${DOLI_PROD}; EOF if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." diff --git a/images/13.0.4-php7.4/Dockerfile b/images/13.0.4-php7.4/Dockerfile index 5ea827d..94df2d4 100644 --- a/images/13.0.4-php7.4/Dockerfile +++ b/images/13.0.4-php7.4/Dockerfile @@ -6,6 +6,7 @@ LABEL maintainer="Garcia MICHEL " ENV DOLI_VERSION 13.0.4 ENV DOLI_INSTALL_AUTO 1 +ENV DOLI_PROD 1 ENV DOLI_DB_TYPE mysqli ENV DOLI_DB_HOST mysql diff --git a/images/13.0.4-php7.4/docker-run.sh b/images/13.0.4-php7.4/docker-run.sh index 8aa7db3..ca8d5f5 100755 --- a/images/13.0.4-php7.4/docker-run.sh +++ b/images/13.0.4-php7.4/docker-run.sh @@ -44,6 +44,9 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} +allow_url_fopen = 0 +session.use_strict_mode = 1 +disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then @@ -63,6 +66,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_db_pass='${DOLI_DB_PASSWORD}'; \$dolibarr_main_db_type='${DOLI_DB_TYPE}'; \$dolibarr_main_authentication='${DOLI_AUTH}'; +\$dolibarr_main_prod=${DOLI_PROD}; EOF if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." diff --git a/images/14.0.5-php7.4/Dockerfile b/images/14.0.5-php7.4/Dockerfile index 3e52b2d..94cca1f 100644 --- a/images/14.0.5-php7.4/Dockerfile +++ b/images/14.0.5-php7.4/Dockerfile @@ -6,6 +6,7 @@ LABEL maintainer="Garcia MICHEL " ENV DOLI_VERSION 14.0.5 ENV DOLI_INSTALL_AUTO 1 +ENV DOLI_PROD 1 ENV DOLI_DB_TYPE mysqli ENV DOLI_DB_HOST mysql diff --git a/images/14.0.5-php7.4/docker-run.sh b/images/14.0.5-php7.4/docker-run.sh index 8aa7db3..ca8d5f5 100755 --- a/images/14.0.5-php7.4/docker-run.sh +++ b/images/14.0.5-php7.4/docker-run.sh @@ -44,6 +44,9 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} +allow_url_fopen = 0 +session.use_strict_mode = 1 +disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then @@ -63,6 +66,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_db_pass='${DOLI_DB_PASSWORD}'; \$dolibarr_main_db_type='${DOLI_DB_TYPE}'; \$dolibarr_main_authentication='${DOLI_AUTH}'; +\$dolibarr_main_prod=${DOLI_PROD}; EOF if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." diff --git a/images/15.0.3-php7.4/Dockerfile b/images/15.0.3-php7.4/Dockerfile index 3eac48c..c9c1ddb 100644 --- a/images/15.0.3-php7.4/Dockerfile +++ b/images/15.0.3-php7.4/Dockerfile @@ -6,6 +6,7 @@ LABEL maintainer="Garcia MICHEL " ENV DOLI_VERSION 15.0.3 ENV DOLI_INSTALL_AUTO 1 +ENV DOLI_PROD 1 ENV DOLI_DB_TYPE mysqli ENV DOLI_DB_HOST mysql diff --git a/images/15.0.3-php7.4/docker-run.sh b/images/15.0.3-php7.4/docker-run.sh index 8aa7db3..ca8d5f5 100755 --- a/images/15.0.3-php7.4/docker-run.sh +++ b/images/15.0.3-php7.4/docker-run.sh @@ -44,6 +44,9 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} +allow_url_fopen = 0 +session.use_strict_mode = 1 +disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then @@ -63,6 +66,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_db_pass='${DOLI_DB_PASSWORD}'; \$dolibarr_main_db_type='${DOLI_DB_TYPE}'; \$dolibarr_main_authentication='${DOLI_AUTH}'; +\$dolibarr_main_prod=${DOLI_PROD}; EOF if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." diff --git a/images/16.0.5-php8.1/Dockerfile b/images/16.0.5-php8.1/Dockerfile index 1139e29..6507065 100644 --- a/images/16.0.5-php8.1/Dockerfile +++ b/images/16.0.5-php8.1/Dockerfile @@ -6,6 +6,7 @@ LABEL maintainer="Garcia MICHEL " ENV DOLI_VERSION 16.0.5 ENV DOLI_INSTALL_AUTO 1 +ENV DOLI_PROD 1 ENV DOLI_DB_TYPE mysqli ENV DOLI_DB_HOST mysql diff --git a/images/16.0.5-php8.1/docker-run.sh b/images/16.0.5-php8.1/docker-run.sh index 8aa7db3..ca8d5f5 100755 --- a/images/16.0.5-php8.1/docker-run.sh +++ b/images/16.0.5-php8.1/docker-run.sh @@ -44,6 +44,9 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} +allow_url_fopen = 0 +session.use_strict_mode = 1 +disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then @@ -63,6 +66,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_db_pass='${DOLI_DB_PASSWORD}'; \$dolibarr_main_db_type='${DOLI_DB_TYPE}'; \$dolibarr_main_authentication='${DOLI_AUTH}'; +\$dolibarr_main_prod=${DOLI_PROD}; EOF if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." diff --git a/images/17.0.2-php8.1/Dockerfile b/images/17.0.2-php8.1/Dockerfile index d6870d5..b2a6441 100644 --- a/images/17.0.2-php8.1/Dockerfile +++ b/images/17.0.2-php8.1/Dockerfile @@ -6,6 +6,7 @@ LABEL maintainer="Garcia MICHEL " ENV DOLI_VERSION 17.0.2 ENV DOLI_INSTALL_AUTO 1 +ENV DOLI_PROD 1 ENV DOLI_DB_TYPE mysqli ENV DOLI_DB_HOST mysql diff --git a/images/17.0.2-php8.1/docker-run.sh b/images/17.0.2-php8.1/docker-run.sh index 8aa7db3..ca8d5f5 100755 --- a/images/17.0.2-php8.1/docker-run.sh +++ b/images/17.0.2-php8.1/docker-run.sh @@ -44,6 +44,9 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} +allow_url_fopen = 0 +session.use_strict_mode = 1 +disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then @@ -63,6 +66,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_db_pass='${DOLI_DB_PASSWORD}'; \$dolibarr_main_db_type='${DOLI_DB_TYPE}'; \$dolibarr_main_authentication='${DOLI_AUTH}'; +\$dolibarr_main_prod=${DOLI_PROD}; EOF if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." diff --git a/images/develop/Dockerfile b/images/develop/Dockerfile index c79bc2b..d5f5a76 100644 --- a/images/develop/Dockerfile +++ b/images/develop/Dockerfile @@ -6,6 +6,7 @@ LABEL maintainer="Garcia MICHEL " ENV DOLI_VERSION develop ENV DOLI_INSTALL_AUTO 1 +ENV DOLI_PROD 1 ENV DOLI_DB_TYPE mysqli ENV DOLI_DB_HOST mysql diff --git a/images/develop/docker-run.sh b/images/develop/docker-run.sh index 8aa7db3..ca8d5f5 100755 --- a/images/develop/docker-run.sh +++ b/images/develop/docker-run.sh @@ -44,6 +44,9 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} +allow_url_fopen = 0 +session.use_strict_mode = 1 +disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF if [[ ! -f /var/www/html/conf/conf.php ]]; then @@ -63,6 +66,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_db_pass='${DOLI_DB_PASSWORD}'; \$dolibarr_main_db_type='${DOLI_DB_TYPE}'; \$dolibarr_main_authentication='${DOLI_AUTH}'; +\$dolibarr_main_prod=${DOLI_PROD}; EOF if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." From caf7fbdd48dfd0864ba9cef8a60ac21a61a1d643 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Wed, 12 Jul 2023 21:21:33 +0200 Subject: [PATCH 15/24] Allow custom php allow_url_fopen conf --- Dockerfile.template | 1 + README.md | 1 + README.template | 1 + docker-run.sh | 2 +- images/11.0.5-php7.4/Dockerfile | 1 + images/11.0.5-php7.4/docker-run.sh | 2 +- images/12.0.5-php7.4/Dockerfile | 1 + images/12.0.5-php7.4/docker-run.sh | 2 +- images/13.0.4-php7.4/Dockerfile | 1 + images/13.0.4-php7.4/docker-run.sh | 2 +- images/14.0.5-php7.4/Dockerfile | 1 + images/14.0.5-php7.4/docker-run.sh | 2 +- images/15.0.3-php7.4/Dockerfile | 1 + images/15.0.3-php7.4/docker-run.sh | 2 +- images/16.0.5-php8.1/Dockerfile | 1 + images/16.0.5-php8.1/docker-run.sh | 2 +- images/17.0.2-php8.1/Dockerfile | 1 + images/17.0.2-php8.1/docker-run.sh | 2 +- images/develop/Dockerfile | 1 + images/develop/docker-run.sh | 2 +- 20 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Dockerfile.template b/Dockerfile.template index 29455c9..ef00e96 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -37,6 +37,7 @@ ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +ENV PHP_INI_ALLOW_URL_FOPEN 0 RUN sed -i \ -e 's/^\(ServerSignature On\)$/#\1/g' \ diff --git a/README.md b/README.md index 543f8c6..d37fe7b 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ When setup this way, to upgrade version the use of the web interface is mandator | **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit | **PHP_INI_UPLOAD_MAX_FILESIZE** | *2M* | PHP Maximum allowed size for uploaded files | **PHP_INI_POST_MAX_SIZE** | *8M* | PHP Maximum size of POST data that PHP will accept. +| **PHP_INI_ALLOW_URL_FOPEN** | *0* | Allow URL-aware fopen wrappers | **WWW_USER_ID** | | ID of user www-data. ID will not changed if leave empty. During a development, it is very practical to put the same ID as the host user. | **WWW_GROUP_ID** | | ID of group www-data. ID will not changed if leave empty. | **DOLI_AUTH** | *dolibarr* | Which method is used to connect users, change to `ldap` or `ldap, dolibarr` to use LDAP diff --git a/README.template b/README.template index ef1ce0c..a408a7b 100644 --- a/README.template +++ b/README.template @@ -101,6 +101,7 @@ When setup this way, to upgrade version the use of the web interface is mandator | **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit | **PHP_INI_UPLOAD_MAX_FILESIZE** | *2M* | PHP Maximum allowed size for uploaded files | **PHP_INI_POST_MAX_SIZE** | *8M* | PHP Maximum size of POST data that PHP will accept. +| **PHP_INI_ALLOW_URL_FOPEN** | *0* | Allow URL-aware fopen wrappers | **WWW_USER_ID** | | ID of user www-data. ID will not changed if leave empty. During a development, it is very practical to put the same ID as the host user. | **WWW_GROUP_ID** | | ID of group www-data. ID will not changed if leave empty. | **DOLI_AUTH** | *dolibarr* | Which method is used to connect users, change to `ldap` or `ldap, dolibarr` to use LDAP diff --git a/docker-run.sh b/docker-run.sh index ca8d5f5..e2a2794 100755 --- a/docker-run.sh +++ b/docker-run.sh @@ -44,7 +44,7 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} -allow_url_fopen = 0 +allow_url_fopen = ${PHP_INI_ALLOW_URL_FOPEN} session.use_strict_mode = 1 disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF diff --git a/images/11.0.5-php7.4/Dockerfile b/images/11.0.5-php7.4/Dockerfile index 8b3c3f9..a50c6fd 100644 --- a/images/11.0.5-php7.4/Dockerfile +++ b/images/11.0.5-php7.4/Dockerfile @@ -37,6 +37,7 @@ ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +ENV PHP_INI_ALLOW_URL_FOPEN 0 RUN sed -i \ -e 's/^\(ServerSignature On\)$/#\1/g' \ diff --git a/images/11.0.5-php7.4/docker-run.sh b/images/11.0.5-php7.4/docker-run.sh index ca8d5f5..e2a2794 100755 --- a/images/11.0.5-php7.4/docker-run.sh +++ b/images/11.0.5-php7.4/docker-run.sh @@ -44,7 +44,7 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} -allow_url_fopen = 0 +allow_url_fopen = ${PHP_INI_ALLOW_URL_FOPEN} session.use_strict_mode = 1 disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF diff --git a/images/12.0.5-php7.4/Dockerfile b/images/12.0.5-php7.4/Dockerfile index f5ff07f..a2dc759 100644 --- a/images/12.0.5-php7.4/Dockerfile +++ b/images/12.0.5-php7.4/Dockerfile @@ -37,6 +37,7 @@ ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +ENV PHP_INI_ALLOW_URL_FOPEN 0 RUN sed -i \ -e 's/^\(ServerSignature On\)$/#\1/g' \ diff --git a/images/12.0.5-php7.4/docker-run.sh b/images/12.0.5-php7.4/docker-run.sh index ca8d5f5..e2a2794 100755 --- a/images/12.0.5-php7.4/docker-run.sh +++ b/images/12.0.5-php7.4/docker-run.sh @@ -44,7 +44,7 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} -allow_url_fopen = 0 +allow_url_fopen = ${PHP_INI_ALLOW_URL_FOPEN} session.use_strict_mode = 1 disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF diff --git a/images/13.0.4-php7.4/Dockerfile b/images/13.0.4-php7.4/Dockerfile index 94df2d4..f0c975a 100644 --- a/images/13.0.4-php7.4/Dockerfile +++ b/images/13.0.4-php7.4/Dockerfile @@ -37,6 +37,7 @@ ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +ENV PHP_INI_ALLOW_URL_FOPEN 0 RUN sed -i \ -e 's/^\(ServerSignature On\)$/#\1/g' \ diff --git a/images/13.0.4-php7.4/docker-run.sh b/images/13.0.4-php7.4/docker-run.sh index ca8d5f5..e2a2794 100755 --- a/images/13.0.4-php7.4/docker-run.sh +++ b/images/13.0.4-php7.4/docker-run.sh @@ -44,7 +44,7 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} -allow_url_fopen = 0 +allow_url_fopen = ${PHP_INI_ALLOW_URL_FOPEN} session.use_strict_mode = 1 disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF diff --git a/images/14.0.5-php7.4/Dockerfile b/images/14.0.5-php7.4/Dockerfile index 94cca1f..7f4d779 100644 --- a/images/14.0.5-php7.4/Dockerfile +++ b/images/14.0.5-php7.4/Dockerfile @@ -37,6 +37,7 @@ ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +ENV PHP_INI_ALLOW_URL_FOPEN 0 RUN sed -i \ -e 's/^\(ServerSignature On\)$/#\1/g' \ diff --git a/images/14.0.5-php7.4/docker-run.sh b/images/14.0.5-php7.4/docker-run.sh index ca8d5f5..e2a2794 100755 --- a/images/14.0.5-php7.4/docker-run.sh +++ b/images/14.0.5-php7.4/docker-run.sh @@ -44,7 +44,7 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} -allow_url_fopen = 0 +allow_url_fopen = ${PHP_INI_ALLOW_URL_FOPEN} session.use_strict_mode = 1 disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF diff --git a/images/15.0.3-php7.4/Dockerfile b/images/15.0.3-php7.4/Dockerfile index c9c1ddb..74d3a01 100644 --- a/images/15.0.3-php7.4/Dockerfile +++ b/images/15.0.3-php7.4/Dockerfile @@ -37,6 +37,7 @@ ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +ENV PHP_INI_ALLOW_URL_FOPEN 0 RUN sed -i \ -e 's/^\(ServerSignature On\)$/#\1/g' \ diff --git a/images/15.0.3-php7.4/docker-run.sh b/images/15.0.3-php7.4/docker-run.sh index ca8d5f5..e2a2794 100755 --- a/images/15.0.3-php7.4/docker-run.sh +++ b/images/15.0.3-php7.4/docker-run.sh @@ -44,7 +44,7 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} -allow_url_fopen = 0 +allow_url_fopen = ${PHP_INI_ALLOW_URL_FOPEN} session.use_strict_mode = 1 disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF diff --git a/images/16.0.5-php8.1/Dockerfile b/images/16.0.5-php8.1/Dockerfile index 6507065..551fff6 100644 --- a/images/16.0.5-php8.1/Dockerfile +++ b/images/16.0.5-php8.1/Dockerfile @@ -37,6 +37,7 @@ ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +ENV PHP_INI_ALLOW_URL_FOPEN 0 RUN sed -i \ -e 's/^\(ServerSignature On\)$/#\1/g' \ diff --git a/images/16.0.5-php8.1/docker-run.sh b/images/16.0.5-php8.1/docker-run.sh index ca8d5f5..e2a2794 100755 --- a/images/16.0.5-php8.1/docker-run.sh +++ b/images/16.0.5-php8.1/docker-run.sh @@ -44,7 +44,7 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} -allow_url_fopen = 0 +allow_url_fopen = ${PHP_INI_ALLOW_URL_FOPEN} session.use_strict_mode = 1 disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF diff --git a/images/17.0.2-php8.1/Dockerfile b/images/17.0.2-php8.1/Dockerfile index b2a6441..a039143 100644 --- a/images/17.0.2-php8.1/Dockerfile +++ b/images/17.0.2-php8.1/Dockerfile @@ -37,6 +37,7 @@ ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +ENV PHP_INI_ALLOW_URL_FOPEN 0 RUN sed -i \ -e 's/^\(ServerSignature On\)$/#\1/g' \ diff --git a/images/17.0.2-php8.1/docker-run.sh b/images/17.0.2-php8.1/docker-run.sh index ca8d5f5..e2a2794 100755 --- a/images/17.0.2-php8.1/docker-run.sh +++ b/images/17.0.2-php8.1/docker-run.sh @@ -44,7 +44,7 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} -allow_url_fopen = 0 +allow_url_fopen = ${PHP_INI_ALLOW_URL_FOPEN} session.use_strict_mode = 1 disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF diff --git a/images/develop/Dockerfile b/images/develop/Dockerfile index d5f5a76..4d54df5 100644 --- a/images/develop/Dockerfile +++ b/images/develop/Dockerfile @@ -37,6 +37,7 @@ ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_MEMORY_LIMIT 256M ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M ENV PHP_INI_POST_MAX_SIZE 8M +ENV PHP_INI_ALLOW_URL_FOPEN 0 RUN sed -i \ -e 's/^\(ServerSignature On\)$/#\1/g' \ diff --git a/images/develop/docker-run.sh b/images/develop/docker-run.sh index ca8d5f5..e2a2794 100755 --- a/images/develop/docker-run.sh +++ b/images/develop/docker-run.sh @@ -44,7 +44,7 @@ sendmail_path = /usr/sbin/sendmail -t -i memory_limit = ${PHP_INI_MEMORY_LIMIT} upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} post_max_size = ${PHP_INI_POST_MAX_SIZE} -allow_url_fopen = 0 +allow_url_fopen = ${PHP_INI_ALLOW_URL_FOPEN} session.use_strict_mode = 1 disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen EOF From eb39763e5bcc675a558b05f81bd90010445d9242 Mon Sep 17 00:00:00 2001 From: Adrian Bach Date: Fri, 11 Aug 2023 13:54:18 +0200 Subject: [PATCH 16/24] feat: update to version 17.0.3 --- README.md | 2 +- images/{17.0.2-php8.1 => 17.0.3-php8.1}/Dockerfile | 2 +- images/{17.0.2-php8.1 => 17.0.3-php8.1}/docker-init.php | 0 images/{17.0.2-php8.1 => 17.0.3-php8.1}/docker-run.sh | 0 versions.sh | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) rename images/{17.0.2-php8.1 => 17.0.3-php8.1}/Dockerfile (99%) rename images/{17.0.2-php8.1 => 17.0.3-php8.1}/docker-init.php (100%) rename images/{17.0.2-php8.1 => 17.0.3-php8.1}/docker-run.sh (100%) mode change 100755 => 100644 diff --git a/README.md b/README.md index d37fe7b..4981bef 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Docker image for Dolibarr with auto installer on first boot. * 14.0.5-php7.4 14.0.5 14 * 15.0.3-php7.4 15.0.3 15 * 16.0.5-php8.1 16.0.5 16 -* 17.0.2-php8.1 17.0.2 17 latest +* 17.0.3-php8.1 17.0.3 17 * develop **End of support for PHP < 7.4** diff --git a/images/17.0.2-php8.1/Dockerfile b/images/17.0.3-php8.1/Dockerfile similarity index 99% rename from images/17.0.2-php8.1/Dockerfile rename to images/17.0.3-php8.1/Dockerfile index a039143..ba6563e 100644 --- a/images/17.0.2-php8.1/Dockerfile +++ b/images/17.0.3-php8.1/Dockerfile @@ -4,7 +4,7 @@ FROM ${ARCH}php:8.1-apache-buster LABEL maintainer="Garcia MICHEL " -ENV DOLI_VERSION 17.0.2 +ENV DOLI_VERSION 17.0.3 ENV DOLI_INSTALL_AUTO 1 ENV DOLI_PROD 1 diff --git a/images/17.0.2-php8.1/docker-init.php b/images/17.0.3-php8.1/docker-init.php similarity index 100% rename from images/17.0.2-php8.1/docker-init.php rename to images/17.0.3-php8.1/docker-init.php diff --git a/images/17.0.2-php8.1/docker-run.sh b/images/17.0.3-php8.1/docker-run.sh old mode 100755 new mode 100644 similarity index 100% rename from images/17.0.2-php8.1/docker-run.sh rename to images/17.0.3-php8.1/docker-run.sh diff --git a/versions.sh b/versions.sh index e870ddc..591ebfa 100644 --- a/versions.sh +++ b/versions.sh @@ -2,5 +2,5 @@ set -e -DOLIBARR_VERSIONS=( "11.0.5" "12.0.5" "13.0.4" "14.0.5" "15.0.3" "16.0.5" "17.0.2" "develop" ) +DOLIBARR_VERSIONS=( "11.0.5" "12.0.5" "13.0.4" "14.0.5" "15.0.3" "16.0.5" "17.0.3" "develop" ) DOLIBARR_LATEST_TAG="17.0.2" From f798337ce2caf8db1940be9d7f374b2cbaa27c49 Mon Sep 17 00:00:00 2001 From: Adrian Bach Date: Fri, 11 Aug 2023 13:56:57 +0200 Subject: [PATCH 17/24] fix: restore latest tag --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4981bef..3b0ead7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Docker image for Dolibarr with auto installer on first boot. * 14.0.5-php7.4 14.0.5 14 * 15.0.3-php7.4 15.0.3 15 * 16.0.5-php8.1 16.0.5 16 -* 17.0.3-php8.1 17.0.3 17 +* 17.0.3-php8.1 17.0.3 17 latest * develop **End of support for PHP < 7.4** From 64b038ee986883054dfd81566f76d1b59d0bd869 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Fri, 11 Aug 2023 20:00:49 +0200 Subject: [PATCH 18/24] Fix file mode --- README.md | 2 +- images/17.0.3-php8.1/docker-run.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 images/17.0.3-php8.1/docker-run.sh diff --git a/README.md b/README.md index 3b0ead7..4981bef 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Docker image for Dolibarr with auto installer on first boot. * 14.0.5-php7.4 14.0.5 14 * 15.0.3-php7.4 15.0.3 15 * 16.0.5-php8.1 16.0.5 16 -* 17.0.3-php8.1 17.0.3 17 latest +* 17.0.3-php8.1 17.0.3 17 * develop **End of support for PHP < 7.4** diff --git a/images/17.0.3-php8.1/docker-run.sh b/images/17.0.3-php8.1/docker-run.sh old mode 100644 new mode 100755 From a51377845b9e26ba51a1cc7e45b7283cfceb4359 Mon Sep 17 00:00:00 2001 From: Garcia MICHEL Date: Mon, 4 Sep 2023 19:11:48 +0200 Subject: [PATCH 19/24] Add dolibarr 18.0.1 (#129) --- README.md | 1 + images/18.0.1-php8.1/Dockerfile | 94 ++++++++++ images/18.0.1-php8.1/docker-init.php | 6 + images/18.0.1-php8.1/docker-run.sh | 256 +++++++++++++++++++++++++++ versions.sh | 4 +- 5 files changed, 359 insertions(+), 2 deletions(-) create mode 100644 images/18.0.1-php8.1/Dockerfile create mode 100644 images/18.0.1-php8.1/docker-init.php create mode 100755 images/18.0.1-php8.1/docker-run.sh diff --git a/README.md b/README.md index 4981bef..702add0 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Docker image for Dolibarr with auto installer on first boot. * 15.0.3-php7.4 15.0.3 15 * 16.0.5-php8.1 16.0.5 16 * 17.0.3-php8.1 17.0.3 17 +* 18.0.1-php8.1 18.0.1 18 latest * develop **End of support for PHP < 7.4** diff --git a/images/18.0.1-php8.1/Dockerfile b/images/18.0.1-php8.1/Dockerfile new file mode 100644 index 0000000..fce1d62 --- /dev/null +++ b/images/18.0.1-php8.1/Dockerfile @@ -0,0 +1,94 @@ +ARG ARCH= + +FROM ${ARCH}php:8.1-apache-buster + +LABEL maintainer="Garcia MICHEL " + +ENV DOLI_VERSION 18.0.1 +ENV DOLI_INSTALL_AUTO 1 +ENV DOLI_PROD 1 + +ENV DOLI_DB_TYPE mysqli +ENV DOLI_DB_HOST mysql +ENV DOLI_DB_HOST_PORT 3306 +ENV DOLI_DB_NAME dolidb + +ENV DOLI_URL_ROOT 'http://localhost' +ENV DOLI_NOCSRFCHECK 0 + +ENV DOLI_AUTH dolibarr +ENV DOLI_LDAP_HOST 127.0.0.1 +ENV DOLI_LDAP_PORT 389 +ENV DOLI_LDAP_VERSION 3 +ENV DOLI_LDAP_SERVER_TYPE openldap +ENV DOLI_LDAP_LOGIN_ATTRIBUTE uid +ENV DOLI_LDAP_DN 'ou=users,dc=my-domain,dc=com' +ENV DOLI_LDAP_FILTER '' +ENV DOLI_LDAP_BIND_DN '' +ENV DOLI_LDAP_BIND_PASS '' +ENV DOLI_LDAP_DEBUG false + +ENV DOLI_CRON 0 + +ENV WWW_USER_ID 33 +ENV WWW_GROUP_ID 33 + +ENV PHP_INI_DATE_TIMEZONE 'UTC' +ENV PHP_INI_MEMORY_LIMIT 256M +ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M +ENV PHP_INI_POST_MAX_SIZE 8M +ENV PHP_INI_ALLOW_URL_FOPEN 0 + +RUN sed -i \ + -e 's/^\(ServerSignature On\)$/#\1/g' \ + -e 's/^#\(ServerSignature Off\)$/\1/g' \ + -e 's/^\(ServerTokens\) OS$/\1 Prod/g' \ + /etc/apache2/conf-available/security.conf + +RUN apt-get update -y \ + && apt-get dist-upgrade -y \ + && apt-get install -y --no-install-recommends \ + libc-client-dev \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libkrb5-dev \ + libldap2-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libzip-dev \ + default-mysql-client \ + postgresql-client \ + cron \ + && apt-get autoremove -y \ + && docker-php-ext-configure gd --with-freetype --with-jpeg \ + && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip \ + && docker-php-ext-configure pgsql -with-pgsql \ + && docker-php-ext-install pdo_pgsql pgsql \ + && docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \ + && docker-php-ext-install -j$(nproc) ldap \ + && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ + && docker-php-ext-install imap \ + && mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini \ + && rm -rf /var/lib/apt/lists/* + +# Get Dolibarr +RUN curl -fLSs https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.tar.gz |\ + tar -C /tmp -xz && \ + cp -r /tmp/dolibarr-${DOLI_VERSION}/htdocs/* /var/www/html/ && \ + ln -s /var/www/html /var/www/htdocs && \ + cp -r /tmp/dolibarr-${DOLI_VERSION}/scripts /var/www/ && \ + rm -rf /tmp/* && \ + mkdir -p /var/www/documents && \ + mkdir -p /var/www/html/custom && \ + chown -R www-data:www-data /var/www + +EXPOSE 80 +VOLUME /var/www/documents +VOLUME /var/www/html/custom + +COPY docker-init.php /var/www/scripts/ +COPY docker-run.sh /usr/local/bin/ +ENTRYPOINT ["docker-run.sh"] + +CMD ["apache2-foreground"] diff --git a/images/18.0.1-php8.1/docker-init.php b/images/18.0.1-php8.1/docker-init.php new file mode 100644 index 0000000..dc0dea8 --- /dev/null +++ b/images/18.0.1-php8.1/docker-init.php @@ -0,0 +1,6 @@ +#!/usr/bin/env php +init(); diff --git a/images/18.0.1-php8.1/docker-run.sh b/images/18.0.1-php8.1/docker-run.sh new file mode 100755 index 0000000..e2a2794 --- /dev/null +++ b/images/18.0.1-php8.1/docker-run.sh @@ -0,0 +1,256 @@ +#!/bin/bash + +# usage: get_env_value VAR [DEFAULT] +# ie: get_env_value 'XYZ_DB_PASSWORD' 'example' +# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of +# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) +function get_env_value() { + local varName="${1}" + local fileVarName="${varName}_FILE" + local defaultValue="${2:-}" + + if [ "${!varName:-}" ] && [ "${!fileVarName:-}" ]; then + echo >&2 "error: both ${varName} and ${fileVarName} are set (but are exclusive)" + exit 1 + fi + + local value="${defaultValue}" + if [ "${!varName:-}" ]; then + value="${!varName}" + elif [ "${!fileVarName:-}" ]; then + value="$(< "${!fileVarName}")" + fi + + echo ${value} + exit 0 +} + +function initDolibarr() +{ + local CURRENT_UID=$(id -u www-data) + local CURRENT_GID=$(id -g www-data) + usermod -u ${WWW_USER_ID} www-data + groupmod -g ${WWW_GROUP_ID} www-data + + if [[ ! -d /var/www/documents ]]; then + echo "[INIT] => create volume directory /var/www/documents ..." + mkdir -p /var/www/documents + fi + + echo "[INIT] => update PHP Config ..." + cat > ${PHP_INI_DIR}/conf.d/dolibarr-php.ini << EOF +date.timezone = ${PHP_INI_DATE_TIMEZONE} +sendmail_path = /usr/sbin/sendmail -t -i +memory_limit = ${PHP_INI_MEMORY_LIMIT} +upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} +post_max_size = ${PHP_INI_POST_MAX_SIZE} +allow_url_fopen = ${PHP_INI_ALLOW_URL_FOPEN} +session.use_strict_mode = 1 +disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen +EOF + +if [[ ! -f /var/www/html/conf/conf.php ]]; then + echo "[INIT] => update Dolibarr Config ..." + cat > /var/www/html/conf/conf.php << EOF + update Dolibarr Config with LDAP entries ..." + cat >> /var/www/html/conf/conf.php << EOF +\$dolibarr_main_auth_ldap_host='${DOLI_LDAP_HOST}'; +\$dolibarr_main_auth_ldap_port='${DOLI_LDAP_PORT}'; +\$dolibarr_main_auth_ldap_version='${DOLI_LDAP_VERSION}'; +\$dolibarr_main_auth_ldap_servertype='${DOLI_LDAP_SERVER_TYPE}'; +\$dolibarr_main_auth_ldap_login_attribute='${DOLI_LDAP_LOGIN_ATTRIBUTE}'; +\$dolibarr_main_auth_ldap_dn='${DOLI_LDAP_DN}'; +\$dolibarr_main_auth_ldap_filter='${DOLI_LDAP_FILTER}'; +\$dolibarr_main_auth_ldap_admin_login='${DOLI_LDAP_BIND_DN}'; +\$dolibarr_main_auth_ldap_admin_pass='${DOLI_LDAP_BIND_PASS}'; +\$dolibarr_main_auth_ldap_debug='${DOLI_LDAP_DEBUG}'; +EOF + fi + fi + + echo "[INIT] => update ownership for file in Dolibarr Config ..." + chown www-data:www-data /var/www/html/conf/conf.php + if [[ ${DOLI_DB_TYPE} == "pgsql" && ! -f /var/www/documents/install.lock ]]; then + chmod 600 /var/www/html/conf/conf.php + else + chmod 400 /var/www/html/conf/conf.php + fi + + if [[ ${CURRENT_UID} -ne ${WWW_USER_ID} || ${CURRENT_GID} -ne ${WWW_GROUP_ID} ]]; then + # Refresh file ownership cause it has changed + echo "[INIT] => As UID / GID have changed from default, update ownership for files in /var/ww ..." + chown -R www-data:www-data /var/www + else + # Reducing load on init : change ownership only for volumes declared in docker + echo "[INIT] => update ownership for files in /var/www/documents ..." + chown -R www-data:www-data /var/www/documents + fi +} + +function waitForDataBase() +{ + r=1 + + while [[ ${r} -ne 0 ]]; do + mysql -u ${DOLI_DB_USER} --protocol tcp -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} --connect-timeout=5 -e "status" > /dev/null 2>&1 + r=$? + if [[ ${r} -ne 0 ]]; then + echo "Waiting that SQL database is up ..." + sleep 2 + fi + done +} + +function lockInstallation() +{ + touch /var/www/documents/install.lock + chown www-data:www-data /var/www/documents/install.lock + chmod 400 /var/www/documents/install.lock +} + +function initializeDatabase() +{ + for fileSQL in /var/www/html/install/mysql/tables/*.sql; do + if [[ ${fileSQL} != *.key.sql ]]; then + echo "Importing table from `basename ${fileSQL}` ..." + sed -i 's/--.*//g;' ${fileSQL} # remove all comment + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} + fi + done + + for fileSQL in /var/www/html/install/mysql/tables/*.key.sql; do + echo "Importing table key from `basename ${fileSQL}` ..." + sed -i 's/--.*//g;' ${fileSQL} + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 + done + + for fileSQL in /var/www/html/install/mysql/functions/*.sql; do + echo "Importing `basename ${fileSQL}` ..." + sed -i 's/--.*//g;' ${fileSQL} + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 + done + + for fileSQL in /var/www/html/install/mysql/data/*.sql; do + echo "Importing data from `basename ${fileSQL}` ..." + sed -i 's/--.*//g;' ${fileSQL} + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 + done + + echo "Create SuperAdmin account ..." + pass_crypted=`echo -n ${DOLI_ADMIN_PASSWORD} | md5sum | awk '{print $1}'` + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_user (entity, login, pass_crypted, lastname, admin, statut) VALUES (0, '${DOLI_ADMIN_LOGIN}', '${pass_crypted}', 'SuperAdmin', 1, 1);" > /dev/null 2>&1 + + echo "Set some default const ..." + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_VERSION_LAST_INSTALL';" > /dev/null 2>&1 + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_NOT_INSTALLED';" > /dev/null 2>&1 + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_LANG_DEFAULT';" > /dev/null 2>&1 + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('SYSTEMTOOLS_MYSQLDUMP', '/usr/bin/mysqldump', 'chaine', 0, '', 0);" > /dev/null 2>&1 + + echo "Enable user module ..." + php /var/www/scripts/docker-init.php +} + +function migrateDatabase() +{ + TARGET_VERSION="$(echo ${DOLI_VERSION} | cut -d. -f1).$(echo ${DOLI_VERSION} | cut -d. -f2).0" + echo "Schema update is required ..." + echo "Dumping Database into /var/www/documents/dump.sql ..." + + mysqldump -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} > /var/www/documents/dump.sql + r=${?} + if [[ ${r} -ne 0 ]]; then + echo "Dump failed ... Aborting migration ..." + return ${r} + fi + echo "Dump done ... Starting Migration ..." + + echo "" > /var/www/documents/migration_error.html + pushd /var/www/htdocs/install > /dev/null + php upgrade.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 && \ + php upgrade2.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 && \ + php step5.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 + r=$? + popd > /dev/null + + if [[ ${r} -ne 0 ]]; then + echo "Migration failed ... Restoring DB ... check file /var/www/documents/migration_error.html for more info on error ..." + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < /var/www/documents/dump.sql + echo "DB Restored ..." + return ${r} + else + echo "Migration successful ... Enjoy !!" + fi + + return 0 +} + +function run() +{ + initDolibarr + echo "Current Version is : ${DOLI_VERSION}" + + if [[ ${DOLI_INSTALL_AUTO} -eq 1 && ${DOLI_CRON} -ne 1 && ! -f /var/www/documents/install.lock && ${DOLI_DB_TYPE} != "pgsql" ]]; then + waitForDataBase + + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "SELECT Q.LAST_INSTALLED_VERSION FROM (SELECT INET_ATON(CONCAT(value, REPEAT('.0', 3 - CHAR_LENGTH(value) + CHAR_LENGTH(REPLACE(value, '.', ''))))) as VERSION_ATON, value as LAST_INSTALLED_VERSION FROM llx_const WHERE name IN ('MAIN_VERSION_LAST_INSTALL', 'MAIN_VERSION_LAST_UPGRADE') and entity=0) Q ORDER BY VERSION_ATON DESC LIMIT 1" > /tmp/lastinstall.result 2>&1 + r=$? + if [[ ${r} -ne 0 ]]; then + initializeDatabase + else + INSTALLED_VERSION=`grep -v LAST_INSTALLED_VERSION /tmp/lastinstall.result` + echo "Last installed Version is : ${INSTALLED_VERSION}" + if [[ "$(echo ${INSTALLED_VERSION} | cut -d. -f1)" -lt "$(echo ${DOLI_VERSION} | cut -d. -f1)" ]]; then + migrateDatabase + else + echo "Schema update is not required ... Enjoy !!" + fi + fi + + if [[ ${DOLI_VERSION} != "develop" ]]; then + lockInstallation + fi + fi +} + +DOLI_DB_USER=$(get_env_value 'DOLI_DB_USER' 'doli') +DOLI_DB_PASSWORD=$(get_env_value 'DOLI_DB_PASSWORD' 'doli_pass') +DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') +DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') +DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') +DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') + +run + +set -e + +if [[ ${DOLI_CRON} -eq 1 ]]; then + echo "PATH=\$PATH:/usr/local/bin" > /etc/cron.d/dolibarr + echo "*/5 * * * * root /bin/su www-data -s /bin/sh -c '/var/www/scripts/cron/cron_run_jobs.php ${DOLI_CRON_KEY} ${DOLI_CRON_USER}' > /proc/1/fd/1 2> /proc/1/fd/2" >> /etc/cron.d/dolibarr + cron -f + exit 0 +fi + +if [ "${1#-}" != "$1" ]; then + set -- apache2-foreground "$@" +fi + +exec "$@" diff --git a/versions.sh b/versions.sh index 591ebfa..3dfe793 100644 --- a/versions.sh +++ b/versions.sh @@ -2,5 +2,5 @@ set -e -DOLIBARR_VERSIONS=( "11.0.5" "12.0.5" "13.0.4" "14.0.5" "15.0.3" "16.0.5" "17.0.3" "develop" ) -DOLIBARR_LATEST_TAG="17.0.2" +DOLIBARR_VERSIONS=( "11.0.5" "12.0.5" "13.0.4" "14.0.5" "15.0.3" "16.0.5" "17.0.3" "18.0.1" "develop" ) +DOLIBARR_LATEST_TAG="18.0.1" From 1c5aec0f98d80ae8dafaba94884140489ca50b7e Mon Sep 17 00:00:00 2001 From: Alban Durrheimer Date: Thu, 7 Sep 2023 18:45:00 +0200 Subject: [PATCH 20/24] Add DOLI_INSTANCE_UNIQUE_ID env variable (#130) --- README.md | 2 ++ README.template | 2 ++ docker-run.sh | 5 +++++ images/11.0.5-php7.4/docker-run.sh | 5 +++++ images/12.0.5-php7.4/docker-run.sh | 5 +++++ images/13.0.4-php7.4/docker-run.sh | 5 +++++ images/14.0.5-php7.4/docker-run.sh | 5 +++++ images/15.0.3-php7.4/docker-run.sh | 5 +++++ images/16.0.5-php8.1/docker-run.sh | 5 +++++ images/17.0.3-php8.1/docker-run.sh | 5 +++++ images/18.0.1-php8.1/docker-run.sh | 5 +++++ images/develop/docker-run.sh | 5 +++++ 12 files changed, 54 insertions(+) diff --git a/README.md b/README.md index 702add0..58dd2a7 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,7 @@ When setup this way, to upgrade version the use of the web interface is mandator | **DOLI_CRON** | *0* | 1: Enable cron service | **DOLI_CRON_KEY** | | Security key launch cron jobs | **DOLI_CRON_USER** | | Dolibarr user used for cron jobs +| **DOLI_INSTANCE_UNIQUE_ID** | | Secret ID used as a salt / key for some encryption. By default, it is set randomly when the docker container is created. Some environment variables are compatible with docker secrets behaviour, just add the `_FILE` suffix to var name and point the value file to read. Environment variables that are compatible with docker secrets: @@ -137,3 +138,4 @@ Environment variables that are compatible with docker secrets: * `DOLI_ADMIN_PASSWORD` => `DOLI_ADMIN_PASSWORD_FILE` * `DOLI_CRON_KEY` => `DOLI_CRON_KEY_FILE` * `DOLI_CRON_USER` => `DOLI_CRON_USER_FILE` +* `DOLI_INSTANCE_UNIQUE_ID` => `DOLI_INSTANCE_UNIQUE_ID_FILE` diff --git a/README.template b/README.template index a408a7b..2cf52e7 100644 --- a/README.template +++ b/README.template @@ -118,6 +118,7 @@ When setup this way, to upgrade version the use of the web interface is mandator | **DOLI_CRON** | *0* | 1: Enable cron service | **DOLI_CRON_KEY** | | Security key launch cron jobs | **DOLI_CRON_USER** | | Dolibarr user used for cron jobs +| **DOLI_INSTANCE_UNIQUE_ID** | | Secret ID used as a salt / key for some encryption. By default, it is set randomly when the docker container is created. Some environment variables are compatible with docker secrets behaviour, just add the `_FILE` suffix to var name and point the value file to read. Environment variables that are compatible with docker secrets: @@ -128,3 +129,4 @@ Environment variables that are compatible with docker secrets: * `DOLI_ADMIN_PASSWORD` => `DOLI_ADMIN_PASSWORD_FILE` * `DOLI_CRON_KEY` => `DOLI_CRON_KEY_FILE` * `DOLI_CRON_USER` => `DOLI_CRON_USER_FILE` +* `DOLI_INSTANCE_UNIQUE_ID` => `DOLI_INSTANCE_UNIQUE_ID_FILE` diff --git a/docker-run.sh b/docker-run.sh index e2a2794..fb463dd 100755 --- a/docker-run.sh +++ b/docker-run.sh @@ -68,6 +68,10 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_authentication='${DOLI_AUTH}'; \$dolibarr_main_prod=${DOLI_PROD}; EOF + if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then + echo "[INIT] => update Dolibarr Config with instance unique id ..." + cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." cat >> /var/www/html/conf/conf.php << EOF @@ -237,6 +241,7 @@ DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') +DOLI_INSTANCE_UNIQUE_ID=$(get_env_value 'DOLI_INSTANCE_UNIQUE_ID' '') run diff --git a/images/11.0.5-php7.4/docker-run.sh b/images/11.0.5-php7.4/docker-run.sh index e2a2794..fb463dd 100755 --- a/images/11.0.5-php7.4/docker-run.sh +++ b/images/11.0.5-php7.4/docker-run.sh @@ -68,6 +68,10 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_authentication='${DOLI_AUTH}'; \$dolibarr_main_prod=${DOLI_PROD}; EOF + if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then + echo "[INIT] => update Dolibarr Config with instance unique id ..." + cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." cat >> /var/www/html/conf/conf.php << EOF @@ -237,6 +241,7 @@ DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') +DOLI_INSTANCE_UNIQUE_ID=$(get_env_value 'DOLI_INSTANCE_UNIQUE_ID' '') run diff --git a/images/12.0.5-php7.4/docker-run.sh b/images/12.0.5-php7.4/docker-run.sh index e2a2794..fb463dd 100755 --- a/images/12.0.5-php7.4/docker-run.sh +++ b/images/12.0.5-php7.4/docker-run.sh @@ -68,6 +68,10 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_authentication='${DOLI_AUTH}'; \$dolibarr_main_prod=${DOLI_PROD}; EOF + if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then + echo "[INIT] => update Dolibarr Config with instance unique id ..." + cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." cat >> /var/www/html/conf/conf.php << EOF @@ -237,6 +241,7 @@ DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') +DOLI_INSTANCE_UNIQUE_ID=$(get_env_value 'DOLI_INSTANCE_UNIQUE_ID' '') run diff --git a/images/13.0.4-php7.4/docker-run.sh b/images/13.0.4-php7.4/docker-run.sh index e2a2794..fb463dd 100755 --- a/images/13.0.4-php7.4/docker-run.sh +++ b/images/13.0.4-php7.4/docker-run.sh @@ -68,6 +68,10 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_authentication='${DOLI_AUTH}'; \$dolibarr_main_prod=${DOLI_PROD}; EOF + if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then + echo "[INIT] => update Dolibarr Config with instance unique id ..." + cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." cat >> /var/www/html/conf/conf.php << EOF @@ -237,6 +241,7 @@ DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') +DOLI_INSTANCE_UNIQUE_ID=$(get_env_value 'DOLI_INSTANCE_UNIQUE_ID' '') run diff --git a/images/14.0.5-php7.4/docker-run.sh b/images/14.0.5-php7.4/docker-run.sh index e2a2794..fb463dd 100755 --- a/images/14.0.5-php7.4/docker-run.sh +++ b/images/14.0.5-php7.4/docker-run.sh @@ -68,6 +68,10 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_authentication='${DOLI_AUTH}'; \$dolibarr_main_prod=${DOLI_PROD}; EOF + if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then + echo "[INIT] => update Dolibarr Config with instance unique id ..." + cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." cat >> /var/www/html/conf/conf.php << EOF @@ -237,6 +241,7 @@ DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') +DOLI_INSTANCE_UNIQUE_ID=$(get_env_value 'DOLI_INSTANCE_UNIQUE_ID' '') run diff --git a/images/15.0.3-php7.4/docker-run.sh b/images/15.0.3-php7.4/docker-run.sh index e2a2794..fb463dd 100755 --- a/images/15.0.3-php7.4/docker-run.sh +++ b/images/15.0.3-php7.4/docker-run.sh @@ -68,6 +68,10 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_authentication='${DOLI_AUTH}'; \$dolibarr_main_prod=${DOLI_PROD}; EOF + if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then + echo "[INIT] => update Dolibarr Config with instance unique id ..." + cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." cat >> /var/www/html/conf/conf.php << EOF @@ -237,6 +241,7 @@ DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') +DOLI_INSTANCE_UNIQUE_ID=$(get_env_value 'DOLI_INSTANCE_UNIQUE_ID' '') run diff --git a/images/16.0.5-php8.1/docker-run.sh b/images/16.0.5-php8.1/docker-run.sh index e2a2794..fb463dd 100755 --- a/images/16.0.5-php8.1/docker-run.sh +++ b/images/16.0.5-php8.1/docker-run.sh @@ -68,6 +68,10 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_authentication='${DOLI_AUTH}'; \$dolibarr_main_prod=${DOLI_PROD}; EOF + if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then + echo "[INIT] => update Dolibarr Config with instance unique id ..." + cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." cat >> /var/www/html/conf/conf.php << EOF @@ -237,6 +241,7 @@ DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') +DOLI_INSTANCE_UNIQUE_ID=$(get_env_value 'DOLI_INSTANCE_UNIQUE_ID' '') run diff --git a/images/17.0.3-php8.1/docker-run.sh b/images/17.0.3-php8.1/docker-run.sh index e2a2794..fb463dd 100755 --- a/images/17.0.3-php8.1/docker-run.sh +++ b/images/17.0.3-php8.1/docker-run.sh @@ -68,6 +68,10 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_authentication='${DOLI_AUTH}'; \$dolibarr_main_prod=${DOLI_PROD}; EOF + if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then + echo "[INIT] => update Dolibarr Config with instance unique id ..." + cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." cat >> /var/www/html/conf/conf.php << EOF @@ -237,6 +241,7 @@ DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') +DOLI_INSTANCE_UNIQUE_ID=$(get_env_value 'DOLI_INSTANCE_UNIQUE_ID' '') run diff --git a/images/18.0.1-php8.1/docker-run.sh b/images/18.0.1-php8.1/docker-run.sh index e2a2794..fb463dd 100755 --- a/images/18.0.1-php8.1/docker-run.sh +++ b/images/18.0.1-php8.1/docker-run.sh @@ -68,6 +68,10 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_authentication='${DOLI_AUTH}'; \$dolibarr_main_prod=${DOLI_PROD}; EOF + if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then + echo "[INIT] => update Dolibarr Config with instance unique id ..." + cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." cat >> /var/www/html/conf/conf.php << EOF @@ -237,6 +241,7 @@ DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') +DOLI_INSTANCE_UNIQUE_ID=$(get_env_value 'DOLI_INSTANCE_UNIQUE_ID' '') run diff --git a/images/develop/docker-run.sh b/images/develop/docker-run.sh index e2a2794..fb463dd 100755 --- a/images/develop/docker-run.sh +++ b/images/develop/docker-run.sh @@ -68,6 +68,10 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then \$dolibarr_main_authentication='${DOLI_AUTH}'; \$dolibarr_main_prod=${DOLI_PROD}; EOF + if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then + echo "[INIT] => update Dolibarr Config with instance unique id ..." + cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." cat >> /var/www/html/conf/conf.php << EOF @@ -237,6 +241,7 @@ DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') +DOLI_INSTANCE_UNIQUE_ID=$(get_env_value 'DOLI_INSTANCE_UNIQUE_ID' '') run From afc05db3bdba39970c6c2af9c52685177e0180fc Mon Sep 17 00:00:00 2001 From: Garcia MICHEL Date: Fri, 8 Sep 2023 07:40:41 +0200 Subject: [PATCH 21/24] Remove old versions 11 to 14 (#131) --- README.md | 6 +- README.template | 2 +- images/11.0.5-php7.4/Dockerfile | 94 ---------- images/11.0.5-php7.4/docker-init.php | 6 - images/11.0.5-php7.4/docker-run.sh | 261 --------------------------- images/12.0.5-php7.4/Dockerfile | 94 ---------- images/12.0.5-php7.4/docker-init.php | 6 - images/12.0.5-php7.4/docker-run.sh | 261 --------------------------- images/13.0.4-php7.4/Dockerfile | 94 ---------- images/13.0.4-php7.4/docker-init.php | 6 - images/13.0.4-php7.4/docker-run.sh | 261 --------------------------- images/14.0.5-php7.4/Dockerfile | 94 ---------- images/14.0.5-php7.4/docker-init.php | 6 - images/14.0.5-php7.4/docker-run.sh | 261 --------------------------- versions.sh | 2 +- 15 files changed, 3 insertions(+), 1451 deletions(-) delete mode 100644 images/11.0.5-php7.4/Dockerfile delete mode 100644 images/11.0.5-php7.4/docker-init.php delete mode 100755 images/11.0.5-php7.4/docker-run.sh delete mode 100644 images/12.0.5-php7.4/Dockerfile delete mode 100644 images/12.0.5-php7.4/docker-init.php delete mode 100755 images/12.0.5-php7.4/docker-run.sh delete mode 100644 images/13.0.4-php7.4/Dockerfile delete mode 100644 images/13.0.4-php7.4/docker-init.php delete mode 100755 images/13.0.4-php7.4/docker-run.sh delete mode 100644 images/14.0.5-php7.4/Dockerfile delete mode 100644 images/14.0.5-php7.4/docker-init.php delete mode 100755 images/14.0.5-php7.4/docker-run.sh diff --git a/README.md b/README.md index 58dd2a7..c83fbc2 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,6 @@ Docker image for Dolibarr with auto installer on first boot. ## Supported tags -* 11.0.5-php7.4 11.0.5 11 -* 12.0.5-php7.4 12.0.5 12 -* 13.0.4-php7.4 13.0.4 13 -* 14.0.5-php7.4 14.0.5 14 * 15.0.3-php7.4 15.0.3 15 * 16.0.5-php8.1 16.0.5 16 * 17.0.3-php8.1 17.0.3 17 @@ -16,7 +12,7 @@ Docker image for Dolibarr with auto installer on first boot. **End of support for PHP < 7.4** -**Dolibarr versions 7, 8, 9, 10 no more updated** +**Dolibarr versions 7, 8, 9, 10, 11, 12, 13, 14 no more updated** ## Supported architectures diff --git a/README.template b/README.template index 2cf52e7..20665e7 100644 --- a/README.template +++ b/README.template @@ -7,7 +7,7 @@ Docker image for Dolibarr with auto installer on first boot. **End of support for PHP < 7.4** -**Dolibarr versions 7, 8, 9, 10 no more updated** +**Dolibarr versions 7, 8, 9, 10, 11, 12, 13, 14 no more updated** ## Supported architectures diff --git a/images/11.0.5-php7.4/Dockerfile b/images/11.0.5-php7.4/Dockerfile deleted file mode 100644 index a50c6fd..0000000 --- a/images/11.0.5-php7.4/Dockerfile +++ /dev/null @@ -1,94 +0,0 @@ -ARG ARCH= - -FROM ${ARCH}php:7.4-apache-buster - -LABEL maintainer="Garcia MICHEL " - -ENV DOLI_VERSION 11.0.5 -ENV DOLI_INSTALL_AUTO 1 -ENV DOLI_PROD 1 - -ENV DOLI_DB_TYPE mysqli -ENV DOLI_DB_HOST mysql -ENV DOLI_DB_HOST_PORT 3306 -ENV DOLI_DB_NAME dolidb - -ENV DOLI_URL_ROOT 'http://localhost' -ENV DOLI_NOCSRFCHECK 0 - -ENV DOLI_AUTH dolibarr -ENV DOLI_LDAP_HOST 127.0.0.1 -ENV DOLI_LDAP_PORT 389 -ENV DOLI_LDAP_VERSION 3 -ENV DOLI_LDAP_SERVER_TYPE openldap -ENV DOLI_LDAP_LOGIN_ATTRIBUTE uid -ENV DOLI_LDAP_DN 'ou=users,dc=my-domain,dc=com' -ENV DOLI_LDAP_FILTER '' -ENV DOLI_LDAP_BIND_DN '' -ENV DOLI_LDAP_BIND_PASS '' -ENV DOLI_LDAP_DEBUG false - -ENV DOLI_CRON 0 - -ENV WWW_USER_ID 33 -ENV WWW_GROUP_ID 33 - -ENV PHP_INI_DATE_TIMEZONE 'UTC' -ENV PHP_INI_MEMORY_LIMIT 256M -ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M -ENV PHP_INI_POST_MAX_SIZE 8M -ENV PHP_INI_ALLOW_URL_FOPEN 0 - -RUN sed -i \ - -e 's/^\(ServerSignature On\)$/#\1/g' \ - -e 's/^#\(ServerSignature Off\)$/\1/g' \ - -e 's/^\(ServerTokens\) OS$/\1 Prod/g' \ - /etc/apache2/conf-available/security.conf - -RUN apt-get update -y \ - && apt-get dist-upgrade -y \ - && apt-get install -y --no-install-recommends \ - libc-client-dev \ - libfreetype6-dev \ - libjpeg62-turbo-dev \ - libkrb5-dev \ - libldap2-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - default-mysql-client \ - postgresql-client \ - cron \ - && apt-get autoremove -y \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip \ - && docker-php-ext-configure pgsql -with-pgsql \ - && docker-php-ext-install pdo_pgsql pgsql \ - && docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \ - && docker-php-ext-install -j$(nproc) ldap \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-install imap \ - && mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini \ - && rm -rf /var/lib/apt/lists/* - -# Get Dolibarr -RUN curl -fLSs https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.tar.gz |\ - tar -C /tmp -xz && \ - cp -r /tmp/dolibarr-${DOLI_VERSION}/htdocs/* /var/www/html/ && \ - ln -s /var/www/html /var/www/htdocs && \ - cp -r /tmp/dolibarr-${DOLI_VERSION}/scripts /var/www/ && \ - rm -rf /tmp/* && \ - mkdir -p /var/www/documents && \ - mkdir -p /var/www/html/custom && \ - chown -R www-data:www-data /var/www - -EXPOSE 80 -VOLUME /var/www/documents -VOLUME /var/www/html/custom - -COPY docker-init.php /var/www/scripts/ -COPY docker-run.sh /usr/local/bin/ -ENTRYPOINT ["docker-run.sh"] - -CMD ["apache2-foreground"] diff --git a/images/11.0.5-php7.4/docker-init.php b/images/11.0.5-php7.4/docker-init.php deleted file mode 100644 index dc0dea8..0000000 --- a/images/11.0.5-php7.4/docker-init.php +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env php -init(); diff --git a/images/11.0.5-php7.4/docker-run.sh b/images/11.0.5-php7.4/docker-run.sh deleted file mode 100755 index fb463dd..0000000 --- a/images/11.0.5-php7.4/docker-run.sh +++ /dev/null @@ -1,261 +0,0 @@ -#!/bin/bash - -# usage: get_env_value VAR [DEFAULT] -# ie: get_env_value 'XYZ_DB_PASSWORD' 'example' -# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of -# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) -function get_env_value() { - local varName="${1}" - local fileVarName="${varName}_FILE" - local defaultValue="${2:-}" - - if [ "${!varName:-}" ] && [ "${!fileVarName:-}" ]; then - echo >&2 "error: both ${varName} and ${fileVarName} are set (but are exclusive)" - exit 1 - fi - - local value="${defaultValue}" - if [ "${!varName:-}" ]; then - value="${!varName}" - elif [ "${!fileVarName:-}" ]; then - value="$(< "${!fileVarName}")" - fi - - echo ${value} - exit 0 -} - -function initDolibarr() -{ - local CURRENT_UID=$(id -u www-data) - local CURRENT_GID=$(id -g www-data) - usermod -u ${WWW_USER_ID} www-data - groupmod -g ${WWW_GROUP_ID} www-data - - if [[ ! -d /var/www/documents ]]; then - echo "[INIT] => create volume directory /var/www/documents ..." - mkdir -p /var/www/documents - fi - - echo "[INIT] => update PHP Config ..." - cat > ${PHP_INI_DIR}/conf.d/dolibarr-php.ini << EOF -date.timezone = ${PHP_INI_DATE_TIMEZONE} -sendmail_path = /usr/sbin/sendmail -t -i -memory_limit = ${PHP_INI_MEMORY_LIMIT} -upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} -post_max_size = ${PHP_INI_POST_MAX_SIZE} -allow_url_fopen = ${PHP_INI_ALLOW_URL_FOPEN} -session.use_strict_mode = 1 -disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen -EOF - -if [[ ! -f /var/www/html/conf/conf.php ]]; then - echo "[INIT] => update Dolibarr Config ..." - cat > /var/www/html/conf/conf.php << EOF - update Dolibarr Config with instance unique id ..." - cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" - fi - if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then - echo "[INIT] => update Dolibarr Config with LDAP entries ..." - cat >> /var/www/html/conf/conf.php << EOF -\$dolibarr_main_auth_ldap_host='${DOLI_LDAP_HOST}'; -\$dolibarr_main_auth_ldap_port='${DOLI_LDAP_PORT}'; -\$dolibarr_main_auth_ldap_version='${DOLI_LDAP_VERSION}'; -\$dolibarr_main_auth_ldap_servertype='${DOLI_LDAP_SERVER_TYPE}'; -\$dolibarr_main_auth_ldap_login_attribute='${DOLI_LDAP_LOGIN_ATTRIBUTE}'; -\$dolibarr_main_auth_ldap_dn='${DOLI_LDAP_DN}'; -\$dolibarr_main_auth_ldap_filter='${DOLI_LDAP_FILTER}'; -\$dolibarr_main_auth_ldap_admin_login='${DOLI_LDAP_BIND_DN}'; -\$dolibarr_main_auth_ldap_admin_pass='${DOLI_LDAP_BIND_PASS}'; -\$dolibarr_main_auth_ldap_debug='${DOLI_LDAP_DEBUG}'; -EOF - fi - fi - - echo "[INIT] => update ownership for file in Dolibarr Config ..." - chown www-data:www-data /var/www/html/conf/conf.php - if [[ ${DOLI_DB_TYPE} == "pgsql" && ! -f /var/www/documents/install.lock ]]; then - chmod 600 /var/www/html/conf/conf.php - else - chmod 400 /var/www/html/conf/conf.php - fi - - if [[ ${CURRENT_UID} -ne ${WWW_USER_ID} || ${CURRENT_GID} -ne ${WWW_GROUP_ID} ]]; then - # Refresh file ownership cause it has changed - echo "[INIT] => As UID / GID have changed from default, update ownership for files in /var/ww ..." - chown -R www-data:www-data /var/www - else - # Reducing load on init : change ownership only for volumes declared in docker - echo "[INIT] => update ownership for files in /var/www/documents ..." - chown -R www-data:www-data /var/www/documents - fi -} - -function waitForDataBase() -{ - r=1 - - while [[ ${r} -ne 0 ]]; do - mysql -u ${DOLI_DB_USER} --protocol tcp -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} --connect-timeout=5 -e "status" > /dev/null 2>&1 - r=$? - if [[ ${r} -ne 0 ]]; then - echo "Waiting that SQL database is up ..." - sleep 2 - fi - done -} - -function lockInstallation() -{ - touch /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock -} - -function initializeDatabase() -{ - for fileSQL in /var/www/html/install/mysql/tables/*.sql; do - if [[ ${fileSQL} != *.key.sql ]]; then - echo "Importing table from `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} # remove all comment - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} - fi - done - - for fileSQL in /var/www/html/install/mysql/tables/*.key.sql; do - echo "Importing table key from `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 - done - - for fileSQL in /var/www/html/install/mysql/functions/*.sql; do - echo "Importing `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 - done - - for fileSQL in /var/www/html/install/mysql/data/*.sql; do - echo "Importing data from `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 - done - - echo "Create SuperAdmin account ..." - pass_crypted=`echo -n ${DOLI_ADMIN_PASSWORD} | md5sum | awk '{print $1}'` - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_user (entity, login, pass_crypted, lastname, admin, statut) VALUES (0, '${DOLI_ADMIN_LOGIN}', '${pass_crypted}', 'SuperAdmin', 1, 1);" > /dev/null 2>&1 - - echo "Set some default const ..." - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_VERSION_LAST_INSTALL';" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_NOT_INSTALLED';" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_LANG_DEFAULT';" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('SYSTEMTOOLS_MYSQLDUMP', '/usr/bin/mysqldump', 'chaine', 0, '', 0);" > /dev/null 2>&1 - - echo "Enable user module ..." - php /var/www/scripts/docker-init.php -} - -function migrateDatabase() -{ - TARGET_VERSION="$(echo ${DOLI_VERSION} | cut -d. -f1).$(echo ${DOLI_VERSION} | cut -d. -f2).0" - echo "Schema update is required ..." - echo "Dumping Database into /var/www/documents/dump.sql ..." - - mysqldump -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} > /var/www/documents/dump.sql - r=${?} - if [[ ${r} -ne 0 ]]; then - echo "Dump failed ... Aborting migration ..." - return ${r} - fi - echo "Dump done ... Starting Migration ..." - - echo "" > /var/www/documents/migration_error.html - pushd /var/www/htdocs/install > /dev/null - php upgrade.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 && \ - php upgrade2.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 && \ - php step5.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 - r=$? - popd > /dev/null - - if [[ ${r} -ne 0 ]]; then - echo "Migration failed ... Restoring DB ... check file /var/www/documents/migration_error.html for more info on error ..." - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < /var/www/documents/dump.sql - echo "DB Restored ..." - return ${r} - else - echo "Migration successful ... Enjoy !!" - fi - - return 0 -} - -function run() -{ - initDolibarr - echo "Current Version is : ${DOLI_VERSION}" - - if [[ ${DOLI_INSTALL_AUTO} -eq 1 && ${DOLI_CRON} -ne 1 && ! -f /var/www/documents/install.lock && ${DOLI_DB_TYPE} != "pgsql" ]]; then - waitForDataBase - - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "SELECT Q.LAST_INSTALLED_VERSION FROM (SELECT INET_ATON(CONCAT(value, REPEAT('.0', 3 - CHAR_LENGTH(value) + CHAR_LENGTH(REPLACE(value, '.', ''))))) as VERSION_ATON, value as LAST_INSTALLED_VERSION FROM llx_const WHERE name IN ('MAIN_VERSION_LAST_INSTALL', 'MAIN_VERSION_LAST_UPGRADE') and entity=0) Q ORDER BY VERSION_ATON DESC LIMIT 1" > /tmp/lastinstall.result 2>&1 - r=$? - if [[ ${r} -ne 0 ]]; then - initializeDatabase - else - INSTALLED_VERSION=`grep -v LAST_INSTALLED_VERSION /tmp/lastinstall.result` - echo "Last installed Version is : ${INSTALLED_VERSION}" - if [[ "$(echo ${INSTALLED_VERSION} | cut -d. -f1)" -lt "$(echo ${DOLI_VERSION} | cut -d. -f1)" ]]; then - migrateDatabase - else - echo "Schema update is not required ... Enjoy !!" - fi - fi - - if [[ ${DOLI_VERSION} != "develop" ]]; then - lockInstallation - fi - fi -} - -DOLI_DB_USER=$(get_env_value 'DOLI_DB_USER' 'doli') -DOLI_DB_PASSWORD=$(get_env_value 'DOLI_DB_PASSWORD' 'doli_pass') -DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') -DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') -DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') -DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') -DOLI_INSTANCE_UNIQUE_ID=$(get_env_value 'DOLI_INSTANCE_UNIQUE_ID' '') - -run - -set -e - -if [[ ${DOLI_CRON} -eq 1 ]]; then - echo "PATH=\$PATH:/usr/local/bin" > /etc/cron.d/dolibarr - echo "*/5 * * * * root /bin/su www-data -s /bin/sh -c '/var/www/scripts/cron/cron_run_jobs.php ${DOLI_CRON_KEY} ${DOLI_CRON_USER}' > /proc/1/fd/1 2> /proc/1/fd/2" >> /etc/cron.d/dolibarr - cron -f - exit 0 -fi - -if [ "${1#-}" != "$1" ]; then - set -- apache2-foreground "$@" -fi - -exec "$@" diff --git a/images/12.0.5-php7.4/Dockerfile b/images/12.0.5-php7.4/Dockerfile deleted file mode 100644 index a2dc759..0000000 --- a/images/12.0.5-php7.4/Dockerfile +++ /dev/null @@ -1,94 +0,0 @@ -ARG ARCH= - -FROM ${ARCH}php:7.4-apache-buster - -LABEL maintainer="Garcia MICHEL " - -ENV DOLI_VERSION 12.0.5 -ENV DOLI_INSTALL_AUTO 1 -ENV DOLI_PROD 1 - -ENV DOLI_DB_TYPE mysqli -ENV DOLI_DB_HOST mysql -ENV DOLI_DB_HOST_PORT 3306 -ENV DOLI_DB_NAME dolidb - -ENV DOLI_URL_ROOT 'http://localhost' -ENV DOLI_NOCSRFCHECK 0 - -ENV DOLI_AUTH dolibarr -ENV DOLI_LDAP_HOST 127.0.0.1 -ENV DOLI_LDAP_PORT 389 -ENV DOLI_LDAP_VERSION 3 -ENV DOLI_LDAP_SERVER_TYPE openldap -ENV DOLI_LDAP_LOGIN_ATTRIBUTE uid -ENV DOLI_LDAP_DN 'ou=users,dc=my-domain,dc=com' -ENV DOLI_LDAP_FILTER '' -ENV DOLI_LDAP_BIND_DN '' -ENV DOLI_LDAP_BIND_PASS '' -ENV DOLI_LDAP_DEBUG false - -ENV DOLI_CRON 0 - -ENV WWW_USER_ID 33 -ENV WWW_GROUP_ID 33 - -ENV PHP_INI_DATE_TIMEZONE 'UTC' -ENV PHP_INI_MEMORY_LIMIT 256M -ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M -ENV PHP_INI_POST_MAX_SIZE 8M -ENV PHP_INI_ALLOW_URL_FOPEN 0 - -RUN sed -i \ - -e 's/^\(ServerSignature On\)$/#\1/g' \ - -e 's/^#\(ServerSignature Off\)$/\1/g' \ - -e 's/^\(ServerTokens\) OS$/\1 Prod/g' \ - /etc/apache2/conf-available/security.conf - -RUN apt-get update -y \ - && apt-get dist-upgrade -y \ - && apt-get install -y --no-install-recommends \ - libc-client-dev \ - libfreetype6-dev \ - libjpeg62-turbo-dev \ - libkrb5-dev \ - libldap2-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - default-mysql-client \ - postgresql-client \ - cron \ - && apt-get autoremove -y \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip \ - && docker-php-ext-configure pgsql -with-pgsql \ - && docker-php-ext-install pdo_pgsql pgsql \ - && docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \ - && docker-php-ext-install -j$(nproc) ldap \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-install imap \ - && mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini \ - && rm -rf /var/lib/apt/lists/* - -# Get Dolibarr -RUN curl -fLSs https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.tar.gz |\ - tar -C /tmp -xz && \ - cp -r /tmp/dolibarr-${DOLI_VERSION}/htdocs/* /var/www/html/ && \ - ln -s /var/www/html /var/www/htdocs && \ - cp -r /tmp/dolibarr-${DOLI_VERSION}/scripts /var/www/ && \ - rm -rf /tmp/* && \ - mkdir -p /var/www/documents && \ - mkdir -p /var/www/html/custom && \ - chown -R www-data:www-data /var/www - -EXPOSE 80 -VOLUME /var/www/documents -VOLUME /var/www/html/custom - -COPY docker-init.php /var/www/scripts/ -COPY docker-run.sh /usr/local/bin/ -ENTRYPOINT ["docker-run.sh"] - -CMD ["apache2-foreground"] diff --git a/images/12.0.5-php7.4/docker-init.php b/images/12.0.5-php7.4/docker-init.php deleted file mode 100644 index dc0dea8..0000000 --- a/images/12.0.5-php7.4/docker-init.php +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env php -init(); diff --git a/images/12.0.5-php7.4/docker-run.sh b/images/12.0.5-php7.4/docker-run.sh deleted file mode 100755 index fb463dd..0000000 --- a/images/12.0.5-php7.4/docker-run.sh +++ /dev/null @@ -1,261 +0,0 @@ -#!/bin/bash - -# usage: get_env_value VAR [DEFAULT] -# ie: get_env_value 'XYZ_DB_PASSWORD' 'example' -# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of -# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) -function get_env_value() { - local varName="${1}" - local fileVarName="${varName}_FILE" - local defaultValue="${2:-}" - - if [ "${!varName:-}" ] && [ "${!fileVarName:-}" ]; then - echo >&2 "error: both ${varName} and ${fileVarName} are set (but are exclusive)" - exit 1 - fi - - local value="${defaultValue}" - if [ "${!varName:-}" ]; then - value="${!varName}" - elif [ "${!fileVarName:-}" ]; then - value="$(< "${!fileVarName}")" - fi - - echo ${value} - exit 0 -} - -function initDolibarr() -{ - local CURRENT_UID=$(id -u www-data) - local CURRENT_GID=$(id -g www-data) - usermod -u ${WWW_USER_ID} www-data - groupmod -g ${WWW_GROUP_ID} www-data - - if [[ ! -d /var/www/documents ]]; then - echo "[INIT] => create volume directory /var/www/documents ..." - mkdir -p /var/www/documents - fi - - echo "[INIT] => update PHP Config ..." - cat > ${PHP_INI_DIR}/conf.d/dolibarr-php.ini << EOF -date.timezone = ${PHP_INI_DATE_TIMEZONE} -sendmail_path = /usr/sbin/sendmail -t -i -memory_limit = ${PHP_INI_MEMORY_LIMIT} -upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} -post_max_size = ${PHP_INI_POST_MAX_SIZE} -allow_url_fopen = ${PHP_INI_ALLOW_URL_FOPEN} -session.use_strict_mode = 1 -disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen -EOF - -if [[ ! -f /var/www/html/conf/conf.php ]]; then - echo "[INIT] => update Dolibarr Config ..." - cat > /var/www/html/conf/conf.php << EOF - update Dolibarr Config with instance unique id ..." - cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" - fi - if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then - echo "[INIT] => update Dolibarr Config with LDAP entries ..." - cat >> /var/www/html/conf/conf.php << EOF -\$dolibarr_main_auth_ldap_host='${DOLI_LDAP_HOST}'; -\$dolibarr_main_auth_ldap_port='${DOLI_LDAP_PORT}'; -\$dolibarr_main_auth_ldap_version='${DOLI_LDAP_VERSION}'; -\$dolibarr_main_auth_ldap_servertype='${DOLI_LDAP_SERVER_TYPE}'; -\$dolibarr_main_auth_ldap_login_attribute='${DOLI_LDAP_LOGIN_ATTRIBUTE}'; -\$dolibarr_main_auth_ldap_dn='${DOLI_LDAP_DN}'; -\$dolibarr_main_auth_ldap_filter='${DOLI_LDAP_FILTER}'; -\$dolibarr_main_auth_ldap_admin_login='${DOLI_LDAP_BIND_DN}'; -\$dolibarr_main_auth_ldap_admin_pass='${DOLI_LDAP_BIND_PASS}'; -\$dolibarr_main_auth_ldap_debug='${DOLI_LDAP_DEBUG}'; -EOF - fi - fi - - echo "[INIT] => update ownership for file in Dolibarr Config ..." - chown www-data:www-data /var/www/html/conf/conf.php - if [[ ${DOLI_DB_TYPE} == "pgsql" && ! -f /var/www/documents/install.lock ]]; then - chmod 600 /var/www/html/conf/conf.php - else - chmod 400 /var/www/html/conf/conf.php - fi - - if [[ ${CURRENT_UID} -ne ${WWW_USER_ID} || ${CURRENT_GID} -ne ${WWW_GROUP_ID} ]]; then - # Refresh file ownership cause it has changed - echo "[INIT] => As UID / GID have changed from default, update ownership for files in /var/ww ..." - chown -R www-data:www-data /var/www - else - # Reducing load on init : change ownership only for volumes declared in docker - echo "[INIT] => update ownership for files in /var/www/documents ..." - chown -R www-data:www-data /var/www/documents - fi -} - -function waitForDataBase() -{ - r=1 - - while [[ ${r} -ne 0 ]]; do - mysql -u ${DOLI_DB_USER} --protocol tcp -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} --connect-timeout=5 -e "status" > /dev/null 2>&1 - r=$? - if [[ ${r} -ne 0 ]]; then - echo "Waiting that SQL database is up ..." - sleep 2 - fi - done -} - -function lockInstallation() -{ - touch /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock -} - -function initializeDatabase() -{ - for fileSQL in /var/www/html/install/mysql/tables/*.sql; do - if [[ ${fileSQL} != *.key.sql ]]; then - echo "Importing table from `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} # remove all comment - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} - fi - done - - for fileSQL in /var/www/html/install/mysql/tables/*.key.sql; do - echo "Importing table key from `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 - done - - for fileSQL in /var/www/html/install/mysql/functions/*.sql; do - echo "Importing `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 - done - - for fileSQL in /var/www/html/install/mysql/data/*.sql; do - echo "Importing data from `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 - done - - echo "Create SuperAdmin account ..." - pass_crypted=`echo -n ${DOLI_ADMIN_PASSWORD} | md5sum | awk '{print $1}'` - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_user (entity, login, pass_crypted, lastname, admin, statut) VALUES (0, '${DOLI_ADMIN_LOGIN}', '${pass_crypted}', 'SuperAdmin', 1, 1);" > /dev/null 2>&1 - - echo "Set some default const ..." - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_VERSION_LAST_INSTALL';" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_NOT_INSTALLED';" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_LANG_DEFAULT';" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('SYSTEMTOOLS_MYSQLDUMP', '/usr/bin/mysqldump', 'chaine', 0, '', 0);" > /dev/null 2>&1 - - echo "Enable user module ..." - php /var/www/scripts/docker-init.php -} - -function migrateDatabase() -{ - TARGET_VERSION="$(echo ${DOLI_VERSION} | cut -d. -f1).$(echo ${DOLI_VERSION} | cut -d. -f2).0" - echo "Schema update is required ..." - echo "Dumping Database into /var/www/documents/dump.sql ..." - - mysqldump -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} > /var/www/documents/dump.sql - r=${?} - if [[ ${r} -ne 0 ]]; then - echo "Dump failed ... Aborting migration ..." - return ${r} - fi - echo "Dump done ... Starting Migration ..." - - echo "" > /var/www/documents/migration_error.html - pushd /var/www/htdocs/install > /dev/null - php upgrade.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 && \ - php upgrade2.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 && \ - php step5.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 - r=$? - popd > /dev/null - - if [[ ${r} -ne 0 ]]; then - echo "Migration failed ... Restoring DB ... check file /var/www/documents/migration_error.html for more info on error ..." - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < /var/www/documents/dump.sql - echo "DB Restored ..." - return ${r} - else - echo "Migration successful ... Enjoy !!" - fi - - return 0 -} - -function run() -{ - initDolibarr - echo "Current Version is : ${DOLI_VERSION}" - - if [[ ${DOLI_INSTALL_AUTO} -eq 1 && ${DOLI_CRON} -ne 1 && ! -f /var/www/documents/install.lock && ${DOLI_DB_TYPE} != "pgsql" ]]; then - waitForDataBase - - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "SELECT Q.LAST_INSTALLED_VERSION FROM (SELECT INET_ATON(CONCAT(value, REPEAT('.0', 3 - CHAR_LENGTH(value) + CHAR_LENGTH(REPLACE(value, '.', ''))))) as VERSION_ATON, value as LAST_INSTALLED_VERSION FROM llx_const WHERE name IN ('MAIN_VERSION_LAST_INSTALL', 'MAIN_VERSION_LAST_UPGRADE') and entity=0) Q ORDER BY VERSION_ATON DESC LIMIT 1" > /tmp/lastinstall.result 2>&1 - r=$? - if [[ ${r} -ne 0 ]]; then - initializeDatabase - else - INSTALLED_VERSION=`grep -v LAST_INSTALLED_VERSION /tmp/lastinstall.result` - echo "Last installed Version is : ${INSTALLED_VERSION}" - if [[ "$(echo ${INSTALLED_VERSION} | cut -d. -f1)" -lt "$(echo ${DOLI_VERSION} | cut -d. -f1)" ]]; then - migrateDatabase - else - echo "Schema update is not required ... Enjoy !!" - fi - fi - - if [[ ${DOLI_VERSION} != "develop" ]]; then - lockInstallation - fi - fi -} - -DOLI_DB_USER=$(get_env_value 'DOLI_DB_USER' 'doli') -DOLI_DB_PASSWORD=$(get_env_value 'DOLI_DB_PASSWORD' 'doli_pass') -DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') -DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') -DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') -DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') -DOLI_INSTANCE_UNIQUE_ID=$(get_env_value 'DOLI_INSTANCE_UNIQUE_ID' '') - -run - -set -e - -if [[ ${DOLI_CRON} -eq 1 ]]; then - echo "PATH=\$PATH:/usr/local/bin" > /etc/cron.d/dolibarr - echo "*/5 * * * * root /bin/su www-data -s /bin/sh -c '/var/www/scripts/cron/cron_run_jobs.php ${DOLI_CRON_KEY} ${DOLI_CRON_USER}' > /proc/1/fd/1 2> /proc/1/fd/2" >> /etc/cron.d/dolibarr - cron -f - exit 0 -fi - -if [ "${1#-}" != "$1" ]; then - set -- apache2-foreground "$@" -fi - -exec "$@" diff --git a/images/13.0.4-php7.4/Dockerfile b/images/13.0.4-php7.4/Dockerfile deleted file mode 100644 index f0c975a..0000000 --- a/images/13.0.4-php7.4/Dockerfile +++ /dev/null @@ -1,94 +0,0 @@ -ARG ARCH= - -FROM ${ARCH}php:7.4-apache-buster - -LABEL maintainer="Garcia MICHEL " - -ENV DOLI_VERSION 13.0.4 -ENV DOLI_INSTALL_AUTO 1 -ENV DOLI_PROD 1 - -ENV DOLI_DB_TYPE mysqli -ENV DOLI_DB_HOST mysql -ENV DOLI_DB_HOST_PORT 3306 -ENV DOLI_DB_NAME dolidb - -ENV DOLI_URL_ROOT 'http://localhost' -ENV DOLI_NOCSRFCHECK 0 - -ENV DOLI_AUTH dolibarr -ENV DOLI_LDAP_HOST 127.0.0.1 -ENV DOLI_LDAP_PORT 389 -ENV DOLI_LDAP_VERSION 3 -ENV DOLI_LDAP_SERVER_TYPE openldap -ENV DOLI_LDAP_LOGIN_ATTRIBUTE uid -ENV DOLI_LDAP_DN 'ou=users,dc=my-domain,dc=com' -ENV DOLI_LDAP_FILTER '' -ENV DOLI_LDAP_BIND_DN '' -ENV DOLI_LDAP_BIND_PASS '' -ENV DOLI_LDAP_DEBUG false - -ENV DOLI_CRON 0 - -ENV WWW_USER_ID 33 -ENV WWW_GROUP_ID 33 - -ENV PHP_INI_DATE_TIMEZONE 'UTC' -ENV PHP_INI_MEMORY_LIMIT 256M -ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M -ENV PHP_INI_POST_MAX_SIZE 8M -ENV PHP_INI_ALLOW_URL_FOPEN 0 - -RUN sed -i \ - -e 's/^\(ServerSignature On\)$/#\1/g' \ - -e 's/^#\(ServerSignature Off\)$/\1/g' \ - -e 's/^\(ServerTokens\) OS$/\1 Prod/g' \ - /etc/apache2/conf-available/security.conf - -RUN apt-get update -y \ - && apt-get dist-upgrade -y \ - && apt-get install -y --no-install-recommends \ - libc-client-dev \ - libfreetype6-dev \ - libjpeg62-turbo-dev \ - libkrb5-dev \ - libldap2-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - default-mysql-client \ - postgresql-client \ - cron \ - && apt-get autoremove -y \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip \ - && docker-php-ext-configure pgsql -with-pgsql \ - && docker-php-ext-install pdo_pgsql pgsql \ - && docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \ - && docker-php-ext-install -j$(nproc) ldap \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-install imap \ - && mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini \ - && rm -rf /var/lib/apt/lists/* - -# Get Dolibarr -RUN curl -fLSs https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.tar.gz |\ - tar -C /tmp -xz && \ - cp -r /tmp/dolibarr-${DOLI_VERSION}/htdocs/* /var/www/html/ && \ - ln -s /var/www/html /var/www/htdocs && \ - cp -r /tmp/dolibarr-${DOLI_VERSION}/scripts /var/www/ && \ - rm -rf /tmp/* && \ - mkdir -p /var/www/documents && \ - mkdir -p /var/www/html/custom && \ - chown -R www-data:www-data /var/www - -EXPOSE 80 -VOLUME /var/www/documents -VOLUME /var/www/html/custom - -COPY docker-init.php /var/www/scripts/ -COPY docker-run.sh /usr/local/bin/ -ENTRYPOINT ["docker-run.sh"] - -CMD ["apache2-foreground"] diff --git a/images/13.0.4-php7.4/docker-init.php b/images/13.0.4-php7.4/docker-init.php deleted file mode 100644 index dc0dea8..0000000 --- a/images/13.0.4-php7.4/docker-init.php +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env php -init(); diff --git a/images/13.0.4-php7.4/docker-run.sh b/images/13.0.4-php7.4/docker-run.sh deleted file mode 100755 index fb463dd..0000000 --- a/images/13.0.4-php7.4/docker-run.sh +++ /dev/null @@ -1,261 +0,0 @@ -#!/bin/bash - -# usage: get_env_value VAR [DEFAULT] -# ie: get_env_value 'XYZ_DB_PASSWORD' 'example' -# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of -# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) -function get_env_value() { - local varName="${1}" - local fileVarName="${varName}_FILE" - local defaultValue="${2:-}" - - if [ "${!varName:-}" ] && [ "${!fileVarName:-}" ]; then - echo >&2 "error: both ${varName} and ${fileVarName} are set (but are exclusive)" - exit 1 - fi - - local value="${defaultValue}" - if [ "${!varName:-}" ]; then - value="${!varName}" - elif [ "${!fileVarName:-}" ]; then - value="$(< "${!fileVarName}")" - fi - - echo ${value} - exit 0 -} - -function initDolibarr() -{ - local CURRENT_UID=$(id -u www-data) - local CURRENT_GID=$(id -g www-data) - usermod -u ${WWW_USER_ID} www-data - groupmod -g ${WWW_GROUP_ID} www-data - - if [[ ! -d /var/www/documents ]]; then - echo "[INIT] => create volume directory /var/www/documents ..." - mkdir -p /var/www/documents - fi - - echo "[INIT] => update PHP Config ..." - cat > ${PHP_INI_DIR}/conf.d/dolibarr-php.ini << EOF -date.timezone = ${PHP_INI_DATE_TIMEZONE} -sendmail_path = /usr/sbin/sendmail -t -i -memory_limit = ${PHP_INI_MEMORY_LIMIT} -upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} -post_max_size = ${PHP_INI_POST_MAX_SIZE} -allow_url_fopen = ${PHP_INI_ALLOW_URL_FOPEN} -session.use_strict_mode = 1 -disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen -EOF - -if [[ ! -f /var/www/html/conf/conf.php ]]; then - echo "[INIT] => update Dolibarr Config ..." - cat > /var/www/html/conf/conf.php << EOF - update Dolibarr Config with instance unique id ..." - cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" - fi - if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then - echo "[INIT] => update Dolibarr Config with LDAP entries ..." - cat >> /var/www/html/conf/conf.php << EOF -\$dolibarr_main_auth_ldap_host='${DOLI_LDAP_HOST}'; -\$dolibarr_main_auth_ldap_port='${DOLI_LDAP_PORT}'; -\$dolibarr_main_auth_ldap_version='${DOLI_LDAP_VERSION}'; -\$dolibarr_main_auth_ldap_servertype='${DOLI_LDAP_SERVER_TYPE}'; -\$dolibarr_main_auth_ldap_login_attribute='${DOLI_LDAP_LOGIN_ATTRIBUTE}'; -\$dolibarr_main_auth_ldap_dn='${DOLI_LDAP_DN}'; -\$dolibarr_main_auth_ldap_filter='${DOLI_LDAP_FILTER}'; -\$dolibarr_main_auth_ldap_admin_login='${DOLI_LDAP_BIND_DN}'; -\$dolibarr_main_auth_ldap_admin_pass='${DOLI_LDAP_BIND_PASS}'; -\$dolibarr_main_auth_ldap_debug='${DOLI_LDAP_DEBUG}'; -EOF - fi - fi - - echo "[INIT] => update ownership for file in Dolibarr Config ..." - chown www-data:www-data /var/www/html/conf/conf.php - if [[ ${DOLI_DB_TYPE} == "pgsql" && ! -f /var/www/documents/install.lock ]]; then - chmod 600 /var/www/html/conf/conf.php - else - chmod 400 /var/www/html/conf/conf.php - fi - - if [[ ${CURRENT_UID} -ne ${WWW_USER_ID} || ${CURRENT_GID} -ne ${WWW_GROUP_ID} ]]; then - # Refresh file ownership cause it has changed - echo "[INIT] => As UID / GID have changed from default, update ownership for files in /var/ww ..." - chown -R www-data:www-data /var/www - else - # Reducing load on init : change ownership only for volumes declared in docker - echo "[INIT] => update ownership for files in /var/www/documents ..." - chown -R www-data:www-data /var/www/documents - fi -} - -function waitForDataBase() -{ - r=1 - - while [[ ${r} -ne 0 ]]; do - mysql -u ${DOLI_DB_USER} --protocol tcp -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} --connect-timeout=5 -e "status" > /dev/null 2>&1 - r=$? - if [[ ${r} -ne 0 ]]; then - echo "Waiting that SQL database is up ..." - sleep 2 - fi - done -} - -function lockInstallation() -{ - touch /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock -} - -function initializeDatabase() -{ - for fileSQL in /var/www/html/install/mysql/tables/*.sql; do - if [[ ${fileSQL} != *.key.sql ]]; then - echo "Importing table from `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} # remove all comment - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} - fi - done - - for fileSQL in /var/www/html/install/mysql/tables/*.key.sql; do - echo "Importing table key from `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 - done - - for fileSQL in /var/www/html/install/mysql/functions/*.sql; do - echo "Importing `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 - done - - for fileSQL in /var/www/html/install/mysql/data/*.sql; do - echo "Importing data from `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 - done - - echo "Create SuperAdmin account ..." - pass_crypted=`echo -n ${DOLI_ADMIN_PASSWORD} | md5sum | awk '{print $1}'` - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_user (entity, login, pass_crypted, lastname, admin, statut) VALUES (0, '${DOLI_ADMIN_LOGIN}', '${pass_crypted}', 'SuperAdmin', 1, 1);" > /dev/null 2>&1 - - echo "Set some default const ..." - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_VERSION_LAST_INSTALL';" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_NOT_INSTALLED';" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_LANG_DEFAULT';" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('SYSTEMTOOLS_MYSQLDUMP', '/usr/bin/mysqldump', 'chaine', 0, '', 0);" > /dev/null 2>&1 - - echo "Enable user module ..." - php /var/www/scripts/docker-init.php -} - -function migrateDatabase() -{ - TARGET_VERSION="$(echo ${DOLI_VERSION} | cut -d. -f1).$(echo ${DOLI_VERSION} | cut -d. -f2).0" - echo "Schema update is required ..." - echo "Dumping Database into /var/www/documents/dump.sql ..." - - mysqldump -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} > /var/www/documents/dump.sql - r=${?} - if [[ ${r} -ne 0 ]]; then - echo "Dump failed ... Aborting migration ..." - return ${r} - fi - echo "Dump done ... Starting Migration ..." - - echo "" > /var/www/documents/migration_error.html - pushd /var/www/htdocs/install > /dev/null - php upgrade.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 && \ - php upgrade2.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 && \ - php step5.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 - r=$? - popd > /dev/null - - if [[ ${r} -ne 0 ]]; then - echo "Migration failed ... Restoring DB ... check file /var/www/documents/migration_error.html for more info on error ..." - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < /var/www/documents/dump.sql - echo "DB Restored ..." - return ${r} - else - echo "Migration successful ... Enjoy !!" - fi - - return 0 -} - -function run() -{ - initDolibarr - echo "Current Version is : ${DOLI_VERSION}" - - if [[ ${DOLI_INSTALL_AUTO} -eq 1 && ${DOLI_CRON} -ne 1 && ! -f /var/www/documents/install.lock && ${DOLI_DB_TYPE} != "pgsql" ]]; then - waitForDataBase - - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "SELECT Q.LAST_INSTALLED_VERSION FROM (SELECT INET_ATON(CONCAT(value, REPEAT('.0', 3 - CHAR_LENGTH(value) + CHAR_LENGTH(REPLACE(value, '.', ''))))) as VERSION_ATON, value as LAST_INSTALLED_VERSION FROM llx_const WHERE name IN ('MAIN_VERSION_LAST_INSTALL', 'MAIN_VERSION_LAST_UPGRADE') and entity=0) Q ORDER BY VERSION_ATON DESC LIMIT 1" > /tmp/lastinstall.result 2>&1 - r=$? - if [[ ${r} -ne 0 ]]; then - initializeDatabase - else - INSTALLED_VERSION=`grep -v LAST_INSTALLED_VERSION /tmp/lastinstall.result` - echo "Last installed Version is : ${INSTALLED_VERSION}" - if [[ "$(echo ${INSTALLED_VERSION} | cut -d. -f1)" -lt "$(echo ${DOLI_VERSION} | cut -d. -f1)" ]]; then - migrateDatabase - else - echo "Schema update is not required ... Enjoy !!" - fi - fi - - if [[ ${DOLI_VERSION} != "develop" ]]; then - lockInstallation - fi - fi -} - -DOLI_DB_USER=$(get_env_value 'DOLI_DB_USER' 'doli') -DOLI_DB_PASSWORD=$(get_env_value 'DOLI_DB_PASSWORD' 'doli_pass') -DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') -DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') -DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') -DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') -DOLI_INSTANCE_UNIQUE_ID=$(get_env_value 'DOLI_INSTANCE_UNIQUE_ID' '') - -run - -set -e - -if [[ ${DOLI_CRON} -eq 1 ]]; then - echo "PATH=\$PATH:/usr/local/bin" > /etc/cron.d/dolibarr - echo "*/5 * * * * root /bin/su www-data -s /bin/sh -c '/var/www/scripts/cron/cron_run_jobs.php ${DOLI_CRON_KEY} ${DOLI_CRON_USER}' > /proc/1/fd/1 2> /proc/1/fd/2" >> /etc/cron.d/dolibarr - cron -f - exit 0 -fi - -if [ "${1#-}" != "$1" ]; then - set -- apache2-foreground "$@" -fi - -exec "$@" diff --git a/images/14.0.5-php7.4/Dockerfile b/images/14.0.5-php7.4/Dockerfile deleted file mode 100644 index 7f4d779..0000000 --- a/images/14.0.5-php7.4/Dockerfile +++ /dev/null @@ -1,94 +0,0 @@ -ARG ARCH= - -FROM ${ARCH}php:7.4-apache-buster - -LABEL maintainer="Garcia MICHEL " - -ENV DOLI_VERSION 14.0.5 -ENV DOLI_INSTALL_AUTO 1 -ENV DOLI_PROD 1 - -ENV DOLI_DB_TYPE mysqli -ENV DOLI_DB_HOST mysql -ENV DOLI_DB_HOST_PORT 3306 -ENV DOLI_DB_NAME dolidb - -ENV DOLI_URL_ROOT 'http://localhost' -ENV DOLI_NOCSRFCHECK 0 - -ENV DOLI_AUTH dolibarr -ENV DOLI_LDAP_HOST 127.0.0.1 -ENV DOLI_LDAP_PORT 389 -ENV DOLI_LDAP_VERSION 3 -ENV DOLI_LDAP_SERVER_TYPE openldap -ENV DOLI_LDAP_LOGIN_ATTRIBUTE uid -ENV DOLI_LDAP_DN 'ou=users,dc=my-domain,dc=com' -ENV DOLI_LDAP_FILTER '' -ENV DOLI_LDAP_BIND_DN '' -ENV DOLI_LDAP_BIND_PASS '' -ENV DOLI_LDAP_DEBUG false - -ENV DOLI_CRON 0 - -ENV WWW_USER_ID 33 -ENV WWW_GROUP_ID 33 - -ENV PHP_INI_DATE_TIMEZONE 'UTC' -ENV PHP_INI_MEMORY_LIMIT 256M -ENV PHP_INI_UPLOAD_MAX_FILESIZE 2M -ENV PHP_INI_POST_MAX_SIZE 8M -ENV PHP_INI_ALLOW_URL_FOPEN 0 - -RUN sed -i \ - -e 's/^\(ServerSignature On\)$/#\1/g' \ - -e 's/^#\(ServerSignature Off\)$/\1/g' \ - -e 's/^\(ServerTokens\) OS$/\1 Prod/g' \ - /etc/apache2/conf-available/security.conf - -RUN apt-get update -y \ - && apt-get dist-upgrade -y \ - && apt-get install -y --no-install-recommends \ - libc-client-dev \ - libfreetype6-dev \ - libjpeg62-turbo-dev \ - libkrb5-dev \ - libldap2-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - default-mysql-client \ - postgresql-client \ - cron \ - && apt-get autoremove -y \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip \ - && docker-php-ext-configure pgsql -with-pgsql \ - && docker-php-ext-install pdo_pgsql pgsql \ - && docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \ - && docker-php-ext-install -j$(nproc) ldap \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-install imap \ - && mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini \ - && rm -rf /var/lib/apt/lists/* - -# Get Dolibarr -RUN curl -fLSs https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.tar.gz |\ - tar -C /tmp -xz && \ - cp -r /tmp/dolibarr-${DOLI_VERSION}/htdocs/* /var/www/html/ && \ - ln -s /var/www/html /var/www/htdocs && \ - cp -r /tmp/dolibarr-${DOLI_VERSION}/scripts /var/www/ && \ - rm -rf /tmp/* && \ - mkdir -p /var/www/documents && \ - mkdir -p /var/www/html/custom && \ - chown -R www-data:www-data /var/www - -EXPOSE 80 -VOLUME /var/www/documents -VOLUME /var/www/html/custom - -COPY docker-init.php /var/www/scripts/ -COPY docker-run.sh /usr/local/bin/ -ENTRYPOINT ["docker-run.sh"] - -CMD ["apache2-foreground"] diff --git a/images/14.0.5-php7.4/docker-init.php b/images/14.0.5-php7.4/docker-init.php deleted file mode 100644 index dc0dea8..0000000 --- a/images/14.0.5-php7.4/docker-init.php +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env php -init(); diff --git a/images/14.0.5-php7.4/docker-run.sh b/images/14.0.5-php7.4/docker-run.sh deleted file mode 100755 index fb463dd..0000000 --- a/images/14.0.5-php7.4/docker-run.sh +++ /dev/null @@ -1,261 +0,0 @@ -#!/bin/bash - -# usage: get_env_value VAR [DEFAULT] -# ie: get_env_value 'XYZ_DB_PASSWORD' 'example' -# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of -# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature) -function get_env_value() { - local varName="${1}" - local fileVarName="${varName}_FILE" - local defaultValue="${2:-}" - - if [ "${!varName:-}" ] && [ "${!fileVarName:-}" ]; then - echo >&2 "error: both ${varName} and ${fileVarName} are set (but are exclusive)" - exit 1 - fi - - local value="${defaultValue}" - if [ "${!varName:-}" ]; then - value="${!varName}" - elif [ "${!fileVarName:-}" ]; then - value="$(< "${!fileVarName}")" - fi - - echo ${value} - exit 0 -} - -function initDolibarr() -{ - local CURRENT_UID=$(id -u www-data) - local CURRENT_GID=$(id -g www-data) - usermod -u ${WWW_USER_ID} www-data - groupmod -g ${WWW_GROUP_ID} www-data - - if [[ ! -d /var/www/documents ]]; then - echo "[INIT] => create volume directory /var/www/documents ..." - mkdir -p /var/www/documents - fi - - echo "[INIT] => update PHP Config ..." - cat > ${PHP_INI_DIR}/conf.d/dolibarr-php.ini << EOF -date.timezone = ${PHP_INI_DATE_TIMEZONE} -sendmail_path = /usr/sbin/sendmail -t -i -memory_limit = ${PHP_INI_MEMORY_LIMIT} -upload_max_filesize = ${PHP_INI_UPLOAD_MAX_FILESIZE} -post_max_size = ${PHP_INI_POST_MAX_SIZE} -allow_url_fopen = ${PHP_INI_ALLOW_URL_FOPEN} -session.use_strict_mode = 1 -disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,passthru,shell_exec,system,proc_open,popen -EOF - -if [[ ! -f /var/www/html/conf/conf.php ]]; then - echo "[INIT] => update Dolibarr Config ..." - cat > /var/www/html/conf/conf.php << EOF - update Dolibarr Config with instance unique id ..." - cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" - fi - if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then - echo "[INIT] => update Dolibarr Config with LDAP entries ..." - cat >> /var/www/html/conf/conf.php << EOF -\$dolibarr_main_auth_ldap_host='${DOLI_LDAP_HOST}'; -\$dolibarr_main_auth_ldap_port='${DOLI_LDAP_PORT}'; -\$dolibarr_main_auth_ldap_version='${DOLI_LDAP_VERSION}'; -\$dolibarr_main_auth_ldap_servertype='${DOLI_LDAP_SERVER_TYPE}'; -\$dolibarr_main_auth_ldap_login_attribute='${DOLI_LDAP_LOGIN_ATTRIBUTE}'; -\$dolibarr_main_auth_ldap_dn='${DOLI_LDAP_DN}'; -\$dolibarr_main_auth_ldap_filter='${DOLI_LDAP_FILTER}'; -\$dolibarr_main_auth_ldap_admin_login='${DOLI_LDAP_BIND_DN}'; -\$dolibarr_main_auth_ldap_admin_pass='${DOLI_LDAP_BIND_PASS}'; -\$dolibarr_main_auth_ldap_debug='${DOLI_LDAP_DEBUG}'; -EOF - fi - fi - - echo "[INIT] => update ownership for file in Dolibarr Config ..." - chown www-data:www-data /var/www/html/conf/conf.php - if [[ ${DOLI_DB_TYPE} == "pgsql" && ! -f /var/www/documents/install.lock ]]; then - chmod 600 /var/www/html/conf/conf.php - else - chmod 400 /var/www/html/conf/conf.php - fi - - if [[ ${CURRENT_UID} -ne ${WWW_USER_ID} || ${CURRENT_GID} -ne ${WWW_GROUP_ID} ]]; then - # Refresh file ownership cause it has changed - echo "[INIT] => As UID / GID have changed from default, update ownership for files in /var/ww ..." - chown -R www-data:www-data /var/www - else - # Reducing load on init : change ownership only for volumes declared in docker - echo "[INIT] => update ownership for files in /var/www/documents ..." - chown -R www-data:www-data /var/www/documents - fi -} - -function waitForDataBase() -{ - r=1 - - while [[ ${r} -ne 0 ]]; do - mysql -u ${DOLI_DB_USER} --protocol tcp -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} --connect-timeout=5 -e "status" > /dev/null 2>&1 - r=$? - if [[ ${r} -ne 0 ]]; then - echo "Waiting that SQL database is up ..." - sleep 2 - fi - done -} - -function lockInstallation() -{ - touch /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock -} - -function initializeDatabase() -{ - for fileSQL in /var/www/html/install/mysql/tables/*.sql; do - if [[ ${fileSQL} != *.key.sql ]]; then - echo "Importing table from `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} # remove all comment - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} - fi - done - - for fileSQL in /var/www/html/install/mysql/tables/*.key.sql; do - echo "Importing table key from `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 - done - - for fileSQL in /var/www/html/install/mysql/functions/*.sql; do - echo "Importing `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 - done - - for fileSQL in /var/www/html/install/mysql/data/*.sql; do - echo "Importing data from `basename ${fileSQL}` ..." - sed -i 's/--.*//g;' ${fileSQL} - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < ${fileSQL} > /dev/null 2>&1 - done - - echo "Create SuperAdmin account ..." - pass_crypted=`echo -n ${DOLI_ADMIN_PASSWORD} | md5sum | awk '{print $1}'` - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_user (entity, login, pass_crypted, lastname, admin, statut) VALUES (0, '${DOLI_ADMIN_LOGIN}', '${pass_crypted}', 'SuperAdmin', 1, 1);" > /dev/null 2>&1 - - echo "Set some default const ..." - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_VERSION_LAST_INSTALL';" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_NOT_INSTALLED';" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "DELETE FROM llx_const WHERE name='MAIN_LANG_DEFAULT';" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) values('MAIN_VERSION_LAST_INSTALL', '${DOLI_VERSION}', 'chaine', 0, 'Dolibarr version when install', 0);" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('MAIN_LANG_DEFAULT', 'auto', 'chaine', 0, 'Default language', 1);" > /dev/null 2>&1 - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "INSERT INTO llx_const(name,value,type,visible,note,entity) VALUES ('SYSTEMTOOLS_MYSQLDUMP', '/usr/bin/mysqldump', 'chaine', 0, '', 0);" > /dev/null 2>&1 - - echo "Enable user module ..." - php /var/www/scripts/docker-init.php -} - -function migrateDatabase() -{ - TARGET_VERSION="$(echo ${DOLI_VERSION} | cut -d. -f1).$(echo ${DOLI_VERSION} | cut -d. -f2).0" - echo "Schema update is required ..." - echo "Dumping Database into /var/www/documents/dump.sql ..." - - mysqldump -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} > /var/www/documents/dump.sql - r=${?} - if [[ ${r} -ne 0 ]]; then - echo "Dump failed ... Aborting migration ..." - return ${r} - fi - echo "Dump done ... Starting Migration ..." - - echo "" > /var/www/documents/migration_error.html - pushd /var/www/htdocs/install > /dev/null - php upgrade.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 && \ - php upgrade2.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 && \ - php step5.php ${INSTALLED_VERSION} ${TARGET_VERSION} >> /var/www/documents/migration_error.html 2>&1 - r=$? - popd > /dev/null - - if [[ ${r} -ne 0 ]]; then - echo "Migration failed ... Restoring DB ... check file /var/www/documents/migration_error.html for more info on error ..." - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} < /var/www/documents/dump.sql - echo "DB Restored ..." - return ${r} - else - echo "Migration successful ... Enjoy !!" - fi - - return 0 -} - -function run() -{ - initDolibarr - echo "Current Version is : ${DOLI_VERSION}" - - if [[ ${DOLI_INSTALL_AUTO} -eq 1 && ${DOLI_CRON} -ne 1 && ! -f /var/www/documents/install.lock && ${DOLI_DB_TYPE} != "pgsql" ]]; then - waitForDataBase - - mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "SELECT Q.LAST_INSTALLED_VERSION FROM (SELECT INET_ATON(CONCAT(value, REPEAT('.0', 3 - CHAR_LENGTH(value) + CHAR_LENGTH(REPLACE(value, '.', ''))))) as VERSION_ATON, value as LAST_INSTALLED_VERSION FROM llx_const WHERE name IN ('MAIN_VERSION_LAST_INSTALL', 'MAIN_VERSION_LAST_UPGRADE') and entity=0) Q ORDER BY VERSION_ATON DESC LIMIT 1" > /tmp/lastinstall.result 2>&1 - r=$? - if [[ ${r} -ne 0 ]]; then - initializeDatabase - else - INSTALLED_VERSION=`grep -v LAST_INSTALLED_VERSION /tmp/lastinstall.result` - echo "Last installed Version is : ${INSTALLED_VERSION}" - if [[ "$(echo ${INSTALLED_VERSION} | cut -d. -f1)" -lt "$(echo ${DOLI_VERSION} | cut -d. -f1)" ]]; then - migrateDatabase - else - echo "Schema update is not required ... Enjoy !!" - fi - fi - - if [[ ${DOLI_VERSION} != "develop" ]]; then - lockInstallation - fi - fi -} - -DOLI_DB_USER=$(get_env_value 'DOLI_DB_USER' 'doli') -DOLI_DB_PASSWORD=$(get_env_value 'DOLI_DB_PASSWORD' 'doli_pass') -DOLI_ADMIN_LOGIN=$(get_env_value 'DOLI_ADMIN_LOGIN' 'admin') -DOLI_ADMIN_PASSWORD=$(get_env_value 'DOLI_ADMIN_PASSWORD' 'admin') -DOLI_CRON_KEY=$(get_env_value 'DOLI_CRON_KEY' '') -DOLI_CRON_USER=$(get_env_value 'DOLI_CRON_USER' '') -DOLI_INSTANCE_UNIQUE_ID=$(get_env_value 'DOLI_INSTANCE_UNIQUE_ID' '') - -run - -set -e - -if [[ ${DOLI_CRON} -eq 1 ]]; then - echo "PATH=\$PATH:/usr/local/bin" > /etc/cron.d/dolibarr - echo "*/5 * * * * root /bin/su www-data -s /bin/sh -c '/var/www/scripts/cron/cron_run_jobs.php ${DOLI_CRON_KEY} ${DOLI_CRON_USER}' > /proc/1/fd/1 2> /proc/1/fd/2" >> /etc/cron.d/dolibarr - cron -f - exit 0 -fi - -if [ "${1#-}" != "$1" ]; then - set -- apache2-foreground "$@" -fi - -exec "$@" diff --git a/versions.sh b/versions.sh index 3dfe793..af5dd1d 100644 --- a/versions.sh +++ b/versions.sh @@ -2,5 +2,5 @@ set -e -DOLIBARR_VERSIONS=( "11.0.5" "12.0.5" "13.0.4" "14.0.5" "15.0.3" "16.0.5" "17.0.3" "18.0.1" "develop" ) +DOLIBARR_VERSIONS=( "15.0.3" "16.0.5" "17.0.3" "18.0.1" "develop" ) DOLIBARR_LATEST_TAG="18.0.1" From 69564347023deb203910abe7a29174589f05a731 Mon Sep 17 00:00:00 2001 From: Alban Durrheimer Date: Fri, 8 Sep 2023 14:02:31 +0200 Subject: [PATCH 22/24] Fix dolibarr_main_instance_unique_id (#132) --- docker-compose.yml | 1 + docker-run.sh | 2 +- images/15.0.3-php7.4/docker-run.sh | 2 +- images/16.0.5-php8.1/docker-run.sh | 2 +- images/17.0.3-php8.1/docker-run.sh | 2 +- images/18.0.1-php8.1/docker-run.sh | 2 +- images/develop/docker-run.sh | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 16c6adf..40d2ae7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,6 +47,7 @@ services: DOLI_CRON: 1 DOLI_CRON_KEY: xxxx DOLI_CRON_USER: administrator + DOLI_INSTANCE_UNIQUE_ID: xxxx DOLI_DB_USER_FILE: /run/secrets/mysql-user DOLI_DB_PASSWORD_FILE: /run/secrets/mysql-password DOLI_ADMIN_LOGIN: administrator diff --git a/docker-run.sh b/docker-run.sh index fb463dd..69e3e3d 100755 --- a/docker-run.sh +++ b/docker-run.sh @@ -70,7 +70,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then EOF if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then echo "[INIT] => update Dolibarr Config with instance unique id ..." - cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + echo "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" >> /var/www/html/conf/conf.php fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." diff --git a/images/15.0.3-php7.4/docker-run.sh b/images/15.0.3-php7.4/docker-run.sh index fb463dd..69e3e3d 100755 --- a/images/15.0.3-php7.4/docker-run.sh +++ b/images/15.0.3-php7.4/docker-run.sh @@ -70,7 +70,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then EOF if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then echo "[INIT] => update Dolibarr Config with instance unique id ..." - cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + echo "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" >> /var/www/html/conf/conf.php fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." diff --git a/images/16.0.5-php8.1/docker-run.sh b/images/16.0.5-php8.1/docker-run.sh index fb463dd..69e3e3d 100755 --- a/images/16.0.5-php8.1/docker-run.sh +++ b/images/16.0.5-php8.1/docker-run.sh @@ -70,7 +70,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then EOF if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then echo "[INIT] => update Dolibarr Config with instance unique id ..." - cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + echo "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" >> /var/www/html/conf/conf.php fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." diff --git a/images/17.0.3-php8.1/docker-run.sh b/images/17.0.3-php8.1/docker-run.sh index fb463dd..69e3e3d 100755 --- a/images/17.0.3-php8.1/docker-run.sh +++ b/images/17.0.3-php8.1/docker-run.sh @@ -70,7 +70,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then EOF if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then echo "[INIT] => update Dolibarr Config with instance unique id ..." - cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + echo "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" >> /var/www/html/conf/conf.php fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." diff --git a/images/18.0.1-php8.1/docker-run.sh b/images/18.0.1-php8.1/docker-run.sh index fb463dd..69e3e3d 100755 --- a/images/18.0.1-php8.1/docker-run.sh +++ b/images/18.0.1-php8.1/docker-run.sh @@ -70,7 +70,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then EOF if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then echo "[INIT] => update Dolibarr Config with instance unique id ..." - cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + echo "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" >> /var/www/html/conf/conf.php fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." diff --git a/images/develop/docker-run.sh b/images/develop/docker-run.sh index fb463dd..69e3e3d 100755 --- a/images/develop/docker-run.sh +++ b/images/develop/docker-run.sh @@ -70,7 +70,7 @@ if [[ ! -f /var/www/html/conf/conf.php ]]; then EOF if [[ ! -z ${DOLI_INSTANCE_UNIQUE_ID} ]]; then echo "[INIT] => update Dolibarr Config with instance unique id ..." - cat >> /var/www/html/conf/conf.php << "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" + echo "\$dolibarr_main_instance_unique_id='${DOLI_INSTANCE_UNIQUE_ID}';" >> /var/www/html/conf/conf.php fi if [[ ${DOLI_AUTH} =~ .*ldap.* ]]; then echo "[INIT] => update Dolibarr Config with LDAP entries ..." From 6a927a057b24eb0ce4aafda0c31b8ce82a2f4260 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Sat, 7 Oct 2023 20:01:08 +0200 Subject: [PATCH 23/24] Add DOLI_INSTANCE_UNIQUE_ID on web container for testing --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 40d2ae7..66fecdc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -72,6 +72,7 @@ services: depends_on: - mariadb environment: + DOLI_INSTANCE_UNIQUE_ID: xxxx DOLI_DB_USER_FILE: "/run/secrets/mysql-user" DOLI_DB_PASSWORD_FILE: "/run/secrets/mysql-password" DOLI_ADMIN_LOGIN: "administrator" From 1341c6cdffd7bef73a37675973d92077729f9f6f Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Sat, 7 Oct 2023 20:03:36 +0200 Subject: [PATCH 24/24] Add version 18.0.2 --- README.md | 2 +- images/{18.0.1-php8.1 => 18.0.2-php8.1}/Dockerfile | 2 +- images/{18.0.1-php8.1 => 18.0.2-php8.1}/docker-init.php | 0 images/{18.0.1-php8.1 => 18.0.2-php8.1}/docker-run.sh | 0 versions.sh | 4 ++-- 5 files changed, 4 insertions(+), 4 deletions(-) rename images/{18.0.1-php8.1 => 18.0.2-php8.1}/Dockerfile (99%) rename images/{18.0.1-php8.1 => 18.0.2-php8.1}/docker-init.php (100%) rename images/{18.0.1-php8.1 => 18.0.2-php8.1}/docker-run.sh (100%) diff --git a/README.md b/README.md index c83fbc2..005f908 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Docker image for Dolibarr with auto installer on first boot. * 15.0.3-php7.4 15.0.3 15 * 16.0.5-php8.1 16.0.5 16 * 17.0.3-php8.1 17.0.3 17 -* 18.0.1-php8.1 18.0.1 18 latest +* 18.0.2-php8.1 18.0.2 18 latest * develop **End of support for PHP < 7.4** diff --git a/images/18.0.1-php8.1/Dockerfile b/images/18.0.2-php8.1/Dockerfile similarity index 99% rename from images/18.0.1-php8.1/Dockerfile rename to images/18.0.2-php8.1/Dockerfile index fce1d62..dbab309 100644 --- a/images/18.0.1-php8.1/Dockerfile +++ b/images/18.0.2-php8.1/Dockerfile @@ -4,7 +4,7 @@ FROM ${ARCH}php:8.1-apache-buster LABEL maintainer="Garcia MICHEL " -ENV DOLI_VERSION 18.0.1 +ENV DOLI_VERSION 18.0.2 ENV DOLI_INSTALL_AUTO 1 ENV DOLI_PROD 1 diff --git a/images/18.0.1-php8.1/docker-init.php b/images/18.0.2-php8.1/docker-init.php similarity index 100% rename from images/18.0.1-php8.1/docker-init.php rename to images/18.0.2-php8.1/docker-init.php diff --git a/images/18.0.1-php8.1/docker-run.sh b/images/18.0.2-php8.1/docker-run.sh similarity index 100% rename from images/18.0.1-php8.1/docker-run.sh rename to images/18.0.2-php8.1/docker-run.sh diff --git a/versions.sh b/versions.sh index af5dd1d..4dc93d7 100644 --- a/versions.sh +++ b/versions.sh @@ -2,5 +2,5 @@ set -e -DOLIBARR_VERSIONS=( "15.0.3" "16.0.5" "17.0.3" "18.0.1" "develop" ) -DOLIBARR_LATEST_TAG="18.0.1" +DOLIBARR_VERSIONS=( "15.0.3" "16.0.5" "17.0.3" "18.0.2" "develop" ) +DOLIBARR_LATEST_TAG="18.0.2"