diff --git a/$user/lsd/config.yaml b/$user/lsd/config.yaml new file mode 100644 index 0000000..f7ec6f1 --- /dev/null +++ b/$user/lsd/config.yaml @@ -0,0 +1,73 @@ +# ========== 经典模式 ========== +# 如果为 true,不使用任何颜色或图标,与标准 ls 行为类似 +classic: false + +# ========== 分块(Blocks) ========== +# 定义每行显示哪些信息块,按顺序排列 +blocks: + - permission # 文件权限 (rwxr-xr-x) + - user # 文件所有者 + - group # 用户组 + - size # 文件大小 + - date # 日期/时间 + - name # 文件名(必须包含) + +# ========== 颜色主题 ========== +color: + # 何时使用颜色:always(总是)、auto(自动)、never(从不) + when: auto + + # 自定义文件类型颜色(覆盖默认值) + theme: custom + +# ========== 日期格式 ========== +date: "+%Y-%m-%d %H:%M:%S" # 可选:relative(相对时间)、iso(ISO格式) + +# ========== 跟随符号链接 ============ +dereference: false + +# ========== 图标 ========== +icons: + # 何时显示图标:always、auto、never + when: auto + + # 图标主题(需要对应的 Nerd Font) + theme: fancy # 或 unicode + + # 分隔符(图标与文件名之间的字符) + separator: " " + +# ========== 忽略选项 ========== +ignore-globs: + - "*.bak" # 忽略所有 .bak 文件 + - ".git" # 忽略 .git 目录 + - "__pycache__" # 忽略 Python 缓存 + +# ========== 布局 ========== +layout: grid # grid(网格)| tree(树状)| oneline(单行) + +# ========== 递归深度(--tree 时有效) ========== +recursion: + enabled: false + depth: 3 # 递归显示的最大深度 + +# ========== 排序 ========== +sorting: + column: name # 排序字段:name、size、time、version、extension + # reverse: false # 是否倒序 + # dir-grouping: first # 目录排序:first(靠前)、last(靠后)、none + +# ========== 符号链接 ========== +# 是否显示符号链接的目标路径 +no-symlink: false +symlink-arrow: " ➜ " + +# ========== 总大小 ========== +total-size: false # 是否显示总大小(在目录底部) + +# ========== 截断所有者名 ========== +truncate-owner: + after: 8 # 用户名超过多少字符截断 + +# ========== 超链接 ========== +hyperlink: never # always | auto | never 是否生成终端超链接 diff --git a/$user/lsd/ colors.yaml b/$user/lsd/ colors.yaml new file mode 100644 index 0000000..f9d8a06 --- /dev/null +++ b/$user/lsd/ colors.yaml @@ -0,0 +1,32 @@ +# 文件类型颜色 +file-type: + directory: + foreground: cyan + bold: true + symlink: + foreground: magenta + italic: true + executable: + foreground: green + bold: true + socket: + foreground: red + pipe: + foreground: yellow + block-device: + foreground: red + char-device: + foreground: yellow + +# 文件扩展名颜色(覆盖文件类型颜色) +extensions: + rs: + foreground: white + bold: true + py: + foreground: yellow + js: + foreground: green + md: + foreground: cyan + italic: true diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..db72de2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,13 @@ +# 强制 LF 行尾(防止 Windows 工具引入 CRLF 导致 bash 报错) +* text=auto eol=lf + +# 显式标记常见脚本/配置类型 +*.sh eol=lf +*.bash eol=lf +*.py eol=lf +*.md eol=lf +*.yml eol=lf +*.yaml eol=lf +*.cfg eol=lf +*.example eol=lf +Dockerfile eol=lf diff --git a/.gitignore b/.gitignore index 0b3e541..fef6676 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,11 @@ # Docker相关 .env +*.env *.env.* +*.env.cfg.* docker-compose.override.yml + # 开发环境 .idea/ .vscode/ @@ -25,8 +28,15 @@ crontab/debug_*.py crontab/test_*.py crontab/test*.py g-b/* -.gitignore mcptime/go.sum mcpTimeServer/go.sum mcp_server_go/config.toml compare_images.py +env.cfg +env.cfg.* +stack.yml.* + +# 例外:env 模板(不视为敏感配置)允许提交 +!**/*.env.example +!**/*.env.cfg.example +!**/env.cfg.example diff --git a/AGENTS.md b/AGENTS.md index cbcb80b..0bb7f1f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,9 +7,9 @@ ``` / ├── stack.yml / compose.yml / .stack.yml / .yml # Docker Compose 文件 - ├── env.cfg # 环境变量(含敏感信息,应 gitignore) - ├── readme.md # 服务说明文档(可选) - └── config/ # 服务配置文件(可选) + ├── env.cfg.example # 环境变量(含敏感信息,应 gitignore) + ├── readme.md # 服务说明文档(可选) + └── config/ # 服务配置文件(可选) ``` 顶层目录按职责划分: @@ -132,6 +132,7 @@ docker compose -p <名称> --env-file ./builder/golang/env.cfg -f ./builder/gola - **国内镜像源**:Dockerfile 和 apt 配置默认使用国内 CDN 镜像(中科大、阿里云、华为),部署在其他地区需修改。 - **Portainer Docker 兼容性**:Portainer CE LTS < 2.36.0 不兼容 Docker >= 29.0.0,需设置 `DOCKER_MIN_API_VERSION=1.24`。详见 `portainer-ce/readme.md`。 - **i2c.py 需要硬件**:OLED 显示脚本需要树莓派 I2C 硬件、`adafruit_ssd1306` 库和中文字体(`fonts-wqy-microhei`)。 +- **shell 脚本禁用 CRLF**:仓库根目录的 `.gitattributes` 已强制 `*.sh` / `*.bash` / `*.py` / `*.md` / `*.yml` / `*.cfg` 等文本 LF 行尾。Windows 工具(IDE agent、记事本、PowerShell)默认写 CRLF,会导致 Linux 上 `'\r': 未找到命令` 和 `function xxx() {` 语法错误。**新建或修改脚本后必须 `file