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

IP Block List #3761

Merged
merged 33 commits into from
Feb 12, 2024
Merged

IP Block List #3761

merged 33 commits into from
Feb 12, 2024

Conversation

aerosol
Copy link
Member

@aerosol aerosol commented Feb 6, 2024

Changes

This PR introduces a basic IP Block List feature. Users are able to add up to 30 IP (v4/v6) Addresses that will be rejected on ingest. A common use case is to block own IP, and this is hopefully made easy. IP ranges (netmask support) will be implemented in a follow-up if there's demand.

The rules are kept in a separate cache process for ingestion lookups and refreshed periodically.
BTW some room is already made for the upcoming Shields - the main live view will later on contain tabs with rule counters.

Reviewing commit-by-commit should work, and apologies for +1k, can split if anyone's struggling.

The docs will require an update + the ℹ️ heroicon link is currently missing from the panel. Migration will be extracted to a separate PR once review is conducted.

There's one minor annoyance with Ecto.Network, ref adam12/ecto_network#28

record-2024-02-07-15-08-19-demo.moen.rule.mp4

edit: Added simple "updated_by" tracking

record-2024-02-08-16-16-26-gulp.john.owls.mp4

Tests

  • Automated tests have been added
  • This PR does not require tests

Changelog

  • Entry has been added to changelog
  • This PR does not make a user-facing change

Documentation

  • Docs have been updated
  • This change does not need a documentation update

Dark mode

  • The UI has been tested both in dark and light mode
  • This PR does not change the UI

@aerosol aerosol changed the title Block ips IP Block List Feb 7, 2024
@aerosol aerosol marked this pull request as ready for review February 7, 2024 14:45
@aerosol aerosol requested a review from a team February 7, 2024 14:46
Copy link
Contributor

@ukutaht ukutaht left a comment

Choose a reason for hiding this comment

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

Couple minor comments about naming but otherwise looks great!

lib/plausible/shield/ip_rule.ex Outdated Show resolved Hide resolved
lib/plausible/ingestion/event.ex Outdated Show resolved Hide resolved
@aerosol aerosol added the deploy-to-staging Special label that triggers a deploy to a staging environment label Feb 12, 2024
@aerosol aerosol merged commit 99fe037 into master Feb 12, 2024
5 checks passed
@aerosol aerosol deleted the block-ips branch February 12, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy-to-staging Special label that triggers a deploy to a staging environment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants