Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- name: Generate fake ./terraform/live/secrets.auto.tfvars
run: |
echo "project_id_map = { stage = \"mapswipe\" }" > ./terraform/live/secrets.auto.tfvars
echo "project_id_map = { stage = \"mapswipe-stage\", prod = \"mapswipe-prod\" }" > ./terraform/live/secrets.auto.tfvars

# TODO: Cache plugins?
- uses: terraform-linters/setup-tflint@v5
Expand Down
25 changes: 16 additions & 9 deletions caddy/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,33 @@


{$CADDY_HOST_BACKEND} {
encode gzip zstd
root * /assets/backend/

request_body {
max_size 10MB
}

handle_path /static/* {
root * /assets/backend/static
import file_server_config
@isStatic {
path /static/* /media/*
}

handle_path /media/* {
root * /assets/backend/media
import file_server_config
@notStatic {
not path /static/* /media/*
}
reverse_proxy @notStatic web:80 {
header_up X-Forwarded-Proto https
}
file_server

handle {
reverse_proxy http://web:80
header @isStatic {
Access-Control-Allow-Origin "*"
Access-Control-Request-Methods "GET"
Access-Control-Allow-Headers Content-Type
}
}



{$CADDY_HOST_MANAGER_DASHBOARD} {
handle {
try_files {path} /index.html
Expand Down
13 changes: 13 additions & 0 deletions terraform/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Project ID

**live/secrets.auto.tfvars**
```hcl
project_id_map = {
stage = "project-id-not-number"
Expand All @@ -9,10 +10,22 @@ project_id_map = {

## Apply changes

### Stage

```bash
cd live/stage

terragrunt plan

terragrunt apply
```

### Prod

```bash
cd live/prod

terragrunt plan

terragrunt apply
```
19 changes: 19 additions & 0 deletions terraform/live/prod/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions terraform/live/prod/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include "root" {
path = find_in_parent_folders("terragrunt.root.hcl")
}

terraform {
source = "../../resources"
}

inputs = {
}
16 changes: 3 additions & 13 deletions terraform/resources/postgres-backup.tf
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
resource "google_storage_bucket" "db_backup_bucket_name" {
name = "mapswipe-postgres-backups-${var.env_name}"
location = var.gcs_region
# storage_class = "NEARLINE"
name = "mapswipe-postgres-backups-${var.env_name}"
location = var.gcs_region
storage_class = "COLDLINE"

uniform_bucket_level_access = true

lifecycle_rule {
action {
type = "Delete"
}
condition {
age = 7
}
}

}

resource "google_service_account" "db_backup_sa" {
Expand Down