Files
a13labs.infra/terraform/apps/prod-01/config.tf
T

157 lines
4.0 KiB
Terraform
Raw Normal View History

2024-09-24 15:28:19 +02:00
locals {
# general
# storage
persistent_folder = "/mnt/microk8s_persistent"
database_folder = "/var/lib"
# domains
primary_domain = "alexpires.me"
websites = {
"alexpires.me" = {
domain_name = "alexpires.me"
fqdn = ["blog.alexpires.me", "www.alexpires.me", "alexpires.me"]
tls = true
issuer = "internal-ca"
custom_snippet = file("${path.module}/resources/alexpires.me.conf")
}
}
2024-09-24 15:28:19 +02:00
# gitea
gitea_version = "1.23.7"
gitea_fqdn = "code.${local.primary_domain}"
2024-09-24 15:28:19 +02:00
# sftpgo
sftpgo_version = "2.6.x"
sftpgo_fqdn = "webdav.${local.primary_domain}"
2024-10-03 23:03:41 +02:00
# m3uproxy
m3uproxy_version = "latest"
m3uproxy_fqdn = "tv.${local.primary_domain}"
# geoip
geoip_cron_schedule = "0 0 * * *"
geoip_editions = [
"GeoLite2-Country",
"GeoLite2-City",
"GeoLite2-ASN"
]
2024-09-24 15:28:19 +02:00
rustdesk_fqdn = "rustdesk.${local.primary_domain}"
# trivy
trivy_cronjob_schedule = "0 1 1/15 * *"
2024-09-24 15:28:19 +02:00
# backup
local_backup_retention_days = 2
cloud_backup_retention_days = 3
mail_backup_path = "${local.persistent_folder}/backup.mail"
gitea_backup_path = "${local.persistent_folder}/backup.gitea"
sftpgo_backup_path = "${local.persistent_folder}/backup.sftpgo"
gitea_sql_backup_cron_schedule = "20 2 * * *"
gitea_files_backup_cron_schedule = "30 2 * * *"
sftpgo_files_backup_cron_schedule = "50 2 * * *"
mail_files_backup_cron_schedule = "0 3 * * *"
2024-09-24 15:28:19 +02:00
2025-03-15 23:01:46 +01:00
# email settings
fetch_emails_schedule = "*/2 * * * *"
scaleway_smtp_host = "smtp.tem.scw.cloud"
scaleway_smtp_port = 587
email_accounts = [
{
domain = "alexpires.me"
recipient = "c.alexandre.pires"
receive = {
type = "imap"
server = "mail-pt.securemail.pro"
port = 993
}
send = {
server = "smtp-pt.securemail.pro"
port = 465
}
username = var.alexpires_me_email_username
password = var.alexpires_me_email_password
mailboxes = ["INBOX", "Sent", "Drafts", "Trash", "Spam"]
}
]
#reverse proxy settings
reverse_proxy_wireguard_config = {
private_key = var.wireguard_1_private_key
public_key = var.wireguard_1_public_key
pre_shared_key = var.wireguard_1_pre_shared_key
endpoint = "aristotle.alexpires.me"
endpoint_port = 51820
address = "10.5.5.2/32"
dns = "10.19.4.1"
allowed_ips = [
"10.19.4.106/32",
2025-06-02 01:42:17 +02:00
"10.19.4.136/32",
]
}
reverse_proxy_services = {
"open-webui" = {
http_port = 8080
https_port = 8443
tls = true
fqdn = ["ai.alexpires.me"]
2025-06-05 23:27:50 +02:00
upstream = "https://10.19.4.136"
locations = [
{
path = "/ws/socket.io/"
headers = {
2025-06-05 23:27:50 +02:00
"Host" = "$host"
"X-Forwarded-For" = "$remote_addr"
"Upgrade" = "$http_upgrade"
"Connection" = "upgrade"
}
},
2025-06-05 23:27:50 +02:00
# {
# private = true
# path = "/tools/gitea"
# upstream = "http://10.19.4.136:8000"
# rewrite = "^/tools/gitea/(.*)$ /$1 break"
# },
{
path = "/"
2025-06-05 23:27:50 +02:00
headers = {
"Host" = "$host"
"X-Forwarded-For" = "$remote_addr"
}
},
]
2025-06-02 01:42:17 +02:00
},
}
# VPS configuration
instance_ips = [
"${local.vps_1.ip}/32",
]
vps_1 = {
id = data.terraform_remote_state.contabo.outputs.instances[0].id
name = data.terraform_remote_state.contabo.outputs.instances[0].name
ip = data.terraform_remote_state.contabo.outputs.instances[0].ip_config[0].v4[0].ip
}
2024-09-24 15:28:19 +02:00
}
data "scaleway_account_project" "default" {
project_id = var.scaleway_project_id
organization_id = var.scaleway_organization_id
}
data "terraform_remote_state" "contabo" {
backend = "s3"
config = {
bucket = "a13labs.infra.eu"
key = "contabo.core.infra.tfstate"
region = "eu-west-1"
}
}