From 2d017b0178b5a20bc0c449fc04b77142cc70a373 Mon Sep 17 00:00:00 2001 From: iLay Date: Fri, 6 Dec 2024 20:44:05 +0800 Subject: [PATCH] fix decrypt --- .github/workflows/docker-build.yml | 45 ++++++++++++++-- Dockerfile | 4 +- README.md | 85 ++++++++---------------------- nuxt.config.ts | 7 +++ pages/index.vue | 2 +- utils/decode.ts | 5 +- 6 files changed, 77 insertions(+), 71 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index bef78aa..f62ad7a 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -7,6 +7,10 @@ on: pull_request: branches: - main +permissions: + contents: read + pages: write + id-token: write jobs: build: @@ -19,6 +23,41 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v2 + - name: Detect package manager + id: detect-package-manager + run: | + if [ -f "${{ github.workspace }}/yarn.lock" ]; then + echo "manager=yarn" >> $GITHUB_OUTPUT + echo "command=install" >> $GITHUB_OUTPUT + exit 0 + elif [ -f "${{ github.workspace }}/package.json" ]; then + echo "manager=npm" >> $GITHUB_OUTPUT + echo "command=ci" >> $GITHUB_OUTPUT + exit 0 + else + echo "Unable to determine package manager" + exit 1 + fi + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: ${{ steps.detect-package-manager.outputs.manager }} + + - uses: actions/cache@v4 + id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' + with: + path: ${{ steps.npm-cache-dir.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install dependencies + run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} + + - name: Static HTML export with Nuxt + run: ${{ steps.detect-package-manager.outputs.manager }} run build + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -28,12 +67,12 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ github.token }} - + - name: set lower case owner name run: | echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV} env: - OWNER: '${{ github.repository_owner }}' + OWNER: "${{ github.repository_owner }}" - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -51,4 +90,4 @@ jobs: tags: ghcr.io/${{ env.OWNER_LC }}/alipan-tv-token:latest - name: Post build cleanup - run: docker builder prune --force \ No newline at end of file + run: docker builder prune --force diff --git a/Dockerfile b/Dockerfile index 4f9f648..62a0327 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ COPY package*.json ./ RUN bun install # 复制项目文件到工作目录 -COPY . . +COPY ./.output/* ./ # 构建项目(如果需要) RUN bun run build @@ -21,4 +21,4 @@ RUN bun run build EXPOSE 3000 # 启动应用 -CMD ["bun","run", "start"] \ No newline at end of file +CMD ["bun","server/index.mjs"] \ No newline at end of file diff --git a/README.md b/README.md index 25b5821..164c587 100644 --- a/README.md +++ b/README.md @@ -1,75 +1,36 @@ -# Nuxt Minimal Starter +# 阿里云盘TV版token获取与刷新 -Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. +## 路由: -## Setup +- `/` 在线扫码 +- `/refresh` 刷新令牌 -Make sure to install dependencies: -```bash -# npm -npm install -# pnpm -pnpm install - -# yarn -yarn install - -# bun -bun install +# Docker部署教程 +``` +docker run --name=alipan-tv-token -d -p 3000:3000 ghcr.io/ilay1678/alipan-tv-token:latest ``` -## Development Server +# vercel部署 +[Deploy on vercel](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FiLay1678%2Falipan-tv-token&&project-name=alipan-tv-token&repository-name=alipan-tv-token) -Start the development server on `http://localhost:3000`: +# Cloudflare Pages 部署教程 -```bash -# npm -npm run dev +## 1. Fork 项目仓库 -# pnpm -pnpm dev +1. 点击右上角的 "Fork" 按钮创建你自己的副本 -# yarn -yarn dev +## 2. 在 Cloudflare 中部署 -# bun -bun run dev -``` +### 2.1 前置准备 +1. 登录 [Cloudflare Dashboard](https://dash.cloudflare.com) +2. 在左侧菜单找到并点击 "Pages" +3. 点击 "连接到 Git" 按钮 +4. 按提示关联你的 GitHub 账号 -## Production - -Build the application for production: - -```bash -# npm -npm run build - -# pnpm -pnpm build - -# yarn -yarn build - -# bun -bun run build -``` - -Locally preview production build: - -```bash -# npm -npm run preview - -# pnpm -pnpm preview - -# yarn -yarn preview - -# bun -bun run preview -``` - -Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. +### 2.2 创建项目 +1. 选择你刚才 fork 的仓库 +2. 点击 "开始设置" +3. 在项目配置页面: + - 框架预设: 选择 `Nuxt.js` diff --git a/nuxt.config.ts b/nuxt.config.ts index 015f3de..e4f06bd 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -26,6 +26,13 @@ export default defineNuxtConfig({ // 启用内联样式以避免闪烁 build: { cssCodeSplit: false + }, + css: { + preprocessorOptions: { + scss: { + api: 'modern-compiler' // or "modern" + } + } } }, diff --git a/pages/index.vue b/pages/index.vue index cc52897..01e02d6 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -95,7 +95,7 @@