安装脚本
当前版本
如果你正在从 v1.5.x 或更早的版本升级,建议使用 CLI 升级或在 Web UI 中运行两次升级,以确保所有组件都正确更新。
如何安装
硬件需求
- CPU: 至少能够兼容 64 bit
- 内存: 大于 1GB (推荐使用更多内存)
- 硬盘: 20GB HDD
系统支持 (仅支持 amd64):
由于 Xenial/Bionic 在这个版本已经无法安装,已安装的用户可以继续升级。 Stretch 依然可以安装和升级,但不再提供更多支持。你需要通过指定 legacy 分支才能安装,更新后也会自动切换到 legacy 分支。
服务器支持
- Bare-metal server(裸金属服务器)
- Dedicated server (独立服务器)
- 使用 KVM/Xen/VMware 等虚拟技术的 VPS (OpenVZ 不受支持)
grsec 是一个 OVH 自定义内核中带有的模块,它会造成面板无法读取部分进程数据,因此强烈推荐使用一个 mainline 默认内核,或者是不带有 grsec 模块的内核。如果你使用 So You Start (SYS) 主机,则安装时选择 distribution kernel 即可解决该问题。否则 QuickBox 需要在安装时替换内核。
使用一键安装模式
你需要首先以 root 身份登录
从 1.3.3 版本开始,可以使用一键安装:
- curl
- wget
bash <(curl -sLo- https://git.io/qbox-lite) COMMAND
bash <(wget -qO- https://git.io/qbox-lite -o /dev/null) COMMAND
如何直接安装开发者模式?
- curl
- wget
bash <(curl -sLo- https://git.io/qbox-lite) --dev COMMAND
bash <(wget -qO- https://git.io/qbox-lite -o /dev/null) --dev COMMAND
目前可以使用以下参数:
QuickBox Lite Setup Script
使用方法: bash setup.sh -u username -p password [OPTS]
选项:
NOTE: * is required anyway
-d, --domain <domain> 为服务器设置以 Let's Encrypt 保护的域名
-H, --hostname <hostname> 为服务器设置 Hostname,默认不修改
-P, --port <1-65535> 为 SSH 服务设置端口,默认修改为 4747
-u, --username <username*> 用户名(必要)
-p, --password <password*> 密码(必要)
-r, --reboot 在安装完成后是否直接重启(默认否)
-s, --source <us|au|cn|fr|de|jp|ru|uk|tuna>
选择一个下载源(默认不修改)
-t, --theme <defaulted|smoked> 为仪表盘选择一个主题(默认 smoked)
--tz,--timezone <timezone> 为服务器设置时区 (e.g. GMT-8 or Europe/Berlin)
--lang <en|zh> 选择 TUI 使用的语言(默认英语)
--with-log,no-log 是否将安装日志写入文件(默认是)
--with-ftp,--no-ftp 是否安装 FTP(默认是)
--ftp-ip <ip address> 手动设置 FTP IP
--with-bbr,--no-bbr 是否安装 BBR(默认否)
--with-cf 使用 cloudflare 替代 github
--with-sf 使用 sourceforge 替代 github
--with-osdn 使用 osdn(jp) 替代 github
--with-github 使用 github
--auth-provider <none|authelia|vouchproxy>
选择仪表盘身份验证提供者(默认 none)
--auth-mode <password|mfa|passwordless>
选择 Authelia 身份验证模式(默认密码)
--admin-email <email> Authelia 管理员邮箱
--smtp-host <host> Authelia SMTP 主机
--smtp-port <port> Authelia SMTP 端口
--smtp-username <user> Authelia SMTP 用户名
--smtp-password <password> Authelia SMTP 密码
--smtp-sender <email> Authelia SMTP 发件人邮箱
--oidc-auth-url <url> Vouch Proxy OIDC 授权 URL
--oidc-token-url <url> Vouch Proxy OIDC 令牌 URL
--oidc-userinfo-url <url> Vouch Proxy OIDC 用户信息 URL
--oidc-client-id <id> Vouch Proxy OIDC 客户端 ID
--oidc-client-secret <secret> Vouch Proxy OIDC 客户端密钥
--oidc-end-session-endpoint <url>
Vouch Proxy 可选的登出端点
--oidc-user <user> 允许访问本地管理员的 OIDC 用户
--oidc-user-map <csv> OIDC 用户名映射到本地管理员
--oidc-email-domains <csv> 允许的 OIDC 邮箱域名
--with-APPNAME 安装一个 app
--qbittorrent-version 指定 qBittorrent 版本
--deluge-version 指定 Deluge 版本
--qbit-libt-version 指定用于 qBittorrent 的 Libtorrent 版本
--de-libt-version 指定用于 Deluge 的 Libtorrent 版本
--rtorrent-version 指定 rTorrent 版本
--transmission-version 指定 Transmission 版本
可选的 APP:
rtorrent | rutorrent | flood | transmission | qbittorrent
deluge | mktorrent | ffmpeg | filebrowser | linuxrar
-h, --help 显示该帮助文档并退出
用户名和密码是必须填写的参数,否则仍然会启动 TUI 安装界面。其他可选参数的功能与 TUI 安装界面相同。下面是一个使用示例:
bash <(wget -qO- https://git.io/qbox-lite -o /dev/null) -u demouser -p demo123456 --with-ffmpeg -P 1234 --with-bbr --with-deluge --with-mktorrent --with-linuxrar --with-cf --hostname vmserver --reboot
这段代码的意思是: 用户名为 demouser,密码为 demo123456,ssh 端口修改为1234,安装 BBR,deluge,mktorrent,linuxrar,使用 Cloudflare 的预编译包镜像源,hostname 修改为 vmserver,安装完成后自动重启。
使用 Authelia 身份验证(带 TOTP 的 MFA)安装:
bash <(wget -qO- https://git.io/qbox-lite -o /dev/null) -u demouser -p demo123456 --auth-provider authelia --auth-mode mfa --admin-email [email protected] --with-deluge --hostname seedbox --reboot
使用 Vouch Proxy 身份验证(OIDC/OAuth2)安装:
bash <(wget -qO- https://git.io/qbox-lite -o /dev/null) -u demouser -p demo123456 --auth-provider vouchproxy --oidc-client-id xxx --oidc-client-secret yyy --oidc-auth-url https://idp.example.com/oauth/authorize --oidc-token-url https://idp.example.com/oauth/token --oidc-userinfo-url https://idp.example.com/oauth/userinfo --with-qbittorrent --reboot
TUI安装模式
运行以下指令来抓取最新的代码 ...
apt-get -yqq update; apt-get -yqq upgrade; apt-get -yqq install git lsb-release dos2unix; \
git clone https://github.com/amefs/quickbox-lite.git /etc/QuickBox; \
dos2unix /etc/QuickBox/setup.sh; \
bash /etc/QuickBox/setup.sh
如何直接安装开发者模式?
在抓取源码时使用如下指令 ...
mkdir /install/ && touch /install/.developer.lock; \
apt-get -yqq update; apt-get -yqq upgrade; apt-get -yqq install git lsb-release dos2unix; \
git clone --branch "development" https://github.com/amefs/quickbox-lite.git /etc/QuickBox; \
dos2unix /etc/QuickBox/setup.sh; \
bash /etc/QuickBox/setup.sh
已经安装 QuickBox 希望切换到开发者模式?
运行如下指令以切换分支 ...
mkdir /install/ && touch /install/.developer.lock; \
sudo box update quickbox
在 v1.4.6 版本中添加了以 box enable-dev 切换为开发者模式的功能。
快速启动配置模式
快速启动配置模式使你能够使用 JSON 文件或 HTTPS URL 的预配置设置自动化 QuickBox 安装。这一功能将有助于无人值守安装或在多个服务器上複製配置。
从 TUI 生成快速启动配置
你可以通过使用 --generate-config 相互运行设置脚本来生成配置文件:
bash /etc/QuickBox/setup.sh -u demouser -p demo123456 --with-qbittorrent --with-deluge --auth-provider authelia --auth-mode mfa --admin-email [email protected] --generate-config --config-output /root/quickbox-kickstart.json
这将会以所有设置创建 /root/quickbox-kickstart.json 文件。
从本地文件加载
一旦你有了宇宿配置文件,使用以下方法安装:
bash /etc/QuickBox/setup.sh --config /root/quickbox-kickstart.json
从远程 HTTPS URL 加载
你也可以从远程 URL 加载配置:
bash /etc/QuickBox/setup.sh --config https://example.com/quickbox-kickstart.json --skip-summary
远程配置默认必须使用 HTTPS。用于测试本地/可信任的网络,可以使用 --allow-http-config。始终将 kickstart 文件视为会有密码、SMTP 奁证信息和 OIDC 客户端秘钥的会有敏感文件。使用 chmod 600 限制文件权限。
快速启动 JSON 结构
Kickstart JSON 可以存储:
- 基本安装设置(用户名、密码、域名、主机名、SSH 端口)
- 程序选择(应用列表)
- 身份验证配置(Authelia 模式、SMTP 设置或 Vouch Proxy OIDC 设置)
- 服务器选项(BBR、交换空间、时区)
- 系统设置(重启、CDN 镜像、Let's Encrypt 域名)
有关 kickstart 配置示例,请参阅 FAQ 部分。
默认安装的功能
- pureftp - vsftp (FTP客户端)
- SSH Server
- Web 控制台 (ttyd)
- QuickBox 面板