English
AstrBot is an Agentic IM Chatbot infrastructure. This AUR package (astrbot-git) provides a system-level, multi-instance deployment of AstrBot using uv for environment isolation.
- Multi-Instance Support: Run multiple bots on the same server with isolated data and environments.
- Systemd Integration: Manage bots as system services (
systemctl start astrbot@instance). - Environment Isolation: Uses
uvto manage Python dependencies in/var/cache/astrbot, keeping your system Python clean. - Secure by Default: Runs as a dedicated
astrbotuser with restricted permissions.
Install from AUR:
paru -S astrbot-git-
Initialize an instance:
sudo astrbotctl init bot1
This creates configuration in
/etc/astrbot/bot1.confand data directory in/var/lib/astrbot/bot1. It also bootstraps the AstrBot data files. -
Start the service:
sudo systemctl enable --now astrbot@bot1 -
Check status:
astrbotctl status bot1 # or systemctl status astrbot@bot1
The astrbotctl utility is the main entry point for managing AstrBot instances.
- Init new instance:
Or initialize directly from an AstrBot backup archive:
sudo astrbotctl init <name>
sudo astrbotctl init -f /path/to/backup.zip <name>
- Copy/Clone instance:
Clones data and generates a new config with a non-conflicting port.
sudo astrbotctl cp <source> <dest>
- Remove instance:
Stops service, deletes data, config, and cache.
sudo astrbotctl rm <name>
- List instances:
astrbotctl list
- Change dashboard credentials quickly:
astrbotctl password <name> astrbotctl password -u admin -p 'new-password' <name>
- Export instance backup quickly:
astrbotctl export <name> astrbotctl export -o /tmp -d sha256 <name>
- Import backup into an instance quickly:
astrbotctl import <name> /path/to/backup.zip astrbotctl import -y <name> /path/to/backup.zip.gpg
- Run natively (CLI):
Execute AstrBot commands directly within the instance's environment (e.g., manage plugins).
# List plugins astrbotctl cli <name> plug list # Install a plugin astrbotctl cli <name> plug install <plugin_repo>
This package uses a read-only application source (/opt) with per-instance mutable data (/var/lib) and environment caches (/var/cache).
/
├── opt/
│ └── astrbot/ # [Read-Only] App source code
│ ├── astrbot/ # Python source package
│ ├
| ── pyproject.toml # Dependency definitions
│
│
├── usr/
│ ├── bin/
│ │ └── astrbotctl # [CLI Entrypoint] Management script
│ │
│ └── lib/systemd/system/
│ └── astrbot@.service # [Systemd Template] Service unit
│
├── etc/
│ └── astrbot/ # [Config Center] Instance config files
│ ├── bot1.conf # Config for 'bot1'
│ └── bot2.conf # Config for 'bot2'
│
├── var/
│ ├── lib/astrbot/ # [Data Persistence] Runtime data
│ │ ├── bot1/ # Data for 'bot1' (DB, logs, plugins)
│ │ └── bot2/ # Data for 'bot2'
│ │
│ └── cache/astrbot/ # [Runtime Env] uv-managed venvs
│ ├── venv-bot1/ # Isolated venv for 'bot1'
│ └── venv-bot2/ # Isolated venv for 'bot2'Configuration files are located at /etc/astrbot/<instance>.conf.
# /etc/astrbot/bot1.conf
# Network
ASTRBOT_HOST=0.0.0.0
ASTRBOT_PORT=3000
# Storage
ASTRBOT_ROOT="/var/lib/astrbot/bot1"
# Advanced
EXTRA_ARGS=""-
Logs:
journalctl -u astrbot@<instance> -f
-
Permission Errors: Ensure directories in
/var/lib/astrbotand the instance venv under/var/cache/astrbotare owned byastrbot:astrbot.sudo chown -R astrbot:astrbot /var/lib/astrbot sudo chown -R astrbot:astrbot /var/cache/astrbot/venv-<instance>
If the venv was created by
root, also ensure its Python interpreter is not linked into/root/.local/share/uv/.... Rebuild the venv after installing the fixed package if needed. -
Clean Cache: If python dependencies break after an update:
sudo rm -rf /var/cache/astrbot/venv-<instance> sudo systemctl restart astrbot@<instance>
- AUR Page: astrbot-git
- Git Clone URL:
https://aur.archlinux.org/astrbot-git.git - Upstream URL: AstrBotDevs/AstrBot
- Maintainer: lightjunction
- License: AGPL-3.0-only
Contributions to the packaging scripts are welcome!
- Packaging Issues: Please comment on the AUR page or submit issues to the maintainer.
- AstrBot Issues: Please report bugs related to the bot functionality to the upstream repository.
- Co-Maintainership: Please apply at AUR Co-maintainers and email
lightjunction.me@gmail.comwith your AUR username and details for review.
中文说明
AstrBot 是一个支持多模型、多平台的即时通讯机器人框架。本 AUR 软件包 (astrbot-git) 提供了基于系统级服务、多实例部署的 AstrBot 环境,并使用 uv 进行环境隔离。
- 多实例支持: 在同一台服务器上运行多个机器人,数据和环境相互隔离。
- Systemd 集成: 将机器人作为系统服务管理 (
systemctl start astrbot@instance)。 - 环境隔离: 使用
uv在/var/cache/astrbot中管理 Python 依赖,保持系统 Python 环境整洁。 - 默认安全: 作为专用的
astrbot用户运行,权限受限。
从 AUR 安装:
paru -S astrbot-git-
初始化实例:
sudo astrbotctl init bot1
这将在
/etc/astrbot/bot1.conf创建配置文件,在/var/lib/astrbot/bot1创建数据目录,并自动初始化 AstrBot 数据文件。 -
启动服务:
sudo systemctl enable --now astrbot@bot1 -
检查状态:
astrbotctl status bot1 # 或者 systemctl status astrbot@bot1
astrbotctl 工具是管理 AstrBot 实例的主要入口。
- 初始化新实例:
也可以直接从 AstrBot 备份文件初始化:
sudo astrbotctl init <name>
sudo astrbotctl init -f /path/to/backup.zip <name>
- 复制/克隆实例:
克隆数据并生成一个新的配置文件(自动分配不冲突的端口)。
sudo astrbotctl cp <source> <dest>
- 删除实例:
停止服务,删除数据、配置和缓存。
sudo astrbotctl rm <name>
- 列出实例:
astrbotctl list
- 快速修改控制台账号密码:
astrbotctl password <name> astrbotctl password -u admin -p 'new-password' <name>
- 快速导出实例备份:
astrbotctl export <name> astrbotctl export -o /tmp -d sha256 <name>
- 快速导入实例备份:
astrbotctl import <name> /path/to/backup.zip astrbotctl import -y <name> /path/to/backup.zip.gpg
- 原生运行 (CLI):
直接在实例环境中执行 AstrBot 命令(例如管理插件)。
# 列出插件 astrbotctl cli <name> plug list # 安装插件 astrbotctl cli <name> plug install <plugin_repo>
本软件包使用只读的应用程序源码 (/opt),配合每个实例的可变数据 (/var/lib) 和环境缓存 (/var/cache)。
/
├── opt/
│ └── astrbot/ # [只读] 应用程序核心代码库
│ ├── astrbot/ # Python 源码包
│ ── pyproject.toml # 依赖定义文件
│
│
├── usr/
│ ├── bin/
│ │ └── astrbotctl # [核心入口] 管理脚本
│ │
│ └── lib/systemd/system/
│ └── astrbot@.service # [Systemd 模板] 服务单元文件
│
├── etc/
│ └── astrbot/ # [配置中心] 实例配置文件
│ ├── bot1.conf # 'bot1' 的配置
│ └── bot2.conf # 'bot2' 的配置
│
├── var/
│ ├── lib/astrbot/ # [数据持久化] 运行时数据
│ │ ├── bot1/ # 'bot1' 的数据 (数据库、日志、插件)
│ │ └── bot2/ # 'bot2' 的数据
│ │
│ └── cache/astrbot/ # [运行时环境] uv 管理的虚拟环境
│ ├── venv-bot1/ # 'bot1' 的独立虚拟环境
│ └── venv-bot2/ # 'bot2' 的独立虚拟环境配置文件位于 /etc/astrbot/<实例名>.conf。
# /etc/astrbot/bot1.conf
# 网络
ASTRBOT_HOST=0.0.0.0
ASTRBOT_PORT=3000
# 存储
ASTRBOT_ROOT="/var/lib/astrbot/bot1"
# 高级
EXTRA_ARGS=""-
查看日志:
journalctl -u astrbot@<instance> -f
-
权限错误: 确保
/var/lib/astrbot以及/var/cache/astrbot/venv-<instance>归astrbot:astrbot所有。sudo chown -R astrbot:astrbot /var/lib/astrbot sudo chown -R astrbot:astrbot /var/cache/astrbot/venv-<instance>
如果 venv 是由
root创建的,还要确认其中的 Python 解释器没有链接到/root/.local/share/uv/...。 安装修复后的包后,必要时重建该实例的 venv。 -
清理缓存: 如果更新后 Python 依赖出现问题:
sudo rm -rf /var/cache/astrbot/venv-<instance> sudo systemctl restart astrbot@<instance>
- AUR 页面: astrbot-git
- Git 克隆地址:
https://aur.archlinux.org/astrbot-git.git - 上游地址: AstrBotDevs/AstrBot
- 维护者: lightjunction
- 许可证: AGPL-3.0-only
欢迎对打包脚本进行贡献!