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

Axum HTTP tracker: announce request in public mode #184

Closed
Tracked by #160
josecelano opened this issue Feb 12, 2023 · 0 comments · Fixed by #185
Closed
Tracked by #160

Axum HTTP tracker: announce request in public mode #184

josecelano opened this issue Feb 12, 2023 · 0 comments · Fixed by #185

Comments

@josecelano
Copy link
Member

Parent issue: #160

@josecelano josecelano linked a pull request Feb 12, 2023 that will close this issue
6 tasks
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Feb 13, 2023
HTTP tracker error responser must be bencoded. Fixed in the new Axum
implementation.
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Feb 13, 2023
HTTP tracker error responser must be bencoded. Fixed in the new Axum
implementation.
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Feb 14, 2023
HTTP tracker error responser must be bencoded. Fixed in the new Axum
implementation.
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Feb 14, 2023
It will be used to extract the right most IP in the X-Forwarded-For
header when the tracer is running on reverse proxy.
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Feb 14, 2023
…he tracker is running on reverse proxy or not

Obtaining the remote peer client IP could be a complex task.

See: https://adam-p.ca/blog/2022/03/x-forwarded-for/#multiple-headers

We were using a custom function to extract the rigth most IP in the
X-Forwarded-For HTTP header. This commit starts using an external crate
for that.
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Feb 14, 2023
…xum tracker

Implemeneted the normal (non-compact) announce response in the new Axum implementation for
the HTTP tracker.
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Feb 14, 2023
…xum tracker

Implemeneted the normal (non-compact) announce response in the new Axum implementation for
the HTTP tracker. Only for the tracker public mode and with only the
mandatory announce request params.
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Feb 14, 2023
…xum tracker

Implemeneted the normal (non-compact) announce response in the new Axum implementation for
the HTTP tracker. Only for the tracker public mode and with only the
mandatory announce request params.
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Feb 15, 2023
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Feb 16, 2023
It uses a wrapper for another extractor becuase that extractor cannot be
optional. We need to get the rigth most IP in the X-Forwarded-For header
only when the tracker is runnin gon reverse proxy.

More info:

imbolc/axum-client-ip#9 (comment)
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Feb 16, 2023
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Feb 16, 2023
josecelano added a commit to josecelano/torrust-tracker that referenced this issue Feb 16, 2023
josecelano added a commit that referenced this issue Feb 20, 2023
da638d6 docs(http): fix extractor docs (Jose Celano)
30918da refactor(http): [#184] move extractor to extractor mod (Jose Celano)
99dbbe4 refactor(http): [#184] extract announce service in Axum tracker (Jose Celano)
02e2516 feat(http): [#184] Axum extractor for peer IP (Jose Celano)
74ed592 feat(http): [#184] added optional params to announce req in Axum implementation (Jose Celano)
b1612f6 test(http): improve tests (Jose Celano)
3eb7475 feat(http): [#184] normal (non-compact) announce response in axum tracker (Jose Celano)
42bd313 feat: [#184] calculate remote client ip depending on whether the tracker is running on reverse proxy or not (Jose Celano)
8318057 feat: [#184] add dependency: axum-client-ip (Jose Celano)
f327dcf fix(http): [#184] bencoded error responses for announce request (Jose Celano)
d0c8eb0 refactor(http): reorganize mods (Jose Celano)
03024e2 refactor(http): extract function to get client IP on reverse proxy (Jose Celano)

Pull request description:

  It implements the `announce` request handler in the Axum HTTP tracker for `public` mode.

  - [x] Normal (non-compact) response with only mandatory params
  - [x] Optional params for `announce` request
  - [x] Return bencoded error when remote client IP cannot be obtained from the `X-Forwarded-For` header on reverse proxy mode. See commented tests.
  - [x] Refactor: extract service for handler body.

  Out of this PR scope:

  - [ ] Capture unexpected handler errors and convert them into bencoded generic HTTP tracker response errors. Moved to [parent issue](#160).
  - [ ] Compact response.

  **UPDATE**: 16/02/2023

Top commit has no ACKs.

Tree-SHA512: 76f77ed87f64ff6a488090e9013d92cbc516135a770206408a38bcba1c57ceb01154cd87b7169ed01ee12791c12d5e991ab59c4e53ba7c164a146292d6a94677
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant