Skip to content

Commit

Permalink
Merge pull request #335 from dgrebb/release/2.3.1
Browse files Browse the repository at this point in the history
Release/2.3.1
  • Loading branch information
dgrebb authored Jun 27, 2023
2 parents 3b115cf + 4c47f94 commit bb2bf3e
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .cz.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"commitizen": {
"name": "cz_conventional_commits",
"version": "2.3.0",
"version": "2.3.1",
"tag_format": "$major.$minor.$patch$prerelease",
"version_type": "semver",
"bump_message": "release $current_version \u2192 $new_version"
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file.

## [2.3.1] - 2023-06-27

### 🐛 Bug Fixes

- ***(front)*** Fixes a silly leftover test
- ***(front)*** Adjusts logic for external link detection
- ***(terraform)*** Applies unique names to security and management resources

## [2.3.0] - 2023-06-26

### 💡 Features
Expand Down
2 changes: 1 addition & 1 deletion _tf/modules/containers/containers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ resource "aws_ecs_service" "strapi" {
network_configuration {
subnets = [for subnet in var.subnets : subnet.id]
assign_public_ip = true
security_groups = [var.service_sg.id]
security_groups = [var.db_sg.id]
}

depends_on = [var.strapi_alb_tg]
Expand Down
2 changes: 1 addition & 1 deletion _tf/modules/containers/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ variable "dashed_cmsdomain" {}
variable "strapi_instance_count" {}
variable "subnets" {}
variable "strapi_alb_tg" {}
variable "service_sg" {}
variable "db_sg" {}
variable "force_delete" {}
4 changes: 2 additions & 2 deletions _tf/modules/database/database.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# CMS Database
# ------------------------------------------------------------------------------
resource "aws_db_instance" "this" {
depends_on = [var.service_sg]
depends_on = [var.db_sg]
identifier = var.dashed_cmsdomain
allocated_storage = 5
engine = "postgres"
Expand All @@ -14,7 +14,7 @@ resource "aws_db_instance" "this" {
password = var.db_password
publicly_accessible = var.public_access
storage_encrypted = false
vpc_security_group_ids = ["${var.service_sg.id}"]
vpc_security_group_ids = ["${var.db_sg.id}"]
db_subnet_group_name = var.db_subnet_group.id
skip_final_snapshot = var.skip_final_snapshot
final_snapshot_identifier = var.dashed_cmsdomain
Expand Down
2 changes: 1 addition & 1 deletion _tf/modules/database/inputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variable "dashed_cmsdomain" {}
variable "service_sg" {}
variable "db_sg" {}
variable "db_subnet_group" {}
variable "instance_class" {}
variable "skip_final_snapshot" {}
Expand Down
2 changes: 1 addition & 1 deletion _tf/modules/management/management.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resource "aws_cloudwatch_log_group" "this" {
}

resource "aws_cloudwatch_event_rule" "this" {
name = "container-stopped"
name = "container-stopped_${var.dashed_cmsdomain}"
description = "Notification for containers with exit code of 1 (error)."

event_pattern = <<PATTERN
Expand Down
1 change: 1 addition & 0 deletions _tf/modules/security/inputs.tf
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
variable "dashed_cmsdomain" {}
variable "pub" {}
4 changes: 2 additions & 2 deletions _tf/modules/security/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
output "service_sg" {
value = aws_security_group.svc
output "db_sg" {
value = aws_security_group.db
}
output "lb_sg" {
value = aws_security_group.lb
Expand Down
8 changes: 7 additions & 1 deletion _tf/modules/security/security.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ data "external" "ip" {
program = ["/bin/bash" , "${path.module}/../../_scripts/ip.sh"]
}

resource "aws_security_group" "svc" {
resource "aws_security_group" "db" {
name_prefix = var.dashed_cmsdomain

lifecycle {
create_before_destroy = true
}

ingress {
from_port = 0
to_port = 0
Expand Down
9 changes: 5 additions & 4 deletions _tf/prd/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ module "containers" {
strapi_instance_count = 1
subnets = module.network.subnets
strapi_alb_tg = module.scaling.strapi_alb_tg
service_sg = module.security.service_sg
db_sg = module.security.db_sg
}

module "database" {
source = "../modules/database"
service_sg = module.security.service_sg
db_sg = module.security.db_sg
db_subnet_group = module.network.db_subnet_group
dashed_cmsdomain = var.dashed_cmsdomain
db_password = var.db_password
Expand Down Expand Up @@ -79,8 +79,9 @@ module "scaling" {
}

module "security" {
source = "../modules/security"
pub = false
source = "../modules/security"
dashed_cmsdomain = var.dashed_cmsdomain
pub = false
}

module "state" {
Expand Down
9 changes: 5 additions & 4 deletions _tf/stg/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ module "containers" {
strapi_instance_count = 1
subnets = module.network.subnets
strapi_alb_tg = module.scaling.strapi_alb_tg
service_sg = module.security.service_sg
db_sg = module.security.db_sg
}

module "database" {
source = "../modules/database"
service_sg = module.security.service_sg
db_sg = module.security.db_sg
db_subnet_group = module.network.db_subnet_group
dashed_cmsdomain = local.dashed_cmsdomain
db_password = var.db_password
Expand Down Expand Up @@ -88,8 +88,9 @@ module "scaling" {
}

module "security" {
source = "../modules/security"
pub = true
source = "../modules/security"
dashed_cmsdomain = local.dashed_cmsdomain
pub = false
}

module "state" {
Expand Down
5 changes: 3 additions & 2 deletions front/src/components/markdown/Link.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
export let href = "";
export let text = "";
export let title = undefined;
const internalPattern = /\/|\#|m|t/g;
let external;
onMount(() => {
external = (href.charAt(0) === "/" || "#" || "m" || "t" ? false :
(new URL(href).origin !== location.origin ? true : false));
external = href.charAt(0).match(internalPattern) ? false :
new URL(href).origin !== location.origin ? true : false;
});
</script>

Expand Down

0 comments on commit bb2bf3e

Please sign in to comment.