mirror of
https://github.com/XTLS/Xray-install.git
synced 2025-12-10 02:09:52 +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>
38 lines
808 B
Plaintext
38 lines
808 B
Plaintext
#!/sbin/openrc-run
|
|
|
|
name="Xray Daemon"
|
|
description="A unified platform for anti-censorship"
|
|
|
|
supervisor=supervise-daemon
|
|
respawn_delay=5
|
|
respawn_max=2
|
|
respawn_period=600
|
|
|
|
pidfile="/run/${RC_SVCNAME}.pid"
|
|
rc_ulimit="-n 1024000 -u 1024000"
|
|
capabilities="^cap_net_bind_service,^cap_net_admin,^cap_net_raw"
|
|
extra_commands="checkconfig"
|
|
|
|
env=${env:-"XRAY_LOCATION_ASSET=/usr/local/share/xray/"} # See: https://github.com/XTLS/Xray-core/blob/main/common/platform/platform.go
|
|
confdir=${confdir:-"/usr/local/etc/xray/"}
|
|
command="/usr/local/bin/xray"
|
|
command_user="nobody:nobody"
|
|
command_args="run -confdir $confdir"
|
|
required_files="$confdir"
|
|
|
|
depend() {
|
|
need net
|
|
want dns ntp-client
|
|
after firewall
|
|
}
|
|
|
|
checkconfig() {
|
|
export $env
|
|
$command $command_args -test
|
|
eend $?
|
|
}
|
|
|
|
start_pre() {
|
|
checkconfig || return 1
|
|
}
|