1
0
mirror of https://github.com/ZeroCatDev/ClassworksKV.git synced 2025-07-01 20:09:23 +00:00

Update authentication middleware in auth.js to improve password hint functionality and error handling. Revise device management routes in kv.js to support password hint retrieval and modification, enhancing security and user experience.

This commit is contained in:
SunWuyuan 2025-05-24 16:34:37 +08:00
parent 91e515b553
commit 14d3587720
No known key found for this signature in database
GPG Key ID: A6A54CF66F56BB64

86
.github/workflows/docker-publish.yml vendored Normal file
View File

@ -0,0 +1,86 @@
name: Docker Build and Push
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
REGISTRY: ghcr.io
MYSQL_IMAGE_NAME: ZeroCatDev/Classworks-mysql
POSTGRES_IMAGE_NAME: ZeroCatDev/Classworks-postgres
SQLITE_IMAGE_NAME: ZeroCatDev/Classworks-sqlite
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ env.MYSQL_IMAGE_NAME }}
${{ env.REGISTRY }}/${{ env.POSTGRES_IMAGE_NAME }}
${{ env.REGISTRY }}/${{ env.SQLITE_IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,format=long
type=raw,value=latest,enable={{is_default_branch}}
# Build and push MySQL image
- name: Build and push MySQL image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
DATABASE_TYPE=mysql
tags: |
${{ env.REGISTRY }}/${{ env.MYSQL_IMAGE_NAME }}:${{ github.sha }}
${{ env.REGISTRY }}/${{ env.MYSQL_IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}
# Build and push PostgreSQL image
- name: Build and push PostgreSQL image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
DATABASE_TYPE=postgres
tags: |
${{ env.REGISTRY }}/${{ env.POSTGRES_IMAGE_NAME }}:${{ github.sha }}
${{ env.REGISTRY }}/${{ env.POSTGRES_IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}
# Build and push SQLite image
- name: Build and push SQLite image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
DATABASE_TYPE=sqlite
tags: |
${{ env.REGISTRY }}/${{ env.SQLITE_IMAGE_NAME }}:${{ github.sha }}
${{ env.REGISTRY }}/${{ env.SQLITE_IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}