fix(security): harden sanitize, flatten, redaction, signature validation, CSP, proxies and CI

This commit is contained in:
alam00000 committed 2026-10-19 14:45:00 +05:30
1 parent b0a186839a
commit edd959f345
62 files changed
+4813 -926

No files matched your search

+60 -75
View File
@@ -2,6 +2,7 @@ import fs from 'fs';
import path from 'path';
import { marked } from 'marked';
import { fileURLToPath } from 'url';
import { serializeJsonLd } from './json-ld.mjs';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
@@ -123,19 +124,15 @@ function faqSchema(entries) {
if (entries.length === 0) return '';
return `
<script type="application/ld+json">
${JSON.stringify(
{
'@context': 'https://schema.org',
'@type': 'FAQPage',
mainEntity: entries.map((f) => ({
'@type': 'Question',
name: f.q,
acceptedAnswer: { '@type': 'Answer', text: plainText(f.a) },
})),
},
null,
2
)}
${serializeJsonLd({
'@context': 'https://schema.org',
'@type': 'FAQPage',
mainEntity: entries.map((f) => ({
'@type': 'Question',
name: f.q,
acceptedAnswer: { '@type': 'Answer', text: plainText(f.a) },
})),
})}
</script>`;
}
@@ -246,55 +243,47 @@ ${renderFaqs(meta.faqs)}
</script>
<script type="application/ld+json">
${JSON.stringify(
{
'@context': 'https://schema.org',
'@type': 'BlogPosting',
headline: meta.h1,
description: meta.description,
url,
datePublished: meta.date,
dateModified: updated,
image: `${SITE_URL}/images/og-tools.png`,
author: {
'@type': 'Person',
name: AUTHOR.name,
url: AUTHOR.url,
sameAs: AUTHOR.profiles,
},
publisher: {
'@type': 'Organization',
name: 'BentoPDF',
url: SITE_URL,
},
${serializeJsonLd({
'@context': 'https://schema.org',
'@type': 'BlogPosting',
headline: meta.h1,
description: meta.description,
url,
datePublished: meta.date,
dateModified: updated,
image: `${SITE_URL}/images/og-tools.png`,
author: {
'@type': 'Person',
name: AUTHOR.name,
url: AUTHOR.url,
sameAs: AUTHOR.profiles,
},
null,
2
)}
publisher: {
'@type': 'Organization',
name: 'BentoPDF',
url: SITE_URL,
},
})}
</script>
<script type="application/ld+json">
${JSON.stringify(
{
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Blog',
item: `${SITE_URL}/blog/`,
},
{
'@type': 'ListItem',
position: 2,
name: meta.breadcrumb,
item: url,
},
],
},
null,
2
)}
${serializeJsonLd({
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Blog',
item: `${SITE_URL}/blog/`,
},
{
'@type': 'ListItem',
position: 2,
name: meta.breadcrumb,
item: url,
},
],
})}
</script>${faqSchema(faqEntries)}
</body>
</html>
@@ -370,23 +359,19 @@ ${cards}
<script type="module" src="/src/js/mobileMenu.ts"></script>
<script type="application/ld+json">
${JSON.stringify(
{
'@context': 'https://schema.org',
'@type': 'Blog',
name: 'The BentoPDF Blog',
url: `${SITE_URL}/blog/`,
description:
'Guides and honest comparisons from the maintainer of BentoPDF.',
publisher: {
'@type': 'Organization',
name: 'BentoPDF',
url: SITE_URL,
},
${serializeJsonLd({
'@context': 'https://schema.org',
'@type': 'Blog',
name: 'The BentoPDF Blog',
url: `${SITE_URL}/blog/`,
description:
'Guides and honest comparisons from the maintainer of BentoPDF.',
publisher: {
'@type': 'Organization',
name: 'BentoPDF',
url: SITE_URL,
},
null,
2
)}
})}
</script>
</body>
</html>