mirror of
https://github.com/luigieai/homelab.git
synced 2025-07-22 11:26:36 -03:00
added postiz but I'm not using it anymore, not useful to me
This commit is contained in:
parent
b54cee5849
commit
b98b18e0f1
7 changed files with 176 additions and 3 deletions
|
@ -56,8 +56,8 @@ keycloak.lab.marioverde.com.br {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dockge.lab.marioverde.com.br {
|
postiz.lab.marioverde.com.br {
|
||||||
reverse_proxy 192.168.15.46:5001
|
reverse_proxy * "${endpoint}:5000"
|
||||||
tls {
|
tls {
|
||||||
dns cloudflare "${cloudflare_api_token}"
|
dns cloudflare "${cloudflare_api_token}"
|
||||||
}
|
}
|
||||||
|
|
77
terraform/modules/postiz/conf/postiz.hcl
Normal file
77
terraform/modules/postiz/conf/postiz.hcl
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
25
terraform/modules/postiz/job.tf
Normal file
25
terraform/modules/postiz/job.tf
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
22
terraform/modules/postiz/providers..tf
Normal file
22
terraform/modules/postiz/providers..tf
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
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
|
||||||
|
}
|
34
terraform/modules/postiz/variables.tf
Normal file
34
terraform/modules/postiz/variables.tf
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
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"
|
||||||
|
}
|
|
@ -47,3 +47,18 @@ variable "twitch_password" {
|
||||||
type = string
|
type = string
|
||||||
description = "Twitch password"
|
description = "Twitch password"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "postiz_database" {
|
||||||
|
type = string
|
||||||
|
description = "postiz database name"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "postiz_url" {
|
||||||
|
type = string
|
||||||
|
description = "postiz url on caddy"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "postiz_jwt" {
|
||||||
|
type = string
|
||||||
|
description = "postiz jwt token"
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue