Showing posts with label github. Show all posts
Showing posts with label github. Show all posts

Friday, 24 October 2025

✨3-step rookie: auto-update BPB VPN | 新手仅需3步,BPB VPN自动更新

Step1️⃣ 🏗️ Create new GitHub repo

Name it whatever like "my-auto-update"


Step2️⃣ 📁 Add workflow file

Must use exact path:

.github/workflows/{yourFileName}.yml

Paste the YAML config we provided

```

name: 晨更作业cf wop


on:

  push:

    branches:

      - main

  schedule:

    - cron: "0 3 * * 1"  # 每周一凌晨3点 UTC 执行(北京时间周一上午11点)

  workflow_dispatch:

    inputs:

      force_update:

        description: '是否强制更新(忽略版本检查)'

        required: false

        default: 'false'


permissions:

  contents: write


jobs:

  update:

    runs-on: ubuntu-latest

    timeout-minutes: 30

    steps:

      - name: 检出代码

        uses: actions/checkout@v4


      - name: 设置 Node.js 环境

        uses: actions/setup-node@v4

        with:

          node-version: "latest"


      - name: 安装依赖

        run: |

          npm install -g javascript-obfuscator

          sudo apt-get update

          sudo apt-get install -y jq curl unzip wget


      - name: 环境变量设置

        run: |

          echo "REPO_URL=https://api.github.com/repos/bia-pain-bache/BPB-Worker-Panel/releases" >> $GITHUB_ENV

          echo "TARGET_FILE=worker.js" >> $GITHUB_ENV  # 调整为 worker.js 以匹配混淆逻辑;如果需要 zip,可修改为 worker.zip 并添加解压后混淆


      - name: 检查与更新 Worker

        id: update_worker

        env:

          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

        run: |

          set -e

          log() { echo "[$(date +'%Y-%m-%d %H:%M:%S')] $1"; }


          log "☀️ 清晨启程,检查更新中…"


          LOCAL_VERSION=$(cat version.txt 2>/dev/null || echo "")

          log "本地版本:${LOCAL_VERSION:-无}"


          log "请求最新 Release 信息…"

          RESPONSE=$(curl -s --retry 5 --retry-delay 2 --max-time 30 \

            -H "Authorization: token $GITHUB_TOKEN" \

            -H "Accept: application/vnd.github.v3+json" \

            "$REPO_URL")

          if [ $? -ne 0 ]; then

            log "❌ 无法访问 GitHub API"

            exit 1

          fi


          TAG_NAME=$(echo "$RESPONSE" | jq -r '.[0].tag_name')

          DOWNLOAD_URL=$(echo "$RESPONSE" | jq -r '.[0].assets[] | select(.name == "'"$TARGET_FILE"'") | .browser_download_url')


          if [ -z "$TAG_NAME" ] || [ "$TAG_NAME" = "null" ]; then

            log "❌ 获取版本号失败"

            exit 1

          fi


          if [ -z "$DOWNLOAD_URL" ] || [ "$DOWNLOAD_URL" = "null" ]; then

            # 备用下载方式:从 repo 下载文件(假设文件在 repo 根目录)

            DOWNLOAD_URL="https://github.com/bia-pain-bache/BPB-Worker-Panel/raw/${TAG_NAME}/${TARGET_FILE}"

            log "⚠️ 未找到 Release 资产,使用 raw 文件下载 URL: $DOWNLOAD_URL"

          fi


          log "最新版本:$TAG_NAME"


          FORCE_UPDATE="${{ github.event.inputs.force_update || 'false' }}"

          if [ "$LOCAL_VERSION" = "$TAG_NAME" ] && [ "$FORCE_UPDATE" != "true" ]; then

            log "✅ 已是最新版本,无需更新"

            exit 0

          fi


          log "⬇️ 下载 $TARGET_FILE…"

          wget -q --tries=5 --timeout=30 -O "origin.js" "$DOWNLOAD_URL"

          if [ $? -ne 0 ]; then

            log "❌ 下载失败"

            exit 1

          fi


          # 如果是 zip,添加解压(当前假设 js;如果 zip,取消注释并调整)

          # log "📦 解压中…"

          # unzip -o "origin.js" > /dev/null  # 实际为 zip 时改名

          # rm "origin.js"

          # mv worker.js origin.js  # 假设 zip 内有 worker.js


          log "🔒 混淆 JS 代码…"

          javascript-obfuscator origin.js --output _worker.js \

            --compact true \

            --identifier-names-generator hexadecimal \

            --rename-globals false \

            --string-array false \

            --transform-object-keys false \

            --self-defending false \

            --simplify true

          echo "// Auto obfuscated at $(date -u)" >> _worker.js

          rm origin.js


          echo "$TAG_NAME" > version.txt

          log "✨ 更新完成,当前版本:$TAG_NAME"


          echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT


      - name: 提交同步结果

        if: success()

        uses: stefanzweifel/git-auto-commit-action@v5

        with:

          commit_message: "🔄 自动同步 Worker 版本: ${{ steps.update_worker.outputs.tag_name }}"

          commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"

```


Step3️⃣ 🚀 Let magic happen

GitHub Actions auto-triggers

Monitors source repo changes

Completes Build & Deploy automatically


💡 Tech highlights:

✅ Webhook auto-monitoring

✅ CI/CD pipeline

✅ Real-time GitHub sync

✅ Zero manual operation


Result preview👉

Every time source updates

Your VPS auto-pulls latest code

Runs Build Script for new version

Totally hands-free!




Step1️⃣ 🏗️ 新建GitHub仓库

创建你的专属代码库 Repository

命名超随意~比如"my-auto-update"


Step2️⃣ 📁 创建Workflow文件

路径必须严格按:

.github/workflows/{你的文件名}.yml

复制提供的YAML配置 一键粘贴就行


Step3️⃣ 🚀 坐等自动化执行

GitHub Actions自动触发

实时监控源Repo更新

自动完成Build & Deploy


💡 核心科技:

✅ Webhook自动监听

✅ CI/CD无缝衔接

✅ 实时同步GitHub源

✅ 完全告别手动操作


效果预览👉

每次源仓库更新

你的VPS都会自动拉取最新代码

执行Build Script生成新版本

全程无需人工干预!


Referencing this/参考了这个 https://github.com/DuolaD/BPB-Auto-update-and-obfuscate/blob/main/.github/workflows/update_worker.yml

Sunday, 11 May 2025

GitHub 代码速懂?DeepWiki 免费用 - Understand GitHub Code Instantly? DeepWiki Free to Use

免费又好用,GitHub 仓库轻松懂!- Free and easy, GitHub repos at your fingertips!



还在为看 GitHub 项目文档挠破头皮吗?那代码迷宫,绕进去就出不来?甭愁啦!救星闪亮登场——它就是 Devin AI 东家 Cognition AI 团队倾情奉献的 DeepWiki!这玩意儿啊,专治各种看不懂、学不快, GitHub 仓库秒变贴心小棉袄,关键是:完全免费,操作简单到起飞!


DeepWiki 是个啥宝贝

简单说,它就是个 GitHub 仓库的“AI翻译官+导游”,把天书代码变成咱看得懂、聊得来、玩得转的交互文档。新手上路?大神赶时间?统统拿下!


咋用?三步走,比把大象放冰箱还简单


乾坤大挪移:GitHub 仓库链接里的 "github.com" 咻的一下改成 "deepwiki.com"。比如: https://github.com/some/repo 就变成 https://deepwiki.com/some/repo 或者,直接上官网 https://deepwiki.com/ 搜仓库大名或“作者/仓库名”。

一眼看穿:技术栈、依赖关系、代码结构图,清清楚楚,明明白白。

AI陪聊:页面底下有个聊天框,代码有啥不明白的,尽管问!那个“Deep Research”一般不用点,慢吞吞,答案也差不多。


实例帮你秒懂

你要是下载了 ComfyUI 和 ComfyUI Manager,想在 ComfyUI 里用 ComfyUI-Fluxtapoz,直接问 AI 助手:“我装了 ComfyUI 和 ComfyUI Manager,咋在 ComfyUI 里用 ComfyUI-Fluxtapoz 啊?” 详细步骤立马呈上。


想用 Express.js 和本地 Ollama 搭个简单的本地聊天工具,在 Mac 终端或 Postman 里跑,不用界面。就在 DeepWiki 的 Express.js 页面底部问 AI:“咋用 Express.js 和本地 Ollama 做个简单的本地聊天工具,在 Mac 终端或 Postman 里跑,不用界面呢?” AI 马上给你整出详细方案。


总结一句:

DeepWiki,GitHub 探险好伴侣!文档自动生成,图表直观易懂,AI 随时答疑。甭管你是小白还是老司机,想快速摸清一个 GitHub 仓库的底细,用它,准没错!省时省力,效率“嗖嗖”往上涨!


Tuesday, 3 December 2024

Claude's God-Level Prompt? Claude's Secret Sauce - Claude 的神级提示词?Claude的秘密武器

Make your Claude smarter, faster, and oh-so-thoughtful! - 让Claude不仅聪明,还能帮你动脑!

Have you ever felt like your AI assistant was just going through the motions? Well, my friend, I've got some electrifying news. A new prompt has emerged that's about to turn Claude into a supercharged language model. It's like giving your AI a rocket booster!

This nifty little thing can seriously supercharge Claude's output. It's not just about getting better answers, but also getting a peek into Claude's thinking process. It's like peeking behind the curtain of the wizardry that goes on in there.

Now, let's talk about how to get our hands on this secret sauce. There are two ways. The first is to install a plugin. You can do it right on Chrome. But if you're like me and always in a hurry, the second method is the way to go. We'll be using the prompt word document.

Head over to its Github page. Dig into the model_instructions folder and find the latest.md file. Let's say it's "v5.1-extensive-20241201.md". Open it up and copy all that good stuff.

Then, log into your Claude account. In the dialog box, click on Choose style. Next, pick Create & Edit Styles and then smash that Create Custom Style button. Instead of the regular option, choose "Use custom instructions (advanced)". On the right side, paste the content from the.md file you copied earlier and hit Create Style. Now, click Options, select Rename Style and give your new style a cool name. If you change your mind, you can even Delete style. Once you've named it, click Use Style and voila! You're all set.

Now you can start asking questions and watch as Claude works its new and improved magic. But here's the thing, some might say it's a bit of a cheat. Is it really fair to give Claude this extra boost? Or is it just us being smart users, making the most of the tools available? That's a debate for another day. For now, let's just enjoy the enhanced experience and see where this new prompt takes us in our conversations with Claude.