content: [build]
    command = "yarn build"
    publish = "build"
  
  [build.environment]
    YARN_FLAGS = "--frozen-lockfile"
    YARN_VERSION = "1.22.19"
    NODE_VERSION = "16.18.1"
    SECRETS_SCAN_SMART_DETECTION_ENABLED = "false" # false positives during build time fail the build on netlify. Codetribute doesn't embed any secrets
  
  # Redirect HTTP to HTTPS
  # TODO: Delete when Codetribute successfully moves to codetribute.mozilla.org
  [[redirects]]
    from = "http://codetribute.netlify.com/*"
    to = "https://codetribute.netlify.com/:splat"
    status = 301
    force = true
  
  # Redirect HTTP to HTTPS
  [[redirects]]
    from = "http://codetribute.mozilla.org/*"
    to = "https://codetribute.mozilla.org/:splat"
    status = 301
    force = true
  
  # Rule for SPA
  [[redirects]]
    from = "/*"
    to = "/index.html"
    status = 200
  
  [[headers]]
    for = "/*"
    [headers.values]
      X-Frame-Options = "DENY"
      X-XSS-Protection = "1; mode=block"
      Content-Security-Policy = "default-src 'none'; connect-src 'self' https://bugzilla-graphql-gateway.herokuapp.com https://api.github.com/graphql; script-src 'self' 'unsafe-inline'; font-src 'self' data:; img-src 'self'; style-src https: 'unsafe-inline'; object-src 'none'; frame-ancestors 'self'"
      Strict-Transport-Security = "max-age=31536000; includeSubDomains;"
      Referrer-Policy = "no-referrer"
      X-Content-Type-Options = "nosniff"
  