diff --git a/app/layout.tsx b/app/layout.tsx index 5c2024c..4721cfc 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -29,6 +29,11 @@ export const metadata: Metadata = { alternates: { canonical: '/', }, + icons: { + icon: [{ url: '/favicon.svg', type: 'image/svg+xml' }], + shortcut: '/favicon.svg', + }, + manifest: '/site.webmanifest', } export const viewport: Viewport = { diff --git a/infra/README.md b/infra/README.md index 2abfedb..ea0610c 100644 --- a/infra/README.md +++ b/infra/README.md @@ -61,6 +61,7 @@ In the DigitalOcean console, authorize App Platform to access `nmandiveyi/portfo ```bash cd infra/environments/prod export TF_VAR_do_token="dop_v1_..." +# or set do_token and do_project_id in portfolio.auto.tfvars (see below) terraform init terraform apply ``` @@ -112,6 +113,9 @@ Never commit secrets. Edit `portfolio.auto.tfvars` (gitignored, auto-loaded): ```bash # infra/environments/prod/portfolio.auto.tfvars +do_token = "dop_v1_..." +do_project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # doctl projects list + cloudflare_enabled = false cloudflare_dns_enabled = false cloudflare_proxy_enabled = false diff --git a/infra/environments/prod/main.tf b/infra/environments/prod/main.tf index c91a23f..98d2aab 100644 --- a/infra/environments/prod/main.tf +++ b/infra/environments/prod/main.tf @@ -27,6 +27,7 @@ module "frontend" { site_url = local.frontend_site_url manage_dns_zone = !var.cloudflare_dns_enabled + project_id = var.do_project_id } module "cloudflare" { diff --git a/infra/environments/prod/terraform.tfvars b/infra/environments/prod/terraform.tfvars index c813d95..a52c7b9 100644 --- a/infra/environments/prod/terraform.tfvars +++ b/infra/environments/prod/terraform.tfvars @@ -1,5 +1,6 @@ -# do_token — set in portfolio.auto.tfvars (gitignored) or export TF_VAR_do_token: +# do_token / do_project_id — set in portfolio.auto.tfvars (gitignored) or export TF_VAR_*: # export TF_VAR_do_token="dop_v1_..." +# export TF_VAR_do_project_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # # cloudflare_api_token / cloudflare_account_id — same pattern; see portfolio.auto.tfvars. # diff --git a/infra/environments/prod/variables.tf b/infra/environments/prod/variables.tf index ed15754..e07bbd6 100644 --- a/infra/environments/prod/variables.tf +++ b/infra/environments/prod/variables.tf @@ -4,6 +4,11 @@ variable "do_token" { sensitive = true } +variable "do_project_id" { + description = "DigitalOcean project UUID for the App Platform app. List with: doctl projects list" + type = string +} + variable "environment" { description = "Environment" type = string diff --git a/infra/modules/frontend/main.tf b/infra/modules/frontend/main.tf index 6c1b35a..a15e407 100644 --- a/infra/modules/frontend/main.tf +++ b/infra/modules/frontend/main.tf @@ -1,4 +1,6 @@ resource "digitalocean_app" "this" { + project_id = var.project_id + spec { name = var.name region = var.region diff --git a/infra/modules/frontend/variables.tf b/infra/modules/frontend/variables.tf index d80ca9d..5e0449c 100644 --- a/infra/modules/frontend/variables.tf +++ b/infra/modules/frontend/variables.tf @@ -43,3 +43,8 @@ variable "manage_dns_zone" { type = bool default = true } + +variable "project_id" { + description = "DigitalOcean project UUID. Without this, the app is created in your account default project." + type = string +} diff --git a/next.config.ts b/next.config.ts index e4f5738..3f40e23 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,5 +1,15 @@ import type { NextConfig } from 'next' -const nextConfig: NextConfig = {} +const nextConfig: NextConfig = { + async redirects() { + return [ + { + source: '/favicon.ico', + destination: '/favicon.svg', + permanent: false, + }, + ] + }, +} export default nextConfig