Skip to content

Commit

Permalink
Merge branch 'develop' into 21various
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy authored Nov 8, 2024
2 parents 0eb6dca + 77efa1b commit 4198c8c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
20 changes: 13 additions & 7 deletions build/docker/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# How to use it ?
# How to use run Dolibarr with docker ?

This directory is experimental. Scope of its used is not clear and not documented.
If you are looking for a process to run Dolibarr as an official Docker image, you can find it on https://hub.docker.com/r/dolibarr/dolibarr


# For experimental dev - TO REMOVE.
## For a fast run of a demo of the local version, you can build the docker image from this current repository by running

But if you want to execute the version of Dolibarr that is into this current directory as a docker process, you can do it with this commands.

sudo docker-compose build

sudo -s

export HOST_USER_ID=$(id -u)
export HOST_GROUP_ID=$(id -g)
export MYSQL_ROOT_PWD=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13; echo)

docker-compose up -d

Warning: There is no persistency of data. If you need so, you should use instead the official Docker image that you can find on https://hub.docker.com/r/dolibarr/dolibarr

Warning: There is no persistency of data. This process is for dev purpose only.


## For a more robust or a production usage

If you want to execute an official Docker package, you can find it and read the doc on ihttps://hub.docker.com/r/dolibarr/dolibarr
18 changes: 13 additions & 5 deletions build/docker/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,26 @@
# Script used by the Dockerfile.
# See README.md to know how to create a Dolibarr env with docker

if [ "${PHP_INI_DIR}" == "" ]; then
echo
echo This script must not be run directly. It is used by the Dockerfile
echo See README.md
echo
exit
fi

usermod -u "${HOST_USER_ID}" www-data
groupmod -g "${HOST_GROUP_ID}" www-data

chgrp -hR www-data /var/www/html
chmod g+rwx /var/www/html/conf

if [ ! -d /var/documents ]; then
echo "[docker-run] => create volume directory /var/documents ..."
mkdir -p /var/documents
if [ ! -d /var/www/documents ]; then
echo "[docker-run] => create volume directory /var/www/documents ..."
mkdir -p /var/www/documents
fi
echo "[docker-run] => Set Permission to www-data for /var/documents"
chown -R www-data:www-data /var/documents
echo "[docker-run] => Set Permission to www-data for /var/www/documents"
chown -R www-data:www-data /var/www/documents

echo "[docker-run] => update '${PHP_INI_DIR}/conf.d/dolibarr-php.ini'"
cat <<EOF > "${PHP_INI_DIR}/conf.d/dolibarr-php.ini"
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -12897,7 +12897,7 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
* @param string $elementType Element type (Value of $object->element or value of $object->element@$object->module). Example:
* 'action', 'facture', 'project', 'project_task' or
* 'myobject@mymodule' (or old syntax 'mymodule_myobject' like 'project_task')
* @return array{module:string,element:string,table_element:string,subelement:string,classpath:string,classfile:string,classname:string,dir_output:string} array('module'=>, 'classpath'=>, 'element'=>, 'subelement'=>, 'classfile'=>, 'classname'=>, 'dir_output'=>)
* @return array{module:string,element:string,table_element:string,subelement:string,classpath:string,classfile:string,classname:string,dir_output:string,dir_temp:string} array('module'=>, 'classpath'=>, 'element'=>, 'subelement'=>, 'classfile'=>, 'classname'=>, 'dir_output'=>, 'dir_temp'=>)
* @see fetchObjectByElement(), getMultidirOutput()
*/
function getElementProperties($elementType)
Expand Down
3 changes: 2 additions & 1 deletion htdocs/core/upload_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@

$permissiontoadd = $user->hasRight($module, $permlevel1, 'read');
$upload_dir = $dir_temp.'/import';
var_dump($upload_dir);

include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
}

Expand Down Expand Up @@ -203,6 +203,7 @@
$maxmin = $maxfilesizearray['maxmin'];
$maxphptoshow = $maxfilesizearray['maxphptoshow'];
$maxphptoshowparam = $maxfilesizearray['maxphptoshowparam'];
$out = '';
if ($maxmin > 0) {
$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
}
Expand Down

0 comments on commit 4198c8c

Please sign in to comment.