mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-19 16:58:42 +02:00
fix: introduce system env var, remove debug mode (#4658)
* fix: introduce system env var * docs * docs
This commit is contained in:
parent
a128c05a97
commit
81ce9c9483
12 changed files with 55 additions and 95 deletions
22
lib/html.php
22
lib/html.php
|
@ -15,19 +15,15 @@ function render(string $template, array $context = []): string
|
|||
'level' => 'info',
|
||||
];
|
||||
}
|
||||
if (Debug::isEnabled()) {
|
||||
$debugModeWhitelist = Configuration::getConfig('system', 'debug_mode_whitelist') ?: [];
|
||||
if ($debugModeWhitelist === []) {
|
||||
$context['messages'][] = [
|
||||
'body' => 'Warning : Debug mode is active from any location, make sure only you can access RSS-Bridge.',
|
||||
'level' => 'error'
|
||||
];
|
||||
} else {
|
||||
$context['messages'][] = [
|
||||
'body' => 'Warning : Debug mode is active from your IP address, your requests will bypass the cache.',
|
||||
'level' => 'warning'
|
||||
];
|
||||
}
|
||||
if (Configuration::getConfig('system', 'env') === 'dev') {
|
||||
$context['messages'][] = [
|
||||
'body' => 'System environment: dev',
|
||||
'level' => 'error'
|
||||
];
|
||||
$context['messages'][] = [
|
||||
'body' => sprintf('Cache type: %s', Configuration::getConfig('cache', 'type')),
|
||||
'level' => 'info'
|
||||
];
|
||||
}
|
||||
$context['page'] = render_template($template, $context);
|
||||
return render_template('base.html.php', $context);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue