From 6738b6c0a293e3645f0d3f6fed17b5364196a6e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Thu, 18 Jun 2026 13:58:13 +0400 Subject: [PATCH] =?UTF-8?q?Application.cfc:=20=D0=B2=D1=81=D1=91=20=D1=85?= =?UTF-8?q?=D0=B0=D1=80=D0=B4=D0=BA=D0=BE=D0=B4,=20=D1=82=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=BA=D0=BE=20DB=5FUSER/DB=5FPASS=20=D0=B8=D0=B7=20env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application.cfc | 179 ++++++++---------------------------------------- 1 file changed, 30 insertions(+), 149 deletions(-) diff --git a/Application.cfc b/Application.cfc index 39549ca..caa4626 100644 --- a/Application.cfc +++ b/Application.cfc @@ -1,153 +1,34 @@ - - +component { + this.name = "contractor"; + this.applicationTimeout = createTimeSpan(0, 0, 3, 0); + this.sessionmanagement = true; + this.datasource = "baza"; + this.restEnabled = true; + this.restSettings = {skipCFCWithError: true}; - - - - - - - - - - - - - - - - - + // defaults + var dbHost = "postgresqlk8s-master.418f9960-2eb7-4429-b2ec-ac64319d7268.svc.cluster.local"; + var dbPort = "5432"; + var dbName = "baza"; - - - - + // из env или дефолт + var sys = createObject("java", "java.lang.System"); + var user = sys.getenv("DB_USER"); + if (isNull(user) || !len(user)) user = "super"; + var pass = sys.getenv("DB_PASS"); + if (isNull(pass) || !len(pass)) pass = "hoHdkA23yxlD9oMUlZ1bIbNyc6DE2mNJmyHMNkEpVD1F4suQs7O2lyN4t0qITyzt"; + this.datasources["baza"] = { + class: "org.postgresql.Driver", + bundleName: "org.postgresql.jdbc", + bundleVersion: "42.6.0", + connectionString: "jdbc:postgresql://#dbHost#:#dbPort#/#dbName#", + username: user, + password: pass + }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - ), - DE( "https://" ), - DE( "http://" ) - ) & - cgi.http_host & - reReplace( - getDirectoryFromPath( arguments.template ), "([^\\/]+[\\/]){#local.requestDepth#}$", - "", - "one" - ) - ) /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + function onRequestStart(targetPage) { + if (structKeyExists(url, "reload")) applicationStop(); + return true; + } +}