jdabtieu / CTFOJ

Lightweight CTF judge platform for capture-the-flag (CTF) clubs
GNU Affero General Public License v3.0
10 stars 5 forks source link

Add X-Fowarded-For middleware #191

Closed jdabtieu closed 1 year ago

jdabtieu commented 1 year ago

Set request.remote_addr to the trusted value in X-Forwarded-For if running CTFOJ under a proxy

For Pythonanywhere, Nginx, and other proxies

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 40.90% and project coverage change: -0.52 :warning:

Comparison is base (54b72d5) 90.60% compared to head (890f08c) 90.09%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #191 +/- ## ========================================== - Coverage 90.60% 90.09% -0.52% ========================================== Files 22 23 +1 Lines 2108 2130 +22 ========================================== + Hits 1910 1919 +9 - Misses 198 211 +13 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `90.09% <40.90%> (-0.52%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jonathan+Wu#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/jdabtieu/CTFOJ/pull/191?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jonathan+Wu) | Coverage Δ | | |---|---|---| | [src/middlewares.py](https://codecov.io/gh/jdabtieu/CTFOJ/pull/191?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jonathan+Wu#diff-c3JjL21pZGRsZXdhcmVzLnB5) | `33.33% <33.33%> (ø)` | | | [src/application.py](https://codecov.io/gh/jdabtieu/CTFOJ/pull/191?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jonathan+Wu#diff-c3JjL2FwcGxpY2F0aW9uLnB5) | `85.33% <66.66%> (-0.05%)` | :arrow_down: | | [src/default\_settings.py](https://codecov.io/gh/jdabtieu/CTFOJ/pull/191?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jonathan+Wu#diff-c3JjL2RlZmF1bHRfc2V0dGluZ3MucHk=) | `85.71% <100.00%> (+0.42%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jonathan+Wu). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jonathan+Wu)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.