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 BEP34 bad parsing, fixes #294 #296

Merged
merged 1 commit into from
Sep 29, 2024
Merged

Fix BEP34 bad parsing, fixes #294 #296

merged 1 commit into from
Sep 29, 2024

Conversation

ismaarino
Copy link
Contributor

Description

Currently, there’s a bug that some people have reported regarding BP34 processing, which makes the system completely ignore whatever is in the DNS record.
This happens because the DNS resolve response returns the contents of the record wrapped in double quotes. As a result, the content string never starts with BITTORRENT since the first character is ", and proceeds tracking the tracker.

For example, the record text example.com. 300 IN TXT "BITTORRENT" is parsed as "BITTORRENT", which is interpreted as not valid according to BEP34 rules.

Just removing trailing quotes will fix the problem.

Affects

  • The consideration of BEP34 when adding a tracker.
  • The ability to remove a tracker (for example, if the URL has changed and the user wants to update it) by adding a BEP34 record without preferences.

Both of these issues are mentioned on the webpage in the FAQ section regarding tracker management, but currently, this information is not true.

Dns record content is being wrapped in quotes
@CorralPeltzer
Copy link
Owner

Thanks for the PR! This probably broke on a dnspython upgrade

@CorralPeltzer CorralPeltzer changed the title Fix BEP34 bad parsing Fix BEP34 bad parsing, fixes #294 Sep 29, 2024
@CorralPeltzer CorralPeltzer merged commit 6cba561 into CorralPeltzer:master Sep 29, 2024
6 checks passed
@CorralPeltzer CorralPeltzer linked an issue Sep 29, 2024 that may be closed by this pull request
@ismaarino ismaarino deleted the fix/bep34-bad-parsing branch September 29, 2024 16:11
@1265578519
Copy link

1265578519 commented Sep 29, 2024

image
BITTORRENT TCP:8080
当前错误指向为https,应当判断 BITTORRENT TCP:8080s 才代表启用https协议

bep34声明TCP为HTTP,而不是HTTPS,utorrent客户端会正确切换到HTTP
如果需要使用HTTPS可以创造一个新的标准,端口号添加小写s代表启用https
8080s

@ismaarino
Copy link
Contributor Author

image
BITTORRENT TCP:8080
当前错误指向为https,应当判断 BITTORRENT TCP:8080s 才代表启用https协议

bep34声明TCP为HTTP,而不是HTTPS,utorrent客户端会正确切换到HTTP
如果需要使用HTTPS可以创造一个新的标准,端口号添加小写s代表启用https
8080s

Hi, sorry I don't understand exactly what's the problem, could you provide more info? Also I don't think creating a standard that only this service can understand is a good idea.

@1265578519
Copy link

1265578519 commented Sep 30, 2024

image
BITTORRENT TCP:8080
当前错误指向为https,应当判断 BITTORRENT TCP:8080s 才代表启用https协议
bep34声明TCP为HTTP,而不是HTTPS,utorrent客户端会正确切换到HTTP
如果需要使用HTTPS可以创造一个新的标准,端口号添加小写s代表启用https
8080s

Hi, sorry I don't understand exactly what's the problem, could you provide more info? Also I don't think creating a standard that only this service can understand is a good idea.

复现
你使用http方式添加你的域名到 https://newtrackon.com/

http://example.com:8080/announce

随后为 example.com 增加txt记录 BITTORRENT TCP:8080 ,等待30分钟后下一次刷新数据,此时 newtrackon 会错误改写成https

本来这个功能有bug,没有正常起效果的时候是正常的,他把这个bug修复了后导致bug开始出现了

@ismaarino
Copy link
Contributor Author

image
BITTORRENT TCP:8080
当前错误指向为https,应当判断 BITTORRENT TCP:8080s 才代表启用https协议
bep34声明TCP为HTTP,而不是HTTPS,utorrent客户端会正确切换到HTTP
如果需要使用HTTPS可以创造一个新的标准,端口号添加小写s代表启用https
8080s

Hi, sorry I don't understand exactly what's the problem, could you provide more info? Also I don't think creating a standard that only this service can understand is a good idea.

复现
你使用http方式添加你的域名到 https://newtrackon.com/

http://example.com:8080/announce

随后为 example.com 增加txt记录 BITTORRENT TCP:8080 ,等待30分钟后下一次刷新数据,此时 newtrackon 会错误改写成https

本来这个功能有bug,没有正常起效果的时候是正常的,他把这个bug修复了后导致bug开始出现了

Yes, because it checks https first. But is it changing the url to https even if https isn't available? Because if available its preferable rather than http, but if not it's a bug.

@1265578519
Copy link

Yes, because it checks https first. But is it changing the url to https even if https isn't available? Because if available its preferable rather than http, but if not it's a bug.

太好了,你理解了我在说什么,在https不可用的情况下,他依旧被错误改成https,这是一个bug,如果你有域名,可以用域名添加来进行测试

@1265578519
Copy link

T%0% `WMM3A6U6XK4TPLY_U
所以因为bep34生效了后,txt内容为tcp但是错误修改成https的问题还有人修复吗?

C:\Users\梦梦>dig p4p.arenabg.com txt

; <<>> DiG 9.10.8-P1 <<>> p4p.arenabg.com txt
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51728
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1408
;; QUESTION SECTION:
;p4p.arenabg.com.               IN      TXT

;; ANSWER SECTION:
p4p.arenabg.com.        586       IN      TXT     "BITTORRENT TCP:1337 UDP:1337"

;; Query time: 1 msec
;; SERVER: 192.168.68.1#53(192.168.68.1)
;; WHEN: Wed Oct 16 19:04:13 中国标准时间 2024
;; MSG SIZE  rcvd: 85


C:\Users\梦梦>

@1265578519
Copy link

应该检测到内容为 TCP:1337s 才修改成https

@1265578519
Copy link

反馈过几次了不去修复,看来今天更新了 #304

@1265578519
Copy link

1265578519 commented Nov 25, 2024

列表中现有的https不会改回http
image

很不幸经过我的测试,#304 并没有修复问题,提交tracker依旧会被修改成https,没有使用我提供的方法去更新,自然依旧有bug

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.

can not delete my old domain
3 participants