diff --git a/.dockerignore b/.dockerignore index 87374dd..0374064 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,10 +1,34 @@ -/.git -/.github -/.idea -/.vscode -./resources/readme/* +# Directories to ignore +.git/ +.github/ +.idea/ +.vscode/ +node_modules/ +resources/ +# Ignore common archive and executable files +*.exe +*.zip +*.tar.gz +*.gz +*.tgz +*.rar +*.7z +*.jar + +# Temporary or lock files +*.tmp +pnpm-lock.yaml +bun.lockb +package-lock.json + +# Ignore configuration and script files .gitignore +.env.template +.env README.md LICENSE + +# Docker-specific files Dockerfile +docker-compose.yml diff --git a/.github/workflows/docker-publish-dev.yml b/.github/workflows/docker-publish-dev.yml deleted file mode 100644 index bf808cb..0000000 --- a/.github/workflows/docker-publish-dev.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Docker Publish Dev - -on: - push: - branches: - - dev - -env: - PLATFORMS: linux/amd64,linux/arm64 - TAG: dev - -permissions: - packages: write - -jobs: - main: - environment: release-docker - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@main - with: - ref: dev - show-progress: false - submodules: recursive - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@master - - - name: Login to ghcr.io - uses: docker/login-action@master - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to DockerHub - uses: docker/login-action@master - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Prepare environment outputs - shell: sh - run: | - set -eu - - echo "DATE_ISO8601=$(date --iso-8601=seconds --utc)" >> "$GITHUB_ENV" - echo "GHCR_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV" - echo "DH_REPOSITORY=$(echo ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV" - - - name: Build and publish Docker image from Dockerfile - uses: docker/build-push-action@master - with: - context: . - platforms: ${{ env.PLATFORMS }} - provenance: true - sbom: true - labels: | - org.opencontainers.image.created=${{ env.DATE_ISO8601 }} - org.opencontainers.image.version=${{ github.sha }} - org.opencontainers.image.revision=${{ github.sha }} - tags: | - ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.TAG }} - ${{ env.DH_REPOSITORY }}:${{ env.TAG }} - push: true diff --git a/.github/workflows/docker-publish-latest.yml b/.github/workflows/docker-publish-latest.yml index 437cee6..ef09d28 100644 --- a/.github/workflows/docker-publish-latest.yml +++ b/.github/workflows/docker-publish-latest.yml @@ -5,65 +5,13 @@ on: tags: - '*' -env: - PLATFORMS: linux/amd64,linux/arm64 - TAG: latest - permissions: packages: write jobs: - main: - environment: release-docker - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@main - with: - show-progress: false - submodules: recursive - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@master - - - name: Login to ghcr.io - uses: docker/login-action@master - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to DockerHub - uses: docker/login-action@master - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Prepare environment outputs - shell: sh - run: | - set -eu - - echo "FIXED_TAG=$(echo ${{ github.ref }} | cut -d '/' -f 3)" >> "$GITHUB_ENV" - echo "DATE_ISO8601=$(date --iso-8601=seconds --utc)" >> "$GITHUB_ENV" - echo "GHCR_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV" - echo "DH_REPOSITORY=$(echo ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV" - - - name: Build and publish Docker image from Dockerfile - uses: docker/build-push-action@master - with: - context: . - platforms: ${{ env.PLATFORMS }} - provenance: true - sbom: true - labels: | - org.opencontainers.image.created=${{ env.DATE_ISO8601 }} - org.opencontainers.image.version=${{ env.FIXED_TAG }} - org.opencontainers.image.revision=${{ github.sha }} - tags: | - ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.TAG }} - ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.FIXED_TAG }} - ${{ env.DH_REPOSITORY }}:${{ env.TAG }} - ${{ env.DH_REPOSITORY }}:${{ env.FIXED_TAG }} - push: true + call-reusable-workflow: + uses: JourneyDocker/github-workflows/.github/workflows/docker-publish.yml@main + with: + tag: latest + platforms: linux/amd64,linux/arm64 + secrets: inherit diff --git a/.github/workflows/docker-publish-main.yml b/.github/workflows/docker-publish-main.yml index b76892f..33114f0 100644 --- a/.github/workflows/docker-publish-main.yml +++ b/.github/workflows/docker-publish-main.yml @@ -1,74 +1,18 @@ name: Docker Publish Main on: + workflow_dispatch: push: branches: - - main - -env: - PLATFORMS: linux/amd64,linux/arm64 - TAG: main + - main permissions: packages: write jobs: - main: - environment: release-docker - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@main - with: - show-progress: false - submodules: recursive - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@master - - - name: Login to ghcr.io - uses: docker/login-action@master - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to DockerHub - uses: docker/login-action@master - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Prepare environment outputs - shell: sh - run: | - set -eu - - echo "DATE_ISO8601=$(date --iso-8601=seconds --utc)" >> "$GITHUB_ENV" - echo "GHCR_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV" - echo "DH_REPOSITORY=$(echo ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV" - - - name: Build and publish Docker image from Dockerfile - uses: docker/build-push-action@master - with: - context: . - platforms: ${{ env.PLATFORMS }} - provenance: true - sbom: true - labels: | - org.opencontainers.image.created=${{ env.DATE_ISO8601 }} - org.opencontainers.image.version=${{ github.sha }} - org.opencontainers.image.revision=${{ github.sha }} - tags: | - ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.TAG }} - ${{ env.DH_REPOSITORY }}:${{ env.TAG }} - push: true - - - name: Update DockerHub repository description - uses: peter-evans/dockerhub-description@main - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - repository: ${{ env.DH_REPOSITORY }} - short-description: ${{ github.event.repository.description }} + call-reusable-workflow: + uses: JourneyDocker/github-workflows/.github/workflows/docker-publish.yml@main + with: + tag: main + platforms: linux/amd64,linux/arm64 + secrets: inherit diff --git a/.gitignore b/.gitignore index 3992829..fd63961 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,12 @@ -node_modules -storage -.env -/pnpm-lock.yaml +# Directories to ignore +node_modules/ +storage/ + +# Temporary or lock files +*.tmp +pnpm-lock.yaml bun.lockb +package-lock.json + +# Ignore configuration files +.env diff --git a/README.md b/README.md index dfd275d..62cbc99 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,43 @@ node . ### Docker Installation +You can use pre-built Docker images to run ASFclaim: + +**Pull the Docker Image:** + + You can choose from two Docker image repositories: + + - From Docker Hub: + + ```sh + journeyover/asfclaim:latest + ``` + + - From GitHub Container Registry: + + ```sh + ghcr.io/journeydocker/asfclaim:latest + ``` + +### Docker Image Tags + + The `ASFclaim` Docker image is available in three primary tag formats, each suited to different use cases: + + - **`main` (Continuous Development)** + - **Description**: The `main` tag is automatically updated to reflect the latest commit on the main branch in GitHub. + - **Usage Consideration**: This tag is not recommended for production use, as it changes frequently and may include untested or unstable updates. Use `main` only if you're contributing to development or need access to the latest features and fixes. + - **Frequency**: Updated with each new commit to the main branch, making this a rapidly evolving image. + + > **Note**: Pulling the `main` tag may introduce breaking changes or instability, as it represents ongoing development work. + + - **`latest` (Latest Stable Release)** + - **Description**: This tag points to the most recent stable release of `ASFclaim`. Unlike `main`, the `latest` tag is only updated with stable, fully-tested versions. + - **Usage Recommendation**: Use the `latest` tag if you want the most current stable build without specifying a particular version. Ideal for production environments where stability is critical. + + - **`A.B.C.D` (Versioned Release)** + - **Description**: Versioned tags, such as `A.B.C.D`, are frozen at a specific release version and will not receive updates after publication. + - **Usage Recommendation**: Use versioned tags when you need consistency and want to avoid updates that might alter functionality. These tags are ideal for production environments requiring fixed versions. + #### Quick Start with Docker ```sh @@ -95,20 +132,20 @@ services: ## Environment Variables -| ENV | Description | Info | Default Value | Required | -|-----------------------------|----------------------------------------------|--------------------------------------------------------|--------------------------------------|----------| -| `TZ` | Your timezone | Timezone identifier (e.g., `Europe/Amsterdam`) | `America/Chicago` | No | -| `ASF_PROTOCOL` | ASF IPC Transfer protocol | Options: `http` or `https` | `http` | No | -| `ASF_HOST` | ASF IPC Hostname or IP | Hostname or IP address | `localhost` | No | -| `ASF_PORT` | ASF IPC Port | Port number for IPC | `1242` | No | -| `ASF_PASS` | ASF IPC Password | Plaintext password for ASF | ` ` | No | -| `ASF_COMMAND_PREFIX` | Command prefix for ASF | Prefix used before commands | `!` | No | -| `ASF_BOTS` | List of ASF bot names | Comma-separated bot names | `asf` | No | -| `ASF_CLAIM_INTERVAL` | Hours to wait for execution | Interval in hours between checks | `6` | No | -| `GIST_ID` | Gist ID containing Steam codes | GitHub Gist ID for fetching codes | `e8c5cf365d816f2640242bf01d8d3675` | No | -| `WEBHOOK_URL` | Discord Webhook URL | URL for Discord webhook or `none` to disable | `none` | No | -| `WEBHOOK_ENABLEDTYPES` | Displayed notification types in Discord chat | Semicolon-separated types (e.g., `error;warn;success`) | `error;warn;success` | No | -| `WEBHOOK_SHOWACCOUNTSTATUS` | Show result from ASF | Options: `true` or `false` | `true` | No | +| ENV | Description | Info | Default Value | Required | +| --------------------------- | -------------------------------------------- | ------------------------------------------------------ | ---------------------------------- | -------- | +| `TZ` | Your timezone | Timezone identifier (e.g., `Europe/Amsterdam`) | `America/Chicago` | No | +| `ASF_PROTOCOL` | ASF IPC Transfer protocol | Options: `http` or `https` | `http` | No | +| `ASF_HOST` | ASF IPC Hostname or IP | Hostname or IP address | `localhost` | No | +| `ASF_PORT` | ASF IPC Port | Port number for IPC | `1242` | No | +| `ASF_PASS` | ASF IPC Password | Plaintext password for ASF | ` ` | No | +| `ASF_COMMAND_PREFIX` | Command prefix for ASF | Prefix used before commands | `!` | No | +| `ASF_BOTS` | List of ASF bot names | Comma-separated bot names | `asf` | No | +| `ASF_CLAIM_INTERVAL` | Hours to wait for execution | Interval in hours between checks | `6` | No | +| `GIST_ID` | Gist ID containing Steam codes | GitHub Gist ID for fetching codes | `e8c5cf365d816f2640242bf01d8d3675` | No | +| `WEBHOOK_URL` | Discord Webhook URL | URL for Discord webhook or `none` to disable | `none` | No | +| `WEBHOOK_ENABLEDTYPES` | Displayed notification types in Discord chat | Semicolon-separated types (e.g., `error;warn;success`) | `error;warn;success` | No | +| `WEBHOOK_SHOWACCOUNTSTATUS` | Show result from ASF | Options: `true` or `false` | `true` | No | ---