RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/NoDeskAI/browser-pilot

Cursor rule

.cursor/rules/env-vars.mdc

环境变量管理规范 — 新增/修改环境变量时需同步更新的文件清单和读取机制

Cursor rules

Quality

63/100

Scores the file, not the repository.

Length

443 words

5 headings · 0 code blocks

Repository

34

— · pushed 25 days ago

Last changed

3 days ago

First indexed 3 days ago.
NoDeskAI/browser-pilot/.cursor/rules/env-vars.mdcRawGitHub
1---
2description: 环境变量管理规范 — 新增/修改环境变量时需同步更新的文件清单和读取机制
3alwaysApply: true
4---
5 
6# 环境变量管理
7 
8## 读取机制
9 
10项目有两种读取方式,新增变量时必须选对:
11 
12| 方式 | 用法 | `.env` 文件生效? | 场景 |
13|------|------|-------------------|------|
14| `config._env(key, default)` | 先读 `.env` 文件,再 `os.environ`,再 default | 是(直接解析) | **首选**,用于所有业务配置 |
15| `os.environ.get(key, default)` | 仅读环境变量 | 仅通过 `start.sh`(`set -a; source .env`)或 `docker-compose env_file` 间接生效 | 仅用于基础设施级配置(如 `LOG_LEVEL`) |
16 
17**规则:新增环境变量优先使用 `config._env()`**,除非变量在 `config.py` 导入之前就需要读取(如 logging 初始化)。
18 
19## 新增/修改环境变量的检查清单
20 
21每次新增或修改环境变量时,必须同步更新以下文件:
22 
231. **`.env.example`** — 添加变量和中文说明;敏感生产值只能作为本地 `.env` 配置,不能写入仓库
242. **`README.md` Configuration 表** — 添加变量、默认值、英文描述
253. **`backend/app/config.py`** — 使用 `_env()` 读取(如适用)
26 
27如果变量影响 Docker 部署:
284. **`docker-compose.yml`** — `environment` 或 `args` 中引用
29 
30## 当前变量全景
31 
32| 变量 | 读取位置 | 默认值 | 用途 |
33|------|----------|--------|------|
34| `DATABASE_URL` | config.py | 无代码默认;从 `.env` / 环境变量读取,`.env.example` 仅提供本地开发示例 | 数据库连接 |
35| `DOCKER_HOST_ADDR` | config.py | `localhost` | 后端访问浏览器容器地址 |
36| `API_BASE_URL` | config.py | `http://localhost:8000` | 内置存储文件 URL 前缀 |
37| `PLATFORM_JWT_SECRET` | config.py | 降级为 `JWT_SECRET` | Platform 管理端独立 JWT 签名密钥 |
38| `OPENAI_API_KEY` | auto_name.py | (空) | Session 自动命名 |
39| `LOG_LEVEL` | logging_config.py | `INFO` | 日志级别 |
40| `APP_TITLE` | config.py | `Browser Pilot` | 品牌名称 |
41| `CLI_COMMAND_NAME` | config.py | `bpilot` | CLI 命令名 |
42| `CLI_INSTALL_COMMAND` | config.py | `pip install bpilot-cli` | CLI 安装命令 |
43| `CONTAINER_PREFIX` | config.py | `bp` | Docker 容器名前缀 |
44| `SELENIUM_IMAGE_NAME` | config.py | `browser-pilot-selenium` | Selenium 镜像名 |
45| `SELENIUM_BASE_IMAGE` | docker-compose.yml | `selenium/standalone-chrome:latest` | Selenium 基础镜像(构建参数) |
46| `NETWORK_EGRESS_DOCKER_NETWORK` | config.py | `browser-pilot-net` | 浏览器容器和托管网络出口容器共用的 Docker 网络 |
47| `NETWORK_EGRESS_CONFIG_DIR` | config.py | `data/network-egress` | 托管 Clash/OpenVPN 出口配置目录 |
48| `NETWORK_EGRESS_CLASH_IMAGE` | config.py | `ghcr.io/metacubex/mihomo:latest` | 托管 Clash 出口镜像 |
49| `NETWORK_EGRESS_CLASH_PROXY_PORT` | config.py | `7890` | 托管 Clash 内部代理端口 |
50| `NETWORK_EGRESS_OPENVPN_IMAGE` | config.py | `browser-pilot-openvpn-egress:latest` | 托管 OpenVPN 出口镜像 |
51| `NETWORK_EGRESS_OPENVPN_PROXY_PORT` | config.py | `8888` | 托管 OpenVPN 内部 HTTP 代理端口 |
52| `POSTGRES_USER` | docker-compose.yml/start.sh | 无 Compose/start.sh 默认;从 `.env` / 环境变量读取,`.env.example` 仅提供本地开发示例 | PG 用户名 |
53| `POSTGRES_PASSWORD` | docker-compose.yml/start.sh | 无 Compose/start.sh 默认;从 `.env` / 环境变量读取,`.env.example` 仅提供本地开发示例 | PG 密码 |
54| `POSTGRES_DB` | docker-compose.yml/start.sh | 无 Compose/start.sh 默认;从 `.env` / 环境变量读取,`.env.example` 仅提供本地开发示例 | PG 数据库名 |
55| `MINIO_STORAGE_BOOTSTRAP` | config.py/docker-compose.yml/start.sh | Docker Compose/start.sh 设为 `true` | 是否在首次 DB 初始化或旧空 S3 配置修复时预置内置 S3 兼容存储 |
56| `MINIO_ROOT_USER` | config.py/docker-compose.yml/start.sh | 无 Compose/start.sh 默认;从 `.env` / 环境变量读取,`.env.example` 仅提供本地开发示例 | 内置 S3 兼容对象存储 root 用户名 |
57| `MINIO_ROOT_PASSWORD` | config.py/docker-compose.yml/start.sh | 无 Compose/start.sh 默认;从 `.env` / 环境变量读取,`.env.example` 仅提供本地开发示例 | 内置 S3 兼容对象存储 root 密码 |
58| `MINIO_BUCKET` | config.py/docker-compose.yml/start.sh | 无 Compose/start.sh 默认;从 `.env` / 环境变量读取,`.env.example` 仅提供本地开发示例 | 内置 S3 兼容对象存储默认 bucket |
59| `MINIO_ENDPOINT` | config.py/docker-compose.yml/start.sh | 本地 `http://localhost:9000`;Docker Compose backend 覆盖为容器内对象存储地址 | 后端访问内置 S3 兼容对象存储的 endpoint |
60 
61## 数据库密码规则
62 
63- `backend/app/config.py` 和 `docker-compose.yml` 禁止硬编码数据库密码或含固定密码的 `DATABASE_URL`。
64- 本地开发示例值只放在 `.env.example`;真实部署必须复制到 `.env` 后修改。
65 

Commands it names

  • docker-compose env_file
  • docker-compose.yml
  • pip install bpilot-cli

Sections

  • 环境变量管理
  • 读取机制
  • 新增/修改环境变量的检查清单
  • 当前变量全景
  • 数据库密码规则

What it covers

setup

Stack — with the evidence

docker

(1.00)

python

(0.80)

node

(0.70)

vue

(0.70)

fastapi

(0.70)

postgres

(0.70)

tailwind

(0.70)

vite

(0.70)

aws

(0.70)

typescript

(0.60)

javascript

(0.50)

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
NoDeskAI
Language
—
License
—
Archived
no

All configs in this repo

Also in NoDeskAI/browser-pilot

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
NoDeskAI/browser-pilot.cursor/rules/build-from-user-perspective.mdc · 34Cursor rulesdockernode+9buildsecurity51/1003 days ago
NoDeskAI/browser-pilot.cursor/rules/debug-container.mdc · 34Cursor rulesdockerpython+9api65/1003 days ago
NoDeskAI/browser-pilot.cursor/rules/deploy.mdc · 34Cursor rulesdockerpython+9no sections38/1003 days ago
NoDeskAI/browser-pilot.cursor/rules/fingerprint-popover-sync.mdc · 34Cursor rulesdockerpython+9no sections25/1003 days ago
NoDeskAI/browser-pilot.cursor/rules/keyboard-shortcuts-ux.mdc · 34Cursor rulesdockerpython+9ui31/1003 days ago
NoDeskAI/browser-pilot.cursor/rules/plan-ui-summary.mdc · 34Cursor rulesdockerpython+9ui54/1003 days ago
NoDeskAI/browser-pilot.cursor/rules/tailwind-css-color-mix.mdc · 34Cursor rulesdockerpython+9ui50/1003 days ago
NoDeskAI/browser-pilot.cursor/rules/ux-ui-daynight.mdc · 34Cursor rulesdockerpython+9lint-formatui54/1003 days ago
NoDeskAI/browser-pilot.cursor/rules/verify-before-claim.mdc · 34Cursor rulesdockerpython+9no sections50/1003 days ago
Diff against .cursor/rules/build-from-user-perspective.mdc Diff against .cursor/rules/debug-container.mdc Diff against .cursor/rules/deploy.mdc Diff against .cursor/rules/fingerprint-popover-sync.mdc Diff against .cursor/rules/keyboard-shortcuts-ux.mdc Diff against .cursor/rules/plan-ui-summary.mdc Diff against .cursor/rules/tailwind-css-color-mix.mdc Diff against .cursor/rules/ux-ui-daynight.mdc Diff against .cursor/rules/verify-before-claim.mdc

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack