diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e433ef4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +.git +.gitignore +node_modules +dist +.idea +.vscode +.cursor +*.log +Dockerfile* +docker-compose*.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..a20ff33 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,43 @@ +name: Deploy To Server + +on: + push: + branches: [main, master] + workflow_dispatch: + +concurrency: + group: deploy-${{ github.ref }} + cancel-in-progress: true + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Deploy over SSH + env: + DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} + DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }} + DEPLOY_USER: ${{ secrets.DEPLOY_USER }} + DEPLOY_SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }} + DEPLOY_SSH_KNOWN_HOSTS: ${{ secrets.DEPLOY_SSH_KNOWN_HOSTS }} + DEPLOY_WORKDIR: ${{ secrets.DEPLOY_WORKDIR }} + run: | + set -eu + + mkdir -p ~/.ssh + chmod 700 ~/.ssh + printf '%s\n' "$DEPLOY_SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + printf '%s\n' "$DEPLOY_SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts + chmod 644 ~/.ssh/known_hosts + + SSH_PORT="${DEPLOY_PORT:-22}" + REMOTE_DIR="${DEPLOY_WORKDIR:-/opt/chat-one-web}" + + ssh -p "$SSH_PORT" "$DEPLOY_USER@$DEPLOY_HOST" < {!collapsed && ( - - ChatOne - + )} {sidebarContent} diff --git a/src/pages/login.tsx b/src/pages/login.tsx index 0294cf0..8c7926c 100644 --- a/src/pages/login.tsx +++ b/src/pages/login.tsx @@ -1,7 +1,8 @@ -import { Button, Input, Typography, message } from "antd"; +import { Button, Input, message } from "antd"; import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; import logoSrc from "../assets/logo.png"; +import logoTitleSrc from "../assets/logo-title.png"; import { ACCESS_TOKEN_KEY, persistTokens, @@ -14,6 +15,7 @@ import { tw } from "../utils/tw"; /** 发送验证码成功后,按钮冷却秒数 */ const SMS_RESEND_COOLDOWN_SEC = 60; const LOGO_SRC = logoSrc; +const LOGIN_TITLE_SRC = logoTitleSrc; /** 短信验证码登录页:校验本地 token、发送验证码、提交登录 */ export default function LoginPage() { @@ -127,18 +129,19 @@ export default function LoginPage() { > {contextHolder} - + + - - ChatOne - @@ -201,7 +204,7 @@ export default function LoginPage() { onClick={() => { void onLogin(); }} - className="mt-1 h-[42px] rounded-full border-0 bg-[#3b5ff7]" + className="mt-1 h-[42px] rounded-full border-0" > 登录