Skip to content

Commit fed730d

Browse files
authored
[Fix] Fix incorrect env var name and update for security (#17799)
* Fix env name * Fix for more secure settings * Fix .env * Add security notice
1 parent 19b0087 commit fed730d

5 files changed

Lines changed: 47 additions & 56 deletions

File tree

skills/.env.example

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,36 @@
11
# ============================================
22
# PaddleOCR Skills Configuration
33
# ============================================
4-
# Copy this file to .env and fill in your configuration
4+
# Copy this file to .env and fill in your configuration.
55
# This is a single shared template for all PaddleOCR skills in this repository.
66
# Get your API credentials at: https://paddleocr.com
77

88
# ============================================
9-
# Text Recognition Configuration
9+
# Shared Configuration
1010
# ============================================
1111

12-
# API URL (full address, including /ocr)
13-
# Example: PADDLEOCR_OCR_API_URL=https://example.aistudio-app.com/ocr
14-
PADDLEOCR_OCR_API_URL=
15-
16-
# Access Token (plain token string, shared between skills)
12+
# Access token (shared between skills)
1713
# Example: PADDLEOCR_ACCESS_TOKEN=your_access_token_here
1814
PADDLEOCR_ACCESS_TOKEN=
1915

2016
# ============================================
21-
# Document Parsing Configuration
22-
# ============================================
23-
# Advanced document parsing with layout analysis
24-
# Get your API credentials at: https://paddleocr.com
25-
26-
# Document Parsing API URL (full endpoint address)
27-
# Example: PADDLEOCR_DOC_PARSING_API_URL=https://xxxxx.aistudio-app.com/layout-parsing
28-
PADDLEOCR_DOC_PARSING_API_URL=
29-
30-
# ============================================
31-
# Optional: Text Recognition Configuration
17+
# Text Recognition Configuration
3218
# ============================================
3319

34-
# Request timeout (milliseconds, default 25000)
35-
# PADDLEOCR_OCR_TIMEOUT=25000
20+
# API URL (get the full URL from the PaddleOCR website)
21+
# Example: PADDLEOCR_OCR_API_URL=https://example.aistudio-app.com/ocr
22+
PADDLEOCR_OCR_API_URL=
3623

37-
# Log level (DEBUG/INFO/WARNING/ERROR, default INFO)
38-
# PADDLEOCR_LOG_LEVEL=INFO
24+
# Request timeout in seconds (default 120)
25+
# PADDLEOCR_OCR_TIMEOUT=120
3926

4027
# ============================================
41-
# Optional: Document Parsing Configuration
28+
# Document Parsing Configuration
4229
# ============================================
4330

44-
# Request timeout (seconds, default 120)
45-
# PADDLEOCR_DOC_PARSING_TIMEOUT=120
46-
47-
# Log level (DEBUG/INFO/WARNING/ERROR, default INFO)
48-
# PADDLEOCR_PARSING_LOG_LEVEL=INFO
31+
# API URL (get the full URL from the PaddleOCR website)
32+
# Example: PADDLEOCR_DOC_PARSING_API_URL=https://example.aistudio-app.com/layout-parsing
33+
PADDLEOCR_DOC_PARSING_API_URL=
4934

50-
# Max file size for local files (MB, default 20)
51-
# Increase this if you need to process larger files locally
52-
# Note: For very large files, consider using --file-url instead
53-
# PADDLEOCR_PARSING_MAX_FILE_SIZE_MB=20
35+
# Request timeout in seconds (default 600)
36+
# PADDLEOCR_DOC_PARSING_TIMEOUT=600

skills/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ After installation, configure the required environment variables so the skills c
6363

6464
| Skill | Required | Optional |
6565
| --- | --- | --- |
66-
| `paddleocr-text-recognition` | `PADDLEOCR_OCR_API_URL` (API URL), `PADDLEOCR_ACCESS_TOKEN` (access token) | `PADDLEOCR_OCR_TIMEOUT` (timeout) |
67-
| `paddleocr-doc-parsing` | `PADDLEOCR_DOC_PARSING_API_URL` (API URL), `PADDLEOCR_ACCESS_TOKEN` (access token) | `PADDLEOCR_DOC_PARSING_TIMEOUT` (timeout) |
66+
| `paddleocr-text-recognition` | `PADDLEOCR_OCR_API_URL` (API URL), `PADDLEOCR_ACCESS_TOKEN` (access token) | `PADDLEOCR_OCR_TIMEOUT` (API request timeout) |
67+
| `paddleocr-doc-parsing` | `PADDLEOCR_DOC_PARSING_API_URL` (API URL), `PADDLEOCR_ACCESS_TOKEN` (access token) | `PADDLEOCR_DOC_PARSING_TIMEOUT` (API request timeout) |
6868

69-
You can ask the AI in natural language (e.g., "I need to configure paddleocr-text-recognition skill"), or configure manually. Below are manual configuration methods for some AI apps:
69+
Below are configuration methods for some AI apps:
7070

7171
- **Claude Code**: add an `env` field to `.claude/settings.local.json` in your project:
7272

@@ -105,6 +105,8 @@ You can ask the AI in natural language (e.g., "I need to configure paddleocr-tex
105105
}
106106
```
107107

108+
Please note that this approach may store the access token in plain text in the configuration file. A more secure way is to configure it through the OpenClaw onboarding wizard or the dashboard.
109+
108110
### Usage Examples
109111

110112
After configuration, describe the OCR or document parsing task in natural language and provide a file URL or local path so the AI app can invoke the corresponding skill.

skills/README_cn.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ git clone https://github.com/PaddlePaddle/PaddleOCR.git
6363

6464
| Skill | 必填 | 可选 |
6565
| --- | --- | --- |
66-
| `paddleocr-text-recognition` | `PADDLEOCR_OCR_API_URL`(API URL)、`PADDLEOCR_ACCESS_TOKEN`(access token) | `PADDLEOCR_OCR_TIMEOUT`超时时间|
67-
| `paddleocr-doc-parsing` | `PADDLEOCR_DOC_PARSING_API_URL`(API URL)、`PADDLEOCR_ACCESS_TOKEN`(access token) | `PADDLEOCR_DOC_PARSING_TIMEOUT`超时时间|
66+
| `paddleocr-text-recognition` | `PADDLEOCR_OCR_API_URL`(API URL)、`PADDLEOCR_ACCESS_TOKEN`(access token) | `PADDLEOCR_OCR_TIMEOUT`API 请求超时时间|
67+
| `paddleocr-doc-parsing` | `PADDLEOCR_DOC_PARSING_API_URL`(API URL)、`PADDLEOCR_ACCESS_TOKEN`(access token) | `PADDLEOCR_DOC_PARSING_TIMEOUT`API 请求超时时间|
6868

69-
可以直接用自然语言告诉 AI(例如:”我需要配置 paddleocr-text-recognition skill”),也可以手动配置。以下是部分 AI 应用的手动配置方式
69+
以下是部分 AI 应用的配置方式
7070

7171
- **Claude Code**:在项目的 `.claude/settings.local.json` 中添加 `env` 字段:
7272

@@ -105,6 +105,8 @@ git clone https://github.com/PaddlePaddle/PaddleOCR.git
105105
}
106106
```
107107

108+
请注意这种方式可能在配置文件中明文存储 access token。更安全的方式是通过 OpenClaw onboarding wizard 或者 dashboard 配置。
109+
108110
### 使用示例
109111

110112
配置完成后,可以直接用自然语言描述 OCR 或文档解析需求,并附上文件 URL 或本地路径,让 AI 应用调用对应 skill。以下是部分提示词示例:

skills/paddleocr-doc-parsing/SKILL.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,19 +209,21 @@ PADDLEOCR_DOC_PARSING_API_URL not configured. Get your API at: https://paddleocr
209209

210210
1. **Show the exact error message** to the user (including the URL).
211211

212-
2. **Explain which environment variables are required**:
213-
```
214-
Configure these values in the host application, runtime environment, or another appropriate config file:
215-
- PADDLEOCR_DOC_PARSING_API_URL
216-
- PADDLEOCR_ACCESS_TOKEN
217-
- Optional: PADDLEOCR_DOC_PARSING_TIMEOUT
218-
```
219-
220-
3. **If the user provides credentials in chat** (accept any reasonable format):
212+
2. **Guide the user to configure securely**:
213+
- Recommend configuring through the host application's standard method (e.g., settings file, environment variable UI) rather than pasting credentials in chat.
214+
- List the required environment variables:
215+
```
216+
- PADDLEOCR_DOC_PARSING_API_URL
217+
- PADDLEOCR_ACCESS_TOKEN
218+
- Optional: PADDLEOCR_DOC_PARSING_TIMEOUT
219+
```
220+
221+
3. **If the user provides credentials in chat anyway** (accept any reasonable format):
221222
- `PADDLEOCR_DOC_PARSING_API_URL=https://xxx.paddleocr.com/layout-parsing, PADDLEOCR_ACCESS_TOKEN=abc123...`
222223
- `Here's my API: https://xxx and token: abc123`
223224
- Copy-pasted code format
224225
- Any other reasonable format
226+
- **Security note**: Warn the user that credentials shared in chat may be stored in conversation history. Recommend setting them through the host application's configuration instead when possible.
225227
226228
4. **Parse and validate the values**:
227229
- Extract `PADDLEOCR_DOC_PARSING_API_URL` (look for URLs with `paddleocr.com` or similar)

skills/paddleocr-text-recognition/SKILL.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
env:
1010
- PADDLEOCR_OCR_API_URL
1111
- PADDLEOCR_ACCESS_TOKEN
12-
- PADDLEOCR_TIMEOUT
12+
- PADDLEOCR_OCR_TIMEOUT
1313
bins:
1414
- python
1515
primaryEnv: PADDLEOCR_ACCESS_TOKEN
@@ -167,19 +167,21 @@ CONFIG_ERROR: PADDLEOCR_OCR_API_URL not configured. Get your API at: https://pad
167167

168168
1. **Show the exact error message** to the user (including the URL).
169169

170-
2. **Explain which environment variables are required**:
171-
```
172-
Configure these values in the host application, runtime environment, or another appropriate config file:
173-
- PADDLEOCR_OCR_API_URL
174-
- PADDLEOCR_ACCESS_TOKEN
175-
- Optional: PADDLEOCR_OCR_TIMEOUT
176-
```
170+
2. **Guide the user to configure securely**:
171+
- Recommend configuring through the host application's standard method (e.g., settings file, environment variable UI) rather than pasting credentials in chat.
172+
- List the required environment variables:
173+
```
174+
- PADDLEOCR_OCR_API_URL
175+
- PADDLEOCR_ACCESS_TOKEN
176+
- Optional: PADDLEOCR_OCR_TIMEOUT
177+
```
177178
178-
3. **If the user provides credentials in chat** (accept any reasonable format):
179+
3. **If the user provides credentials in chat anyway** (accept any reasonable format):
179180
- `PADDLEOCR_OCR_API_URL=https://xxx.paddleocr.com/ocr, PADDLEOCR_ACCESS_TOKEN=abc123...`
180181
- `Here's my API: https://xxx and token: abc123`
181182
- Copy-pasted code format
182183
- Any other reasonable format
184+
- **Security note**: Warn the user that credentials shared in chat may be stored in conversation history. Recommend setting them through the host application's configuration instead when possible.
183185
184186
4. **Parse and validate the values**:
185187
- Extract `PADDLEOCR_OCR_API_URL` (look for URLs with `paddleocr.com` or similar)

0 commit comments

Comments
 (0)