Fiddlin' still doesn't work.

This commit is contained in:
Greyscale 2025-03-03 19:52:50 +01:00
parent 0456a9dd2d
commit 8764e63ab8
2 changed files with 48 additions and 31 deletions
products/seafile

View file

@ -5,9 +5,13 @@ variable "enable" {
} }
variable "seafile_version" { variable "seafile_version" {
type = string type = string
default = "11.0.13" default = "12.0-latest"
description = "The version of the docker image to use for the Seafile service." description = "The version of the docker image to use for the Seafile service."
} }
variable "domain" {
type = string
description = "The domain to use for the traefik configuration."
}
# Pass-thru variables # Pass-thru variables
variable "stack_name" { variable "stack_name" {
type = string type = string
@ -33,7 +37,9 @@ variable "ports" {
protocol = optional(string, "tcp") protocol = optional(string, "tcp")
publish_mode = optional(string, "ingress") publish_mode = optional(string, "ingress")
})) }))
default = [] default = [
{ container = 80 },
]
description = "A map of port mappings to expose on the host. The key is the host port, and the value is the container port." description = "A map of port mappings to expose on the host. The key is the host port, and the value is the container port."
} }
variable "mysql_ports" { variable "mysql_ports" {
@ -43,7 +49,9 @@ variable "mysql_ports" {
protocol = optional(string, "tcp") protocol = optional(string, "tcp")
publish_mode = optional(string, "ingress") publish_mode = optional(string, "ingress")
})) }))
default = [] default = [
{ container = 3306 },
]
description = "A map of port mappings to expose on the host. The key is the host port, and the value is the container port." description = "A map of port mappings to expose on the host. The key is the host port, and the value is the container port."
} }
variable "mounts" { variable "mounts" {

View file

@ -1,19 +1,37 @@
variable "domain" { variable "admin_email" {
type = string
description = "The email address of the admin user."
}
variable "admin_password" {
default = null
description = "Optional password for the admin user. If not provided, a random password will be generated."
}
resource "random_password" "admin_password" {
count = var.admin_password == null ? 1 : 0
length = 32
special = false
}
locals {
admin_password = var.admin_password != null ? var.admin_password : random_password.admin_password[0].result
}
variable "protocol" {
default = "https"
description = "http or https"
type = string type = string
description = "The domain to use for the traefik configuration."
} }
module "seafile" { module "seafile" {
depends_on = [module.memcached, module.mysql, module.network] depends_on = [module.memcached, module.mysql, module.network]
source = "../../docker/service" source = "../../docker/service"
enable = var.enable enable = var.enable
stack_name = var.stack_name stack_name = var.stack_name
image = "h44z/seafile-ce:${var.seafile_version}" image = "seafileltd/seafile-mc:${var.seafile_version}"
placement_constraints = var.placement_constraints placement_constraints = var.placement_constraints
service_name = var.service_name service_name = var.service_name
networks = concat([module.network.network], var.networks, ) networks = concat([module.network.network], var.networks, )
ports = var.ports
mounts = { mounts = {
"${var.data_persist_path}/seafile" = "/seafile" "${var.data_persist_path}/data" = "/seafile"
"${var.data_persist_path}/logs" = "/opt/seafile/logs" "${var.data_persist_path}/logs" = "/opt/seafile/logs"
} }
labels = { labels = {
"traefik.enable" = "true" "traefik.enable" = "true"
@ -59,31 +77,22 @@ module "seafile" {
# You can either specify a root password (MYSQL_ROOT_PASSWORD), or use your exsting database tables. # You can either specify a root password (MYSQL_ROOT_PASSWORD), or use your exsting database tables.
# Also specifying MYSQL_USER_HOST only makes sense if MYSQL_ROOT_PASSWORD is given, otherwise no new MySQL user will be created. # Also specifying MYSQL_USER_HOST only makes sense if MYSQL_ROOT_PASSWORD is given, otherwise no new MySQL user will be created.
# To use an external database, simply remove the MySQL service from the docker-compose.yml. # To use an external database, simply remove the MySQL service from the docker-compose.yml.
MYSQL_SERVER = module.mysql.service_name DB_HOST = module.mysql.service_name
MYSQL_USER = module.mysql.username DB_PORT = 3306
MYSQL_USER_PASSWORD = module.mysql.password DB_USER = module.mysql.username
MYSQL_PORT = 3306 DB_PASSWORD = module.mysql.password
DB_ROOT_PASSWORD = module.mysql.root_password
INIT_SEAFILE_ADMIN_EMAIL = var.admin_email
INIT_SEAFILE_ADMIN_PASSWORD = local.admin_password
# General Seafile Settings # General Seafile Settings
SEAFILE_VERSION = var.seafile_version SEAFILE_SERVER_HOSTNAME = var.domain
SEAFILE_NAME = "Seafile" SEAFILE_SERVER_PROTOCOL = var.protocol
SEAFILE_ADDRESS = var.domain SEAFILE_LOG_TO_STDOUT = true
SEAFILE_ADMIN = "admin@${var.domain}" ENABLE_SEADOC = false
SEAFILE_ADMIN_PW = "changeme" SEADOC_SERVER_URL = "${var.protocol}://${var.domain}/seadoc"
JWT_PRIVATE_KEY = "Supers3cr3t" // @todo generate a key instead
# OnlyOffice Settings
ONLYOFFICE_JWT_SECRET = "Supers3cr3t" // @todo generate a key instead
# Optional Seafile Settings
LDAP_IGNORE_CERT_CHECK = true
# Traefik (Reverse Proxy) Settings
DOMAINNAME = var.domain
# All other settings can be edited in the conf dir (/seafile/conf) once the container started up!
# runmode, default = run
#MODE=maintenance
} }
converge_enable = false // @todo: Fix healthcheck and change this. converge_enable = false // @todo: Fix healthcheck and change this.
} }