Files
Xray-install/README.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

97 lines
2.8 KiB
Markdown

# Xray-install
English | [简体中文](README_zh-Hans.md) | [繁體中文](README_zh-Hant.md)
Bash script for installing Xray in operating systems such as CentOS / Debian / OpenSUSE that support systemd.
**For Alpine Linux users**, please refer to **[Alpine Linux Specific Instructions](alpinelinux/README.md)** for installation scripts and guides tailored for Alpine Linux.
---
#### [Filesystem Hierarchy Standard (FHS)](https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard)
```
installed: /etc/systemd/system/xray.service
installed: /etc/systemd/system/xray@.service
installed: /usr/local/bin/xray
installed: /usr/local/etc/xray/*.json
installed: /usr/local/share/xray/geoip.dat
installed: /usr/local/share/xray/geosite.dat
installed: /var/log/xray/access.log
installed: /var/log/xray/error.log
```
Notice: Xray will NOT log to `/var/log/xray/*.log` by default. Configure `"log"` to specify log files.
## Basic Usage
**Install & Upgrade Xray-core and geodata with `User=nobody`, but will NOT overwrite `User` in existing service files**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
```
**Update geoip.dat and geosite.dat only**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install-geodata
```
**Remove Xray, except json and logs**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ remove
```
## Advance
**Install & Upgrade Xray-core to a pre-release version**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install --beta
```
**Install & Upgrade Xray-core and geodata with `logrotate`, `$time` can be in the format of 12:34:56**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install --logrotate $time
```
```
installed: /etc/systemd/system/logrotate@.service
installed: /etc/systemd/system/logrotate@.timer
installed: /etc/logrotate.d/xray
```
**Install & Upgrade Xray-core and geodata with `User=root`, which will overwrite `User` in existing service files**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install -u root
```
**Install & Upgrade Xray-core without geodata**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install --without-geodata
```
**Remove Xray, include json and logs**
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ remove --purge
```
## More Usage
```
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ help
```
## Stargazers over time
[![Stargazers over time](https://starchart.cc/XTLS/Xray-install.svg)](https://starchart.cc/XTLS/Xray-install)