diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 4a7051f..2660bde 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -102,50 +102,61 @@ jobs: cache-from: type=registry,ref=bunkerity/cache:bw-ui-386-cache cache-to: type=registry,ref=bunkerity/cache:bw-ui-386-cache,mode=min - # Build bunkerweb/armv8 - # build-bw-armv8: - # runs-on: ubuntu-latest - # steps: + # Build bunkerweb/arm + build-bw-arm: + runs-on: ubuntu-latest + steps: # Prepare - # - name: Checkout source code - # uses: actions/checkout@v3 - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v2 - # - name: Setup Buildx - # uses: docker/setup-buildx-action@v2 - # - name: Login to Docker Hub - # uses: docker/login-action@v2 - # with: - # username: ${{ secrets.DOCKER_USERNAME }} - # password: ${{ secrets.DOCKER_TOKEN }} + - name: Checkout source code + uses: actions/checkout@v3 + - name: Setup Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + - name: Setup SSH for ARM node + run: | + mkdir -p ~/.ssh + echo "$SSH_KEY" > ~/.ssh/id_rsa_arm + chmod 600 ~/.ssh/id_rsa_arm + echo "$SSH_CONFIG" > ~/.ssh/config + env: + SSH_KEY: ${{ secrets.ARM_SSH_KEY }} + SSH_CONFIG: ${{ secrets.ARM_SSH_CONFIG }} + - name: Append ARM node to buildx + run: | + docker buildx create --append --name ${{ steps.buildx.outputs.name }} --node arm --platform linux/arm64,linux/arm/v7,linux/arm/v6 ssh://ubuntu@arm # Build images - # - name: Build BW for armv8 - # uses: docker/build-push-action@v3 - # with: - # context: . - # platforms: linux/arm64/v8 - # tags: bunkerweb-tests-armv8:latest - # cache-from: type=registry,ref=bunkerity/cache:bw-armv8-cache - # cache-to: type=registry,ref=bunkerity/cache:bw-armv8-cache,mode=min - # - name: Build BW autoconf for armv8 - # uses: docker/build-push-action@v3 - # with: - # context: . - # file: autoconf/Dockerfile - # platforms: linux/arm64/v8 - # tags: bunkerweb-autoconf-tests-armv8:latest - # cache-from: type=registry,ref=bunkerity/cache:bw-autoconf-armv8-cache - # cache-to: type=registry,ref=bunkerity/cache:bw-autoconf-armv8-cache,mode=min - # - name: Build BW UI for armv8 - # uses: docker/build-push-action@v3 - # with: - # context: . - # file: ui/Dockerfile - # platforms: linux/arm64/v8 - # tags: bunkerweb-ui-tests-armv8:latest - # cache-from: type=registry,ref=bunkerity/cache:bw-ui-armv8-cache - # cache-to: type=registry,ref=bunkerity/cache:bw-ui-armv8-cache,mode=min + - name: Build BW for ARM + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/arm64,linux/arm/v7 + tags: bunkerweb-tests-arm:latest + cache-from: type=registry,ref=bunkerity/cache:bw-arm-cache + cache-to: type=registry,ref=bunkerity/cache:bw-arm-cache,mode=min + - name: Build BW autoconf for ARM + uses: docker/build-push-action@v3 + with: + context: . + file: autoconf/Dockerfile + platforms: linux/arm64,linux/arm/v7 + tags: bunkerweb-autoconf-tests-arm:latest + cache-from: type=registry,ref=bunkerity/cache:bw-autoconf-arm-cache + cache-to: type=registry,ref=bunkerity/cache:bw-autoconf-arm-cache,mode=min + - name: Build BW UI for ARM + uses: docker/build-push-action@v3 + with: + context: . + file: ui/Dockerfile + platforms: linux/arm64,linux/arm/v7 + tags: bunkerweb-ui-tests-arm:latest + cache-from: type=registry,ref=bunkerity/cache:bw-ui-arm-cache + cache-to: type=registry,ref=bunkerity/cache:bw-ui-arm-cache,mode=min # Run tests tests: @@ -227,17 +238,15 @@ jobs: # Push to dev registries push-docker: - # needs: [tests, build-bw-386, build-bw-arm] - needs: [tests, build-bw-386] + needs: [tests, build-bw-386, build-bw-arm] runs-on: ubuntu-latest steps: # Prepare - name: Checkout source code uses: actions/checkout@v3 - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - name: Setup Buildx + id: buildx uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub uses: docker/login-action@v2 @@ -250,40 +259,55 @@ jobs: registry: ${{ secrets.PRIVATE_REGISTRY }} username: registry password: ${{ secrets.PRIVATE_REGISTRY_TOKEN }} + - name: Setup SSH for ARM node + run: | + mkdir -p ~/.ssh + echo "$SSH_KEY" > ~/.ssh/id_rsa_arm + chmod 600 ~/.ssh/id_rsa_arm + echo "$SSH_CONFIG" > ~/.ssh/config + env: + SSH_KEY: ${{ secrets.ARM_SSH_KEY }} + SSH_CONFIG: ${{ secrets.ARM_SSH_CONFIG }} + - name: Append ARM node to buildx + run: | + docker buildx create --append --name ${{ steps.buildx.outputs.name }} --node arm --platform linux/arm64,linux/arm/v7,linux/arm/v6 ssh://ubuntu@arm # Build and push - name: Build and push BW uses: docker/build-push-action@v3 with: context: . - platforms: linux/amd64,linux/386 + platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7 push: true tags: ${{ secrets.PRIVATE_REGISTRY }}/infra/bunkerweb:staging,bunkerity/bunkerweb:dev cache-from: | type=registry,ref=bunkerity/cache:bw-amd64-cache type=registry,ref=bunkerity/cache:bw-386-cache + type=registry,ref=bunkerity/cache:bw-arm-cache - name: Build and push BW autoconf uses: docker/build-push-action@v3 with: context: . file: autoconf/Dockerfile - platforms: linux/amd64,linux/386 + platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7 push: true tags: ${{ secrets.PRIVATE_REGISTRY }}/infra/bunkerweb-autoconf:staging,bunkerity/bunkerweb-autoconf:dev cache-from: | type=registry,ref=bunkerity/cache:bw-autoconf-amd64-cache type=registry,ref=bunkerity/cache:bw-autoconf-386-cache + type=registry,ref=bunkerity/cache:bw-autoconf-arm-cache - name: Build and push BW UI uses: docker/build-push-action@v3 with: context: . file: ui/Dockerfile - platforms: linux/amd64,linux/386 + platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7 push: true tags: ${{ secrets.PRIVATE_REGISTRY }}/infra/bunkerweb-ui:staging,bunkerity/bunkerweb-ui:dev cache-from: | type=registry,ref=bunkerity/cache:bw-ui-amd64-cache type=registry,ref=bunkerity/cache:bw-ui-386-cache + type=registry,ref=bunkerity/cache:bw-ui-arm-cache # Push to PackageCloud push-linux: diff --git a/examples/authentik/.env b/examples/authentik/.env index e63a9c9..464014c 100644 --- a/examples/authentik/.env +++ b/examples/authentik/.env @@ -1,3 +1,5 @@ PG_PASS=changeme AUTHENTIK_SECRET_KEY=changeme AUTHENTIK_COOKIE_DOMAIN=example.com +AUTHENTIK_BOOTSTRAP_PASSWORD=changeme +AUTHENTIK_BOOTSTRAP_TOKEN=changeme \ No newline at end of file diff --git a/tests/docker.sh b/tests/docker.sh index 6144a1c..eeaaaa8 100755 --- a/tests/docker.sh +++ b/tests/docker.sh @@ -52,7 +52,8 @@ echo "Running Docker tests ..." single_docker_test "authelia" "60" "https://$TEST_DOMAIN1_1 authelia" "https://$TEST_DOMAIN1_2 authelia" # authentik -single_docker_test "authentik" "60" "https://$TEST_DOMAIN1_1 authentik" "https://$TEST_DOMAIN1_2 authentik" +# TODO : find a way to load a basic configuration for automatic tests +# single_docker_test "authentik" "60" "https://$TEST_DOMAIN1_1 authentik" "https://$TEST_DOMAIN1_2 authentik" # drupal single_docker_test "drupal" "60" "https://$TEST_DOMAIN1 drupal"