Xray-install/alpinelinux
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
..
init.d Add Alpine Linux (#86) 2025-04-30 04:21:15 +00:00
README.md Add Alpine Linux (#86) 2025-04-30 04:21:15 +00:00
README_zh-Hans.md Add Alpine Linux (#86) 2025-04-30 04:21:15 +00:00
README_zh-Hant.md Add Alpine Linux (#86) 2025-04-30 04:21:15 +00:00
install-release.sh Add Alpine Linux (#86) 2025-04-30 04:21:15 +00:00

README.md

Xray-install for Alpine Linux

English | 简体中文 | 繁體中文

Install Xray

Install cURL

apk add curl

Download Installation Script

curl -O https://raw.githubusercontent.com/XTLS/Xray-install/main/alpinelinux/install-release.sh

Run Installation Script

ash install-release.sh

Management Commands

Enable Xray Service (Auto-start on Boot)

rc-update add xray

Disable Xray Service (Remove from Auto-start)

rc-update del xray

Start Xray

rc-service xray start

Stop Xray

rc-service xray stop

Restart Xray

rc-service xray restart

Breaking Changes at 2025-04-09

Path Change: Original path /usr/local/lib/xray/ has been updated to new path /usr/local/share/xray/

  • This directory contains geosite.dat and geoip.dat
  • If you have scripts to automatically update these files, please adjust them accordingly
  • Regular users can ignore this change

Watchdog: Xray process will now automatically restart indefinitely (every 5 seconds) upon panic, unless it panic 3 times in 10 minutes

  • Advanced users no longer need to manually modify /etc/init.d/xray or write custom daemon scripts
  • Regular users can ignore this change

No root Required: Xray now retains privileges (capabilities) to support tproxy and sockopt even when running as nobody

  • Advanced users should not (and need not) run Xray as root anymore — it already has all required network privileges
  • If you run Xray as a server (not client), you may optionally run the command below to reduce capabilities. This theoretically minimizes attack surface but has negligible practical impact
  • Regular users can ignore this change
sed -i 's/^capabilities="^cap_net_bind_service,^cap_net_admin,^cap_net_raw"$/capabilities="^cap_net_bind_service"/g' /etc/init.d/xray