Files
explore/nextjs/csp/generateCspPolicy.ts
zeekay e9756e8814 run on the native fleet
Adds .hanzo/workflows/cicd.yml calling the canonical pipeline and drops the
GitHub-hosted workflows it replaces. Lands here because this is where the repo
is written — git.hanzo.ai is upstream and github.com is its push mirror, so the
same change made on github.com never reaches the runner fleet.
2026-08-20 20:20:18 -07:00

32 lines
1.0 KiB
TypeScript

import * as descriptors from './policies';
import { makePolicyString, mergeDescriptors } from './utils';
function generateCspPolicy(isPrivateMode = false) {
const policyDescriptor = mergeDescriptors(
descriptors.app(isPrivateMode),
// Exclude tracking/analytics sources in private mode
isPrivateMode ? {} : descriptors.ad(),
isPrivateMode ? {} : descriptors.blockchainInteraction(),
descriptors.cloudFlare(),
descriptors.flashblocks(),
descriptors.googleFonts(),
descriptors.googleReCaptcha(),
isPrivateMode ? {} : descriptors.hanzoInsights(),
descriptors.helia(),
isPrivateMode ? {} : descriptors.marketplace(),
descriptors.megaEth(),
isPrivateMode ? {} : descriptors.mixpanel(),
descriptors.monaco(),
descriptors.multichain(),
isPrivateMode ? {} : descriptors.rollbar(),
descriptors.rollup(),
descriptors.safe(),
descriptors.usernameApi(),
descriptors.zetachain(),
);
return makePolicyString(policyDescriptor);
}
export default generateCspPolicy;