From 5b570a892efc8d228030a891d45b53f451698188 Mon Sep 17 00:00:00 2001 From: Krypton Date: Mon, 10 Mar 2025 10:32:14 +0100 Subject: [PATCH] ci: Unzip rockyou & cleanup Docker images --- .github/workflows/docker-publish.yml | 20 +++++++++++--------- .github/workflows/update-generated-files.yml | 6 ++++-- .github/workflows/update-tlds-list.yml | 6 ++++-- Dockerfile.alpine | 13 ++++++++++++- Dockerfile.debian | 15 +++++++++++++-- Dockerfile.ubuntu | 13 ++++++++++++- 6 files changed, 56 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d9e3d91..58473c6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,31 +1,33 @@ -name: Publish Docker Image +name: Publish Docker Images on: - release: - types: [published] + push: + branches: + - main workflow_dispatch: jobs: build-and-push: + name: Build and push Docker images runs-on: ubuntu-latest strategy: matrix: - os: [alpine, debian, ubuntu] + image: [alpine, debian, ubuntu] steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Log in to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Build and push Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . - file: ./Dockerfile.${{ matrix.os }} + file: ./Dockerfile.${{ matrix.image }} platforms: linux/amd64,linux/arm64 push: true - tags: kkrypt0nn/wordlists:${{ matrix.os }}-latest + tags: kkrypt0nn/wordlists:${{ matrix.image }}-latest diff --git a/.github/workflows/update-generated-files.yml b/.github/workflows/update-generated-files.yml index 369a0bd..f4fbc56 100644 --- a/.github/workflows/update-generated-files.yml +++ b/.github/workflows/update-generated-files.yml @@ -8,13 +8,15 @@ on: jobs: update_generated_file: + name: Update generated files runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v4 with: token: ${{ secrets.PAT }} - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" - name: Make README file diff --git a/.github/workflows/update-tlds-list.yml b/.github/workflows/update-tlds-list.yml index 1189a88..86ec95c 100644 --- a/.github/workflows/update-tlds-list.yml +++ b/.github/workflows/update-tlds-list.yml @@ -7,13 +7,15 @@ on: jobs: update_tlds_list: + name: Update TLDs list runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v4 with: token: ${{ secrets.PAT }} - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install Python packages diff --git a/Dockerfile.alpine b/Dockerfile.alpine index bb379a0..8e83d54 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -1,5 +1,16 @@ FROM alpine:latest +# Copy wordlists COPY wordlists /wordlists -WORKDIR /wordlists \ No newline at end of file +# Copy relevant Markdown files +COPY NOTICE.md /wordlists/NOTICE.md +COPY TERMS_OF_USE.md /wordlists/TERMS_OF_USE.md + +# Unzip rockyou +WORKDIR /wordlists/famous +RUN apk add --no-cache unzip && \ + unzip rockyou.zip && rm rockyou.zip + +# Cleanup +RUN rm -rf /tmp/* \ No newline at end of file diff --git a/Dockerfile.debian b/Dockerfile.debian index e01f731..09898d6 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -1,5 +1,16 @@ -FROM debian:latest +FROM debian:bookworm-slim +# Copy wordlists COPY wordlists /wordlists -WORKDIR /wordlists \ No newline at end of file +# Copy relevant Markdown files +COPY NOTICE.md /wordlists/NOTICE.md +COPY TERMS_OF_USE.md /wordlists/TERMS_OF_USE.md + +# Unzip rockyou +WORKDIR /wordlists/famous +RUN apt-get update && apt-get install -y unzip && \ + unzip rockyou.zip && rm rockyou.zip + +# Cleanup +RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ No newline at end of file diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index 9d92b8a..c724176 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -1,5 +1,16 @@ FROM ubuntu:latest +# Copy wordlists COPY wordlists /wordlists -WORKDIR /wordlists \ No newline at end of file +# Copy relevant Markdown files +COPY NOTICE.md /wordlists/NOTICE.md +COPY TERMS_OF_USE.md /wordlists/TERMS_OF_USE.md + +# Unzip rockyou +WORKDIR /wordlists/famous +RUN apt-get update && apt-get install -y unzip && \ + unzip rockyou.zip && rm rockyou.zip + +# Cleanup +RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ No newline at end of file