reject-data-source.ts 9.8 KB

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