From a8b07bb36dde3b7de9e6f078a8619261f8166c04 Mon Sep 17 00:00:00 2001 From: Luigi Oliveira Date: Tue, 29 Oct 2024 02:29:48 -0300 Subject: [PATCH] decided to delete postiz 4ever --- terraform/modules/postiz/conf/postiz.hcl | 77 ------------------------ terraform/modules/postiz/job.tf | 25 -------- terraform/modules/postiz/providers..tf | 22 ------- terraform/modules/postiz/variables.tf | 34 ----------- 4 files changed, 158 deletions(-) delete mode 100644 terraform/modules/postiz/conf/postiz.hcl delete mode 100644 terraform/modules/postiz/job.tf delete mode 100644 terraform/modules/postiz/providers..tf delete mode 100644 terraform/modules/postiz/variables.tf diff --git a/terraform/modules/postiz/conf/postiz.hcl b/terraform/modules/postiz/conf/postiz.hcl deleted file mode 100644 index b9d7857..0000000 --- a/terraform/modules/postiz/conf/postiz.hcl +++ /dev/null @@ -1,77 +0,0 @@ -job "postizz" { - datacenters = ["dc"] - type = "service" - - group "postizz" { - count = 1 - - update { - healthy_deadline = "15m" - progress_deadline = "20m" - } - - - network { - port "postizz" { - static = 5000 - to = 5000 - } - } - - restart { - attempts = 2 - interval = "5m" - delay = "30s" - mode = "delay" - } - - task "postizz" { - driver = "docker" - - config { - image = "ghcr.io/gitroomhq/postiz-app:amd64-1729871118" - ports = ["postizz"] - volumes = [ - "${NOMAD_ALLOC_DIR}/postiz-config:/config/", - "${NOMAD_ALLOC_DIR}/postiz-uploads:/uploads/" - ] - } - - resources { - memory_max = 3024 - } - - env { - MAIN_URL = "https://${URL}" - FRONTEND_URL = "https://${URL}" - NEXT_PUBLIC_BACKEND_URL = "https://${URL}/api" - JWT_SECRET = "${JWT_SECRET}" - DATABASE_URL = "postgresql://${POSTGREE_USER}:${POSTGREE_PASSWORD}@${POSTGREE_ENDPOINT}:5432/${POSTGREE_DATABASE}" - REDIS_URL = "redis://${REDIS_ENPOINT}" - BACKEND_INTERNAL_URL = "http://localhost:3000" - IS_GENERAL = "true" - STORAGE_PROVIDER = "local" - UPLOAD_DIRECTORY = "/uploads" - NEXT_PUBLIC_UPLOAD_DIRECTORY = "/uploads" - } - service { - name = "postizz" - port = "postizz" - provider = "nomad" - - check { - name = "postiz-check" - type = "tcp" - port = "postizz" - interval = "10s" - timeout = "3s" - } - } - - logs { - max_files = 5 - max_file_size = 15 - } - } - } -} \ No newline at end of file diff --git a/terraform/modules/postiz/job.tf b/terraform/modules/postiz/job.tf deleted file mode 100644 index 0589199..0000000 --- a/terraform/modules/postiz/job.tf +++ /dev/null @@ -1,25 +0,0 @@ -resource "postgresql_database" "postiz_database" { - name = var.postgree_database - owner = var.postgree_user - lc_collate = "C" - connection_limit = -1 - allow_connections = true - alter_object_ownership = true -} - -resource "nomad_job" "app" { - jobspec = templatefile("${path.module}/conf/postiz.hcl", { - NOMAD_ALLOC_DIR = "/alloc" - URL = var.url - POSTGREE_ENDPOINT = var.postgree_endpoint - POSTGREE_USER = var.postgree_user - POSTGREE_PASSWORD = var.postgree_password - POSTGREE_DATABASE = var.postgree_database - REDIS_ENPOINT = var.redis_endpoint - JWT_SECRET = var.jwt_secret - - depends_on = postgresql_database.postiz_database - }) -} - - diff --git a/terraform/modules/postiz/providers..tf b/terraform/modules/postiz/providers..tf deleted file mode 100644 index eac63ea..0000000 --- a/terraform/modules/postiz/providers..tf +++ /dev/null @@ -1,22 +0,0 @@ -terraform { - required_providers { - nomad = { - source = "hashicorp/nomad" - version = "2.0.0-rc.1" - } - postgresql = { - source = "cyrilgdn/postgresql" - version = "1.24.0" - } - } - required_version = ">= 0.14" -} - -provider "postgresql" { - host = var.postgree_endpoint - port = 5432 - username = var.postgree_user - password = var.postgree_password - sslmode = "disable" - connect_timeout = 15 -} \ No newline at end of file diff --git a/terraform/modules/postiz/variables.tf b/terraform/modules/postiz/variables.tf deleted file mode 100644 index 4876972..0000000 --- a/terraform/modules/postiz/variables.tf +++ /dev/null @@ -1,34 +0,0 @@ -variable "url" { - type = string - description = "Caddy url for potiz" -} - -variable "postgree_endpoint" { - type = string - description = "Postgree host for potiz" -} - -variable "postgree_user" { - type = string - description = "Postgree username for potiz" -} - -variable "postgree_password" { - type = string - description = "Postgree password for potiz" -} - -variable "postgree_database" { - type = string - description = "Postgree database for potiz" -} - -variable "redis_endpoint" { - type = string - description = "Redis host for potiz" -} - -variable "jwt_secret" { - type = string - description = "JWT token for potiz" -} \ No newline at end of file