From 932187ee90df70b9ad4ab2af93b288b8be224d8a Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 26 Jan 2025 21:41:57 -0700 Subject: [PATCH] fix --- src/policies/tagPolicy.ts | 2 +- strfry-policy.clean | 30 ++++++++++++++++ strfry-policy.ts | 1 + sync-wot.sh | 72 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+), 1 deletion(-) create mode 100755 strfry-policy.clean create mode 100755 sync-wot.sh diff --git a/src/policies/tagPolicy.ts b/src/policies/tagPolicy.ts index d19cb70..ba99998 100755 --- a/src/policies/tagPolicy.ts +++ b/src/policies/tagPolicy.ts @@ -44,7 +44,7 @@ if (msg.event.kind === 0) { }; }; - let mastodon: (string | number)[] = ['poa.st','catgirlsfor','pawoo','comam.es','baraag','eicker.news','oisaur','wonkodon','beep.town','loli','yotsu','poni','cottoncandy','youjo','cunny','bxe.io','blastcloud.net','metroholografix.ca','matrix.rocks','cloudisland.nz','akko.wtf','techfieldday.net','kazam.site','freesoftwareextremist.com','my.talesofmy.life','dirtyknight.life','honi.club','woem.space','dobbs.town','whitewomen.dog','yotsu.rocks','filly.love','sushi.ski','some.fi','cbrx.io','union.place','bird.makeup','p.m464.net','rhabarberbarbara.bar','soapbox.midwaytrades.com','bird.gmem.ca','fox.nexus','fairy.id','friends.chat','beitmenotyou.online','me.ns.ci','f.cz','bobbinsrobots.com','snac.bsd.cafe','pan.rent','kidsarehot.fyi','layer8.space','mikuobsession.net','romancelandia.club','vmst.io','uneune.one','ioc.exchange','pointless.chat','sns.minovsky.space','chirp.enworld.org','framapiaf.org','mu.zaitcev.nu','woof.tech','k.lapy.link','voskey','ngmx.com','brain.worm.pink','alpaca.gold','zpravobot.news','wolfgirl.bar','alpaca.gold','minidisc.tokyo','raptol.net','atomicpoet.org','binky.fish','worldkey.io','mi.shiromaru.work','9kb.me','mi.kyanos.one','dabr.ca','girlboss.gaslight.love','mi.soli0222.com','ddoskey.com','friedcheese.us','pantsfree.cc','vivere.uno','unstraight.club','amala.schwartzwelt.xyz','cum.salon','noauthority.social','dragonchat.org','halo.nu','wizard.casa','boymilk','pieville.net','freeatlantis.com','partyon.xyz','eepy.express','frikiverse.zone','ai6yr','dresden.network','cr8r.gg','tuusin','snac.bsd.cafe.mostr.pub','pynews.com.br','momo.mame.moe','tldr.nettime.org','better.boston','bolha.us','ottawa.place','craftgoblin.club','hispagatos.space','orwell','puppyspace','khiar.net','smutlandia','furville','mysportgallery','net4sw.com','filthy.love','musicians.today','waldvogel','meisskey','thefolklore.cafe','fandom.ink','witter.cz','einverne','talk.marq42','amicale.net','xoxo.zone','zotum.net','persadon.com','me.dm','puntarella','electricrequiem','cunny','todon.nl','appdot.net','dill.burggit','moonbow','sports','wxw.moe','scicomm','sunny.garden','wandering.shop','tkz','jazztodon','fedi','bgme','hacky.town','retro','chitter','adtools','newsmast','jasette','twtr','shota','qoto','flipping.rocks','waskuisland','cyberpunk','sauropods','thicc','blovice','piggo','io.mwl.io','official.resource.org','cuties.zone','o3o.ca','mas.corq.co','snac.lowkey.party','gravure','packmates','spinster','alive.bar','pawoo','prsm.space','miniwa.moe','netzsphaere','varishangout','godforsaken.website','zirk.us','fediscience.org','shota','.uk','.eu','.de','.it','ravenation.club','declin.eu','furry','101010.pl','boing.world','socel.net','freeradical.zone','stefanbohacek.online','queer','hellions.cloud','absturztau','freefree.ps','mast','fedi.monster','womenforward.us','threads','masto','connectop.us','dice.camp','orfodon.org','m.moec.top','aethy.com','anakmanis.com','flipboard.com','eclipse.pub','blimps.xyz','bsky.social','glammr.us','pubeurope.com','spookygirl.boo','woem.men','universeodon.com','masto.es','loforo.com','india.goonj.xyz','xscape.club','digipres.club','troet.cafe','beige.party','theres.life','imm.erge','writing.exchange','bsky','fxckedtodeath','fedibird','accioly','baraag', 'girlcock.club','rape.pet','peoplemaking.games','gay','mas.to','abraham.su','lgbt','fosstodon','bae.st','bsky','liberal.city','mastodon.bot','botsin.space','a2mi.social','.au','masto.host','mastodon.online','social.beaware.live','nofan.xyz','mastodon.social','mstdn','mathstodon','universeodon','infosec', 'mastdn', 'kitty.social', 'c.im', '.jp', '.de', '.fr', 'toot', 'mastodon', 'misskey', 'journa.host', 'social', 'eldritchcafe', 'hachyderm', 'plush.city','kinky', 'chaosfem'] + let mastodon: (string | number)[] = ['vive.im','poa.st','catgirlsfor','pawoo','comam.es','baraag','eicker.news','oisaur','wonkodon','beep.town','loli','yotsu','poni','cottoncandy','youjo','cunny','bxe.io','blastcloud.net','metroholografix.ca','matrix.rocks','cloudisland.nz','akko.wtf','techfieldday.net','kazam.site','freesoftwareextremist.com','my.talesofmy.life','dirtyknight.life','honi.club','woem.space','dobbs.town','whitewomen.dog','yotsu.rocks','filly.love','sushi.ski','some.fi','cbrx.io','union.place','bird.makeup','p.m464.net','rhabarberbarbara.bar','soapbox.midwaytrades.com','bird.gmem.ca','fox.nexus','fairy.id','friends.chat','beitmenotyou.online','me.ns.ci','f.cz','bobbinsrobots.com','snac.bsd.cafe','pan.rent','kidsarehot.fyi','layer8.space','mikuobsession.net','romancelandia.club','vmst.io','uneune.one','ioc.exchange','pointless.chat','sns.minovsky.space','chirp.enworld.org','framapiaf.org','mu.zaitcev.nu','woof.tech','k.lapy.link','voskey','ngmx.com','brain.worm.pink','alpaca.gold','zpravobot.news','wolfgirl.bar','alpaca.gold','minidisc.tokyo','raptol.net','atomicpoet.org','binky.fish','worldkey.io','mi.shiromaru.work','9kb.me','mi.kyanos.one','dabr.ca','girlboss.gaslight.love','mi.soli0222.com','ddoskey.com','friedcheese.us','pantsfree.cc','vivere.uno','unstraight.club','amala.schwartzwelt.xyz','cum.salon','noauthority.social','dragonchat.org','halo.nu','wizard.casa','boymilk','pieville.net','freeatlantis.com','partyon.xyz','eepy.express','frikiverse.zone','ai6yr','dresden.network','cr8r.gg','tuusin','snac.bsd.cafe.mostr.pub','pynews.com.br','momo.mame.moe','tldr.nettime.org','better.boston','bolha.us','ottawa.place','craftgoblin.club','hispagatos.space','orwell','puppyspace','khiar.net','smutlandia','furville','mysportgallery','net4sw.com','filthy.love','musicians.today','waldvogel','meisskey','thefolklore.cafe','fandom.ink','witter.cz','einverne','talk.marq42','amicale.net','xoxo.zone','zotum.net','persadon.com','me.dm','puntarella','electricrequiem','cunny','todon.nl','appdot.net','dill.burggit','moonbow','sports','wxw.moe','scicomm','sunny.garden','wandering.shop','tkz','jazztodon','fedi','bgme','hacky.town','retro','chitter','adtools','newsmast','jasette','twtr','shota','qoto','flipping.rocks','waskuisland','cyberpunk','sauropods','thicc','blovice','piggo','io.mwl.io','official.resource.org','cuties.zone','o3o.ca','mas.corq.co','snac.lowkey.party','gravure','packmates','spinster','alive.bar','pawoo','prsm.space','miniwa.moe','netzsphaere','varishangout','godforsaken.website','zirk.us','fediscience.org','shota','.uk','.eu','.de','.it','ravenation.club','declin.eu','furry','101010.pl','boing.world','socel.net','freeradical.zone','stefanbohacek.online','queer','hellions.cloud','absturztau','freefree.ps','mast','fedi.monster','womenforward.us','threads','masto','connectop.us','dice.camp','orfodon.org','m.moec.top','aethy.com','anakmanis.com','flipboard.com','eclipse.pub','blimps.xyz','bsky.social','glammr.us','pubeurope.com','spookygirl.boo','woem.men','universeodon.com','masto.es','loforo.com','india.goonj.xyz','xscape.club','digipres.club','troet.cafe','beige.party','theres.life','imm.erge','writing.exchange','bsky','fxckedtodeath','fedibird','accioly','baraag', 'girlcock.club','rape.pet','peoplemaking.games','gay','mas.to','abraham.su','lgbt','fosstodon','bae.st','bsky','liberal.city','mastodon.bot','botsin.space','a2mi.social','.au','masto.host','mastodon.online','social.beaware.live','nofan.xyz','mastodon.social','mstdn','mathstodon','universeodon','infosec', 'mastdn', 'kitty.social', 'c.im', '.jp', '.de', '.fr', 'toot', 'mastodon', 'misskey', 'journa.host', 'social', 'eldritchcafe', 'hachyderm', 'plush.city','kinky', 'chaosfem'] const p = msg.event.tags.filter((tag) => tag[0] === 'p'); const e = msg.event.tags.filter((tag) => tag[0] === 'e'); diff --git a/strfry-policy.clean b/strfry-policy.clean new file mode 100755 index 0000000..d45b0ad --- /dev/null +++ b/strfry-policy.clean @@ -0,0 +1,30 @@ +#!/bin/sh +//bin/true; exec deno run -A "$0" "$@" +import { +antiDuplicationPolicy, +hellthreadPolicy, +pipeline, +readStdin, +keywordPolicy, +writeStdout, +rateLimitPolicy, +pubkeyBanPolicy, +keyworkdPolicy, +regexPolicy, +replyGuy, +whitelistPolicy, +tagPolicy, +emoji +} from '/opt/strfry-policies/mod.ts'; +for await (const msg of readStdin()) { +const result = await pipeline(msg, [ +tagPolicy, +[rateLimitPolicy, { whitelist: ['127.0.0.1', '192.168.0.55', '192.168.0.1','192.168.0.0/24'] }], +[regexPolicy, /(nlogpost|embedded-sunset|ย|==|program-ai.app|#transgender|#trans|#LGBTQ|#LGBTQIA|simpleX|1-1111-1|1-1-1-1|-----END|Sensor data:|"part"|경|TURIZBOT|If you want this to stop|DID YOU MISS ME?|This is a post from|DYNAMITE|#Rogule|MPN:|Author:|#blowjob|ア|サ|#gedanken|#lust|#nude|#sexy|#lingerie|이|#gay|#cock|#cum|#frots|==========|===============|리|#perverted|#pissing|#kinky|#fetish|ミ|今|シ|ロ|タ|ワ|일|ヤ|メ|コ|中|#regexle|自|ゥ|フ|月|ĝ|手|川|ぁ|什|マ|ル|ブ|ぺ|ぇ|円|万|キ|ャ|り|予|ㅋ|어|할|음|디|지|で|ノ|ス|ミ|ぐ|え|フ|ラ|れ|ゴ|タ|キ|ク|イ|ก|น|พื่|ド|モ|ふ|む|theYescoin_bot|休|ン|ァ|二|を|下|出|門|へ|ぱ|し|首|大|子|소|트|든|소|#Worldle|아|대|인|百|合|東|ふ|む|牛|跨|界|บ|งั|ぴ|よ|ね|ウ|ボ|ァ|沖|田|#decreasingfees|"ping"|常|可|非|#metazooa|ã|ú|#WhereTaken|#Lingule|き|チ|~|จั|ลั|ม|ü|ส|น่|说|胡|#Swarm_to_Nostr|ą|ę|Hello World!|#pastpuzzle|#Polygonle|上|几|哈|#waffle|ぃ|ひ|ค่|め|こ|わ|女|头|É|botsin|克|ッ|ー|ア|か|示|来|ç|à|に|う|ろ|早|ハ|だ|ガ|#Horoscope|ハ|オ|ヨ|#feesbelow10|#feesbelow20|utxo|õ|た|い|お|í|じ|ま|ご|europesays|元|不|一|replicatr|✄|屁|〜|良|す|る|了|#caturday|人|#Ukraine|#labor|ぽ|ゆ|林|黑|Wordle|ć|ś|#Bot|ñ|ん|#Airport|も|yadio|SELLEUR|ö|ä|н|ч|и|п|д|ê|á|สุ|ด|는|보|trojan|siam|は|ン|ス|ッ|nhk|っ|ー|の|て|サ|ة|ك|หิ|あ|と|rss|eth.limo|vmess|ク|ょ|日|立|ら|リ|#ass|#pussy|#reddit|#porn|telegra.ph|재|서|다|한|로)/i], +[keywordPolicy, ['https://media.channels.im','pay rent','Revealing nonce:','NostrDice','npub1q6ps7m94jfdastx2tx76sj8sq4nxdhlsgmzns2tr4xt6ydx6grzspm0kxr','My goals:','TURDISMO','https://media.fops.cloud','https://t.co','https://witter.cz','https://cdn.noods.fun','https://thumbsnap.com','https://paste.gmem.ca','https://x.com','https://kneel.before.dog','https://media.nofan.xyz','https://stockroom.wandering.shop','https://quark.scrolller.com','https://www.manyvids.com','https://fansly.com','https://onlyfans.com','https://proton.scrolller.com','https://api-test.summary.news','https://fans.ly','https://figure.game','https://link.storjshare.io','https://open.spotify.com','https://t.me/','https://nyc3.digitaloceanspaces.com']], +//[whitelistPolicy, [ +//] +//] +]); +writeStdout(result); +} diff --git a/strfry-policy.ts b/strfry-policy.ts index c75fde1..d45b0ad 100755 --- a/strfry-policy.ts +++ b/strfry-policy.ts @@ -24,6 +24,7 @@ tagPolicy, [keywordPolicy, ['https://media.channels.im','pay rent','Revealing nonce:','NostrDice','npub1q6ps7m94jfdastx2tx76sj8sq4nxdhlsgmzns2tr4xt6ydx6grzspm0kxr','My goals:','TURDISMO','https://media.fops.cloud','https://t.co','https://witter.cz','https://cdn.noods.fun','https://thumbsnap.com','https://paste.gmem.ca','https://x.com','https://kneel.before.dog','https://media.nofan.xyz','https://stockroom.wandering.shop','https://quark.scrolller.com','https://www.manyvids.com','https://fansly.com','https://onlyfans.com','https://proton.scrolller.com','https://api-test.summary.news','https://fans.ly','https://figure.game','https://link.storjshare.io','https://open.spotify.com','https://t.me/','https://nyc3.digitaloceanspaces.com']], //[whitelistPolicy, [ //] +//] ]); writeStdout(result); } diff --git a/sync-wot.sh b/sync-wot.sh new file mode 100755 index 0000000..fc9212a --- /dev/null +++ b/sync-wot.sh @@ -0,0 +1,72 @@ +#!/bin/bash +cd /opt/strfry + +STRFRY_POLICY_DIR="/opt/strfry-policies" +STRFRY_POLICY_TEMPLATE="$STRFRY_POLICY_DIR/strfry-policy.clean" +STRFRY_POLICY_TEMPLATE_TMP="/tmp/strfry-policy.ts" +STRFRY_POLICY_FILE="$STRFRY_POLICY_DIR/strfry-policy.ts" +TMP_FILE="/tmp/data.tmp" +TMP_FILE_FINAL="/tmp/data/final.tmp" + +cp -f $STRFRY_POLICY_TEMPLATE $STRFRY_POLICY_TEMPLATE_TMP + +WOT=( + 33c74427f3b2b73d5e38f3e6c991c122a55d204072356f71da49a0e209fb6940 + 82341f882b6eabcd2ba7f1ef90aad961cf074af15b9ef44a09f9d2a8fbfbe6a2 + ) + +function gather(){ + echo > /tmp/db.txt + local array=() + for y in "${WOT[@]}"; do + echo nak req -k 3 -a $y wss://poster.place/relay + nak req -k 3 -a 33c74427f3b2b73d5e38f3e6c991c122a55d204072356f71da49a0e209fb6940 wss://poster.place/relay | jq | grep "\"" | grep -Evi "\"p\"" | grep -Evi 'tags|pubkey|alt|Follow List|content|sig|kind|id|created' | sed 's/"//g' | sed 's/,//g' > $TMP_FILE + NPUBS=( $(cat $TMP_FILE) ) + for n in "${NPUBS[@]}"; do + if [ ${#n} -ge 64 ]; then + nak req -k 3 -a $n wss://poster.place/relay | jq | grep "\"" | grep -Evi "\"p\"" | grep -Evi 'tags|pubkey|alt|Follow List|content|sig|kind|id|created' | sed 's/"//g' | sed 's/,//g' >> $TMP_FILE + fi + done + + done +} + +function write(){ + cd $STRFRY_POLICY_DIR + sed -i "s/////g" $STRFRY_POLICY_TEMPLATE_TMP + sed -i '/deno/d' $STRFRY_POLICY_TEMPLATE_TMP + sed -i '/#!/a \/\/bin/true; exec deno run -A "$0" "$@"' $STRFRY_POLICY_TEMPLATE_TMP + cat $TMP_FILE | sort -u > $TMP_FILE_FINAL + readarray -t file_contents < $TMP_FILE_FINAL + + for elem in "${file_contents[@]}"; do + IFS=',' read -ra parts <<< "$elem" + for part in "${parts[@]}"; do + if [ ${#part} -gt 64 ]; then + if [[ $part == *:* ]]; then + echo "Skipping" + else + CLEAN=$(echo $part | sed 's/[[:space:]]*$//' | sed "s/'//g" | sed "s/,//g") + sed -i "/\[whitelistPolicy, \[/a\'$CLEAN'," $STRFRY_POLICY_TEMPLATE_TMP + echo "'$CLEAN'," + fi + else + echo "Skipping" + fi + done + done + + sed -i "s/\/\/\[whitelistPolicy/\[whitelistPolicy/" $STRFRY_POLICY_TEMPLATE_TMP + sed -i "s/\/\/\]/\]/g" $STRFRY_POLICY_TEMPLATE_TMP + + #cp -f $STRFRY_POLICY_TEMPLATE_TMP $STRFRY_POLICY_FILE +} + +if [ "$1" = "gather" ]; then + rm -f $TMP_FILE + gather +elif [ "$1" = "write" ]; then + write +else + gather +fi