music: 新建 music app,替换 piano-sheet
deploy cube / build-and-deploy (push) Successful in 1m10s
deploy music / build-and-deploy (push) Successful in 1m47s
deploy simpleasm / build-and-deploy (push) Successful in 1m20s

听歌 + 练琴曲目管理:
- 数据:piece (title/artist/category/lyrics/play_count/notes) + attachments (audio/video/pdf/image; image 带 role=chord/numbered/staff)
- 后端 axum + sqlite,附件流式落 PVC,ServeFile 支持 Range(视频拖动)
- 前端 guitar 风格 player:左 sidebar + tabs(歌词/吉他谱/简谱/五线谱/PDF/视频),LRC 同步、快捷键、笔记自动保存
- ns cube-music + music.famzheng.me + bodylimit 5GiB
- scripts/import_guitar.py 用于把 oci /data/guitar/ 旧曲库导入
This commit is contained in:
Fam Zheng
2026-05-09 22:36:14 +01:00
parent 58f344db85
commit 1a8f297302
30 changed files with 2683 additions and 1314 deletions
+123
View File
@@ -0,0 +1,123 @@
apiVersion: v1
kind: Namespace
metadata:
name: cube-music
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: music-data
namespace: cube-music
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
# video / audio 大附件 + 初始 guitar 曲库(~? GB),50Gi 起步
storage: 50Gi
# storageClassName 留空 → k3s 默认 local-path
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: music
namespace: cube-music
labels:
app: music
spec:
replicas: 1
strategy:
# PVC 是 RWOrolling 上线时新旧 pod 抢 PVC 会卡住,直接 Recreate
type: Recreate
selector:
matchLabels:
app: music
template:
metadata:
labels:
app: music
spec:
imagePullSecrets:
- name: registry-creds
containers:
- name: music
image: registry.famzheng.me/mochi/music:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
name: http
env:
- name: DB_PATH
value: /data/app.db
- name: BLOBS_DIR
value: /data/blobs
readinessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 1
periodSeconds: 5
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 5
periodSeconds: 15
resources:
requests:
cpu: 10m
memory: 32Mi
limits:
cpu: 1000m
memory: 512Mi
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: data
persistentVolumeClaim:
claimName: music-data
---
apiVersion: v1
kind: Service
metadata:
name: music
namespace: cube-music
spec:
selector:
app: music
ports:
- name: http
port: 80
targetPort: 8080
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: bodylimit
namespace: cube-music
spec:
buffering:
# 单文件最大 1GiBmain.rs 里 SINGLE_FILE_BYTES),multipart 总和留 5GiB 余量
maxRequestBodyBytes: 5368709120
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: music
namespace: cube-music
annotations:
traefik.ingress.kubernetes.io/router.middlewares: cube-music-bodylimit@kubernetescrd
spec:
ingressClassName: traefik
rules:
- host: music.famzheng.me
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: music
port:
number: 80