Skip to content

Comments

Maintenance Allowed IP list#147

Merged
bennothommo merged 15 commits intodevelopfrom
wip/maintenance-ip-whitelist
Sep 7, 2021
Merged

Maintenance Allowed IP list#147
bennothommo merged 15 commits intodevelopfrom
wip/maintenance-ip-whitelist

Conversation

@jaxwilko
Copy link
Member

@jaxwilko jaxwilko commented May 4, 2021

This PR adds support for whitelisting IP addresses to be allowed to visit the frontend while in maintenance mode. This is really useful when you have a site in maintenance mode to avoid being indexed by crawlers or for staging sites where automated tools need to be ran.

Backend Form

Uses Request::ip() under the hood for IP detection.

Co-authored-by: Luke Towers <github@luketowers.ca>
@LukeTowers LukeTowers added Status: In Progress enhancement PRs that implement a new feature or substantial change labels May 4, 2021
@damsfx
Copy link
Contributor

damsfx commented May 4, 2021

Nice!
I Always use this option with a little bit of code in themes to show "pre openning" or waiting pages to visitors, and at the same time let backend users to use the website in real conditions.

@LukeTowers
Copy link
Member

Minor point, but as developers in general we should probably move away from white/black list terminology towards include/exclude instead as it's more clear to newcomers and less controversial. I would name the field "Allowed IP addresses" with the visual comment "IP addresses that are permitted to view the site while maintenance mode is active".

@WebVPF
Copy link
Contributor

WebVPF commented May 5, 2021

How about adding the line "Your ip ..." before the list of allowed ip addresses, where to display the user's current ip address and the button "Add ip to the allowed list" if the ip is not in the allowed list?

And is it possible to do this functionality the same way to access the backend? Store only an array with allowed IP addresses in the config/cms.php file.

@LukeTowers
Copy link
Member

And is it possible to do this functionality the same way to access the backend? Store only an array with allowed IP addresses in the config/cms.php file.

@WebVPF that could easily be achieved via a plugin

@bennothommo bennothommo marked this pull request as draft May 6, 2021 02:11
@bennothommo bennothommo changed the title [WIP] Maintenance IP Whitelist Maintenance IP Whitelist May 6, 2021
@bennothommo bennothommo changed the title Maintenance IP Whitelist Maintenance Allowed IP list May 6, 2021
@bennothommo bennothommo added this to the v1.1.4 milestone May 6, 2021
@bennothommo bennothommo removed this from the v1.1.4 milestone May 21, 2021
@jaxwilko jaxwilko marked this pull request as ready for review June 18, 2021 10:08
@jaxwilko jaxwilko added the needs review Issues/PRs that require a review from a maintainer label Jun 18, 2021
@bennothommo bennothommo added this to the v1.1.5 milestone Jun 29, 2021
@github-actions
Copy link

This pull request will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this is still being worked on, please respond and we will re-open this pull request.
If this pull request is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions github-actions bot added the stale Issues/PRs that have had no activity and may be archived label Aug 29, 2021
@LukeTowers LukeTowers removed the stale Issues/PRs that have had no activity and may be archived label Aug 29, 2021
@bennothommo
Copy link
Member

Just to note, as I'm having a look into it now, but this functionality does not support trusted proxies currently. It's using the proxy's IP in the lookup for allowed IPs.

@bennothommo bennothommo added Status: Revision Needed and removed needs review Issues/PRs that require a review from a maintainer labels Aug 30, 2021
@bennothommo
Copy link
Member

My previous comment can be ignored. It seems to be something intrinsic to Gitpod in not forwarding on my actual IP - it doesn't happen on other proxies.

@bennothommo bennothommo merged commit 26c8995 into develop Sep 7, 2021
@bennothommo bennothommo deleted the wip/maintenance-ip-whitelist branch September 7, 2021 08:45
LukeTowers added a commit that referenced this pull request Nov 13, 2021
* develop: (25 commits)
  Support embedded data URIs in the list image column type
  Make some adjustments to the readme content
  Update banner in readme
  Add new GitHub banner
  Documentation with icons (#347)
  Limit options shown in group filter, apply scope when retrieving filtered options
  Add Exception on wrong relation type in relation formwidget (#334)
  Redesigned color picker widget (#324)
  Add winter:test command (#202)
  Use the correct backend timezone config key (#337)
  Get changelog only of the current branch
  Fix Markdown editor sizing issue on Chrome.
  Check overrides for parent locale when compiling language files (#242)
  Fixing commas in English translation files (#305)
  Added Latvian translations for Allowed IP messages (#304)
  Add missing filter translations (#303)
  Clean up newlines
  Update Russian language (#302)
  Fix issue present in overriding RelationController partials using the default code
  Maintenance Allowed IP list (#147)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement PRs that implement a new feature or substantial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants