- Added `auth.ts` for JWT authentication middleware. - Created `auth` route to handle authentication and token verification. - Integrated authentication middleware into `media.ts` for protected routes. - Updated `main.ts` to register the new authentication route.
30 lines
705 B
Bash
30 lines
705 B
Bash
#!/bin/bash
|
|
###
|
|
# @Date: 2025-06-13 16:11:38
|
|
# @LastEditors: 陈子健
|
|
# @LastEditTime: 2025-06-23 16:56:58
|
|
# @FilePath: /my-score/honoback/deploy.sh
|
|
###
|
|
|
|
# 服务器配置
|
|
SERVER="123.57.93.143"
|
|
USER="root"
|
|
REMOTE_DIR="/home/media-backend"
|
|
|
|
# 本地构建
|
|
echo "Building project..."
|
|
deno cache main.ts
|
|
|
|
# 创建远程目录
|
|
echo "Creating remote directory..."
|
|
ssh $USER@$SERVER "mkdir -p $REMOTE_DIR"
|
|
|
|
# 同步文件到服务器
|
|
echo "Syncing files to server..."
|
|
rsync -avz --exclude 'db/media.db' \
|
|
--exclude '.git' \
|
|
./ $USER@$SERVER:$REMOTE_DIR/
|
|
|
|
# 在服务器上安装依赖并重启服务
|
|
echo "Installing and starting systemd service..."
|
|
ssh $USER@$SERVER "systemctl restart my-score" |