reject-data-source.ts 10 KB

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