forked from colin/resume
2
0
Fork 0

Fix Docker configuration to include theme.js and styles.css files

This commit is contained in:
Your Name 2025-03-31 04:23:32 -04:00
parent 1c328df0c7
commit 71e142b82e
3 changed files with 4 additions and 13 deletions

View File

@ -3,17 +3,6 @@
file_server
encode gzip
# Generate a random nonce for each request
@html {
path *.html
}
handle @html {
header {
+Content-Type "text/html; charset=utf-8"
}
templates
}
# Security headers
header {
# Remove default Caddy headers
@ -37,7 +26,7 @@
Cross-Origin-Opener-Policy "same-origin"
# Simplified CSP for static content
Content-Security-Policy "default-src 'none'; script-src 'self' 'nonce-{{.RandomString}}'; style-src 'self'; img-src 'self' data:; font-src 'self' data:; connect-src 'self'; object-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'none';"
Content-Security-Policy "default-src 'none'; script-src 'self' 'unsafe-inline'; style-src 'self'; img-src 'self' data:; font-src 'self' data:; connect-src 'self'; object-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'none';"
}
# Handle 404s

View File

@ -3,6 +3,8 @@ FROM caddy:2-alpine
# Copy Caddyfile and static content
COPY Caddyfile /etc/caddy/Caddyfile
COPY index.html /srv/
COPY theme.js /srv/
COPY styles.css /srv/
# Expose port 8080
EXPOSE 8080

View File

@ -6,7 +6,7 @@
<meta name="description" content="Colin Knapp - Cybersecurity Expert and Software Developer Portfolio">
<title>Colin Knapp Portfolio</title>
<link rel="stylesheet" href="styles.css">
<script src="theme.js" nonce="{{.RandomString}}" crossorigin="anonymous"></script>
<script src="theme.js"></script>
</head>
<body>
<div class="theme-switch">