mirror of
https://github.com/msfjarvis/server-config
synced 2025-08-14 08:17:01 +05:30
Caddyfile: commonize CSP
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
1296f188d8
commit
7d05cabf3e
1 changed files with 22 additions and 33 deletions
55
Caddyfile
55
Caddyfile
|
@ -23,6 +23,26 @@
|
||||||
transparent
|
transparent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(csp_config) {
|
||||||
|
header / {
|
||||||
|
Content-Security-Policy "
|
||||||
|
base-uri 'self';
|
||||||
|
connect-src 'self' commento.msfjarvis.dev;
|
||||||
|
default-src 'self';
|
||||||
|
frame-ancestors 'none';
|
||||||
|
frame-src github.com;
|
||||||
|
font-src 'self' data: commento.msfjarvis.dev;
|
||||||
|
img-src 'self' data: gfycat.com imgur.com *.imgur.com commento.msfjarvis.dev;
|
||||||
|
object-src 'none';
|
||||||
|
script-src 'self' commento.msfjarvis.dev platform.twitter.com unpkg.com;
|
||||||
|
style-src 'self' commento.msfjarvis.dev 'unsafe-inline';
|
||||||
|
"
|
||||||
|
}
|
||||||
|
errors {
|
||||||
|
404 404.html
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
https://www.msfjarvis.dev {
|
https://www.msfjarvis.dev {
|
||||||
import base_config
|
import base_config
|
||||||
redir https://msfjarvis.dev{uri} 301
|
redir https://msfjarvis.dev{uri} 301
|
||||||
|
@ -31,30 +51,14 @@ https://www.msfjarvis.dev {
|
||||||
https://msfjarvis.dev {
|
https://msfjarvis.dev {
|
||||||
import base_config
|
import base_config
|
||||||
import compression_config
|
import compression_config
|
||||||
|
import csp_config
|
||||||
root /var/www/msfjarvis.dev/
|
root /var/www/msfjarvis.dev/
|
||||||
log / /etc/logs/requests.log
|
log / /etc/logs/requests.log
|
||||||
errors {
|
|
||||||
404 404.html
|
|
||||||
}
|
|
||||||
redir 301 {
|
redir 301 {
|
||||||
/caesium-stable https://dl.msfjarvis.dev/caesium/wahoo/stable/updater.json
|
/caesium-stable https://dl.msfjarvis.dev/caesium/wahoo/stable/updater.json
|
||||||
/caesium-beta https://dl.msfjarvis.dev/caesium/wahoo/beta/updater.json
|
/caesium-beta https://dl.msfjarvis.dev/caesium/wahoo/beta/updater.json
|
||||||
/caesium-alpha https://dl.msfjarvis.dev/caesium/wahoo/alpha/updater.json
|
/caesium-alpha https://dl.msfjarvis.dev/caesium/wahoo/alpha/updater.json
|
||||||
}
|
}
|
||||||
header / {
|
|
||||||
Content-Security-Policy "
|
|
||||||
base-uri 'self';
|
|
||||||
connect-src 'self' commento.msfjarvis.dev;
|
|
||||||
default-src 'self';
|
|
||||||
frame-ancestors 'none';
|
|
||||||
frame-src github.com;
|
|
||||||
font-src 'self' data: commento.msfjarvis.dev;
|
|
||||||
img-src 'self' data: gfycat.com imgur.com *.imgur.com commento.msfjarvis.dev;
|
|
||||||
object-src 'none';
|
|
||||||
script-src 'self' commento.msfjarvis.dev platform.twitter.com unpkg.com;
|
|
||||||
style-src 'self' commento.msfjarvis.dev 'unsafe-inline';
|
|
||||||
"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
https://bin.msfjarvis.dev {
|
https://bin.msfjarvis.dev {
|
||||||
|
@ -94,21 +98,6 @@ https://rss.msfjarvis.dev {
|
||||||
https://staging.msfjarvis.dev {
|
https://staging.msfjarvis.dev {
|
||||||
import base_config
|
import base_config
|
||||||
import compression_config
|
import compression_config
|
||||||
|
import csp_config
|
||||||
root /var/www/staging.msfjarvis.dev/
|
root /var/www/staging.msfjarvis.dev/
|
||||||
errors {
|
|
||||||
404 404.html
|
|
||||||
}
|
|
||||||
header / {
|
|
||||||
Content-Security-Policy "
|
|
||||||
base-uri 'self';
|
|
||||||
connect-src 'self' commento.msfjarvis.dev;
|
|
||||||
default-src 'self';
|
|
||||||
frame-ancestors 'none';
|
|
||||||
font-src 'self' data: commento.msfjarvis.dev stackpath.bootstrapcdn.com;
|
|
||||||
img-src 'self' data: gfycat.com imgur.com *.imgur.com commento.msfjarvis.dev *.amazonaws.com;
|
|
||||||
object-src 'none';
|
|
||||||
script-src 'self' commento.msfjarvis.dev unpkg.com;
|
|
||||||
style-src 'self' commento.msfjarvis.dev stackpath.bootstrapcdn.com;
|
|
||||||
"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue