2025-05-05 00:47:36 +02:00
|
|
|
locals {
|
|
|
|
|
data_path = "${var.persistent_folder}/sftpgo"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sftpgo_config = {
|
2025-05-08 22:36:47 +02:00
|
|
|
common = {
|
|
|
|
|
defender = {
|
|
|
|
|
enabled = false
|
2025-05-05 00:47:36 +02:00
|
|
|
}
|
|
|
|
|
},
|
2025-05-08 22:36:47 +02:00
|
|
|
sftpd = {
|
|
|
|
|
bindings = [
|
2025-05-05 00:47:36 +02:00
|
|
|
{
|
2025-05-08 22:36:47 +02:00
|
|
|
port = 0
|
2025-05-05 00:47:36 +02:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
2025-05-08 22:36:47 +02:00
|
|
|
webdavd = {
|
|
|
|
|
bindings = [
|
2025-05-05 00:47:36 +02:00
|
|
|
{
|
2025-05-08 22:36:47 +02:00
|
|
|
port = 8081
|
|
|
|
|
address = "0.0.0.0"
|
|
|
|
|
enable_https = var.tls_enabled
|
|
|
|
|
certificate_file = "/etc/ssl/certs/private/tls.crt"
|
|
|
|
|
certificate_key_file = "/etc/ssl/certs/private/tls.key"
|
2025-05-05 00:47:36 +02:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
2025-05-08 22:36:47 +02:00
|
|
|
data_provider = {
|
|
|
|
|
create_default_admin = true
|
|
|
|
|
backups_path = "/var/lib/sftpgo/backup"
|
2025-05-05 00:47:36 +02:00
|
|
|
},
|
2025-05-08 22:36:47 +02:00
|
|
|
httpd = {
|
|
|
|
|
bindings = [
|
2025-05-05 00:47:36 +02:00
|
|
|
{
|
2025-05-08 22:36:47 +02:00
|
|
|
port = 8080
|
|
|
|
|
address = "0.0.0.0"
|
|
|
|
|
enable_https = var.tls_enabled
|
|
|
|
|
certificate_file = "/etc/ssl/certs/private/tls.crt"
|
|
|
|
|
certificate_key_file = "/etc/ssl/certs/private/tls.key"
|
|
|
|
|
branding = {
|
|
|
|
|
web_client = {
|
|
|
|
|
name = "alexpires.me cloud"
|
|
|
|
|
short_name = "alexpires.me"
|
2025-05-05 00:47:36 +02:00
|
|
|
},
|
2025-05-08 22:36:47 +02:00
|
|
|
web_admin = {
|
|
|
|
|
name = "alexpires.me cloud"
|
|
|
|
|
short_name = "alexpires.me"
|
2025-05-05 00:47:36 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
2025-05-08 22:36:47 +02:00
|
|
|
web_root = "/config/dav",
|
2025-05-05 00:47:36 +02:00
|
|
|
},
|
2025-05-08 22:36:47 +02:00
|
|
|
telemetry = {
|
|
|
|
|
bind_port = 10000
|
|
|
|
|
bind_address = "0.0.0.0"
|
2025-05-05 00:47:36 +02:00
|
|
|
},
|
2025-05-08 22:36:47 +02:00
|
|
|
mfa = {
|
|
|
|
|
totp = [
|
2025-05-05 00:47:36 +02:00
|
|
|
{
|
2025-05-08 22:36:47 +02:00
|
|
|
name = "Default",
|
|
|
|
|
issuer = "alexpires.me"
|
|
|
|
|
algo = "sha1"
|
2025-05-05 00:47:36 +02:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
2025-05-08 22:36:47 +02:00
|
|
|
smtp = {
|
|
|
|
|
host = var.smtp_host,
|
|
|
|
|
port = var.smtp_port,
|
|
|
|
|
from = var.from_email
|
|
|
|
|
encryption = 1,
|
|
|
|
|
domain = "alexpires.me"
|
2025-05-05 00:47:36 +02:00
|
|
|
},
|
2025-05-08 22:36:47 +02:00
|
|
|
plugins = []
|
2025-05-05 00:47:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
config = jsonencode(local.sftpgo_config)
|
|
|
|
|
config_checksum = sha256(local.config)
|
|
|
|
|
|
|
|
|
|
credentials = templatefile("${path.module}/resources/aws.tpl", {
|
|
|
|
|
access_key = var.access_key
|
|
|
|
|
secret_key = var.secret_key
|
|
|
|
|
})
|
|
|
|
|
credentials_checksum = sha256(local.credentials)
|
|
|
|
|
}
|
|
|
|
|
|