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

Fixup IP logging #272

Merged
merged 7 commits into from
May 2, 2022
Merged

Fixup IP logging #272

merged 7 commits into from
May 2, 2022

Conversation

thebeanogamer
Copy link
Member

IP logging currently doesn't understand X-Forwarded-For containing multiple values, as happens when using Cloudflare. This fixes that by always using the first value, and includes a migration to clean up old events and use the Database's inbuilt inet type.

This also adds a slightly dodgy manage.py command to view users grouped by IP address. This probably wont be used much, but we have had users ask for it to try and catch cheaters.

You can also now do Member.ips, so that's neat.

Copy link
Contributor

@0xAda 0xAda left a comment

Choose a reason for hiding this comment

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

This feature as a whole looks like it could do with a rewrite, but I'm happy to merge this for now

@0xAda 0xAda enabled auto-merge (rebase) May 1, 2022 23:58
@codecov
Copy link

codecov bot commented May 1, 2022

Codecov Report

Merging #272 (da1b0e0) into master (d198ffb) will increase coverage by 0.01%.
The diff coverage is 98.41%.

@@            Coverage Diff             @@
##           master     #272      +/-   ##
==========================================
+ Coverage   96.86%   96.88%   +0.01%     
==========================================
  Files         109      111       +2     
  Lines        5071     5131      +60     
  Branches      274      281       +7     
==========================================
+ Hits         4912     4971      +59     
  Misses        128      128              
- Partials       31       32       +1     
Impacted Files Coverage Δ
src/ractf/management/commands/group_ips.py 96.15% <96.15%> (ø)
src/member/models.py 100.00% <100.00%> (ø)
src/ractf/tests.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d198ffb...da1b0e0. Read the comment docs.

@0xAda 0xAda merged commit 45ee449 into master May 2, 2022
@0xAda 0xAda deleted the feature/betteriplogging branch May 2, 2022 12:10
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.

3 participants