Skip to content

Commit

Permalink
Merge pull request #224 from WardPearce/feature/improved-vercel-headers
Browse files Browse the repository at this point in the history
Feature/improved vercel headers
  • Loading branch information
WardPearce authored Jul 10, 2023
2 parents 7c3680c + 0b0e436 commit f4da93f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ Paaster uses XChaCha20-Poly1305 encryption, which is implemented using the [libs
- Paaster will never have opt-in / opt-out encryption, encryption will always be present.

# Setup

## Production with Docker

NOTE: Latest MongoDB requires CPU with AVX support. If you're using virtual CPU (e.g. `kvm64`) it will not work.
Expand All @@ -108,6 +107,15 @@ To fix that, either downgrade MongoDB to 4.x, or adjust your VM CPU configuratio
NOTE: the self-hosted version uses a temporary container (`paaster-minio-init`) to create initial bucket
in MinIO container and configure it for public access.

### Recommended headers for frontend
**Disable automatically via Vercel**

- `Strict-Transport-Security: max-age=31536000`
- `X-XSS-Protection: 1; mode=block`
- `X-Frame-Options: DENY`
- `Content-Security-Policy: default-src 'self'`
- `Feature-Policy: microphone 'none'; camera 'none'; geolocation 'none'; payment 'none';`

### Vercel

Paaster's frontend is also configured to work with [Vercel](https://vercel.com), which offers enhanced security through server separation and improved performance.
Expand Down
34 changes: 33 additions & 1 deletion frontend/vercel.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
{
"rewrites": [{ "source": "/(.*)", "destination": "/" }]
"headers": [
{
"source": "/(.*)",
"headers": [
{
"key": "Strict-Transport-Security",
"value": "max-age=31536000;"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "X-Frame-Options",
"value": "DENY"
},
{
"key": "Content-Security-Policy",
"value": "default-src 'self'"
},
{
"key": "Feature-Policy",
"value": "microphone 'none'; camera 'none'; geolocation 'none'; payment 'none';"
}
]
}
],
"rewrites": [
{
"source": "/(.*)",
"destination": "/"
}
]
}

1 comment on commit f4da93f

@vercel
Copy link

@vercel vercel bot commented on f4da93f Jul 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

paaster – ./

paaster-git-main-boringsh.vercel.app
paaster.vercel.app
paaster-boringsh.vercel.app
paaster.io

Please sign in to comment.