liberethos_paradigm/tools/gen_brokerage_table.sh

252 lines
19 KiB
Bash
Raw Normal View History

2021-01-17 21:34:10 +01:00
#!/bin/bash
typeset -r db_file=$(mktemp --dry-run --suffix=.db)
table_populate()
{
2021-02-09 22:08:08 +01:00
# fiTbl: "financial institution table"
2021-01-17 21:34:10 +01:00
sqlite3 "${db_file}" <<'EOF'
2021-02-09 22:08:08 +01:00
create table if not exists fiTbl (name text primary key not null,
url text,
fi_kind text check(fi_kind in ('bank', 'brokerage', 'CU', 'insurer')) not null default 'brokerage',
lst_kind text check(lst_kind in ('black', 'gray', 'white')) not null default 'white',
hrecaptcha text check(hrecaptcha in ('unavoidable', 'non-essential tasks', 'never')) not null default 'never',
parent text,
cflogin boolean default 0,
antitor boolean default 0,
alec boolean default 0,
forced_nfsw boolean default 0,
aws boolean default 0,
cispa boolean default 0,
dt boolean default 0,
notes text);
/* BEGIN BROKERAGES */
/* insert into fiTbl (name,notes) values ("Evertrade","Where's the website? Sold to TIAA-CREF?");*/
insert into fiTbl (name,url,aws,notes) values ("Janus Henderson","https://www.janushenderson.com",1,"transactional web host (www.secureaccountview.com) is not AWS, but it is Tor-hostile; it's possible to work offline and receive gratis paper statements.");
insert into fiTbl (name,url,dt,notes) values ("Vanguard","https://investor.vanguard.com",1,"");
insert into fiTbl (name,url,notes) values ("Rich Uncles","https://richuncles.com","Real estate investing only");
insert into fiTbl (name,url,aws,notes) values
2021-01-17 21:34:10 +01:00
("Stash","https://stash.com",1,
"no mutual funds; no options; no crypto; maintenance fee: $1/month");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,aws,notes) values
2021-01-17 21:34:10 +01:00
("nvstr","https://www.nvstr.com",1,
"maintenance fee: $4/month; promos: $15-150 for funding, random bonus awards, referral bonuses");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,aws,notes) values
2021-01-17 21:34:10 +01:00
("tastyworks","https://tastyworks.com",1,
"TIRA; RIRA; no forex; no crypto; no non-US stocks; open/close fee= $0/0; commission=$5/stock trade (closing trades gratis), $1/option trade; promo: funding (100 shares [$1-6ea, avg:$200-220]), referral=$75");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,aws,notes) values
2021-01-17 21:34:10 +01:00
("Webull","https://www.webull.com",1,"TIRA; RIRA; crypto; no forex");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,aws,notes) values
2021-01-17 21:34:10 +01:00
("TradeStation","https://www.tradestation.com",1,
"crypto; min. invest=$500 ($2k for bonus); open/close fee= $0/0; commission=$0.50/option trade; commission=$0-5/stock trade");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,cispa,notes) values
2021-01-17 21:34:10 +01:00
("E*Trade","https://us.etrade.com",1,
"covers: Canada, France, Germany, Hong Kong, Japan, United Kingdom, and United States; funding bonus ($5k=>$50; $10k=>$100; $20k=>$150)");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,notes) values
2021-01-17 21:34:10 +01:00
("Greenvest","https://greenvest.com",
"RIRA; min. investment to avoid fees: $100k; [B corp](https://bcorporation.net/directory/greenvest)");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,aws,notes) values
2021-01-19 00:30:07 +01:00
("Robinhood","https://robinhood.com/us/en/",1,"[Fined $65M](https://nypost.com/2020/12/17/sec-slaps-robinhood-app-with-65m-fine-for-misleading-users) for misleading users; They may have used CloudFlare in the past but apparently that changed");
2021-01-17 21:34:10 +01:00
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,notes) values
2021-01-17 21:34:10 +01:00
("InteractiveBrokers","https://interactivebrokers.com",
"min. investment to avoid fees: $100k per account; has a ""impact"" feature to analyze the portfolio's ESG factors w.r.t. the user's ethical views; covers Australia, Belgium, Canada, France, Germany, Hong Kong, Italy, Japan, Mexico, Netherlands, Singapore, South Korea, Spain, Sweden, Switzerland, United Kingdom, and United States; website is **partially Tor-hostile** but the site can be avoided for most operations after sign-up");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,lst_kind,notes) values
("TD Ameritrade","https://www.tdameritrade.com","black",
"Majority owned by Charles Schwab, a firm that [supports](us_banks.md) republicans, CISPA, drug tests their staff, and treats Tor users with hostility (but note that TDA functions over Tor). Schwab outsources banking operations to PNC bank, which is [quite evil](us_banks.md); [Uses MS Github to host s/w](https://github.com/TDAmeritrade/stumpy)");
2021-01-17 21:34:10 +01:00
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,hrecaptcha,aws,notes) values ("Fundrise","https://fundrise.com","unavoidable",1,"Unavoidable CAPTCHAs");
insert into fiTbl (name,url,aws,cispa,alec,dt) values ("Prudential","https://www.prudential.com",1,1,1,1);
insert into fiTbl (name,url,cflogin,aws) values ("Ellevest","https://www.ellevest.com",1,1);
insert into fiTbl (name,url,cflogin) values ("Euro Pacific Capital","https://europacbank.com",1);
insert into fiTbl (name,url,cflogin) values ("Zackstrade","https://zackstrade.com",1);
insert into fiTbl (name,url,cflogin) values ("Stockpile","https://www.stockpile.com",1);
insert into fiTbl (name,url,cflogin) values ("Tradingblock","https://tradingblock.com",1);
insert into fiTbl (name,url,cflogin) values ("Wealthsimple","https://wealthsimple.com",1);
2021-01-17 21:34:10 +01:00
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,notes) values
2021-01-18 19:19:16 +01:00
("Finhabits","https://www.finhabits.com",
2021-01-17 21:34:10 +01:00
"[B corp](https://bcorporation.net/directory/finhabits); Hosted on Google Cloud; outsources to Apex; uses Equifax for address verification");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,hrecaptcha,notes) values
("Wealthfront","https://www.wealthfront.com","unavoidable","Registration imposes Google reCAPTCHA; [caught](https://www.jpost.com/Breaking-News/US-regulator-sanctions-robo-advisers-Wealthfront-Hedgeable-on-false-disclosures-575044) making false disclosures and [charged](https://www.eastbaytimes.com/2018/12/21/bay-area-robo-adviser-firm-wealthfront-charged-by-sec-with-false-advertising) for false advertising.");
2021-01-17 21:34:10 +01:00
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,cflogin,aws,notes) values
("Axos Invest","https://www.axosinvest.com",1,1,
2021-01-17 21:34:10 +01:00
"Axos Bank is jailed in CloudFlare and Axos Invest will be soon. Investors who get blocked by that will have to pay $5/month for paper statements.");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,antitor,notes) values
2021-01-17 21:34:10 +01:00
("Firstrade","https://firstrade.com",1,"whole site is Tor-hostile (468 error)");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,antitor,notes) values
2021-01-17 21:34:10 +01:00
("TIAA-CREF","https://tiaa-cref.org",1,"Whole site is Tor-hostile");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,antitor,cispa,notes) values
2021-01-17 21:34:10 +01:00
("Ally","http://www.ally.com/",1,1,"whole site is Tor-hostile (403 error)");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,cflogin,notes) values
("SoFi","https://sofi.com/",1,
2021-01-19 00:30:07 +01:00
"They censor posts in their Reddit sub that expose the risks of passing sensitive financial data through CloudFlare; also [caught](https://www.ftc.gov/news-events/press-releases/2018/10/online-student-loan-refinance-company-sofi-settles-ftc-charges) in a deceptive advertizing scandal.");
2021-01-17 21:34:10 +01:00
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,cflogin,notes) values
("M1 Finance","https://www.m1finance.com",1,
2021-01-17 21:34:10 +01:00
"They censor posts in their Reddit sub that expose the risks of passing sensitive financial data through CloudFlare.");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,cflogin,notes) values ("Lightspeed","https://www.lightspeed.com",1,"");
2021-01-17 21:34:10 +01:00
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,hrecaptcha,notes) values
("Betterment","https://www.betterment.com","unavoidable",
2021-01-17 21:34:10 +01:00
"Imposes hCAPTCHA just to read the landing page. They censor posts in their Reddit sub that complains about this instead of offering support.");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,cflogin,notes) values ("Siebert","https://www.siebert.com",1,"");
2021-01-17 21:34:10 +01:00
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,parent,dt,notes) values
("Merrill Edge","https://www.merrilledge.com/","Bank of America",1,
2021-01-17 21:34:10 +01:00
"Owned by one of the [most evil](us_banks.md) banks in the world (Bank of America)");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,parent,cispa,dt,notes) values
("Wellstrade","https://wellstrade","Wells Fargo",1,1,"Owned by Wells Fargo, an [evil](us_banks.md) bank.");
2021-01-17 21:34:10 +01:00
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,cflogin,notes) values
("Sogotrade","https://sogotrade.com",1,"");
2021-01-17 21:34:10 +01:00
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,forced_nfsw,notes) values
2021-01-17 21:34:10 +01:00
("FUTU","fututrade.com",1,
"support.fututrade.com is CloudFlared; no web app; mobile app is GPS-iOS-only; desktop is Mac/Windows only");
2021-02-09 22:08:08 +01:00
insert into fiTbl (name,url,forced_nfsw,notes) values
2021-01-17 21:34:10 +01:00
("Gatsby","trygatsby.com",1,"no web app; no desktop app; mobile app is GPS-iOS-only");
2021-02-09 22:08:08 +01:00
/* END BROKERAGES */
/* BEGIN INSURERS */
insert into fiTbl (fi_kind,name,url,parent) values ("insurer","21st Century","https://www.21st.com","Farmers");
insert into fiTbl (fi_kind,name,url,cispa,dt,aws) values ("insurer","Allianz","https://allianz.com",1,1,1);
insert into fiTbl (fi_kind,name,url,cispa,dt,aws,antitor) values ("insurer","Allied","https://www.alliedinsurance.com",1,1,1,1);
insert into fiTbl (fi_kind,name,url,cispa,dt,antitor,notes) values ("insurer","Allstate","https://www.allstate.com",1,1,1,"akamai hosted");
insert into fiTbl (fi_kind,name,url) values ("insurer","American Family","https://www.amfam.com");
2021-02-09 22:17:02 +01:00
insert into fiTbl (fi_kind,name,url,notes) values ("insurer","American Modern","https://www.amig.com","**Google Cloud-hosted**");
2021-02-09 22:08:08 +01:00
insert into fiTbl (fi_kind,name,url,cispa,dt,notes) values ("insurer","Ameriprise Financial","https://www.ameriprise.com",1,1,"akamai hosted");
insert into fiTbl (fi_kind,name,url,antitor) values ("insurer","Amica","https://www.amica.com",1);
insert into fiTbl (fi_kind,name,url,dt) values ("insurer","Berkshire Hathaway","https://berkshirehathaway.com",1);
insert into fiTbl (fi_kind,name,url,hrecaptcha,cflogin,cispa) values ("insurer","Brown & Brown Insurance","https://bbinsurance.com",'unavoidable',1,1);
insert into fiTbl (fi_kind,name,url) values ("insurer","Erie","https://www.erieinsurance.com");
insert into fiTbl (fi_kind,name,url,parent,notes) values ("insurer","Esurance","https://www.esurance.com","Allstate","akamai hosted");
insert into fiTbl (fi_kind,name,url,alec,dt,notes) values ("insurer","Farmers","https://www.farmers.com",1,1,"akamai hosted");
insert into fiTbl (fi_kind,name,url,dt) values ("insurer","First American Insurance Agency","https://www.faiagency.com",1);
insert into fiTbl (fi_kind,name,url,parent,dt) values ("insurer","Foremost","http://www.foremost.com","Farmers",1);
insert into fiTbl (fi_kind,name,url,alec,dt,notes) values ("insurer","Geico","https://www.geico.com",1,1,"akamai hosted but transactional site ecams.geico.com is not.");
insert into fiTbl (fi_kind,name,url,parent,notes) values ("insurer","Gen Re","https://www.genre.com","Berkshire Hathaway","akamai hosted, but transactional site www.genre-connect.com is not.");
insert into fiTbl (fi_kind,name,url,dt,notes) values ("insurer","National General","https://www.nationalgeneral.com",1,"formerly GMAC");
insert into fiTbl (fi_kind,name,url,dt) values ("insurer","Grange Mutual","https://www.grangeinsurance.com",1);
insert into fiTbl (fi_kind,name,url,parent) values ("insurer","Harleysville Group","https://www.harleysvillegroup.com","Nationwide");
insert into fiTbl (fi_kind,name,url,antitor,cispa,dt,notes) values ("insurer","Hartford","https://www.thehartford.com",1,1,1,"akamai hosted");
insert into fiTbl (fi_kind,name,dt,notes) values ("insurer","Horace Mann",1,"no website, only an access-restricted Facebook page");
insert into fiTbl (fi_kind,name,url,antitor,dt) values ("insurer","Infinity","https://infinityauto.com",1,1);
insert into fiTbl (fi_kind,name,url,antitor,alec,notes) values ("insurer","Lexington","https://www.lexingtoninsurance.com",1,1,"landing page allows Tor access but all links therein refuse Tor; AIG partner");
insert into fiTbl (fi_kind,name,url,antitor,alec,cispa,notes) values ("insurer","Liberty Mutual","https://www.libertymutual.com",1,1,1,"akamai hosted");
insert into fiTbl (fi_kind,name,url,antitor,dt) values ("insurer","Mercury","https://www.mercuryinsurance.com",1,1);
insert into fiTbl (fi_kind,name,url,cispa,dt,aws,notes) values ("insurer","MetLife","https://www.metlife.com",1,1,1,"transactional site identity.metlife.com is not AWS");
insert into fiTbl (fi_kind,name,notes) values ("insurer","N&D Group","no website, only an access-restricted Facebook page");
insert into fiTbl (fi_kind,name,url,antitor,aws,alec,cispa,dt) values ("insurer","Nationwide","https://nationwide.com",1,1,1,1,1);
insert into fiTbl (fi_kind,name,url,antitor,dt) values ("insurer","Progressive","https://progressive.com",1,1);
2021-02-09 22:27:04 +01:00
insert into fiTbl (fi_kind,name,url,antitor,notes) values ("insurer","Safe Auto","http://www.safeauto.com",1,"**Tor-hostile** sign-in page despite Tor-friendly landing page.");
2021-02-09 22:17:02 +01:00
insert into fiTbl (fi_kind,name,url,parent,antitor,notes) values ("insurer","Safeco","https://safeco.com","Liberty Mutual",1,"akamai hosted");
2021-02-09 22:08:08 +01:00
insert into fiTbl (fi_kind,name,url,dt,notes) values ("insurer","Selective","https://www.selective.com",1,"pushes CloudFlare javascript, but apparently execution is optional.");
insert into fiTbl (fi_kind,name,url,dt) values ("insurer","Shelter Insurance","https://shelterinsurance.com",1);
insert into fiTbl (fi_kind,name,url,antitor,alec,cispa,dt,notes) values ("insurer","State Farm","https://www.statefarm.com",1,1,1,1,"edgecast-hosted");
insert into fiTbl (fi_kind,name,url,aws,dt) values ("insurer","Stewart Information Services Corporation","https://www.stewart.com/en.html",1,1);
insert into fiTbl (fi_kind,name,url) values ("insurer","The General","https://thegeneral.com");
insert into fiTbl (fi_kind,name,url,parent) values ("insurer","Titan","https://titaninsured.com","Nationwide");
insert into fiTbl (fi_kind,name,url,cispa,dt,notes) values ("insurer","Travelers","https://www.travelers.com",1,1,"akamai hosted");
insert into fiTbl (fi_kind,name,url,antitor,cispa,dt) values ("insurer","USAA","https://www.usaa.com",1,1,1);
insert into fiTbl (fi_kind,name,url,hrecaptcha,cflogin) values ("insurer","Western Mutual","https://www.westernmutual.com",'unavoidable',1);
/* END INSURERS */
2021-02-09 22:17:02 +01:00
update fiTbl set lst_kind = 'gray' where lst_kind = 'white' and (aws or cispa or dt or (notes is not null and (notes like '%tor_hostile%' or notes like '%equifax%' or notes like '%google_cloud_hosted%')));
2021-02-09 22:08:08 +01:00
update fiTbl set lst_kind = 'black' where cflogin or alec or antitor or forced_nfsw or hrecaptcha = 'unavoidable' or parent in ('Bank of America','Wells Fargo');
update fiTbl set lst_kind = 'black' where parent in (select name from fiTbl where lst_kind = 'black');
update fiTbl set lst_kind = 'gray' where parent in (select name from fiTbl where lst_kind = 'gray') and lst_kind = 'white';
update fiTbl set notes = 'parent: '||parent||case when notes is null then '' else '; '||notes end
where parent is not null and (notes is null or notes not like '%'||parent||'%');
2021-02-09 22:27:04 +01:00
update fiTbl set notes = '**Amazon AWS-hosted**'||case when notes is null then '' else '; '||notes end where aws;
2021-02-09 22:43:59 +01:00
/* update fiTbl set notes = '**Tor-hostile** resources'||case when notes is null then '' else '; '||notes end where antitor and (notes is null or notes not like '%tor_hostile%');*/
2021-01-17 21:34:10 +01:00
EOF
};#table_populate
gen_md()
{
2021-02-09 22:08:08 +01:00
local fi_kind=$1
2021-01-29 05:17:18 +01:00
#local red_circle='🔴'
local red_circle=$'\xF0\x9F\x94\xB4'
#local green_circle='🟢'
local green_circle=$'\xf0\x9f\x9f\xa2'
#local test_tube='🧪'
local test_tube=$'\xf0\x9f\xa7\xaa'
#local cloud_lightening='🌩'
local cloud_lightening=$'\xf0\x9f\x8c\xa9'
#local detective='🕵'
local detective=$'\xf0\x9f\x95\xb5'
#local okhand='👌'
local okhand=$'\xF0\x9F\x91\x8C'
2021-02-09 22:43:59 +01:00
#👁
2021-02-09 22:46:06 +01:00
local eye=$'\xf0\x9f\x91\x81'
2021-01-29 05:17:18 +01:00
2021-01-17 21:34:10 +01:00
printf '\n%s\n' '# Whitelist'
2021-02-09 22:08:08 +01:00
printf %s '| *'"$fi_kind"'* | *ALEC member* | *sensitive info exposed to CloudFlare* | *supported CISPA* | *forced drug testing of staff* | *notes* |
2021-01-17 21:34:10 +01:00
|---|---|---|---|---|---|
'
sqlite3 "${db_file}" "select case when url like '_%' then '|['||name||']('||url||')' else '|'||name end,
2021-01-29 05:17:18 +01:00
case when alec then '$okhand' else 'n' end,
2021-01-17 21:34:10 +01:00
case when cflogin then 'y' else 'n' end,
2021-01-29 05:17:18 +01:00
case when cispa then 'y' else 'n' end,
2021-01-29 05:23:16 +01:00
case when dt then 'y' else 'n' end,
2021-02-09 22:08:08 +01:00
case when notes is null then '|' else notes||'|' end
from fiTbl where fi_kind = '$fi_kind' and lst_kind = 'white'
order by name collate nocase;"
2021-01-17 21:34:10 +01:00
printf '\n%s\n' '# Graylist'
2021-02-09 22:08:08 +01:00
printf %s '| *'"$fi_kind"'* | *ALEC member* | *sensitive info exposed to CloudFlare* | *supported CISPA* | *forced drug testing of staff* | *notes* |
2021-01-17 21:34:10 +01:00
|---|---|---|---|---|---|
'
2021-02-09 22:08:08 +01:00
sqlite3 "${db_file}" "select case when url like '_%' then '|['||name||']('||url||')' else '|'||name end,
2021-01-29 05:17:18 +01:00
case when alec then '$okhand' else 'n' end,
case when cflogin then 'y' else 'n' end,
case when cispa then '$detective' else 'n' end,
case when dt then '$test_tube' else 'n' end,
2021-02-09 22:08:08 +01:00
case when notes is null then '|' else notes||'|' end
from fiTbl where fi_kind = '$fi_kind' and lst_kind = 'gray'
order by name collate nocase;"
2021-01-17 21:34:10 +01:00
printf '\n%s\n' '# Blacklist'
2021-02-09 22:43:59 +01:00
printf %s '| *'"$fi_kind"'* | *ALEC member* | *Tor-hostile* | *sensitive info exposed to CloudFlare* | *supported CISPA* | *forced drug testing of staff* | *notes* |
|---|---|---|---|---|---|---|
2021-01-17 21:34:10 +01:00
'
sqlite3 "${db_file}" "select '|'||name,
2021-01-29 05:17:18 +01:00
case when alec then '$okhand' else 'n' end,
2021-02-09 22:43:59 +01:00
case when antitor then '$eye' else 'n' end,
2021-01-29 05:17:18 +01:00
case when cflogin then '$cloud_lightening' else 'n' end,
case when cispa then '$detective' else 'n' end,
case when dt then '$test_tube' else 'n' end,
2021-02-09 22:08:08 +01:00
case when notes is null then '|' else notes||'|' end
from fiTbl where fi_kind = '$fi_kind' and lst_kind = 'black'
order by name collate nocase;"
2021-01-17 21:34:10 +01:00
};#gen_md
table_populate
2021-02-09 22:08:08 +01:00
gen_md "${1,,}"; # the CLI arg must be one of: 'bank', 'brokerage', 'CU', or 'insurer'