Allow configuring the desired client IP source #1931
No reviewers
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
continuwuation/continuwuity!1931
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "nex/fix/source-IPs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request adds a config option to allow choosing the desired client IP source, per https://docs.rs/axum-client-ip/latest/axum_client_ip/enum.ClientIpSource.html. This retains the existing functional default of "TCP connecting IP".
Fixes: #1812
Pull request checklist:
mainbranch, and the branch is named something other thanmain.myself, if applicable. This includes ensuring code compiles.
@ -373,0 +390,4 @@////// default: 0#[serde(default)]pub request_ip_source: u8,this should be an enum, not an opaque u8
rocksdb_recovery_modedoesn't do thatrocksdb_recovery_modeis also older than this project 🗿 I don't want to hear itlalalalalalala
54cab87494a68873f2c5@ -49,2 +49,4 @@let layers = layers.layer(compression_layer(server));let client_ip_layer = match services.config.request_ip_source {| 1 => ClientIpSource::CfConnectingIp,Uh can we just use a string? https://docs.rs/axum-client-ip/latest/axum_client_ip/enum.ClientIpSource.html#method.from_str
don't know what the field names resolve to
click "View Source" 😭
"just read the source code bro"
ok no because that uses the camelcase names and im not telling people to unironically write camelcase variables in their configuration
Oh ok if you want to save people from that crime
@ -51,0 +63,4 @@| Some("x_real_ip") => ClientIpSource::XRealIp,| None | Some(_) => ClientIpSource::ConnectInfo,};This seems evil. Probably better to use https://docs.rs/axum-client-ip/latest/src/axum_client_ip/lib.rs.html#163-178
Nevermind jade already said that, I'm gonna resolve this.