Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker improvements #411

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM composer as composer
COPY composer.json composer.lock ./
RUN composer install --ignore-platform-reqs --no-dev

FROM php:8.1-apache
FROM php:8.3-apache
RUN apt-get update && apt-get install -y zlib1g-dev \
libzip-dev \
libldap2-dev \
Expand Down
4 changes: 2 additions & 2 deletions docker/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
| application/logs/ folder. Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';
$config['log_path'] = 'php://stdout';

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -229,7 +229,7 @@
| MUST set an encryption key. See the user guide for info.
|
*/
$config['encryption_key'] = 'YJ9FljXV4axG7QTzEzbRaUBFwi0FzIls';
$config['encryption_key'] = getEnv('ENC_KEY') ?: 'YJ9FljXV4axG7QTzEzbRaUBFwi0FzIls';

/*
|--------------------------------------------------------------------------
Expand Down
17 changes: 10 additions & 7 deletions system/core/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,14 @@ public function __construct()
$this->_file_ext = (isset($config['log_file_extension']) && $config['log_file_extension'] !== '')
? ltrim($config['log_file_extension'], '.') : 'php';

file_exists($this->_log_path) OR mkdir($this->_log_path, 0755, TRUE);

if ( ! is_dir($this->_log_path) OR ! is_really_writable($this->_log_path))
{
$this->_enabled = FALSE;
if ($this->_log_path !== 'php://stdout')
{
file_exists($this->_log_path) OR mkdir($this->_log_path, 0755, TRUE);

if ( ! is_dir($this->_log_path) OR ! is_really_writable($this->_log_path))
{
$this->_enabled = FALSE;
}
}

if (is_numeric($config['log_threshold']))
Expand Down Expand Up @@ -183,10 +186,10 @@ public function write_log($level, $msg)
return FALSE;
}

$filepath = $this->_log_path.'log-'.date('Y-m-d').'.'.$this->_file_ext;
$filepath = $this->_log_path === 'php://stdout' ? $this->_log_path : $this->_log_path.'log-'.date('Y-m-d').'.'.$this->_file_ext;
$message = '';

if ( ! file_exists($filepath))
if ($this->_log_path !== 'php://stdout' AND ! file_exists($filepath))
{
$newfile = TRUE;
// Only add protection to php files
Expand Down