diff --git a/.github/workflows/codeql-analyze.yaml b/.github/workflows/codeql-analyze.yaml index 18796f2..54d3b7e 100644 --- a/.github/workflows/codeql-analyze.yaml +++ b/.github/workflows/codeql-analyze.yaml @@ -12,6 +12,7 @@ name: "CodeQL" on: + workflow_dispatch: push: branches: [ main ] pull_request: diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml deleted file mode 100644 index 8f75b36..0000000 --- a/.github/workflows/docker.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: Docker Scan and Build - -on: - push: - branches: [ main ] - schedule: - - cron: "0 0 * * *" # Daily at midnight UTC - workflow_dispatch: - inputs: - trigger-build: - description: 'Trigger a manual build and push' - default: 'true' - -env: - DOCKER_IMAGE: donaldzou/wgdashboard - -jobs: - docker_build_analyze: - runs-on: ubuntu-latest - strategy: - fail-fast: false - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_PASSWORD }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and export (multi-arch) - uses: docker/build-push-action@v6 - with: - context: . - file: ./docker/Dockerfile - push: true - tags: ${{ env.DOCKER_IMAGE }}:latest - platforms: linux/amd64,linux/arm64,linux/arm/v7 #ARM v6 no longer support by go image. - - - name: Docker Scout - id: docker-scout - uses: docker/scout-action@v1 - with: - command: cves - image: ${{ env.DOCKER_IMAGE }}:latest - only-severities: critical,high,medium,low,unspecified - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..06c6002 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,105 @@ +name: Docker Build and Push + +on: + workflow_dispatch: + push: + branches: + - 'main' + tags: + - '*' + release: + types: [ published ] + +env: + DOCKERHUB_PREFIX: docker.io + GITHUB_CONTAINER_PREFIX: ghcr.io + DOCKER_IMAGE: donaldzou/wgdashboard + +jobs: + docker_build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + registry: ${{ env.DOCKERHUB_PREFIX }} + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.GITHUB_CONTAINER_PREFIX }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: | + - linux/amd64 + - linux/arm64 + - linux/arm/v7 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta by docs https://github.com/docker/metadata-action + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.DOCKERHUB_PREFIX }}/${{ env.DOCKER_IMAGE }} + ${{ env.GITHUB_CONTAINER_PREFIX }}/${{ env.DOCKER_IMAGE }} + tags: | + type=ref,event=branch + type=ref,event=tag + + - name: Build and export (multi-arch) + uses: docker/build-push-action@v6 + with: + context: . + file: ./docker/Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + + docker_scan: + if: ${{ github.event_name != 'pull_request' }} + runs-on: ubuntu-latest + needs: docker_build + steps: + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + registry: ${{ env.DOCKERHUB_PREFIX }} + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + + - name: Docker Scout CVEs + uses: docker/scout-action@v1 + with: + command: cves + image: ${{ env.GITHUB_CONTAINER_PREFIX }}/${{ env.DOCKER_IMAGE }}:main + only-severities: critical,high + only-fixed: true + write-comment: true + github-token: ${{ secrets.GITHUB_TOKEN }} + exit-code: true + + - name: Docker Scout Compare + uses: docker/scout-action@v1 + with: + command: compare + # Set to Github for maximum compat + image: ${{ env.GITHUB_CONTAINER_PREFIX }}/${{ env.DOCKER_IMAGE }}:main + to: ${{ env.GITHUB_CONTAINER_PREFIX }}/${{ env.DOCKER_IMAGE }}:latest + only-severities: critical,high + ignore-unchanged: true + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml deleted file mode 100644 index 7bdf543..0000000 --- a/.github/workflows/qodana_code_quality.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Qodana -on: - workflow_dispatch: - pull_request: - push: - branches: # Specify your branches here - - main # The 'main' branch - - v4.2-dev - -jobs: - qodana: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - checks: write - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit - fetch-depth: 0 # a full history is required for pull request analysis - - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2024.3 - with: - pr-mode: false - env: - QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_2090978292 }} - QODANA_ENDPOINT: 'https://qodana.cloud' diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..bc64ad1 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,24 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/actions/stale +name: Mark stale issues and pull requests + +on: + schedule: + - cron: '00 08 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - uses: actions/stale@v9 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'This issue has not been update for 20 days' + stale-pr-message: 'Stale pull request message' + stale-issue-label: 'stale' + days-before-stale: 30 diff --git a/.gitignore b/.gitignore index 8461e6a..df24dc4 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ src/db/wgdashboard.db node_modules/** */proxy.js src/static/app/proxy.js +.secrets # Logs logs diff --git a/README.md b/README.md index 3a1b026..4cf05a1 100644 --- a/README.md +++ b/README.md @@ -4,20 +4,21 @@ > [!NOTE] > **Help Wanted 🎉**: Localizing WGDashboard to other languages! If you're willing to help, please visit https://github.com/donaldzou/WGDashboard/issues/397. Many thanks! + + 
-
-
-
-
-
+
+
+
@@ -37,43 +38,40 @@
This project is not affiliate to the official WireGuard Project
- +- Join our Discord Server for quick help, or you wanna chat about this project! + You can reach out at
+
+ You can support via
- Alternatively, you can also reach out at our Matrix.org Chatroom :) -
-
- Matrix.org Chatroom
+
+
+
+ or, visit our merch store and support us by purchasing a merch for only $USD 17.00 (Including shipping worldwide & duties) +
+