1
This commit is contained in:
@@ -1,71 +0,0 @@
|
||||
|
||||
# resource "nubes_lucee" "app1" {
|
||||
# # Lucee-приложение, зависит от Postgres
|
||||
# resource_name = "lucy_teststand_0"
|
||||
# resource_realm = nubes_postgres.npg.resource_realm
|
||||
# domain = "web-test-stand"
|
||||
|
||||
# git_path = "https://gitea-naeel.giteak8s.services.ngcloud.ru/naeel/testlucee.git"
|
||||
|
||||
# json_env = jsonencode({
|
||||
# # 🔗 Настройки Data Source 'testds' для Lucee (Application.cfc)
|
||||
# testds_class = "org.postgresql.Driver" # 📂 Драйвер БД
|
||||
# testds_bundleName = "org.postgresql.jdbc" # 📦 Имя бандла JDBC
|
||||
# testds_bundleVersion = "42.6.0" # 🔢 Версия драйвера
|
||||
# testds_connectionString = "jdbc:postgresql://${nubes_postgres.npg.state_out_flat["internalConnect.master"]}:5432/${nubes_postgres_database.db2_app.db_name}?sslmode=require" # 🚀 Строка подключения
|
||||
# testds_username = nubes_postgres_user.pg_user.username # 👤 Логин
|
||||
# testds_password = jsondecode(nubes_postgres.npg.vault_secrets["users"])[nubes_postgres_user.pg_user.username]["password"] # 🔑 Пароль
|
||||
# testds_connectionLimit = "5" # 🚦 Лимит соединений
|
||||
# testds_liveTimeout = "15" # ⏳ Таймаут жизни
|
||||
# testds_validate = "false" # ✅ Валидация при запросе
|
||||
# })
|
||||
|
||||
# resource_c_p_u = 300
|
||||
# resource_memory = 512
|
||||
# resource_instances = 1
|
||||
# app_version = "5.4"
|
||||
|
||||
# depends_on = [nubes_postgres.npg]
|
||||
# }
|
||||
|
||||
# resource "nubes_nodejs" "app3" {
|
||||
# # NodeJS демо, работающий с тем же Postgres.
|
||||
# resource_name = "node_01"
|
||||
# resource_realm = nubes_postgres.npg.resource_realm
|
||||
# domain = "node07"
|
||||
# git_path = "https://gitea-naeel.giteak8s.services.ngcloud.ru/naeel/testnode.git"
|
||||
# health_path = "/healthz"
|
||||
# app_version = "23"
|
||||
|
||||
# json_env = jsonencode({
|
||||
# # Переменные подключения к Postgres.
|
||||
# PGHOST = nubes_postgres.npg.state_out_flat["internalConnect.master"]
|
||||
# PGPORT = "5432"
|
||||
# PGUSER = nubes_postgres_user.pg_user.username
|
||||
# PGPASSWORD = jsondecode(nubes_postgres.npg.vault_secrets["users"])[nubes_postgres_user.pg_user.username]["password"]
|
||||
# PGDATABASE = nubes_postgres_database.db2_app.db_name
|
||||
# PGSSLMODE = "require"
|
||||
# DATABASE_URL = format(
|
||||
# "postgresql://%s:%s@%s:5432/%s?sslmode=require",
|
||||
# nubes_postgres_user.pg_user.username,
|
||||
# jsondecode(nubes_postgres.npg.vault_secrets["users"])[nubes_postgres_user.pg_user.username]["password"],
|
||||
# nubes_postgres.npg.state_out_flat["internalConnect.master"],
|
||||
# nubes_postgres_database.db2_app.db_name
|
||||
# )
|
||||
# })
|
||||
|
||||
# resource_c_p_u = 300
|
||||
# resource_memory = 256
|
||||
# resource_instances = 1
|
||||
|
||||
# depends_on = [nubes_postgres.npg]
|
||||
# }
|
||||
|
||||
# output "pg_vault_secrets" {
|
||||
# value = nubes_postgres.npg.vault_secrets
|
||||
# sensitive = true
|
||||
# }
|
||||
|
||||
# terraform output -json pg_vault_secrets
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ NUBES_API_ENDPOINT="https://lk-api-gateway-test.ngcloud.ru/api/v1/svc"
|
||||
TOKEN_FILE="secrets/test.token"
|
||||
|
||||
# Version
|
||||
VERSION="5.1.2"
|
||||
VERSION="5.2.0"
|
||||
|
||||
# Docs generation — ONLY from docs_gen/<stand>/ (never from docs/)
|
||||
DOCS_GEN_DIR="provider/docs_gen/test"
|
||||
|
||||
@@ -133,12 +133,51 @@ func buildManualPage(spec types.ServiceSpec, nav string) string {
|
||||
if man == "" {
|
||||
man = "Manual not available."
|
||||
}
|
||||
b.WriteString("<div class=\"man-content\">\n")
|
||||
b.WriteString(man)
|
||||
b.WriteString("\n</div>\n")
|
||||
b.WriteString("<div class=\"man-content\">\n\n")
|
||||
b.WriteString(htmlToMarkdown(man))
|
||||
b.WriteString("\n\n</div>\n")
|
||||
return b.String()
|
||||
}
|
||||
|
||||
// htmlToMarkdown converts raw HTML to Markdown.
|
||||
func htmlToMarkdown(s string) string {
|
||||
// <br/> or <br> → newline
|
||||
s = regexp.MustCompile(`<br\s*/?>`).ReplaceAllString(s, "\n")
|
||||
// <h1>...</h1> → # ...
|
||||
s = regexp.MustCompile(`<h1>(.*?)</h1>`).ReplaceAllString(s, "# $1")
|
||||
// <h2>...</h2> → ## ...
|
||||
s = regexp.MustCompile(`<h2>(.*?)</h2>`).ReplaceAllString(s, "## $1")
|
||||
// <h3>...</h3> → ### ...
|
||||
s = regexp.MustCompile(`<h3>(.*?)</h3>`).ReplaceAllString(s, "### $1")
|
||||
// <strong> or <b> → **...**
|
||||
s = regexp.MustCompile(`<(?:strong|b)>(.*?)</(?:strong|b)>`).ReplaceAllString(s, "**$1**")
|
||||
// <em> or <i> → *...*
|
||||
s = regexp.MustCompile(`<(?:em|i)>(.*?)</(?:em|i)>`).ReplaceAllString(s, "*$1*")
|
||||
// <code>...</code> → `...`
|
||||
s = regexp.MustCompile(`<code>(.*?)</code>`).ReplaceAllString(s, "`$1`")
|
||||
// <a href="...">...</a> → [...](...)
|
||||
s = regexp.MustCompile(`<a\s+href="(.*?)">(.*?)</a>`).ReplaceAllString(s, "[$2]($1)")
|
||||
// <ul> / </ul> — remove
|
||||
s = regexp.MustCompile(`</?ul>`).ReplaceAllString(s, "")
|
||||
// <li>...</li> → - ...
|
||||
s = regexp.MustCompile(`<li>(.*?)</li>`).ReplaceAllString(s, "- $1")
|
||||
// <ol> / </ol> — remove
|
||||
s = regexp.MustCompile(`</?ol>`).ReplaceAllString(s, "")
|
||||
// <p> / </p> — remove
|
||||
s = regexp.MustCompile(`</?p>`).ReplaceAllString(s, "")
|
||||
// <pre> / </pre> — remove (content stays)
|
||||
s = regexp.MustCompile(`</?pre>`).ReplaceAllString(s, "")
|
||||
// <hr> or <hr/> → ---
|
||||
s = regexp.MustCompile(`<hr\s*/?>`).ReplaceAllString(s, "\n---\n")
|
||||
// Strip remaining HTML tags
|
||||
s = regexp.MustCompile(`<[^>]+>`).ReplaceAllString(s, "")
|
||||
// Decode HTML entities
|
||||
s = html.UnescapeString(s)
|
||||
// Collapse multiple blank lines
|
||||
s = regexp.MustCompile(`\n{3,}`).ReplaceAllString(s, "\n\n")
|
||||
return strings.TrimSpace(s)
|
||||
}
|
||||
|
||||
func buildExamplePage(spec types.ServiceSpec, nav, version string, apiEndpoint string) string {
|
||||
var b strings.Builder
|
||||
b.WriteString(buildHeader(spec, nav))
|
||||
@@ -169,7 +208,7 @@ func exampleBlock(spec types.ServiceSpec, version string, apiEndpoint string) st
|
||||
b.WriteString("terraform {\n")
|
||||
b.WriteString(" required_providers {\n")
|
||||
b.WriteString(" nubes = {\n")
|
||||
b.WriteString(" source = \"terra.k8c.ru/nubes/nubes\"\n")
|
||||
b.WriteString(" source = \"registry.kube5s.ru/nubes-test/nubes\"\n")
|
||||
b.WriteString(fmt.Sprintf(" version = \"%s\"\n", version))
|
||||
b.WriteString(" }\n")
|
||||
b.WriteString(" }\n")
|
||||
@@ -424,7 +463,7 @@ func buildSubresourceExamplePage(spec types.ServiceSpec, srName string, nav stri
|
||||
b.WriteString("terraform {\n")
|
||||
b.WriteString(" required_providers {\n")
|
||||
b.WriteString(" nubes = {\n")
|
||||
b.WriteString(" source = \"terra.k8c.ru/nubes/nubes\"\n")
|
||||
b.WriteString(" source = \"registry.kube5s.ru/nubes-test/nubes\"\n")
|
||||
b.WriteString(fmt.Sprintf(" version = \"%s\"\n", version))
|
||||
b.WriteString(" }\n")
|
||||
b.WriteString(" }\n")
|
||||
|
||||
Reference in New Issue
Block a user