Skip to content

Commit

Permalink
feat: add system config enable_maintenance_mode (#3497)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvikan authored Jul 6, 2023
1 parent 8f91474 commit f8801d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions actions/DisplayAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class DisplayAction implements ActionInterface
{
public function execute(array $request)
{
if (Configuration::getConfig('system', 'enable_maintenance_mode')) {
return new Response('503 Service Unavailable', 503);
}

$bridgeFactory = new BridgeFactory();

$bridgeClassName = $bridgeFactory->createBridgeClassName($request['bridge'] ?? '');
Expand Down
3 changes: 3 additions & 0 deletions config.default.ini.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
; debug_mode_whitelist[] = 127.0.0.1
; debug_mode_whitelist[] = 192.168.1.10

; Whether to enable maintenance mode. If enabled, feed requests receive 503 Service Unavailable
enable_maintenance_mode = false

[http]
timeout = 60
useragent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0"
Expand Down

0 comments on commit f8801d8

Please sign in to comment.