deploy: 9f0ca8983d024f88d4337aa2d10aa919adc6820f

This commit is contained in:
SukkaBot
2022-09-16 17:16:37 +00:00
parent 9f82fe282f
commit 22c43f67ae
4 changed files with 1398 additions and 1162 deletions

View File

@@ -1,9 +1,11 @@
const { workerData, move } = require('piscina');
const len = workerData.length;
// pre check if fullset domain is starts with a "."
// This avoid calling chatCodeAt repeatedly
const fullsetDomainStartsWithADot = workerData.map(domain => domain.charCodeAt(0) === 46);
// workerData is an array of string. Sort it by length, short first:
const fullsetDomainStartsWithADot = workerData.sort((a, b) => a.length - b.length).filter(domain => domain.charCodeAt(0) === 46);
const totalLen = fullsetDomainStartsWithADot.length;
module.exports = ({ chunk }) => {
const chunkLength = chunk.length;
@@ -12,35 +14,38 @@ module.exports = ({ chunk }) => {
for (let i = 0; i < chunkLength; i++) {
const domainFromInput = chunk[i];
for (let j = 0; j < len; j++) {
// Check if domainFromFullset starts with a "."
if (!fullsetDomainStartsWithADot[j]) continue;
for (let j = 0; j < totalLen; j++) {
const domainFromFullSet = fullsetDomainStartsWithADot[j];
// domainFromFullSet is now startsWith a "."
const domainFromFullSet = workerData[j];
if (domainFromFullSet === domainFromInput) continue;
const domainFromInputLen = domainFromInput.length;
const domainFromFullSetLen = domainFromFullSet.length;
// !domainFromInput.starsWith('.') && `.${domainFromInput}` === domainFromFullSet
if (domainFromInput.charCodeAt(0) !== 46) {
let shouldBeRemoved = true;
if (domainFromInputLen + 1 === domainFromFullSetLen) {
for (let k = 0; k < domainFromInputLen; k++) {
if (domainFromFullSet.charCodeAt(k + 1) !== domainFromInput.charCodeAt(k)) {
shouldBeRemoved = false;
let shouldBeRemoved = true;
for (let k = 0; k < domainFromInputLen; k++) {
if (domainFromFullSet.charCodeAt(k + 1) !== domainFromInput.charCodeAt(k)) {
shouldBeRemoved = false;
break;
}
}
if (shouldBeRemoved) {
outputToBeRemoved[i] = 1;
break;
}
}
if (shouldBeRemoved) {
outputToBeRemoved[i] = 1;
break;
}
}
// domainFromInput is now startsWith a "."
if (domainFromInputLen >= domainFromFullSet.length) {
if (domainFromInputLen >= domainFromFullSetLen) {
if (domainFromInput.endsWith(domainFromFullSet)) {
outputToBeRemoved[i] = 1;
break;

View File

@@ -476,11 +476,12 @@ cdn2.editmysite.com
updates.signal.org
updates2.signal.org
# >> OCSP Stapling Server
.lencr.org
.ocsp.digicert.com
.ocsp.comodoca.com
.amazontrust.com
# Zoho
.zohocdn.com
.zohostatic.com
.zohowebstatic.com
.zohostatic.eu
webfonts.zoho.com
# >> General CDN
# Zoom

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@
<main class="container">
<h1>Sukka Surge Ruleset Server</h1>
<p>Made by <a href="https://skk.moe">Sukka</a> | <a href="https://github.com/SukkaW/Surge/">Source @ GitHub</a> | Licensed under <a href="https://github.com/SukkaW/Surge/blob/master/LICENSE" target="_blank">AGPL-3.0</a></p>
<p>Last Updated: 2022-09-16T12:45:50.050Z</p>
<p>Last Updated: 2022-09-16T17:16:36.297Z</p>
<hr>
<br>
<ul>