Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Add) Ip blocking system #3136

Merged
merged 4 commits into from
Nov 6, 2023
Merged

(Add) Ip blocking system #3136

merged 4 commits into from
Nov 6, 2023

Conversation

HDVinnie
Copy link
Collaborator

@HDVinnie HDVinnie commented Sep 11, 2023

No description provided.

@HDVinnie HDVinnie marked this pull request as ready for review September 11, 2023 17:45
app/Http/Middleware/BlockIpAddress.php Outdated Show resolved Hide resolved
{
Schema::create('blocked_ips', function (Blueprint $table): void {
$table->id();
$table->unsignedInteger('user_id');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should block ranges instead of IPs directly. Blocked IPs aren't always associated with a user, so the user_id should be nullable as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the user_id here is not related to a blocked member but is just to show what staff member initiated the block on said IP.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that makes sense. Ranges would still be useful however if easy enough.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wildcards would be nice also. xxx.xxx.xxx.* for instance, to block the /24

app/Models/BlockedIp.php Outdated Show resolved Hide resolved
HDVinnie and others added 2 commits September 12, 2023 19:25
Co-authored-by: Roardom <78790963+Roardom@users.noreply.github.com>
@HDVinnie HDVinnie merged commit aae2322 into 7.x.x Nov 6, 2023
8 checks passed
@HDVinnie HDVinnie deleted the Ip-Blocking branch November 6, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants