mirror of
https://github.com/XTLS/Xray-install.git
synced 2026-01-04 14:39:54 +00:00
* Initial commit * Testable * Add description * Instruction revision * Fix wrong content * Fix environment variables * Correct variable location * Content adjustment * More precise content * Replace '[[' with '[' * Fix mistakes * Correct the output * Fix case conversion * Basically available * Variable correction * Complete basic revision * Fix mistakes * Fix the source of log files * Make script more compatible and fails fast * Update download link to v2fly and fix #2 Issue (#3) * Update download link to v2fly. * Update "Identify architecture" * Fix Line 56 variable name * Try to fix verification_v2ray * improve detect arm without vfp * feat: install Xray-core * docs: add English and Chinese Simplified * Fix SHA * Update install-release.sh 修改路径,跟https://github.com/XTLS/Xray-install保持一致 * Update xray * Rewrite OpenRC * cap: daemon with ambient and inheritable * Fix README * Use tab * Fix README * respawn period * Fix README * daemon: 3 panic in 10 minutes stops service * README: rename files * README: rename * Migration: modify the path to fit this repo * Migration: merge license * Alpine: Fix shebang * Alpine: check alpine * Alpine: check root * Alpine: refactor code related to architecture identification * Alpine: shellcheck * Alpine: shellcheck SC2181 * Alpine: shellcheck SC2002 * Alpine: Move global variable to main function to fix runtime error after refactoring * Alpine: Hide debug information * Alpine: Enhance script usability - Add necessary user prompts for better feedback - Exit on failure of rc service installation - Reduce permissions for geoip and geosite files - Rename install_software to install_dependencies * Alpine: Add HTTP error handling to all curl commands * README.md: Add Chinese translations * README.md: Add link to Alpine Linux README for specific instructions * Alpine README.md: Clarify content to remove ambiguity --------- Co-authored-by: Dct Mei <dctxmei@gmail.com> Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Co-authored-by: Kslr <kslrwang@gmail.com> Co-authored-by: Elvis Wang <me@elvisw.com> Co-authored-by: 秋のかえで <autmaple@protonmail.com> Co-authored-by: Markson Hon <50002150+MarksonHon@users.noreply.github.com> Co-authored-by: winds365 <winds365@live.com>
79 lines
1.8 KiB
Markdown
79 lines
1.8 KiB
Markdown
# Xray-install for Alpine Linux
|
|
|
|
[English](README.md) | 简体中文 | [繁體中文](README_zh-Hant.md)
|
|
|
|
## 安装 Xray
|
|
|
|
#### 安装 cURL
|
|
|
|
```sh
|
|
apk add curl
|
|
```
|
|
|
|
#### 下载安装脚本
|
|
|
|
```sh
|
|
curl -O https://raw.githubusercontent.com/XTLS/Xray-install/main/alpinelinux/install-release.sh
|
|
```
|
|
|
|
#### 运行安装脚本
|
|
|
|
```sh
|
|
ash install-release.sh
|
|
```
|
|
|
|
## 管理命令
|
|
|
|
#### 启用 Xray 服务 (开机自启)
|
|
|
|
```sh
|
|
rc-update add xray
|
|
```
|
|
|
|
#### 禁用 Xray 服务 (取消自启)
|
|
|
|
```sh
|
|
rc-update del xray
|
|
```
|
|
|
|
#### 运行 Xray
|
|
|
|
```sh
|
|
rc-service xray start
|
|
```
|
|
|
|
#### 停止 Xray
|
|
|
|
```sh
|
|
rc-service xray stop
|
|
```
|
|
|
|
#### 重启 Xray
|
|
|
|
```sh
|
|
rc-service xray restart
|
|
```
|
|
|
|
## 重大更改 at 2025-04-09
|
|
|
|
#### 路径变更:原路径 `/usr/local/lib/xray/` 变更为 新路径 `/usr/local/share/xray/`
|
|
|
|
- 此目录存放了 `geosite.dat` 和 `geoip.dat`
|
|
- 如果你编写了一些脚本来自动更新这些文件,需要留意此项改动
|
|
- 普通用户无需关注此改动
|
|
|
|
#### 看门狗:若 Xray 进程 `panic` 将无限自动重启,间隔 5 秒,除非 10 分钟内崩溃 3 次
|
|
|
|
- 对于高级用户,你无需再手动调整 `/etc/init.d/xray` 或自己编写 daemon 脚本了
|
|
- 普通用户无需关注此改动
|
|
|
|
#### 无需 `root`:已为 Xray 授予特权,即便以 `nobody` 身份运行也支持 `tproxy` 和 `sockopt`
|
|
|
|
- 对于高级用户,你无需、也**不应该**再让 Xray 以 `root` 身份运行,现在它们已具备所有网络特权
|
|
- 如果你的 Xray 作为**节点**而不是客户端运行,或*可考虑*执行下面的命令撤销部分网络特权。理论上可以降低攻击面,实际上无关痛痒
|
|
- 普通用户无需关注此改动
|
|
|
|
```sh
|
|
sed -i 's/^capabilities="^cap_net_bind_service,^cap_net_admin,^cap_net_raw"$/capabilities="^cap_net_bind_service"/g' /etc/init.d/xray
|
|
```
|