From 445370f25cf6285ab16c151e51fec68b3f8a2a08 Mon Sep 17 00:00:00 2001 From: HanZiyao Date: Thu, 6 Mar 2025 20:40:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=B5=81=E7=A8=8B=E4=B8=AD=E6=89=80=E6=9C=89?= =?UTF-8?q?=E9=98=BB=E5=A1=9E=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/service/Auth.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/service/Auth.kt b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/service/Auth.kt index 1b5685c..6e73863 100644 --- a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/service/Auth.kt +++ b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/service/Auth.kt @@ -136,7 +136,7 @@ class AuthService(val call: ApplicationCall) : IService { private suspend fun afterLogin(token: String, user: User): LoginUserResponse { if (user.paasToken.isBlank()) { - call.project.createUser(user.id) +// call.project.createUser(user.id) } // insert token in redis (just for compatibility with older platforms) @@ -291,7 +291,7 @@ class AuthService(val call: ApplicationCall) : IService { user.acceptTime = System.currentTimeMillis().toString() user.flushChanges() - call.project.createUser(user) +// call.project.createUser(user) return afterLogin(generateRSAToken(user.id), user) } From 800fa7ac38f721c2962fa2f9745face568538f4a Mon Sep 17 00:00:00 2001 From: HanZiyao Date: Thu, 12 Jun 2025 12:46:47 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E8=99=9A=E6=8B=9F=E6=9C=BA=E7=9B=B8=E5=85=B3=E5=AE=88=E6=8A=A4?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/cn/edu/buaa/scs/kube/VirtualMachineClient.kt | 4 ++-- .../src/main/kotlin/cn/edu/buaa/scs/vm/VMRoutine.kt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/kube/VirtualMachineClient.kt b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/kube/VirtualMachineClient.kt index 9ecdd5c..277ea07 100644 --- a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/kube/VirtualMachineClient.kt +++ b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/kube/VirtualMachineClient.kt @@ -14,6 +14,6 @@ val vmKubeClient by lazy { fun registerVirtualMachineOperator() { val operator = Operator(kubeClient) - operator.register(VirtualMachineReconciler(kubeClient)) - operator.start() +// operator.register(VirtualMachineReconciler(kubeClient)) +// operator.start() } diff --git a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/VMRoutine.kt b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/VMRoutine.kt index 3202ad8..fee09bf 100644 --- a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/VMRoutine.kt +++ b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/VMRoutine.kt @@ -126,10 +126,10 @@ object VMRoutine : Routine { } override val routineList: List = listOf( - updateVmCrd, - updateVMsToDatabase, - createVm, - deleteVm, +// updateVmCrd, +// updateVMsToDatabase, +// createVm, +// deleteVm, // add more routines if needed ) } From 7a752706c2bbcfbf30c0346a1f85e009e3d55130 Mon Sep 17 00:00:00 2001 From: HanZiyao Date: Sun, 22 Jun 2025 10:52:51 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E8=99=9A=E6=8B=9F?= =?UTF-8?q?=E6=9C=BA=E5=AE=88=E6=8A=A4=E7=BA=BF=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/cn/edu/buaa/scs/kube/VirtualMachineClient.kt | 4 ++-- .../src/main/kotlin/cn/edu/buaa/scs/vm/VMRoutine.kt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/kube/VirtualMachineClient.kt b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/kube/VirtualMachineClient.kt index 277ea07..9ecdd5c 100644 --- a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/kube/VirtualMachineClient.kt +++ b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/kube/VirtualMachineClient.kt @@ -14,6 +14,6 @@ val vmKubeClient by lazy { fun registerVirtualMachineOperator() { val operator = Operator(kubeClient) -// operator.register(VirtualMachineReconciler(kubeClient)) -// operator.start() + operator.register(VirtualMachineReconciler(kubeClient)) + operator.start() } diff --git a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/VMRoutine.kt b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/VMRoutine.kt index fee09bf..3202ad8 100644 --- a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/VMRoutine.kt +++ b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/VMRoutine.kt @@ -126,10 +126,10 @@ object VMRoutine : Routine { } override val routineList: List = listOf( -// updateVmCrd, -// updateVMsToDatabase, -// createVm, -// deleteVm, + updateVmCrd, + updateVMsToDatabase, + createVm, + deleteVm, // add more routines if needed ) } From 6d782825f5c02e3c1c28b41f42f151617bf66f10 Mon Sep 17 00:00:00 2001 From: HanZiyao Date: Sun, 22 Jun 2025 14:33:58 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=BF=BD=E7=95=A5vcenter=E7=9A=84=E8=AF=81?= =?UTF-8?q?=E4=B9=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cloudapi-common/build.gradle.kts | 11 +++++++++++ cloudapi-model/build.gradle.kts | 11 +++++++++++ cloudapi-web/build.gradle.kts | 11 +++++++++++ .../cn/edu/buaa/scs/vm/vcenter/VCenterClient.kt | 11 +++++++++++ vcenter/build.gradle.kts | 11 +++++++++++ 5 files changed, 55 insertions(+) diff --git a/cloudapi-common/build.gradle.kts b/cloudapi-common/build.gradle.kts index 40be325..cc0e175 100644 --- a/cloudapi-common/build.gradle.kts +++ b/cloudapi-common/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + plugins { id("java") @@ -63,8 +65,17 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter:5.8.1") testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1") + implementation(kotlin("stdlib-jdk8")) } tasks.getByName("test") { useJUnitPlatform() } +val compileKotlin: KotlinCompile by tasks +compileKotlin.kotlinOptions { + jvmTarget = "1.8" +} +val compileTestKotlin: KotlinCompile by tasks +compileTestKotlin.kotlinOptions { + jvmTarget = "1.8" +} \ No newline at end of file diff --git a/cloudapi-model/build.gradle.kts b/cloudapi-model/build.gradle.kts index 98e7420..2b70739 100644 --- a/cloudapi-model/build.gradle.kts +++ b/cloudapi-model/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + plugins { id("java") kotlin("jvm") @@ -20,8 +22,17 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1") + implementation(kotlin("stdlib-jdk8")) } tasks.getByName("test") { useJUnitPlatform() } +val compileKotlin: KotlinCompile by tasks +compileKotlin.kotlinOptions { + jvmTarget = "1.8" +} +val compileTestKotlin: KotlinCompile by tasks +compileTestKotlin.kotlinOptions { + jvmTarget = "1.8" +} \ No newline at end of file diff --git a/cloudapi-web/build.gradle.kts b/cloudapi-web/build.gradle.kts index cbf338b..65368bb 100644 --- a/cloudapi-web/build.gradle.kts +++ b/cloudapi-web/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + val kotlin_version: String by project plugins { @@ -81,6 +83,7 @@ dependencies { // test testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlin_version") + implementation(kotlin("stdlib-jdk8")) } tasks { @@ -99,3 +102,11 @@ tasks { useJUnitPlatform() } } +val compileKotlin: KotlinCompile by tasks +compileKotlin.kotlinOptions { + jvmTarget = "1.8" +} +val compileTestKotlin: KotlinCompile by tasks +compileTestKotlin.kotlinOptions { + jvmTarget = "1.8" +} \ No newline at end of file diff --git a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/vcenter/VCenterClient.kt b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/vcenter/VCenterClient.kt index dc2bffe..b1cff89 100644 --- a/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/vcenter/VCenterClient.kt +++ b/cloudapi-web/src/main/kotlin/cn/edu/buaa/scs/vm/vcenter/VCenterClient.kt @@ -21,6 +21,8 @@ import org.ktorm.dsl.and import org.ktorm.dsl.eq import org.ktorm.entity.find import org.ktorm.jackson.KtormModule +import java.security.cert.X509Certificate +import javax.net.ssl.X509TrustManager object VCenterClient : IVMClient { @@ -38,6 +40,15 @@ object VCenterClient : IVMClient { install(HttpTimeout) { requestTimeoutMillis = 10000L } + engine { + https { + trustManager = object : X509TrustManager { + override fun getAcceptedIssuers(): Array = arrayOf() + override fun checkClientTrusted(chain: Array, authType: String) {} + override fun checkServerTrusted(chain: Array, authType: String) {} + } + } + } }, basePath = globalConfig.vcenter.serviceUrl ) diff --git a/vcenter/build.gradle.kts b/vcenter/build.gradle.kts index b4a53e6..13a1f31 100644 --- a/vcenter/build.gradle.kts +++ b/vcenter/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + plugins { id("java") application @@ -37,6 +39,7 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1") + implementation(kotlin("stdlib-jdk8")) } tasks { @@ -55,3 +58,11 @@ tasks { useJUnitPlatform() } } +val compileKotlin: KotlinCompile by tasks +compileKotlin.kotlinOptions { + jvmTarget = "1.8" +} +val compileTestKotlin: KotlinCompile by tasks +compileTestKotlin.kotlinOptions { + jvmTarget = "1.8" +} \ No newline at end of file