feat(kosync): add Terraform module for KOReader sync server

This commit is contained in:
Thomas Rijpstra 2026-07-23 15:48:44 +02:00
parent 0a4620a7a5
commit 0592b6ad03
Signed by: thomas
SSH Key Fingerprint: SHA256:NoPljIC4A210B8B3jJovKUIFRtnYxYA4ej6sgkR/yWA
1 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,61 @@
variable "wait_on" {
type = any
description = "Resources to wait on"
default = true
}
variable "server_ip" {
type = string
}
variable "ssh_private_key_path" {
type = string
}
variable "server_domain" {
type = string
}
module "kosync" {
source = "../quadlet-app"
wait_on = var.wait_on
server_ip = var.server_ip
ssh_private_key_path = var.ssh_private_key_path
app_name = "kosync"
image = "docker.io/koreader/kosync:latest"
ports = ["17200:17200"]
volumes = [
"/opt/storage/data/kosync/logs/app:/app/koreader-sync-server/logs:Z",
"/opt/storage/data/kosync/logs/redis:/var/log/redis:Z",
"/opt/storage/data/kosync/data/redis:/var/lib/redis:Z",
]
environment = {
ENABLE_USER_REGISTRATION = "true"
GIN_ENV = "production"
}
# Healthcheck over plain HTTP (port 17200) since HAProxy handles TLS
healthcmd = "curl -sf -H \"Accept: application/vnd.koreader.v1+json\" http://127.0.0.1:17200/healthcheck | grep -q '\"state\":\"OK\"'"
haproxy_services = [
{
name = "kosync"
domain = "kosync.${var.server_domain}"
port = "17200"
host = "127.0.0.1"
tls = false
},
]
}
output "app_urls" {
value = module.kosync.app_urls
}
output "installed" {
value = true
depends_on = [module.kosync.installed]
}