Files
download/CLAUDE.md
耗子 758e1c8799
All checks were successful
Generate Checksums / checksums (push) Successful in 46s
feat: 清理提交
2026-01-31 07:03:45 +08:00

69 lines
2.4 KiBLFS
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## 仓库概述
这是 AcePanel 的公共下载资源库,包含面板及各种服务器应用的安装、更新、卸载脚本。仓库内容会定时同步到 `dl.acepanel.net` 下载节点。
## 仓库结构
- `public.sh` - 核心公共库,被所有脚本引用。提供系统检测、下载函数 (`dl`)、错误处理、系统信息等工具函数。
- `install_alpha.sh` - 面板主安装脚本(测试版)
- `update.sh` / `uninstall.sh` - 面板更新和卸载脚本
- `acepanel.service` - 面板的 systemd 服务文件
### 应用目录
每个应用都有独立目录,包含标准化脚本:
- `install.sh` - 安装脚本
- `update.sh` - 更新脚本
- `uninstall.sh` - 卸载脚本
支持的应用nginx, openresty, php, mysql, mariadb, percona, postgresql, redis, memcached, docker, podman, gitea, code-server, frp, fail2ban, minio, phpmyadmin, pureftpd, rsync, s3fs, supervisor, apache 等
### PHP 扩展
`php_exts/` 目录包含 PHP 扩展安装脚本swoole, redis, imagick, xdebug, grpc 等)
## 脚本规范
所有脚本遵循以下模式:
```bash
#!/bin/bash
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
```
### public.sh 提供的关键变量
- `$OS` - 检测到的系统类型:`rhel``debian``ubuntu``unknown`
- `$VERSION` - 系统主版本号
- `$ARCH` - 架构:`x86_64``aarch64`
- `$MEM` / `$SWAP` - 内存和交换分区大小MB
- `$CORES` - CPU 核心数
- `$setup_path` - 安装根目录(默认:`/opt/ace`
- `$download_endpoint` - 下载服务器地址
### public.sh 提供的关键函数
- `dl <保存目录> <服务器路径> [文件名]` - 使用 aria2c 下载文件并进行 SHA256 校验
- `error <消息>` - 输出错误信息并退出
- `sys_info` - 输出系统信息
- `calculate_j` / `calculate_j2` - 根据内存计算 make -j 参数值
### 脚本参数
安装脚本通常接收:
- `$1` - 渠道(如 `stable`
- `$2` - 版本号
## CI/CD
GitLab CI`.gitlab-ci.yml`)在每次提交时自动为所有跟踪文件生成 `.sha256` 校验文件。
## 支持的系统
- RHEL 系Rocky Linux、AlmaLinux、CentOS Stream、阿里云 Linux、TencentOS
- Debian 系Debian 11+、Ubuntu 20.04+
- 架构x86_64需支持 x86-64-v2 指令集、aarch64