mirror of
https://github.com/pezkuwichain/phishing.git
synced 2026-06-12 18:11:05 +00:00
+1
-1
@@ -41,7 +41,7 @@
|
|||||||
"dnslink-cloudflare": "^3.0.0"
|
"dnslink-cloudflare": "^3.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/dev": "^0.75.26",
|
"@polkadot/dev": "^0.76.15",
|
||||||
"@types/node": "^20.4.0"
|
"@types/node": "^20.4.0"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
"version": "0.21.6-298-x",
|
"version": "0.21.6-298-x",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polkadot/util": "^12.3.2",
|
"@polkadot/util": "^12.4.1",
|
||||||
"@polkadot/util-crypto": "^12.3.2",
|
"@polkadot/util-crypto": "^12.4.1",
|
||||||
"@polkadot/x-fetch": "^12.3.2",
|
"@polkadot/x-fetch": "^12.4.1",
|
||||||
"tslib": "^2.6.0"
|
"tslib": "^2.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ function checkTag (url: string, tag: string, attr?: string): Promise<[string, st
|
|||||||
const match = new RegExp(`<${tag}${attr ? ` ${attr}` : ''}>(.*?)</${tag}>`, 'g').exec(result);
|
const match = new RegExp(`<${tag}${attr ? ` ${attr}` : ''}>(.*?)</${tag}>`, 'g').exec(result);
|
||||||
|
|
||||||
// /<\/?p( id="trnsctin")?>/g
|
// /<\/?p( id="trnsctin")?>/g
|
||||||
return match && match.length
|
return match?.length
|
||||||
? match.map((v) =>
|
? match.map((v) =>
|
||||||
v
|
v
|
||||||
.replace(new RegExp(`</?${tag}${attr ? `( ${attr})?` : ''}>`, 'g'), '')
|
.replace(new RegExp(`</?${tag}${attr ? `( ${attr})?` : ''}>`, 'g'), '')
|
||||||
@@ -84,7 +84,7 @@ function checkAttr (url: string, attr: string): Promise<[string, string[]]> {
|
|||||||
const result = await fetchText(url, TIMEOUT);
|
const result = await fetchText(url, TIMEOUT);
|
||||||
const match = new RegExp(`${attr}"[a-zA-Z0-9]+"`, 'g').exec(result);
|
const match = new RegExp(`${attr}"[a-zA-Z0-9]+"`, 'g').exec(result);
|
||||||
|
|
||||||
return match && match.length
|
return match?.length
|
||||||
? [match[0].replace(new RegExp(attr, 'g'), '').replace(/"/g, '').trim()]
|
? [match[0].replace(new RegExp(attr, 'g'), '').replace(/"/g, '').trim()]
|
||||||
: null;
|
: null;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ export async function checkAddress (address: string | Uint8Array, allowCached =
|
|||||||
u8as.some((a) => u8aEq(a, u8a))
|
u8as.some((a) => u8aEq(a, u8a))
|
||||||
);
|
);
|
||||||
|
|
||||||
return (entry && entry[0]) || null;
|
return entry?.[0] || null;
|
||||||
} catch {
|
} catch {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2017-2023 @polkadot/api authors & contributors
|
// Copyright 2017-2023 @polkadot/phishing authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import { createBundle } from '@polkadot/dev/config/rollup';
|
import { createBundle } from '@polkadot/dev/config/rollup';
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ const PINMETA = {
|
|||||||
/** @type {PinataClient} */
|
/** @type {PinataClient} */
|
||||||
// @ts-expect-error For some reason we have issues here...
|
// @ts-expect-error For some reason we have issues here...
|
||||||
const pinata = new PinataSDK({
|
const pinata = new PinataSDK({
|
||||||
pinataApiKey: process.env.PINATA_API_KEY,
|
pinataApiKey: process.env['PINATA_API_KEY'],
|
||||||
pinataSecretApiKey: process.env.PINATA_SECRET_KEY
|
pinataSecretApiKey: process.env['PINATA_SECRET_KEY']
|
||||||
});
|
});
|
||||||
|
|
||||||
async function wait (delay = 2500) {
|
async function wait (delay = 2500) {
|
||||||
@@ -53,7 +53,7 @@ async function unpin (exclude) {
|
|||||||
.map((r) => r.ipfs_pin_hash)
|
.map((r) => r.ipfs_pin_hash)
|
||||||
.filter((/** @type { string} */ hash) => hash !== exclude);
|
.filter((/** @type { string} */ hash) => hash !== exclude);
|
||||||
|
|
||||||
for (let i = 0; i < hashes.length; i++) {
|
for (let i = 0, count = hashes.length; i < count; i++) {
|
||||||
const hash = hashes[i];
|
const hash = hashes[i];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -74,12 +74,12 @@ async function unpin (exclude) {
|
|||||||
async function dnslink (hash) {
|
async function dnslink (hash) {
|
||||||
const records = [`_dnslink.${SUB_DOMAIN}.${DOMAIN}`];
|
const records = [`_dnslink.${SUB_DOMAIN}.${DOMAIN}`];
|
||||||
|
|
||||||
for (let i = 0; i < records.length; i++) {
|
for (let i = 0, count = records.length; i < count; i++) {
|
||||||
const record = records[i];
|
const record = records[i];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await cloudflare(
|
await cloudflare(
|
||||||
{ token: process.env.CF_API_TOKEN },
|
{ token: process.env['CF_API_TOKEN'] },
|
||||||
{ link: `/ipfs/${hash}`, record, zone: DOMAIN }
|
{ link: `/ipfs/${hash}`, record, zone: DOMAIN }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user