diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..cbcd6b3e --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +commafeed-client \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c563ce47..bc00e4d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,7 @@ on: [ push ] env: JAVA_VERSION: 21 + DOCKER_BUILD_SUMMARY: false jobs: build-linux: @@ -53,7 +54,7 @@ jobs: # Docker - name: Login to Container Registry uses: docker/login-action@v3 - if: ${{ github.ref_type == 'tag' || github.ref_name == 'master' }} + if: ${{ github.ref_type == 'tag' || github.ref_name == 'master' || github.ref_name == 'quarkus' }} with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -63,62 +64,67 @@ jobs: uses: docker/build-push-action@v6 if: ${{ github.ref_type == 'tag' }} with: - context: commafeed-server - file: src/main/docker/Dockerfile.native + context: . + file: commafeed-server/src/main/docker/Dockerfile.native push: true platforms: linux/amd64 tags: | - athou/commafeed:latest-native - athou/commafeed:${{ github.ref_name }}-native + athou/commafeed:latest-${{ matrix.database }} + athou/commafeed:${{ github.ref_name }}-${{ matrix.database }} - name: Docker build and push tag - jvm uses: docker/build-push-action@v6 if: ${{ github.ref_type == 'tag' }} with: - context: commafeed-server - file: src/main/docker/Dockerfile.jvm + context: . + file: commafeed-server/src/main/docker/Dockerfile.jvm push: true - platforms: linux/arm64/v8 + platforms: linux/amd64,linux/arm64/v8 tags: | - athou/commafeed:latest-jvm - athou/commafeed:${{ github.ref_name }}-jvm - - - name: Docker merge tag manifests - uses: Noelware/docker-manifest-action@0.4.2 - if: ${{ github.ref_type == 'tag' }} - with: - inputs: athou/commafeed:latest - images: athou/commafeed:latest-native,athou/commafeed:latest-jvm - push: true + athou/commafeed:latest-${{ matrix.database }}-jvm + athou/commafeed:${{ github.ref_name }}-${{ matrix.database }}-jvm ## master - name: Docker build and push master - native uses: docker/build-push-action@v6 if: ${{ github.ref_name == 'master' }} with: - context: commafeed-server - file: src/main/docker/Dockerfile.native + context: . + file: commafeed-server/src/main/docker/Dockerfile.native push: true platforms: linux/amd64 - tags: athou/commafeed:master-native + tags: athou/commafeed:master-${{ matrix.database }} - name: Docker build and push master - jvm uses: docker/build-push-action@v6 if: ${{ github.ref_name == 'master' }} with: - context: commafeed-server - file: src/main/docker/Dockerfile.jvm + context: . + file: commafeed-server/src/main/docker/Dockerfile.jvm push: true - platforms: linux/arm64/v8 - tags: athou/commafeed:master-jvm + platforms: linux/amd64,linux/arm64/v8 + tags: athou/commafeed:master-${{ matrix.database }}-jvm - - name: Docker merge master manifests - uses: Noelware/docker-manifest-action@0.4.2 - if: ${{ github.ref_name == 'master' }} + ## quarkus branch - remove when merged into master, also remove the condition in the login step + - name: Docker build and push quarkus - native + uses: docker/build-push-action@v6 + if: ${{ github.ref_name == 'quarkus' }} with: - inputs: athou/commafeed:master - images: athou/commafeed:master-native,athou/commafeed:master-jvm + context: . + file: commafeed-server/src/main/docker/Dockerfile.native push: true + platforms: linux/amd64 + tags: athou/commafeed:quarkus-${{ matrix.database }} + + - name: Docker build and push quarkus - jvm + uses: docker/build-push-action@v6 + if: ${{ github.ref_name == 'quarkus' }} + with: + context: . + file: commafeed-server/src/main/docker/Dockerfile.jvm + push: true + platforms: linux/amd64,linux/arm64/v8 + tags: athou/commafeed:quarkus-${{ matrix.database }}-jvm build-windows: runs-on: windows-latest diff --git a/commafeed-client/pom.xml b/commafeed-client/pom.xml index c55058fb..753ee1ec 100644 --- a/commafeed-client/pom.xml +++ b/commafeed-client/pom.xml @@ -6,7 +6,7 @@ com.commafeed commafeed - 4.6.0 + 5.0.0-beta commafeed-client CommaFeed Client diff --git a/commafeed-server/pom.xml b/commafeed-server/pom.xml index fbd54e20..95b2c255 100644 --- a/commafeed-server/pom.xml +++ b/commafeed-server/pom.xml @@ -6,7 +6,7 @@ com.commafeed commafeed - 4.6.0 + 5.0.0-beta commafeed-server CommaFeed Server @@ -229,7 +229,7 @@ com.commafeed commafeed-client - 4.6.0 + 5.0.0-beta diff --git a/commafeed-server/src/main/java/com/commafeed/security/mechanism/CookieMaxAgeFormAuthenticationMechanism.java b/commafeed-server/src/main/java/com/commafeed/security/mechanism/CookieMaxAgeFormAuthenticationMechanism.java index 97445772..c5ffa581 100644 --- a/commafeed-server/src/main/java/com/commafeed/security/mechanism/CookieMaxAgeFormAuthenticationMechanism.java +++ b/commafeed-server/src/main/java/com/commafeed/security/mechanism/CookieMaxAgeFormAuthenticationMechanism.java @@ -2,26 +2,20 @@ package com.commafeed.security.mechanism; import java.security.SecureRandom; import java.util.Base64; -import java.util.Set; -import io.quarkus.security.identity.IdentityProviderManager; -import io.quarkus.security.identity.SecurityIdentity; -import io.quarkus.security.identity.request.AuthenticationRequest; import io.quarkus.vertx.http.runtime.FormAuthConfig; import io.quarkus.vertx.http.runtime.FormAuthRuntimeConfig; import io.quarkus.vertx.http.runtime.HttpBuildTimeConfig; import io.quarkus.vertx.http.runtime.HttpConfiguration; -import io.quarkus.vertx.http.runtime.security.ChallengeData; import io.quarkus.vertx.http.runtime.security.FormAuthenticationMechanism; import io.quarkus.vertx.http.runtime.security.HttpAuthenticationMechanism; -import io.quarkus.vertx.http.runtime.security.HttpCredentialTransport; import io.quarkus.vertx.http.runtime.security.PersistentLoginManager; -import io.smallrye.mutiny.Uni; import io.vertx.core.http.Cookie; import io.vertx.core.http.impl.ServerCookie; import io.vertx.ext.web.RoutingContext; import jakarta.annotation.Priority; import jakarta.inject.Singleton; +import lombok.experimental.Delegate; import lombok.extern.slf4j.Slf4j; /** @@ -37,6 +31,7 @@ public class CookieMaxAgeFormAuthenticationMechanism implements HttpAuthenticati // the temp encryption key, persistent across dev mode restarts static volatile String encryptionKey; + @Delegate private final FormAuthenticationMechanism delegate; public CookieMaxAgeFormAuthenticationMechanism(HttpConfiguration httpConfiguration, HttpBuildTimeConfig buildTimeConfig) { @@ -86,26 +81,6 @@ public class CookieMaxAgeFormAuthenticationMechanism implements HttpAuthenticati landingPage, redirectAfterLogin, locationCookie, cookieSameSite, cookiePath, loginManager); } - @Override - public Uni authenticate(RoutingContext context, IdentityProviderManager identityProviderManager) { - return delegate.authenticate(context, identityProviderManager); - } - - @Override - public Uni getChallenge(RoutingContext context) { - return delegate.getChallenge(context); - } - - @Override - public Set> getCredentialTypes() { - return delegate.getCredentialTypes(); - } - - @Override - public Uni getCredentialTransport(RoutingContext context) { - return delegate.getCredentialTransport(context); - } - private static String startWithSlash(String page) { if (page == null) { return null; diff --git a/pom.xml b/pom.xml index da9fb825..7d321f30 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.commafeed commafeed - 4.6.0 + 5.0.0-beta CommaFeed pom