From 33bd693c8ec5238fcadc37eb7335a319cb78d3ac Mon Sep 17 00:00:00 2001 From: Pascal Honegger Date: Wed, 13 Nov 2024 22:03:05 +0100 Subject: [PATCH] feat(backend): switch to library version of argon2 --- .idea/kotlinc.xml | 2 +- Backend/security/build.gradle.kts | 3 ++- Dockerfile | 11 ++++++----- DockerfileBuiltLocally | 1 + settings.gradle.kts | 3 ++- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index c224ad5..5ed8ccb 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/Backend/security/build.gradle.kts b/Backend/security/build.gradle.kts index bd380f5..d6d5734 100644 --- a/Backend/security/build.gradle.kts +++ b/Backend/security/build.gradle.kts @@ -10,8 +10,9 @@ kotlin { dependencies { implementation(project(":Backend:domain")) implementation(libs.java.jwt) - implementation(libs.argon2.jvm) + implementation(libs.argon2.jvm.nolibs) implementation(libs.kotlinx.datetime) + testImplementation(libs.argon2.jvm) testImplementation(testLibs.kotlin.test) testImplementation(testLibs.mockk) } diff --git a/Dockerfile b/Dockerfile index 897ccdd..10326d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,19 @@ -FROM node:22-alpine AS buildFrontend +FROM node:22-alpine AS build_frontend RUN corepack enable COPY ./Frontend /home/node/src WORKDIR /home/node/src RUN pnpm i --frozen-lockfile -RUN pnpm build +RUN pnpm build --outDir ./dist -FROM eclipse-temurin:23-jdk-alpine AS buildBackend +FROM eclipse-temurin:23-jdk-alpine AS build_backend COPY . /home/gradle/src -COPY --from=buildFrontend /home/node/src/dist /home/gradle/src/Backend/bootstrap/src/main/resources/static +COPY --from=build_frontend /home/node/src/dist /home/gradle/src/Backend/bootstrap/src/main/resources/static WORKDIR /home/gradle/src RUN ./gradlew shadowJar --no-daemon FROM eclipse-temurin:23-jre-alpine +RUN apk add --no-cache argon2-libs EXPOSE 8080:8080 RUN mkdir /app -COPY --from=buildBackend /home/gradle/src/Backend/bootstrap/build/libs/*.jar /app/jasstracker.jar +COPY --from=build_backend /home/gradle/src/Backend/bootstrap/build/libs/*.jar /app/jasstracker.jar ENTRYPOINT ["java","-jar","/app/jasstracker.jar"] diff --git a/DockerfileBuiltLocally b/DockerfileBuiltLocally index ace6603..1e6b46b 100644 --- a/DockerfileBuiltLocally +++ b/DockerfileBuiltLocally @@ -1,4 +1,5 @@ FROM eclipse-temurin:23-jre-alpine +RUN apk add --no-cache argon2-libs EXPOSE 8080:8080 RUN mkdir /app COPY ./Backend/bootstrap/build/libs/*.jar /app/jasstracker.jar diff --git a/settings.gradle.kts b/settings.gradle.kts index 4cdce98..2a54873 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -11,7 +11,7 @@ plugins { dependencyResolutionManagement { versionCatalogs { - val kotlin = "2.1.0-Beta2" + val kotlin = "2.1.0-RC" val mockk = "1.13.13" val ktor = "3.0.1" val logback = "1.5.12" @@ -51,6 +51,7 @@ dependencyResolutionManagement { library("postgresql", "org.postgresql", "postgresql").version(postgresql) library("jooq", "org.jooq", "jooq").version(jooq) library("java-jwt", "com.auth0", "java-jwt").version(javaJwt) + library("argon2-jvm-nolibs", "de.mkammerer", "argon2-jvm-nolibs").version(argon2) library("argon2-jvm", "de.mkammerer", "argon2-jvm").version(argon2) library("kotlin-reflect", "org.jetbrains.kotlin", "kotlin-reflect").version(kotlin)