Files
Xray-install/README_zh-Hans.md
Meow cbc6bf326e Add Alpine Linux (#86)
* 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>
2025-04-30 04:21:15 +00:00

98 lines
2.7 KiB
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.

# Xray-install
[English](README.md) | 简体中文 | [繁體中文](README_zh-Hant.md)
用于在支持 systemd 的操作系统(如 CentOS / Debian / OpenSUSE中安装 Xray 的 Bash 脚本。
**对于 Alpine Linux 用户**,请参考 **[Alpine Linux 专用说明](alpinelinux/README_zh-Hans.md)** 以获取适用于 Alpine Linux 的安装脚本和指南。
---
#### [文件系统层次结构标准 (FHS)](https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard)
```
已安装文件:
- /etc/systemd/system/xray.service
- /etc/systemd/system/xray@.service
- /usr/local/bin/xray
- /usr/local/etc/xray/*.json
- /usr/local/share/xray/geoip.dat
- /usr/local/share/xray/geosite.dat
- /var/log/xray/access.log
- /var/log/xray/error.log
```
注意Xray 默认不会将日志记录到 `/var/log/xray/*.log`。请配置 `"log"` 来指定日志文件。
## 基本用法
**安装并升级 Xray-core 和地理数据,默认使用 `User=nobody`,但不会覆盖已有服务文件中的 `User` 设置**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
```
**仅更新 geoip.dat 和 geosite.dat**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install-geodata
```
**移除 Xray但保留 json 配置文件和日志**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ remove
```
## 高级用法
**安装并升级 Xray-core 到预发布版本**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install --beta
```
**安装并升级 Xray-core 和地理数据,并启用 `logrotate``$time` 可以是 12:34:56 格式的时间**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install --logrotate $time
```
```
已安装文件:
- /etc/systemd/system/logrotate@.service
- /etc/systemd/system/logrotate@.timer
- /etc/logrotate.d/xray
```
**安装并升级 Xray-core 和地理数据,使用 `User=root`,会覆盖已有服务文件中的 `User` 设置**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install -u root
```
**安装并升级 Xray-core但不包含地理数据**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install --without-geodata
```
**移除 Xray包括 json 配置文件和日志**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ remove --purge
```
## 更多用法
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ help
```
## 星标趋势图
[![星标趋势图](https://starchart.cc/XTLS/Xray-install.svg)](https://starchart.cc/XTLS/Xray-install)