Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 7 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
. $IDF_PATH/export.sh
VERSION="${GITHUB_REF_NAME}"

# Generate merged firmware for single-command flashing (includes SPIFFS)
# 生成单文件固件,方便一条命令直接刷入。
esptool.py --chip esp32s3 merge_bin \
--flash_mode qio \
--flash_size 16MB \
Expand All @@ -37,15 +37,13 @@ jobs:
0x0 build/bootloader/bootloader.bin \
0x8000 build/partition_table/partition-table.bin \
0xf000 build/ota_data_initial.bin \
0x20000 build/mimiclaw.bin \
0x420000 build/spiffs.bin
0x20000 build/mimiclaw.bin

# Copy individual binaries with version suffix
# 保留分开的固件文件,方便需要手动刷写的场景。
cp build/mimiclaw.bin "mimiclaw-${VERSION}.bin"
cp build/bootloader/bootloader.bin "bootloader-${VERSION}.bin"
cp build/partition_table/partition-table.bin "partition-table-${VERSION}.bin"
cp build/ota_data_initial.bin "ota_data_initial-${VERSION}.bin"
cp build/spiffs.bin "spiffs-${VERSION}.bin"

- name: Create Release
uses: softprops/action-gh-release@v2
Expand All @@ -69,28 +67,16 @@ jobs:
0x0 bootloader-${{ github.ref_name }}.bin \
0x8000 partition-table-${{ github.ref_name }}.bin \
0xf000 ota_data_initial-${{ github.ref_name }}.bin \
0x20000 mimiclaw-${{ github.ref_name }}.bin \
0x420000 spiffs-${{ github.ref_name }}.bin
0x20000 mimiclaw-${{ github.ref_name }}.bin
```

### 3. OTA update (for devices already running MimiClaw)
### 3. 固件行为

Upload `mimiclaw-${{ github.ref_name }}.bin` via the OTA endpoint.

### 4. First-time setup

After flashing, connect via serial (115200 baud) and configure:

```
wifi <ssid> <password>
tg_token <your-telegram-bot-token>
api_key <your-anthropic-api-key>
reboot
```
这是当前的 LLM MVP 固件。上电后会直接读取代码里的 WiFi 和 DeepSeek 配置,
自动联网、发起一次固定问题请求,并把结果打印到串口。
Comment on lines +73 to +76
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Blocker: tagged public releases can ship embedded WiFi/API secrets without an explicit safeguard.

The firmware behavior text now confirms config is read from code, but release builds still publish binaries that may contain plaintext credentials (main/mvp_config.h:1-36). This is an immediate secret-leak risk for any public tag release.

🔒 Proposed fix (release warning + CI guard)
       - name: Build firmware
         shell: bash
         run: |
           . $IDF_PATH/export.sh
+          # Block public release if obvious real secrets are still hardcoded in MVP config.
+          grep -Eq 'MVP_LLM_API_KEY\s+"sk-[^"]+"' main/mvp_config.h && {
+            echo "::error::Hardcoded DeepSeek API key detected in main/mvp_config.h. Replace with placeholder before tagging a release."
+            exit 1
+          }
           idf.py set-target esp32s3
           idf.py build
@@
-            ### 3. 固件行为
+            ### 3. 固件行为
 
             这是当前的 LLM MVP 固件。上电后会直接读取代码里的 WiFi 和 DeepSeek 配置,
             自动联网、发起一次固定问题请求,并把结果打印到串口。
+
+            > ⚠️ 安全提示:该 MVP 从编译期宏读取配置。请勿发布包含真实 WiFi 密码或 API Key 的固件。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 73 - 76, The release workflow
currently allows tagged public releases that may embed plaintext secrets from
the firmware config (referenced by main/mvp_config.h); add a CI guard to
block/tagged releases when hardcoded secrets are present and surface a clear
warning in the release job. Specifically, update the release workflow job (the
release workflow step in release.yml) to run a lightweight preflight that scans
main/mvp_config.h for common secret patterns (SSID, PSK, API_KEY, secret-like
strings) and fail the job with an actionable error message if any are found;
additionally, modify the workflow to require an explicit override (e.g., a
dedicated release_secret_approval boolean input or required env var) before
allowing a tagged release to proceed so maintainers must consciously opt in to
releasing binaries that may include credentials.

files: |
mimiclaw-full-${{ github.ref_name }}.bin
mimiclaw-${{ github.ref_name }}.bin
bootloader-${{ github.ref_name }}.bin
partition-table-${{ github.ref_name }}.bin
ota_data_initial-${{ github.ref_name }}.bin
spiffs-${{ github.ref_name }}.bin
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Coding Standards
- 遵守注释规范:”.docs/嵌入式C Doxygen 注释规范.md“
Comment on lines +1 to +2
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix the referenced standards path.

”.docs/嵌入式C Doxygen 注释规范.md“ does not resolve to the file added in this PR, so agents/readers will miss the rule set.

📌 Suggested fix
 ## Coding Standards
-- 遵守注释规范:”.docs/嵌入式C Doxygen 注释规范.md“
+- 遵守注释规范:`docs/嵌入式C Doxygen 注释规范.md`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` around lines 1 - 2, The referenced standards path in AGENTS.md is
incorrect; replace the string ”.docs/嵌入式C Doxygen 注释规范.md“ with the actual
filename added in this PR (match the repo file name exactly, e.g.,
.docs/嵌入式C_Doxygen_注释规范.md or the precise added path) so readers can resolve the
rule set; update the AGENTS.md entry accordingly and verify the link opens the
file in the repo browser.

3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@ cmake_minimum_required(VERSION 3.16)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(mimiclaw)

# Pre-flash a valid SPIFFS image so first boot does not need runtime formatting.
spiffs_create_partition_image(spiffs spiffs_data FLASH_IN_PROJECT)
59 changes: 0 additions & 59 deletions CONTRIBUTING.md

This file was deleted.

Loading