package patrol

import (
	"math/rand"
	"time"
)

// getRandomTestDomain returns a random test domain from the test domain list.
// Not cryptographically secure random, though.
func getRandomTestDomain() string {
	rng := rand.New(rand.NewSource(time.Now().UnixNano())) //nolint:gosec
	return testDomains[rng.Intn(len(testDomains)-1)]       //nolint:gosec // Weak randomness is not an issue here.
}

// testDomains is a list of domains to check if they respond successfully to a HTTP GET request.
// They are sourced from tranco - trimmed, checked, and cleaned.
// Use TestCleanDomains to clean a new/updated list.
// Treat as a constant.
var testDomains = []string{
	"about.com",
	"addtoany.com",
	"adobe.com",
	"aliyun.com",
	"ampproject.org",
	"android.com",
	"apache.org",
	"apple.com",
	"apple.news",
	"appspot.com",
	"arnebrachhold.de",
	"avast.com",
	"bbc.co.uk",
	"bbc.com",
	"bing.com",
	"blogger.com",
	"blogspot.com",
	"branch.io",
	"calendly.com",
	"cam.ac.uk",
	"canonical.com",
	"canva.com",
	"cisco.com",
	"cloudflare.com",
	"cloudns.net",
	"cnblogs.com",
	"cnn.com",
	"creativecommons.org",
	"criteo.com",
	"cupfox.app",
	"dailymail.co.uk",
	"ddnss.de",
	"debian.org",
	"digitalocean.com",
	"doi.org",
	"domainmarket.com",
	"doubleclick.net",
	"dreamhost.com",
	"dropbox.com",
	"dynect.net",
	"ed.gov",
	"elegantthemes.com",
	"elpais.com",
	"epa.gov",
	"eporner.com",
	"espn.com",
	"europa.eu",
	"example.com",
	"facebook.com",
	"fb.com",
	"fb.me",
	"fb.watch",
	"fbcdn.net",
	"feedburner.com",
	"free.fr",
	"ftc.gov",
	"g.page",
	"getbootstrap.com",
	"gitlab.com",
	"gmail.com",
	"gnu.org",
	"goo.gl",
	"google-analytics.com",
	"google.ca",
	"google.co.in",
	"google.co.jp",
	"google.co.th",
	"google.co.uk",
	"google.com.au",
	"google.com.br",
	"google.com.hk",
	"google.com.mx",
	"google.com.tr",
	"google.com.tw",
	"google.com",
	"google.de",
	"google.es",
	"google.fr",
	"google.it",
	"googledomains.com",
	"googlesyndication.com",
	"gstatic.com",
	"harvard.edu",
	"hitomi.la",
	"hubspot.com",
	"hugedomains.com",
	"ibm.com",
	"icloud.com",
	"ikea.com",
	"ilovepdf.com",
	"indiatimes.com",
	"instagram.com",
	"investing.com",
	"investopedia.com",
	"irs.gov",
	"kickstarter.com",
	"launchpad.net",
	"lencr.org",
	"lijit.com",
	"linkedin.com",
	"linode.com",
	"mashable.com",
	"medium.com",
	"mega.co.nz",
	"mega.nz",
	"merriam-webster.com",
	"mit.edu",
	"netflix.com",
	"nginx.org",
	"nist.gov",
	"notion.so",
	"nsone.net",
	"office.com",
	"onetrust.com",
	"openstreetmap.org",
	"patreon.com",
	"pexels.com",
	"photobucket.com",
	"php.net",
	"pki.goog",
	"plos.org",
	"ps.kz",
	"readthedocs.io",
	"redd.it",
	"reddit.com",
	"remove.bg",
	"rfc-editor.org",
	"savefrom.net",
	"sedo.com",
	"so-net.ne.jp",
	"sourceforge.net",
	"spamhaus.org",
	"speedtest.net",
	"spotify.com",
	"stanford.edu",
	"state.gov",
	"substack.com",
	"t.me",
	"taboola.com",
	"techcrunch.com",
	"telegram.me",
	"telegram.org",
	"threema.ch",
	"tinyurl.com",
	"ubuntu.com",
	"ui.com",
	"umich.edu",
	"uol.com.br",
	"upenn.edu",
	"usgs.gov",
	"utexas.edu",
	"va.gov",
	"verisign.com",
	"vmware.com",
	"w3.org",
	"wa.me",
	"webs.com",
	"whatsapp.com",
	"whatsapp.net",
	"whitehouse.gov",
	"wikimedia.org",
	"wikipedia.org",
	"wiktionary.org",
	"www.aliyundrive.com",
	"www.amazon.ca",
	"www.amazon.co.jp",
	"www.amazon.co.uk",
	"www.amazon.com",
	"www.amazon.de",
	"www.amazon.es",
	"www.amazon.fr",
	"www.amazon.in",
	"www.amazon.it",
	"www.aol.com",
	"www.appsflyer.com",
	"www.att.com",
	"www.business.site",
	"www.ca.gov",
	"www.canada.ca",
	"www.cctv.com",
	"www.cdc.gov",
	"www.chinaz.com",
	"www.cloud.com",
	"www.cnet.com",
	"www.comcast.com",
	"www.comcast.net",
	"www.cornell.edu",
	"www.crashlytics.com",
	"www.datadoghq.com",
	"www.db.com",
	"www.deloitte.com",
	"www.dw.com",
	"www.engadget.com",
	"www.eset.com",
	"www.fao.org",
	"www.fedex.com",
	"www.flickr.com",
	"www.force.com",
	"www.ford.com",
	"www.frontiersin.org",
	"www.geeksforgeeks.org",
	"www.gene.com",
	"www.genius.com",
	"www.github.io",
	"www.gov.uk",
	"www.gravatar.com",
	"www.healthline.com",
	"www.hhs.gov",
	"www.hichina.com",
	"www.hinet.net",
	"www.house.gov",
	"www.hp.com",
	"www.huawei.com",
	"www.hupu.com",
	"www.ietf.org",
	"www.immunet.com",
	"www.independent.co.uk",
	"www.intel.com",
	"www.jotform.com",
	"www.klaviyo.com",
	"www.launchdarkly.com",
	"www.live.com",
	"www.macromedia.com",
	"www.medallia.com",
	"www.mediatek.com",
	"www.medicalnewstoday.com",
	"www.microsoft.com",
	"www.mongodb.com",
	"www.mysql.com",
	"www.namu.wiki",
	"www.nasa.gov",
	"www.nba.com",
	"www.nbcnews.com",
	"www.nih.gov",
	"www.noaa.gov",
	"www.npr.org",
	"www.nps.gov",
	"www.ny.gov",
	"www.okta.com",
	"www.openai.com",
	"www.optimizely.com",
	"www.oracle.com",
	"www.outlook.com",
	"www.paloaltonetworks.com",
	"www.pbs.org",
	"www.pixabay.com",
	"www.plala.or.jp",
	"www.playstation.com",
	"www.plesk.com",
	"www.princeton.edu",
	"www.prnewswire.com",
	"www.psu.edu",
	"www.python.org",
	"www.qq.com",
	"www.quantserve.com",
	"www.quillbot.com",
	"www.rackspace.com",
	"www.redhat.com",
	"www.researchgate.net",
	"www.roku.com",
	"www.salesforce.com",
	"www.skype.com",
	"www.sun.com",
	"www.teamviewer.com",
	"www.ted.com",
	"www.tesla.com",
	"www.theguardian.com",
	"www.typeform.com",
	"www.uchicago.edu",
	"www.ucla.edu",
	"www.usda.gov",
	"www.usps.com",
	"www.utorrent.com",
	"www.warnerbros.com",
	"www.webex.com",
	"www.who.int",
	"www.worldbank.org",
	"www.xbox.com",
	"www.xerox.com",
	"www.youdao.com",
	"www.zdnet.com",
	"www.zebra.com",
	"yahoo.com",
	"yale.edu",
	"yandex.com",
	"yandex.net",
	"youku.com",
	"youtu.be",
	"youtube.com",
	"zemanta.com",
	"zoro.to",
}
