35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
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
|
|
};
|
|
|
|
function onRequestStart(targetPage) {
|
|
if (structKeyExists(url, "reload")) applicationStop();
|
|
return true;
|
|
}
|
|
}
|