mirror of
https://github.com/0x5477/phantomlink.git
synced 2026-11-06 00:14:39 +00:00
- Tauri 2 + Rust + React + TypeScript - AES-256-GCM + X25519 ECDH + Argon2id end-to-end encryption - mDNS device discovery + P2P TLS 1.3 - Private chat, group chat, burn-after-read - Image/file transfer with encrypted local storage - Encrypted backup export/import - Auto-lock, clipboard clear, brute-force protection - Sci-fi themed UI (deep space + neon + glassmorphism)
27 lines
745 B
JavaScript
27 lines
745 B
JavaScript
import { readFileSync, writeFileSync } from "node:fs";
|
|
|
|
const CSP = [
|
|
"default-src 'self'",
|
|
"script-src 'self'",
|
|
"style-src 'self' 'unsafe-inline'",
|
|
"img-src 'self' data: blob:",
|
|
"connect-src ipc: http://ipc.localhost",
|
|
"font-src 'self' data:",
|
|
"object-src 'none'",
|
|
"base-uri 'none'",
|
|
"form-action 'none'",
|
|
].join("; ");
|
|
|
|
const file = "dist/index.html";
|
|
const html = readFileSync(file, "utf8");
|
|
if (!html.includes("Content-Security-Policy")) {
|
|
const injected = html.replace(
|
|
"<head>",
|
|
`<head>\n <meta http-equiv="Content-Security-Policy" content="${CSP}" />`,
|
|
);
|
|
writeFileSync(file, injected);
|
|
console.log("[inject-csp] CSP injected");
|
|
} else {
|
|
console.log("[inject-csp] CSP already present, skipping");
|
|
}
|