Merge pull request #1701 from wallabag/v2-maintenance

Fix #1351: add maintenance mode
This commit is contained in:
Jeremy Benoist 2016-02-22 13:40:15 +01:00
commit 2b71f68c95
7 changed files with 80 additions and 1 deletions

View file

@ -34,6 +34,7 @@ class AppKernel extends Kernel
new Wallabag\ImportBundle\WallabagImportBundle(), new Wallabag\ImportBundle\WallabagImportBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new Craue\ConfigBundle\CraueConfigBundle(), new Craue\ConfigBundle\CraueConfigBundle(),
new Lexik\Bundle\MaintenanceBundle\LexikMaintenanceBundle(),
]; ];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {

View file

@ -200,3 +200,13 @@ scheb_two_factor:
kphoen_rulerz: kphoen_rulerz:
executors: executors:
doctrine: true doctrine: true
lexik_maintenance:
authorized:
ips: ['127.0.0.1']
driver:
ttl: 3600
class: 'Lexik\Bundle\MaintenanceBundle\Drivers\DatabaseDriver'
response:
code: 503
status: "wallabag Service Temporarily Unavailable"

View file

@ -65,7 +65,8 @@
"doctrine/doctrine-migrations-bundle": "^1.0", "doctrine/doctrine-migrations-bundle": "^1.0",
"paragonie/random_compat": "~1.0", "paragonie/random_compat": "~1.0",
"craue/config-bundle": "~1.4", "craue/config-bundle": "~1.4",
"mnapoli/piwik-twig-extension": "^1.0" "mnapoli/piwik-twig-extension": "^1.0",
"lexik/maintenance-bundle": "~2.1"
}, },
"require-dev": { "require-dev": {
"doctrine/doctrine-fixtures-bundle": "~2.2", "doctrine/doctrine-fixtures-bundle": "~2.2",

View file

@ -0,0 +1,32 @@
Maintenance mode
================
If you have some long tasks to do on your wallabag instance, you can enable a maintenance mode.
Nobody will have access to your instance.
Enable maintenance mode
-----------------------
To enable maintenance mode, execute this command:
::
bin/console lexik:maintenance:lock --no-interaction
You can set your IP address in ``app/config/config.yml`` if you want to access to wallabag even if maintenance mode is enabled. For example:
::
lexik_maintenance:
authorized:
ips: ['127.0.0.1']
Disable maintenance mode
------------------------
To disable maintenance mode, execute this command:
::
bin/console lexik:maintenance:unlock

View file

@ -41,3 +41,4 @@ The main documentation for this application is organized into a couple sections:
developer/docker developer/docker
developer/translate developer/translate
developer/maintenance

View file

@ -0,0 +1,33 @@
Mode maintenance
================
Si vous devez effectuer de longues tâches sur votre instance de wallabag, vous pouvez activer le mode maintenance.
Plus personne ne pourra accéder à wallabag.
Activer le mode maintenance
---------------------------
Pour activer le mode maintenance, exécutez cette commande :
::
bin/console lexik:maintenance:lock --no-interaction
Vous pouvez spécifier votre adresse IP dans ``app/config/config.yml`` si vous souhaitez accéder à wallabag même si
le mode maintenance est activé. Par exemple :
::
lexik_maintenance:
authorized:
ips: ['127.0.0.1']
Désactiver le mode maintenance
------------------------------
Pour désactiver le mode maintenance, exécutez cette commande :
::
bin/console lexik:maintenance:unlock

View file

@ -42,3 +42,4 @@ La documentation principale de cette application est découpée en plusieurs sec
developer/docker developer/docker
developer/translate developer/translate
developer/maintenance