mirror of
https://github.com/kccleoc/seedpgp-web.git
synced 2026-03-07 09:57:50 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eeb5184b8a | ||
|
|
422fe04a12 | ||
|
|
ebeea79a33 | ||
|
|
faf58dc49d | ||
|
|
46982794cc |
13
GEMINI.md
13
GEMINI.md
@@ -130,9 +130,18 @@ bun run preview # Preview production build
|
||||
|
||||
### Deployment Process
|
||||
|
||||
This project is now deployed to Cloudflare Pages for enhanced security.
|
||||
|
||||
1. **Private repo** (`seedpgp-web`): Source code, development
|
||||
2. **Public repo** (`seedpgp-web-app`): Built files for GitHub Pages
|
||||
3. **Deploy script** (`scripts/deploy.sh`): Builds + copies to dist/ + pushes to public repo
|
||||
2. **Cloudflare Pages**: Deploys from `seedpgp-web` repo directly.
|
||||
3. **GitHub Pages (Legacy)**: `seedpgp-web-app` public repo is retained for historical purposes, but no longer actively deployed to.
|
||||
|
||||
### Cloudflare Pages Deployment
|
||||
|
||||
1. Connect GitHub repo (`seedpgp-web`) to Cloudflare Pages.
|
||||
2. Build settings: `bun run build`, output directory: `dist/`.
|
||||
3. `public/_headers` file enforces Content Security Policy (CSP) and other security headers automatically.
|
||||
4. Benefits: Real CSP enforcement, not just a UI toggle.
|
||||
|
||||
### Git Workflow
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "seedpgp-web",
|
||||
"private": true,
|
||||
"version": "1.4.0",
|
||||
"version": "1.4.2",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
6
public/_headers
Normal file
6
public/_headers
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'none'; form-action 'none'; base-uri 'self';
|
||||
X-Frame-Options: DENY
|
||||
X-Content-Type-Options: nosniff
|
||||
X-XSS-Protection: 1; mode=block
|
||||
Referrer-Policy: strict-origin-when-cross-origin
|
||||
@@ -12,7 +12,8 @@ const gitHash = execSync('git rev-parse --short HEAD').toString().trim()
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
base: '/seedpgp-web-app/',
|
||||
base: process.env.CF_PAGES ? '/' : '/seedpgp-web-app/',
|
||||
publicDir: 'public', // ← Explicitly set (should be default)
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
emptyOutDir: false,
|
||||
|
||||
Reference in New Issue
Block a user