expose configuration option for s3

This commit is contained in:
SergiX44 2021-08-15 21:33:44 +02:00
parent 2be6d1994d
commit 54284424ff
5 changed files with 12 additions and 8 deletions

View file

@ -1,8 +1,8 @@
Options -Indexes
Options -Indexes +SymLinksIfOwnerMatch
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(app|bin|bootstrap|resources|storage|vendor|logs|CHANGELOG.md)(/.*|)$ - [NC,F]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
</IfModule>

View file

@ -81,7 +81,7 @@ class AdminController extends Controller
$out = [];
$out['Default - Bootstrap 4 default theme'] = 'https://bootswatch.com/4/_vendor/bootstrap/dist/css/bootstrap.min.css';
$out['Default - Bootstrap 4 default theme'] = self::DEFAULT_THEME_URL;
foreach ($apiJson->themes as $theme) {
$out["{$theme->name} - {$theme->description}"] = $theme->cssMin;
}

View file

@ -27,6 +27,8 @@ use Psr\Http\Message\ServerRequestInterface as Request;
*/
abstract class Controller
{
protected const DEFAULT_THEME_URL = 'https://bootswatch.com/4/_vendor/bootstrap/dist/css/bootstrap.min.css';
/** @var Container */
protected $container;

View file

@ -9,8 +9,6 @@ use Psr\Http\Message\ServerRequestInterface as Request;
class SettingController extends Controller
{
public const DEFAULT_THEME_URL = 'https://bootswatch.com/4/_vendor/bootstrap/dist/css/bootstrap.min.css';
/**
* @param Request $request
* @param Response $response
@ -76,7 +74,8 @@ class SettingController extends Controller
if (!is_writable(BASE_DIR.'static/bootstrap/css/bootstrap.min.css')) {
$this->session->alert(lang('cannot_write_file'), 'danger');
} else {
file_put_contents(BASE_DIR.'static/bootstrap/css/bootstrap.min.css', file_get_contents(param($request, 'css')));
file_put_contents(BASE_DIR.'static/bootstrap/css/bootstrap.min.css',
file_get_contents(param($request, 'css')));
}
// if is default, remove setting
@ -95,9 +94,11 @@ class SettingController extends Controller
private function updateSetting($key, $value = null)
{
if (!$this->database->query('SELECT `value` FROM `settings` WHERE `key` = '.$this->database->getPdo()->quote($key))->fetch()) {
$this->database->query('INSERT INTO `settings`(`key`, `value`) VALUES ('.$this->database->getPdo()->quote($key).', ?)', $value);
$this->database->query('INSERT INTO `settings`(`key`, `value`) VALUES ('.$this->database->getPdo()->quote($key).', ?)',
$value);
} else {
$this->database->query('UPDATE `settings` SET `value`=? WHERE `key` = '.$this->database->getPdo()->quote($key), $value);
$this->database->query('UPDATE `settings` SET `value`=? WHERE `key` = '.$this->database->getPdo()->quote($key),
$value);
}
}
}

View file

@ -58,6 +58,7 @@ return [
'region' => $config['storage']['region'],
'endpoint' => $config['storage']['endpoint'],
'version' => 'latest',
'use_path_style_endpoint' => $config['storage']['use_path_style_endpoint'] ?? false,
'@http' => ['stream' => true],
]);