Add TLS feature with Caddy

This commit is contained in:
2026-10-21 09:13:59 +01:00
parent 1462067e72
commit ed4a6f3ec8
109 changed files with 6374 additions and 156 deletions
+145
View File
@@ -281,6 +281,151 @@ const schema: BUN_SQLITE_DatabaseSchemaType = {
},
],
},
{
tableName: "client_routes",
tableDescription: `TLS routes served to WireGuard clients`,
fields: [
{
fieldName: "user_id",
dataType: "INTEGER",
},
{
fieldName: "host_id",
dataType: "INTEGER",
defaultValue: 0,
},
{
fieldName: "name",
dataType: "TEXT",
},
{
fieldName: "hostname",
dataType: "TEXT",
},
{
fieldName: "path_prefix",
dataType: "TEXT",
defaultValue: "/",
},
{
fieldName: "strip_prefix",
dataType: "INTEGER",
options: [0, 1],
defaultValue: 0,
},
{
fieldName: "upstream_url",
dataType: "TEXT",
},
{
fieldName: "upstream_tls_verify",
dataType: "INTEGER",
options: [0, 1],
defaultValue: 1,
},
{
fieldName: "enabled",
dataType: "INTEGER",
options: [0, 1],
defaultValue: 1,
},
{
fieldName: "notes",
dataType: "TEXT",
},
{
fieldName: "acme_email",
dataType: "TEXT",
},
{
fieldName: "acme_dns_provider",
dataType: "TEXT",
},
{
fieldName: "acme_staging",
dataType: "INTEGER",
options: [0, 1],
defaultValue: 0,
},
{
fieldName: "acme_credentials",
dataType: "TEXT",
},
],
uniqueConstraints: [
{
constraintName: "Unique path per route hostname",
alias: "unique_path_per_route_hostname",
constraintTableFields: [
{ value: "hostname" },
{ value: "path_prefix" },
],
},
],
},
{
tableName: "tls_certificates",
tableDescription: `TLS certificates served by the Caddy ingress`,
fields: [
{
fieldName: "user_id",
dataType: "INTEGER",
},
{
fieldName: "hostname",
dataType: "TEXT",
unique: true,
},
{
fieldName: "provider",
dataType: "TEXT",
defaultValue: "letsencrypt",
},
{
fieldName: "challenge",
dataType: "TEXT",
defaultValue: "dns-01",
},
{
fieldName: "dns_provider",
dataType: "TEXT",
},
{
fieldName: "cert_path",
dataType: "TEXT",
},
{
fieldName: "key_path",
dataType: "TEXT",
},
{
fieldName: "expires_at",
dataType: "INTEGER",
},
{
fieldName: "status",
dataType: "TEXT",
options: [
"missing",
"issuing",
"active",
"error",
"expiring",
],
defaultValue: "missing",
},
{
fieldName: "last_error",
dataType: "TEXT",
},
{
fieldName: "auto_renew",
dataType: "INTEGER",
options: [0, 1],
defaultValue: 1,
},
],
},
{
tableName: "variables",
fields: [