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

(fix) Fixed an issue that admission webhook url is not proper #1751

Closed
wants to merge 1 commit into from

Conversation

negtak
Copy link

@negtak negtak commented Dec 16, 2024

Fix: set rtmp tokens, only if url scheme is rtmp

relative issue: #1739

@getroot
Copy link
Member

getroot commented Dec 16, 2024

Thanks for the PR.

What problem does this solve?

ovlibrary should be implemented in a way that is as independent of specific protocols or modules as possible. So it seems like we need to use a different approach.

@negtak
Copy link
Author

negtak commented Dec 16, 2024

@getroot

OvenMediaEngine use the same url library for both rtmp and webhook url.
So if we set the admission webhook like http://localhost/path/to/admission/webhook, it request to http://localhost/path/to/admission.

[2024-12-16 05:47:36.295] I [SPRTMP-t1935:14] AccessController | access_controller.cpp:100  | AdmissionWebhooks queried http://host.docker.internal/path/to/admission/webhook whether client 172.27.0.1:50542 could access rtmp://localhost:1935/app/streamname. (Result : Reject Elapsed : 2 ms)
$ python3 -m http.server 80
Serving HTTP on :: port 80 (http://[::]:80/) ...
::ffff:127.0.0.1 - - [16/Dec/2024 14:47:45] code 501, message Unsupported method ('POST')
::ffff:127.0.0.1 - - [16/Dec/2024 14:47:45] "POST /path/to/admission HTTP/1.1" 501 -

After patched

[2024-12-16 05:59:28.611] I [SPRTMP-t1935:14] AccessController | access_controller.cpp:198  | AdmissionWebhooks queried http://host.docker.internal/path/to/admission/webhook whether client 172.27.0.1:60872 could access rtmp://localhost:1935/app. (Result : Reject Elapsed : 8 ms)
$ python3 -m http.server 80
Serving HTTP on :: port 80 (http://[::]:80/) ...
::ffff:127.0.0.1 - - [16/Dec/2024 14:59:28] code 501, message Unsupported method ('POST')
::ffff:127.0.0.1 - - [16/Dec/2024 14:59:28] "POST /path/to/admission/webhook HTTP/1.1" 501 -

ovlibrary should be implemented in a way that is as independent of specific protocols or modules as possible. So it seems like we need to use a different approach.

I agree with this opinion.

@getroot
Copy link
Member

getroot commented Dec 16, 2024

Thank you.

After checking, I found out that this is a regression bug. I think it would be better to just remove the part that resets _path in the UpdateUrl function.

@dimiden Could you check this?

@getroot getroot requested a review from dimiden December 16, 2024 06:22
@negtak
Copy link
Author

negtak commented Dec 23, 2024

The bug was fixed in v0.17.3. Thank you!

@negtak negtak closed this Dec 23, 2024
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.

2 participants