Git Product home page Git Product logo

wd-maintenance-bundle's Introduction

webetdesign/wd-maintenance-bundle

Bundle to temparary disable website. Work for multisite.

Requirement

  • PHP ^8.0
  • symfony ^5

Installation

Add the repo to your composer.json

"repositories": [
	 {
	   "type": "git",
	   "url": "https://github.com/webetdesign/wd-maintenance-bundle.git"
	 }
],

And

composer require webetdesign/wd-maintenance-bundle

Register the bundles in config/bundles.php

return [
    ...
    WebEtDesign\MaintenanceBundle\WDMaintenanceBundle::class => ['all' => true],
    ...
];

Register routes

# config/routes/wd_maintenance.yaml
wd_maintenance:
  resource: "@WDMaintenanceBundle/Resources/config/routes.yaml"

Exclude maintenance file

#.gitignore
# Used to store IP
/var/.maintenance

Security

#config/packages/security.yaml
access_control:
  - { path: ^/maintenance/authorize/.*, roles: IS_AUTHENTICATED_ANONYMOUSLY }

Enable maintenance mode

If a client with a IP in the list try to access website during maintenance mode, he won't be blocked

# Provide a list of white IP
bin/console app:maintenance-mode --on "ip_1,ip_2,ip_3"

# Specify the CmsSite host to enable (default all website enabled)
bin/console app:maintenance-mode --on "ip_1,ip_2,ip_3" mysite.com

Disable maintenance mode

# Disable for all website
bin/console app:maintenance-mode --off

# Specify the CmsSite host to disable (default all website edited)
bin/console app:maintenance-mode --off mysite.com

White link

Configure white list hash

MAINTENANCE_BUNDLE_HASH=my_hash

You can send a link to somenone to give him access whitout adding is IP. Provide a value to MAINTENANCE_BUNDLE_HASH in the .env.local file.

bin/console app:maintenance-mode-link

Don't forget to ask IKOULA to trust cookie used to verify the link : MAINTENANCE_WHITE_LINK

wd-maintenance-bundle's People

Contributors

br-development avatar youpidok avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.