reject-data-source.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. import { TTL } from './cache-filesystem';
  2. type HostsSource = [main: string, mirrors: string[] | null, includeAllSubDomain: boolean, ttl: number];
  3. export const HOSTS: HostsSource[] = [
  4. [
  5. 'https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext',
  6. ['https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/thirdparties/pgl.yoyo.org/as/serverlist'],
  7. true,
  8. TTL.THREE_HOURS()
  9. ],
  10. // Dan Pollock's hosts file, 0.0.0.0 version is 30 KiB smaller
  11. ['https://someonewhocares.org/hosts/zero/hosts', null, true, TTL.THREE_HOURS()],
  12. // no coin list is not actively maintained, but it updates daily when being maintained, so we set a 3 days cache ttl
  13. ['https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt', null, true, TTL.THREE_DAYS()],
  14. // have not been updated for more than a year, so we set a 14 days cache ttl
  15. ['https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt', null, true, TTL.TWO_WEEKS()],
  16. ['https://raw.githubusercontent.com/jerryn70/GoodbyeAds/master/Extension/GoodbyeAds-Xiaomi-Extension.txt', null, false, TTL.THREE_DAYS()],
  17. ['https://raw.githubusercontent.com/jerryn70/GoodbyeAds/master/Extension/GoodbyeAds-Huawei-AdBlock.txt', null, false, TTL.THREE_DAYS()],
  18. // ad-wars is not actively maintained, so we set a 7 days cache ttl
  19. ['https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts', null, false, TTL.ONE_WEEK()],
  20. ['https://raw.githubusercontent.com/durablenapkin/block/master/luminati.txt', null, true, TTL.THREE_HOURS()]
  21. ] as const;
  22. export const DOMAIN_LISTS: HostsSource[] = [
  23. // CoinBlockerList
  24. // Although the hosts file is still actively maintained, the hosts_browser file is not updated since 2021-07, so we set a 14 days cache ttl
  25. ['https://zerodot1.gitlab.io/CoinBlockerLists/list_browser.txt', [], true, TTL.TWO_WEEKS()],
  26. // BarbBlock
  27. // The barbblock list has never been updated since 2019-05, so we set a 14 days cache ttl
  28. ['https://paulgb.github.io/BarbBlock/blacklists/domain-list.txt', [], true, TTL.TWO_WEEKS()],
  29. // DigitalSide Threat-Intel - OSINT Hub
  30. // Update once per day
  31. ['https://osint.digitalside.it/Threat-Intel/lists/latestdomains.txt', [], true, TTL.ONE_DAY()],
  32. // Curben's PUP Domains Blocklist
  33. // 'https://curbengh.github.io/pup-filter/pup-filter-agh.txt'
  34. // 'https://pup-filter.pages.dev/pup-filter-agh.txt'
  35. // The PUP filter has paused the update since 2023-05, so we set a 14 days cache ttl
  36. [
  37. 'https://curbengh.github.io/pup-filter/pup-filter-domains.txt',
  38. [
  39. 'https://pup-filter.pages.dev/pup-filter-domains.txt',
  40. 'https://malware-filter.gitlab.io/pup-filter/pup-filter-domains.txt'
  41. ],
  42. true, TTL.TWO_WEEKS()
  43. ],
  44. // Curben's UrlHaus Malicious URL Blocklist
  45. [
  46. 'https://curbengh.github.io/urlhaus-filter/urlhaus-filter-domains.txt',
  47. [
  48. 'https://urlhaus-filter.pages.dev/urlhaus-filter-domains.txt',
  49. 'https://malware-filter.gitlab.io/malware-filter/urlhaus-filter-domains.txt'
  50. ],
  51. true, TTL.THREE_HOURS()
  52. ],
  53. // AdGuard CNAME Filter Combined
  54. // Update on a 7 days basis, so we add a 3 hours cache ttl
  55. ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_ads_justdomains.txt', [], true, TTL.THREE_DAYS()],
  56. ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_trackers_justdomains.txt', [], true, TTL.THREE_DAYS()],
  57. ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_clickthroughs_justdomains.txt', [], true, TTL.THREE_DAYS()],
  58. ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_microsites_justdomains.txt', [], true, TTL.THREE_DAYS()],
  59. ['https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_mail_trackers_justdomains.txt', [], true, TTL.THREE_DAYS()]
  60. ] as const;
  61. export const PHISHING_DOMAIN_LISTS: [HostsSource, HostsSource] = [
  62. [
  63. 'https://curbengh.github.io/phishing-filter/phishing-filter-domains.txt',
  64. [
  65. 'https://phishing-filter.pages.dev/phishing-filter-domains.txt',
  66. 'https://malware-filter.gitlab.io/malware-filter/phishing-filter-domains.txt'
  67. ],
  68. true, TTL.THREE_HOURS()
  69. ],
  70. [
  71. 'https://phishing.army/download/phishing_army_blocklist.txt',
  72. [],
  73. true, TTL.THREE_HOURS()
  74. ]
  75. ] as const;
  76. type AdGuardFilterSource = string | [main: string, mirrors: string[] | null, ttl: number];
  77. export const ADGUARD_FILTERS: AdGuardFilterSource[] = [
  78. // EasyList
  79. [
  80. 'https://easylist.to/easylist/easylist.txt',
  81. [
  82. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easylist.txt',
  83. 'https://ublockorigin.pages.dev/thirdparties/easylist.txt',
  84. 'https://easylist-downloads.adblockplus.org/easylist.txt',
  85. 'https://raw.githubusercontent.com/easylist/easylist/gh-pages/easylist.txt',
  86. 'https://secure.fanboy.co.nz/easylist.txt'
  87. ],
  88. TTL.TWLVE_HOURS()
  89. ],
  90. // EasyPrivacy
  91. [
  92. 'https://easylist.to/easylist/easyprivacy.txt',
  93. [
  94. 'https://secure.fanboy.co.nz/easyprivacy.txt',
  95. 'https://raw.githubusercontent.com/easylist/easylist/gh-pages/easyprivacy.txt',
  96. 'https://easylist-downloads.adblockplus.org/easyprivacy.txt',
  97. 'https://ublockorigin.github.io/uAssetsCDN/thirdparties/easyprivacy.txt',
  98. 'https://ublockorigin.pages.dev/thirdparties/easyprivacy.txt'
  99. ],
  100. TTL.TWLVE_HOURS()
  101. ],
  102. // AdGuard DNS Filter
  103. [
  104. 'https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt',
  105. [
  106. 'https://filters.adtidy.org/extension/ublock/filters/15_optimized.txt',
  107. 'https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt'
  108. ],
  109. TTL.TWLVE_HOURS()
  110. ],
  111. // uBlock Origin Filter List
  112. [
  113. 'https://ublockorigin.github.io/uAssetsCDN/filters/filters.min.txt',
  114. [
  115. 'https://ublockorigin.pages.dev/filters/filters.min.txt'
  116. ],
  117. TTL.THREE_HOURS()
  118. ],
  119. // uBlock Origin Badware Risk List
  120. [
  121. 'https://ublockorigin.github.io/uAssetsCDN/filters/badware.min.txt',
  122. [
  123. 'https://ublockorigin.pages.dev/filters/badware.min.txt'
  124. ],
  125. TTL.THREE_HOURS()
  126. ],
  127. // uBlock Origin Privacy List
  128. [
  129. 'https://ublockorigin.github.io/uAssetsCDN/filters/privacy.min.txt',
  130. [
  131. 'https://ublockorigin.pages.dev/filters/privacy.min.txt'
  132. ],
  133. TTL.THREE_HOURS()
  134. ],
  135. // uBlock Origin Resource Abuse: merged in uBlock Origin Privacy List
  136. // [
  137. // 'https://ublockorigin.github.io/uAssetsCDN/filters/resource-abuse.txt',
  138. // [
  139. // 'https://ublockorigin.pages.dev/filters/resource-abuse.txt'
  140. // ]
  141. // ],
  142. // uBlock Origin Unbreak
  143. [
  144. 'https://ublockorigin.github.io/uAssetsCDN/filters/unbreak.min.txt',
  145. [
  146. 'https://ublockorigin.pages.dev/filters/unbreak.min.txt'
  147. ],
  148. TTL.THREE_HOURS()
  149. ],
  150. // AdGuard Base Filter
  151. ['https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt', null, TTL.THREE_HOURS()],
  152. // AdGuard Mobile AD
  153. ['https://filters.adtidy.org/extension/ublock/filters/11_optimized.txt', null, TTL.THREE_HOURS()],
  154. // AdGuard Tracking Protection
  155. ['https://filters.adtidy.org/extension/ublock/filters/3_optimized.txt', null, TTL.THREE_HOURS()],
  156. // AdGuard Japanese filter
  157. ['https://filters.adtidy.org/extension/ublock/filters/7_optimized.txt', null, TTL.THREE_HOURS()],
  158. // AdGuard Chinese filter (EasyList China + AdGuard Chinese filter)
  159. ['https://filters.adtidy.org/extension/ublock/filters/224_optimized.txt', null, TTL.THREE_HOURS()],
  160. // AdGuard Annoyances filter
  161. ['https://filters.adtidy.org/android/filters/14_optimized.txt', null, TTL.THREE_HOURS()],
  162. // EasyList Germany filter
  163. [
  164. 'https://easylist.to/easylistgermany/easylistgermany.txt',
  165. [
  166. 'https://easylist-downloads.adblockplus.org/easylistgermany.txt'
  167. ],
  168. TTL.TWLVE_HOURS()
  169. ],
  170. // GameConsoleAdblockList
  171. // Update almost once per 1 to 3 months, let's set a 10 days cache ttl
  172. ['https://raw.githubusercontent.com/DandelionSprout/adfilt/master/GameConsoleAdblockList.txt', null, TTL.TEN_DAYS()],
  173. // PiHoleBlocklist
  174. // Update almost once per 3 months, let's set a 10 days cache ttl
  175. [
  176. 'https://perflyst.github.io/PiHoleBlocklist/SmartTV-AGH.txt',
  177. [
  178. 'https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV-AGH.txt'
  179. ],
  180. TTL.TEN_DAYS()
  181. ],
  182. // Spam404
  183. // Not actively maintained, let's use a 10 days cache ttl
  184. ['https://raw.githubusercontent.com/Spam404/lists/master/adblock-list.txt', null, TTL.TEN_DAYS()],
  185. // Brave First Party & First Party CNAME
  186. ['https://raw.githubusercontent.com/brave/adblock-lists/master/brave-lists/brave-firstparty.txt', null, TTL.ONE_DAY()]
  187. ] as const;
  188. export const PREDEFINED_WHITELIST = [
  189. 'localhost',
  190. 'local',
  191. 'localhost.localdomain',
  192. 'broadcasthost',
  193. 'ip6-loopback',
  194. 'ip6-localnet',
  195. 'ip6-mcastprefix',
  196. 'ip6-allnodes',
  197. 'ip6-allrouters',
  198. 'ip6-allhosts',
  199. 'mcastprefix',
  200. 'skk.moe',
  201. 'analytics.google.com',
  202. 'cloud.answerhub.com',
  203. 'ae01.alicdn.com',
  204. 'whoami.akamai.net',
  205. 'whoami.ds.akahelp.net',
  206. 'pxlk9.net.', // This one is malformed from EasyList, which I will manually add instead
  207. 'instant.page', // No, it doesn't violate anyone's privacy. I will whitelist it
  208. 'piwik.pro',
  209. 'mixpanel.com',
  210. 'cdn.mxpnl.com',
  211. 'heapanalytics.com',
  212. 'segment.com',
  213. 'segmentify.com',
  214. 't.co', // pgl yoyo add t.co to the blacklist
  215. 'survicate.com', // AdGuardDNSFilter
  216. 'perfops.io', // AdGuardDNSFilter
  217. 'd2axgrpnciinw7.cloudfront.net', // ADGuardDNSFilter
  218. 'sb-cd.com', // AdGuard
  219. 'storage.yandexcloud.net', // phishing list
  220. 'login.microsoftonline.com', // phishing list
  221. 'api.xiaomi.com', // https://github.com/jerryn70/GoodbyeAds/issues/281
  222. 'api.io.mi.com', // https://github.com/jerryn70/GoodbyeAds/issues/281
  223. 'cdn.userreport.com', // https://github.com/AdguardTeam/AdGuardSDNSFilter/issues/1158
  224. 'ip-api.com',
  225. 'fastly-analytics.com',
  226. 'digitaloceanspaces.com',
  227. 's3.nl-ams.scw.cloud',
  228. 'geolocation-db.com',
  229. 'uploads.codesandbox.io',
  230. 'vlscppe.microsoft.com', // Affect Windows ISO download https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_trackers.txt
  231. 'statsig.com', // OpenAI use this for A/B testing
  232. 'pstmrk.it', // Fuck Peter Lowe Hosts
  233. 'clicks.mlsend.com', // Fuck Peter Lowe Hosts
  234. 'email.accounts.bitly.com', // Fuck Peter Lowe Hosts
  235. 'adsense.google.com', // Fuck Peter Lowe Hosts
  236. 'api.vip.miui.com', // Fuck Goodbye Xiaomi Ads
  237. 'stripe.com', // EasyPrivacy only blocks m.stripe.com wwith $third-party,
  238. // yet stupid AdGuardDNSFilter blocks all of it. Stupid AdGuard
  239. 'w3s.link', // ipfs gateway
  240. 'dweb.link', // ipfs gateway
  241. 'nftstorage.link', // ipfs gateway
  242. 'fleek.cool', // ipfs gateway
  243. 'square.site', // Drag'n'Drop site building platform
  244. 'business.site', // Drag'n'Drop site building platform
  245. 'page.link', // Firebase URL Shortener
  246. 'notion.site'
  247. ];
  248. export const PREDEFINED_ENFORCED_WHITELIST = [
  249. 'r2.dev',
  250. 'godaddysites.com',
  251. 'web.app',
  252. 'firebaseapp.com',
  253. 'ipfs.nftstorage.link',
  254. 'ipfs.4everland.io',
  255. 'ipfs.cf-ipfs.com',
  256. 'ipfs.dweb.link',
  257. 'ipfs.infura-ipfs.io',
  258. 'ipfs.fleek.cool',
  259. 'repl.co',
  260. 'w3s.link',
  261. 'translate.goog',
  262. 'backblazeb2.com',
  263. 'workers.dev',
  264. 'r2.dev',
  265. 'glitch.me',
  266. 'netlify.app',
  267. 'blogspot.com',
  268. 'appspot.com'
  269. ];