repos
/ timelite-nextjs master

timelite-nextjs

mirror archived upstream

A dead simple time tracker that keeps everything in local storage. Next.js, no accounts and no server.

handcodedlocalstoragenextjsreactself-hostedserverlesstime-trackingtimer

1.2 KB · 45 lines · JavaScript Raw History
 1/** @type {import('next').NextConfig} */
 2const isDev = process.env.NODE_ENV !== "production";
 3
 4const securityHeaders = [
 5  { key: "X-Content-Type-Options", value: "nosniff" },
 6  { key: "X-Frame-Options", value: "SAMEORIGIN" },
 7  { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
 8  {
 9    key: "Permissions-Policy",
10    value: "camera=(), microphone=(), geolocation=(), interest-cohort=()",
11  },
12  {
13    key: "Content-Security-Policy",
14    value: [
15      "default-src 'self'",
16      // unsafe-eval only in dev: Next's dev runtime needs it, prod does not.
17      `script-src 'self' 'unsafe-inline'${isDev ? " 'unsafe-eval'" : ""}`,
18      "style-src 'self' 'unsafe-inline' https://fonts.googleapis.com",
19      "img-src 'self' data: blob:",
20      "font-src 'self' data: https://fonts.gstatic.com",
21      "connect-src 'self' blob:",
22      "manifest-src 'self'",
23      "base-uri 'self'",
24      "form-action 'self'",
25      "frame-ancestors 'self'",
26    ].join("; "),
27  },
28];
29
30const nextConfig = {
31  devIndicators: {
32    position: "top-right",
33  },
34  async headers() {
35    return [
36      {
37        source: "/:path*",
38        headers: securityHeaders,
39      },
40    ];
41  },
42};
43
44module.exports = nextConfig;