Skip to content

feat: extract curl ua to config value#2568

Merged
dvikan merged 3 commits intoRSS-Bridge:masterfrom
dvikan:config-ua
Apr 3, 2022
Merged

feat: extract curl ua to config value#2568
dvikan merged 3 commits intoRSS-Bridge:masterfrom
dvikan:config-ua

Conversation

@dvikan
Copy link
Contributor

@dvikan dvikan commented Mar 30, 2022

This change allows for modification of the curl ua in config.ini.php.

It's mostly a refactor but leaving out the version and github url from the ua. Ideally the ua should contain some information on how to reach the person responsible for the network traffic. But that only's a problem with misbehaving clients who spam with http requests. Could encourage bridge instances to modify it to include some contact information.

That ua is one of the most popular uas. It's Chrome 74 on Windows 10:

https://developers.whatismybrowser.com/useragents/parse/1302411chrome-windows-blink

@github-actions
Copy link

github-actions bot commented Mar 30, 2022

Pull request artifacts

file last change
FB2-current-context1 2022-04-03, 07:36:34
FurAffinityUser-current-context1 2022-04-03, 07:36:34
MixCloud-current-context1 2022-04-03, 07:36:34
Vk-current-context1 2022-04-03, 07:36:34
Webfail-current-context1 2022-04-03, 07:36:34
ZoneTelechargement-current-context1 2022-04-03, 07:36:34
FB2-pr-context1 2022-04-03, 07:36:34
FurAffinityUser-pr-context1 2022-04-03, 07:36:34
MixCloud-pr-context1 2022-04-03, 07:36:34
Vk-pr-context1 2022-04-03, 07:36:34
Webfail-pr-context1 2022-04-03, 07:36:34
ZoneTelechargement-pr-context1 2022-04-03, 07:36:34

@Bockiii
Copy link
Contributor

Bockiii commented Mar 30, 2022

Hi,

In order to use different UAs (there might be a reason for that. Maybe sites provide content differently, read: easier to scrape, for older UAs), the server hoster would need to change the bridge back to a defined UA right? Because its a single UA for all, not by bridge.

The change in this form will break all those bridges for people with custom configuration files (which is not uncommon), since the default.configuration change is not picked up by custom configs. So the bridge breaks because it's looking for a UA thats not in the default config

@dvikan
Copy link
Contributor Author

dvikan commented Mar 30, 2022

The default config config.default.ini.php is always picked up first. Then if config.ini.php exists, its values are merged into it.

A few bridges used hardcoded uas:

  • FB2Bridge: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0
  • MixCloudBridge: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0
  • VkBridge: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0
  • WebFail: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0
  • ZoneTelechargementBridge: curl/7.64.0

I checked FB2, VkBridge and WebFail they are still working despite the change in ua. MixCloud and ZoneTelechargementBridge are currently broken/flaky.

@dvikan dvikan merged commit bed20e9 into RSS-Bridge:master Apr 3, 2022
@dvikan dvikan deleted the config-ua branch April 3, 2022 07:37
IAM-marco pushed a commit to IAM-marco/rss-bridge that referenced this pull request Jun 17, 2022
* exclude config.default.ini.php from phpcs
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