-
Notifications
You must be signed in to change notification settings - Fork 0
/
iris.script
executable file
·119 lines (107 loc) · 6.52 KB
/
iris.script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
set r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c")
zpm "install webterminal"
zpm "install objectscript-json-trace-viewer"
zpm "install swagger-ui"
zpm "install iris-apipub"
zpm "install classexplorer"
zpm "install openapi-client-gen"
write "INSTALLING IRISAPP"
do $SYSTEM.OBJ.Load("/home/irisowner/dev/App.Installer.cls", "ck")
set sc = ##class(App.Installer).setup()
if 'sc {
set ^["USER"]TRACE($zdt($now(),3,,6),"IRISAPP App.Installer")=$lb($system.Status.GetErrorCodes(sc),$system.Status.GetErrorText(sc))
} else {
set ^["USER"]TRACE($zdt($now(),3,,6),"IRISAPP App.Installer")="successful"
}
zn "%SYS"
do ##class(Security.Users).UnExpireUserPasswords("*")
set tRes = ##class(%SQL.Statement).%ExecDirect(,"update security.events set enabled=1")
if tRes.%SQLCODE=0 {
set ^["USER"]TRACE($zdt($now(),3,,6),"%SYS Security.Events")=tRes.%ROWCOUNT_" successfully enabled"
} else {
set ^["USER"]TRACE($zdt($now(),3,,6),"%SYS Security.Events")=tRes.%Message_" SQLCODE:"_tRes.%SQLCODE
}
set username="interop"
set roles="%EnsRole_Developer,%DB_IRISAPP-CODE,%DB_IRISAPP-DATA"
set password="SYS"
set sc = ##class(Security.Users).Create(username,roles,password,,"IRISAPP",,"",0,1,,,,,,1,1)
if 'sc {
set ^["USER"]TRACE($zdt($now(),3,,6),"%SYS Create User "_username)=$lb($system.Status.GetErrorCodes(sc),$system.Status.GetErrorText(sc))
} else {
set ^["USER"]TRACE($zdt($now(),3,,6),"%SYS Create User "_username)="successful"
}
#; set ^%SYS("sql","ODBCCONNECTION","DATA") = 1
#; set ^%SYS("sql","ODBCCONNECTION","DATA",1) = $lb("","","mysql","formation","XKVFJaLViXIivSMPXT5kxEXtRKAfc1tGqSZOPNH3Hfw=",0,1,"jdbc:mysql://host.docker.internal:3306/formation","com.mysql.cj.jdbc.Driver","/jdbc/mysql-connector-java-8.0.26.jar","",0,"",0,0,1,0,0,0,"",0,0,"")
#; set ^%SYS("sql","ODBCCONNECTION","INDEX","NameIndex"," MYSQL",1) = ""
set ^SYS("Security","SSLConfigsD","API") = $lb("","","","","ALL:!aNULL:!eNULL:!EXP:!SSLv2","",1,"API","","",2,"",0,9,0,"","",32,16,"TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256",0,"","","",0,2,0,1)
set ^%SYS("sql","ODBCCONNECTION","DATA")=5
set ^%SYS("sql","ODBCCONNECTION","DATA",1)=$lb("","","mysql","formation","XKVFJaLViXIivSMPXT5kxEXtRKAfc1tGqSZOPNH3Hfw=",0,1,"jdbc:mysql://host.docker.internal:3306/formation","com.mysql.cj.jdbc.Driver","/jdbc/mysql-connector-java-8.0.26.jar","",0,"",0,0,1,0,0,0,"",0,0,"")
set ^%SYS("sql","ODBCCONNECTION","DATA",2)=$lb("","","oracle","oracle","bKsQDMYXiMVqAY4YJL5h7Q==",0,1,"jdbc:oracle:thin:@host.docker.internal:1521:orcl","oracle.jdbc.driver.OracleDriver","/jdbc/ojdbc11.jar","",0,"",0,0,1,0,0,0,"",0,0,"")
set ^%SYS("sql","ODBCCONNECTION","DATA",3)=$lb("","","postgres","postgres","6f8eAI5TOg0c3NkS9xnNDA==",0,1,"jdbc:postgresql://postgres:5432/postgres","org.postgresql.Driver","/jdbc/postgresql-42.6.0.jar","",0,"",0,0,1,0,0,0,"",0,0,"")
set ^%SYS("sql","ODBCCONNECTION","DATA",4)=$lb("","","iris","_system","HnBuSSuEERERntcVPGsUMQ==",0,1,"jdbc:IRIS://127.0.0.1:1972/IRISAPP","com.intersystems.jdbc.IRISDriver","/jdbc/intersystems-jdbc-3.3.1.jar","",0,"",0,0,1,0,0,0,"",0,0,"")
set ^%SYS("sql","ODBCCONNECTION","DATA",5)=$lb("","","mssql","sa","sfwsrQYWfOEjZXXC5CIsEPSk695//kJ58ulzTRakyqE=",0,1,"jdbc:sqlserver://mssql:1433;databaseName=master;encrypt=false","com.microsoft.sqlserver.jdbc.SQLServerDriver","/jdbc/mssql-jdbc-11.2.1.jre8.jar","",0,"",0,0,1,0,0,0,"",0,0,"")
set ^%SYS("sql","ODBCCONNECTION","INDEX","NameIndex"," MYSQL",1)=""
set ^%SYS("sql","ODBCCONNECTION","INDEX","NameIndex"," ORACLE",2)=""
set ^%SYS("sql","ODBCCONNECTION","INDEX","NameIndex"," POSTGRES",3)=""
set ^%SYS("sql","ODBCCONNECTION","INDEX","NameIndex"," IRIS",4)=""
set ^%SYS("sql","ODBCCONNECTION","INDEX","NameIndex"," MSSQL",5)=""
set webName = "/common"
write "Create web application ...",webName
set webProperties("DispatchClass") = "common.REST"
set webProperties("NameSpace") = "IRISAPP"
set webProperties("Enabled") = 1
set webProperties("AutheEnabled") = 96
set webProperties("MatchRoles")=":%All"
set sc = ##class(Security.Applications).Create(webName, .webProperties)
if 'sc {
set ^["USER"]TRACE($zdt($now(),3,,6),"Web App "_webName)=$lb($system.Status.GetErrorCodes(sc),$system.Status.GetErrorText(sc))
} else {
set ^["USER"]TRACE($zdt($now(),3,,6),"Web App "_webName)="successful"
}
set webName = "/formation/crud"
write "Create web application ...",webName
set webProperties("DispatchClass") = "REST.crud"
set webProperties("NameSpace") = "IRISAPP"
set webProperties("Enabled") = 1
set webProperties("AutheEnabled") = 96
set webProperties("MatchRoles")=":%All"
set sc = ##class(Security.Applications).Create(webName, .webProperties)
if 'sc {
set ^["USER"]TRACE($zdt($now(),3,,6),"Web App "_webName)=$lb($system.Status.GetErrorCodes(sc),$system.Status.GetErrorText(sc))
} else {
set ^["USER"]TRACE($zdt($now(),3,,6),"Web App "_webName)="successful"
}
set webName = "/admin"
write "Create web application ...",webName
set webProperties("DispatchClass") = "admin.REST"
set webProperties("NameSpace") = "IRISAPP"
set webProperties("Enabled") = 1
set webProperties("AutheEnabled") = 96
set webProperties("MatchRoles")=":%All"
set sc = ##class(Security.Applications).Create(webName, .webProperties)
if 'sc {
set ^["USER"]TRACE($zdt($now(),3,,6),"Web App "_webName)=$lb($system.Status.GetErrorCodes(sc),$system.Status.GetErrorText(sc))
} else {
set ^["USER"]TRACE($zdt($now(),3,,6),"Web App "_webName)="successful"
}
set prop("AutheEnabled")=32
set prop("DeepSeeEnabled")=1
set app="/csp/irisapp"
set sc = ##class(Security.Applications).Modify(app,.prop)
if 'sc {
set ^["USER"]TRACE($zdt($now(),3,,6),"IRISAPP "_app)=$lb($system.Status.GetErrorCodes(sc),$system.Status.GetErrorText(sc))
} else {
set ^["USER"]TRACE($zdt($now(),3,,6),"IRISAPP "_app)="successful"
}
zn "IRISAPP"
do $system.OBJ.Load("/home/irisowner/dev/src/inc/common.inc")
do $system.OBJ.Load("/home/irisowner/dev/src/inc/FCE.inc")
do $System.OBJ.LoadDir("/home/irisowner/dev/src","ck",,1)
write ##class(Ens.Config.Credentials).SetCredential("ftp","app","youneverknow",1)
write ##class(Ens.Config.Credentials).SetCredential("PostgreSQL","postgres","postgres",1)
set ^Ens.Config.DefaultSettingsD("formation.prod.personne","to personne SQL","*","DSN") = $lb("mysql","",0)
zpm "install alwo-enshelper"
zpm "install dataset-countries"
zpm "install analyzethis"
zpm "install csvgen-ui"
halt