Auto-backup data and configs
Browse files- .gitattributes +1 -0
- .github/workflows/build.yml +111 -0
- .github/workflows/docker-publish.yml +68 -0
- data/database.db +3 -0
- docker-compose.yml +19 -0
.gitattributes
CHANGED
|
@@ -58,3 +58,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
data/database.db filter=lfs diff=lfs merge=lfs -text
|
.github/workflows/build.yml
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Multi-platform Build Release
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
tags:
|
| 6 |
+
- "v*"
|
| 7 |
+
workflow_dispatch:
|
| 8 |
+
inputs:
|
| 9 |
+
version:
|
| 10 |
+
description: "Version tag, for example v1.0.0"
|
| 11 |
+
required: false
|
| 12 |
+
default: "dev"
|
| 13 |
+
|
| 14 |
+
jobs:
|
| 15 |
+
build:
|
| 16 |
+
name: Build ${{ matrix.os }}
|
| 17 |
+
runs-on: ${{ matrix.os }}
|
| 18 |
+
strategy:
|
| 19 |
+
fail-fast: false
|
| 20 |
+
matrix:
|
| 21 |
+
include:
|
| 22 |
+
- os: windows-latest
|
| 23 |
+
source_name: codex-console.exe
|
| 24 |
+
asset_name: codex-console-windows-x64.exe
|
| 25 |
+
- os: ubuntu-latest
|
| 26 |
+
source_name: codex-console
|
| 27 |
+
asset_name: codex-console-linux-x64
|
| 28 |
+
- os: macos-latest
|
| 29 |
+
source_name: codex-console
|
| 30 |
+
asset_name: codex-console-macos-arm64
|
| 31 |
+
|
| 32 |
+
steps:
|
| 33 |
+
- name: Checkout code
|
| 34 |
+
uses: actions/checkout@v4
|
| 35 |
+
|
| 36 |
+
- name: Setup Python 3.11
|
| 37 |
+
uses: actions/setup-python@v5
|
| 38 |
+
with:
|
| 39 |
+
python-version: "3.11"
|
| 40 |
+
cache: "pip"
|
| 41 |
+
|
| 42 |
+
- name: Install dependencies
|
| 43 |
+
run: |
|
| 44 |
+
pip install -r requirements.txt pyinstaller
|
| 45 |
+
|
| 46 |
+
- name: Build binary
|
| 47 |
+
run: |
|
| 48 |
+
pyinstaller codex_register.spec --clean --noconfirm
|
| 49 |
+
|
| 50 |
+
- name: Rename packaged binary
|
| 51 |
+
shell: bash
|
| 52 |
+
run: |
|
| 53 |
+
mv "dist/${{ matrix.source_name }}" "dist/${{ matrix.asset_name }}"
|
| 54 |
+
|
| 55 |
+
- name: Upload build artifact
|
| 56 |
+
uses: actions/upload-artifact@v4
|
| 57 |
+
with:
|
| 58 |
+
name: ${{ matrix.asset_name }}
|
| 59 |
+
path: dist/${{ matrix.asset_name }}
|
| 60 |
+
if-no-files-found: error
|
| 61 |
+
|
| 62 |
+
release:
|
| 63 |
+
name: Create release
|
| 64 |
+
needs: build
|
| 65 |
+
runs-on: ubuntu-latest
|
| 66 |
+
if: startsWith(github.ref, 'refs/tags/')
|
| 67 |
+
permissions:
|
| 68 |
+
contents: write
|
| 69 |
+
|
| 70 |
+
steps:
|
| 71 |
+
- name: Checkout code
|
| 72 |
+
uses: actions/checkout@v4
|
| 73 |
+
|
| 74 |
+
- name: Download all artifacts
|
| 75 |
+
uses: actions/download-artifact@v4
|
| 76 |
+
with:
|
| 77 |
+
path: dist/
|
| 78 |
+
merge-multiple: true
|
| 79 |
+
|
| 80 |
+
- name: Create GitHub release
|
| 81 |
+
uses: softprops/action-gh-release@v2
|
| 82 |
+
with:
|
| 83 |
+
files: dist/*
|
| 84 |
+
generate_release_notes: true
|
| 85 |
+
body: |
|
| 86 |
+
## codex-console
|
| 87 |
+
|
| 88 |
+
### Download
|
| 89 |
+
| Platform | File |
|
| 90 |
+
|------|------|
|
| 91 |
+
| Windows x64 | `codex-console-windows-x64.exe` |
|
| 92 |
+
| Linux x64 | `codex-console-linux-x64` |
|
| 93 |
+
| macOS ARM64 | `codex-console-macos-arm64` |
|
| 94 |
+
|
| 95 |
+
### Usage
|
| 96 |
+
```bash
|
| 97 |
+
# Linux/macOS may need execute permission first
|
| 98 |
+
chmod +x codex-console-*
|
| 99 |
+
|
| 100 |
+
# Start Web UI
|
| 101 |
+
./codex-console
|
| 102 |
+
|
| 103 |
+
# Custom port
|
| 104 |
+
./codex-console --port 8080
|
| 105 |
+
|
| 106 |
+
# Debug mode
|
| 107 |
+
./codex-console --debug
|
| 108 |
+
|
| 109 |
+
# Set Web UI password
|
| 110 |
+
./codex-console --access-password mypassword
|
| 111 |
+
```
|
.github/workflows/docker-publish.yml
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Docker Image CI
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches: [ "master", "main" ]
|
| 6 |
+
# 当发布新版本时触发
|
| 7 |
+
tags: [ 'v*.*.*' ]
|
| 8 |
+
pull_request:
|
| 9 |
+
branches: [ "master", "main" ]
|
| 10 |
+
|
| 11 |
+
env:
|
| 12 |
+
# GitHub Container Registry 的地址
|
| 13 |
+
REGISTRY: ghcr.io
|
| 14 |
+
# 镜像名称,默认为 GitHub 用户名/仓库名
|
| 15 |
+
IMAGE_NAME: ${{ github.repository }}
|
| 16 |
+
|
| 17 |
+
jobs:
|
| 18 |
+
build-and-push-image:
|
| 19 |
+
runs-on: ubuntu-latest
|
| 20 |
+
permissions:
|
| 21 |
+
contents: read
|
| 22 |
+
packages: write
|
| 23 |
+
# 如果需要签名生成的镜像,可以使用 id-token: write
|
| 24 |
+
|
| 25 |
+
steps:
|
| 26 |
+
- name: Checkout repository
|
| 27 |
+
uses: actions/checkout@v4
|
| 28 |
+
|
| 29 |
+
# 设置 Docker Buildx 用于构建多平台镜像 (可选)
|
| 30 |
+
- name: Set up Docker Buildx
|
| 31 |
+
uses: docker/setup-buildx-action@v3
|
| 32 |
+
|
| 33 |
+
# 登录到 Docker 镜像仓库
|
| 34 |
+
# 如果只是在 PR 中测试构建,则跳过登录
|
| 35 |
+
- name: Log in to the Container registry
|
| 36 |
+
if: github.event_name != 'pull_request'
|
| 37 |
+
uses: docker/login-action@v3
|
| 38 |
+
with:
|
| 39 |
+
registry: ${{ env.REGISTRY }}
|
| 40 |
+
username: ${{ github.actor }}
|
| 41 |
+
password: ${{ secrets.GITHUB_TOKEN }}
|
| 42 |
+
|
| 43 |
+
# 提取 Docker 镜像的元数据(标签、注释等)
|
| 44 |
+
- name: Extract metadata (tags, labels) for Docker
|
| 45 |
+
id: meta
|
| 46 |
+
uses: docker/metadata-action@v5
|
| 47 |
+
with:
|
| 48 |
+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
| 49 |
+
tags: |
|
| 50 |
+
type=schedule
|
| 51 |
+
type=ref,event=branch
|
| 52 |
+
type=ref,event=pr
|
| 53 |
+
type=semver,pattern={{version}}
|
| 54 |
+
type=semver,pattern={{major}}.{{minor}}
|
| 55 |
+
type=semver,pattern={{major}}
|
| 56 |
+
type=sha
|
| 57 |
+
type=raw,value=latest,enable={{is_default_branch}}
|
| 58 |
+
|
| 59 |
+
# 构建并推送 Docker 镜像
|
| 60 |
+
- name: Build and push Docker image
|
| 61 |
+
uses: docker/build-push-action@v5
|
| 62 |
+
with:
|
| 63 |
+
context: .
|
| 64 |
+
push: ${{ github.event_name != 'pull_request' }}
|
| 65 |
+
tags: ${{ steps.meta.outputs.tags }}
|
| 66 |
+
labels: ${{ steps.meta.outputs.labels }}
|
| 67 |
+
cache-from: type=gha
|
| 68 |
+
cache-to: type=gha,mode=max
|
data/database.db
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e92eb66c217748a240f5ce234d22798c1d19cdcd7f2d82497a1e18f7fb0a3897
|
| 3 |
+
size 126976
|
docker-compose.yml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version: '3.8'
|
| 2 |
+
|
| 3 |
+
services:
|
| 4 |
+
webui:
|
| 5 |
+
build: .
|
| 6 |
+
ports:
|
| 7 |
+
- "1455:1455"
|
| 8 |
+
environment:
|
| 9 |
+
- WEBUI_HOST=0.0.0.0
|
| 10 |
+
- WEBUI_PORT=1455
|
| 11 |
+
- DEBUG=0
|
| 12 |
+
- LOG_LEVEL=info
|
| 13 |
+
# 如果需要访问密码,可以在这里取消注释并设置
|
| 14 |
+
- WEBUI_ACCESS_PASSWORD=admin123
|
| 15 |
+
volumes:
|
| 16 |
+
# 挂载数据目录以持久化数据库和日志
|
| 17 |
+
- ./data:/app/data
|
| 18 |
+
- ./logs:/app/logs
|
| 19 |
+
restart: unless-stopped
|