Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate All Important things to English. #177

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GAYHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
Expand Down Expand Up @@ -144,4 +144,4 @@ jobs:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: x-ui-linux-s390x.tar.gz
asset_name: x-ui-linux-s390x.tar.gz
asset_content_type: application/gzip
asset_content_type: application/gzip
122 changes: 61 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# x-ui

支持多协议多用户的 xray 面板
xray panel with multi-protocol multi-user support

# 功能介绍
# Function introduction

- 系统状态监控
- 支持多用户多协议,网页可视化操作
- 支持的协议:vmessvlesstrojanshadowsocksdokodemo-doorsockshttp
- 支持配置更多传输配置
- 流量统计,限制流量,限制到期时间
- 可自定义 xray 配置模板
- 支持 https 访问面板(自备域名 + ssl 证书)
- 支持一键SSL证书申请且自动续签
- 更多高级配置项,详见面板
- System status monitoring
- Support multi-user multi-protocol, web page visualization operation
- Supported protocols: vmess, vless, trojan, shadowsocks, dokodemo-door, socks, http
- Support to configure more transport configurations
- Traffic statistics, limit traffic, limit expiration time
- Customizable xray Configuration templates
- Support https Access panel (self-provided domain name + ssl certificate)
- Support one-click SSL certificate application and automatic renewal
- More advanced configuration items, see panel for details

# 安装&升级
# Install & Upgrade

```
bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh)
bash <(curl -Ls https://raw.githubusercontent.com/msameim181/x-ui/main/install.sh)
```

## 手动安装&升级
## Manual install & upgrade

1. 首先从 https://github.com/vaxilu/x-ui/releases 下载最新的压缩包,一般选择 `amd64`架构
2. 然后将这个压缩包上传到服务器的 `/root/`目录下,并使用 `root`用户登录服务器
1. First download the latest compressed package from https://github.com/msameim181/x-ui/releases , generally choose `amd64` architecture
2. Then upload the compressed package to the `/root/` directory of the server, and use the `root` user to log in to the server

> 如果你的服务器 cpu 架构不是 `amd64`,自行将命令中的 `amd64`替换为其他架构
> If your server cpu architecture is not `amd64`, replace `amd64` in the command with another architecture

```
cd /root/
Expand All @@ -40,17 +40,17 @@ systemctl enable x-ui
systemctl restart x-ui
```

## 使用docker安装
## Install using docker

> docker 教程与 docker 镜像由[Chasing66](https://github.com/Chasing66)提供
> This docker tutorial and docker image are provided by [Chasing66](https://github.com/Chasing66)

1. 安装docker
1. Install docker

```shell
curl -fsSL https://get.docker.com | sh
```

2. 安装x-ui
2. Install x-ui

```shell
mkdir x-ui && cd x-ui
Expand All @@ -61,82 +61,82 @@ docker run -itd --network=host \
enwaiax/x-ui:latest
```

> Build 自己的镜像
> Build own image

```shell
docker build -t x-ui .
```

## SSL证书申请
## SSL certificate application

> 此功能与教程由[FranzKafkaYu](https://github.com/FranzKafkaYu)提供
> This function and tutorial are provided by [FranzKafkaYu](https://github.com/FranzKafkaYu)

脚本内置SSL证书申请功能,使用该脚本申请证书,需满足以下条件:
The script has a built-in SSL certificate application function. To use this script to apply for a certificate, the following conditions must be met:

- 知晓Cloudflare 注册邮箱
- 知晓Cloudflare Global API Key
- 域名已通过cloudflare进行解析到当前服务器
- Know Cloudflare registered email
- Aware of Cloudflare Global API Key
- The domain name has been resolved to the current server through cloudflare

获取Cloudflare Global API Key的方法:
How to get Cloudflare Global API Key:
![](media/bda84fbc2ede834deaba1c173a932223.png)
![](media/d13ffd6a73f938d1037d0708e31433bf.png)

使用时只需输入 `域名`, `邮箱`, `API KEY`即可,示意图如下:
When using, just enter `domain name`, `mailbox`, `API KEY`, the diagram is as follows:
![](media/2022-04-04_141259.png)

注意事项:
Precautions:

- 该脚本使用DNS API进行证书申请
- 默认使用Let'sEncrypt作为CA方
- 证书安装目录为/root/cert目录
- 本脚本申请证书均为泛域名证书
- The script uses DNS API for certificate request
- Use Let'sEncrypt as the CA by default
- The certificate installation directory is the /root/cert directory
- The certificates applied for by this script are all generic domain name certificates

## Tg机器人使用(开发中,暂不可使用)
## Tg robot use (under development, temporarily unavailable)

> 此功能与教程由[FranzKafkaYu](https://github.com/FranzKafkaYu)提供
> This function and tutorial are provided by [FranzKafkaYu](https://github.com/FranzKafkaYu)

X-UI支持通过Tg机器人实现每日流量通知,面板登录提醒等功能,使用Tg机器人,需要自行申请
具体申请教程可以参考[博客链接](https://coderfan.net/how-to-use-telegram-bot-to-alarm-you-when-someone-login-into-your-vps.html)
使用说明:在面板后台设置机器人相关参数,具体包括
X-UI supports daily traffic notification, panel login reminder and other functions through Tg robot. To use Tg robot, you need to apply by yourself
For specific application tutorials, please refer to [blog link](https://coderfan.net/how-to-use-telegram-bot-to-alarm-you-when-someone-login-into-your-vps.html)
Instructions for use: Set robot-related parameters in the background of the panel, including

- Tg机器人Token
- Tg机器人ChatId
- Tg机器人周期运行时间,采用crontab语法
- Tg Robot Token
- Tgbot ChatId
- Tg Robot cycle running time, using crontab syntax

参考语法:
- 30 * * * * * //每一分的第30s进行通知
- @hourly //每小时通知
- @daily //每天通知(凌晨零点整)
- @every 8h //每8小时通知
Reference syntax:
- 30 * * * * * //Notify at the 30s of every point
- @hourly //Hourly notification
- @daily //Daily notification (0:00 AM)
- @every 8h //Notify every 8 hours

TG通知内容:
- 节点流量使用
- 面板登录提醒
- 节点到期提醒
- 流量预警提醒
TG notification content:
- Node traffic usage
- Panel login reminder
- Node expiration reminder
- Traffic warning reminder

更多功能规划中...
## 建议系统
More features are planned...
## Suggestion system

- CentOS 7+
- Ubuntu 16+
- Debian 8+

# 常见问题
# FAQ

## v2-ui 迁移
## Migrated from v2-ui

首先在安装了 v2-ui 的服务器上安装最新版 x-ui,然后使用以下命令进行迁移,将迁移本机 v2-ui 的 `所有 inbound 账号数据`至 x-ui,`面板设置和用户名密码不会迁移`
First install the latest version of x-ui on the server where v2-ui is installed, and then use the following command to migrate, which will migrate `all inbound account data` of the local v2-ui to x-ui, `Panel settings and username passwords are not migrated`

> 迁移成功后请 `关闭 v2-ui`并且 `重启 x-ui`,否则 v2-ui inbound 会与 x-ui 的 inbound 会产生 `端口冲突`
> After the migration is successful, please `close v2-ui` and `restart x-ui`, otherwise the inbound of v2-ui will be the same as the inbound of x-ui will generate `port conflict`

```
x-ui v2-ui
```

## issue 关闭
## issue Close

各种小白问题看得血压很高
All kinds of white problems see high blood pressure

## Stargazers over time

Expand Down
92 changes: 46 additions & 46 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plain='\033[0m'
cur_dir=$(pwd)

# check root
[[ $EUID -ne 0 ]] && echo -e "${red}错误:${plain} 必须使用root用户运行此脚本!\n" && exit 1
[[ $EUID -ne 0 ]] && echo -e "${red}Error: ${plain} must be root to run this script! \n" && exit 1

# check os
if [[ -f /etc/redhat-release ]]; then
Expand All @@ -26,7 +26,7 @@ elif cat /proc/version | grep -Eqi "ubuntu"; then
elif cat /proc/version | grep -Eqi "centos|red hat|redhat"; then
release="centos"
else
echo -e "${red}未检测到系统版本,请联系脚本作者!${plain}\n" && exit 1
echo -e "System version not detected by ${red}, please contact the script author! ${plain}\n" && exit 1
fi

arch=$(arch)
Expand All @@ -39,13 +39,13 @@ elif [[ $arch == "s390x" ]]; then
arch="s390x"
else
arch="amd64"
echo -e "${red}检测架构失败,使用默认架构: ${arch}${plain}"
echo -e "${red}Failed to detect schema, use default schema: ${arch}${plain}"
fi

echo "架构: ${arch}"

if [ $(getconf WORD_BIT) != '32' ] && [ $(getconf LONG_BIT) != '64' ]; then
echo "本软件不支持 32 位系统(x86),请使用 64 位系统(x86_64),如果检测有误,请联系作者"
echo "This software does not support 32-bit system (x86), please use 64-bit system (x86_64), if the detection is wrong, please contact the author"
exit -1
fi

Expand All @@ -61,15 +61,15 @@ fi

if [[ x"${release}" == x"centos" ]]; then
if [[ ${os_version} -le 6 ]]; then
echo -e "${red}请使用 CentOS 7 或更高版本的系统!${plain}\n" && exit 1
echo -e "${red}Please use CentOS 7 or higher! ${plain}\n" && exit 1
fi
elif [[ x"${release}" == x"ubuntu" ]]; then
if [[ ${os_version} -lt 16 ]]; then
echo -e "${red}请使用 Ubuntu 16 或更高版本的系统!${plain}\n" && exit 1
echo -e "${red}Please use Ubuntu 16 or later! ${plain}\n" && exit 1
fi
elif [[ x"${release}" == x"debian" ]]; then
if [[ ${os_version} -lt 8 ]]; then
echo -e "${red}请使用 Debian 8 或更高版本的系统!${plain}\n" && exit 1
echo -e "${red}Please use Debian 8 or higher!${plain}\n" && exit 1
fi
fi

Expand All @@ -83,22 +83,22 @@ install_base() {

#This function will be called when user installed x-ui out of sercurity
config_after_install() {
echo -e "${yellow}出于安全考虑,安装/更新完成后需要强制修改端口与账户密码${plain}"
read -p "确认是否继续?[y/n]": config_confirm
echo -e "${yellow}For security reasons, it is necessary to forcibly modify the port and account password after the installation/update is completed.${plain}"
read -p "Confirm whether to continue?[y/n]": config_confirm
if [[ x"${config_confirm}" == x"y" || x"${config_confirm}" == x"Y" ]]; then
read -p "请设置您的账户名:" config_account
echo -e "${yellow}您的账户名将设定为:${config_account}${plain}"
read -p "请设置您的账户密码:" config_password
echo -e "${yellow}您的账户密码将设定为:${config_password}${plain}"
read -p "请设置面板访问端口:" config_port
echo -e "${yellow}您的面板访问端口将设定为:${config_port}${plain}"
echo -e "${yellow}确认设定,设定中${plain}"
read -p "Please set your account name:" config_account
echo -e "${yellow}Your account name will be set to:${config_account}${plain}"
read -p "Please set your account password:" config_password
echo -e "${yellow}Please set your account password:${config_password}${plain}"
read -p "Please set the panel access port:" config_port
echo -e "${yellow}Your panel access port will be set to:${config_port}${plain}"
echo -e "${yellow}Confirm setting, setting${plain}"
/usr/local/x-ui/x-ui setting -username ${config_account} -password ${config_password}
echo -e "${yellow}账户密码设定完成${plain}"
echo -e "${yellow}Account password setting completed${plain}"
/usr/local/x-ui/x-ui setting -port ${config_port}
echo -e "${yellow}面板端口设定完成${plain}"
echo -e "${yellow}Panel port setting completed${plain}"
else
echo -e "${red}已取消,所有设置项均为默认设置,请及时修改${plain}"
echo -e "${red}Cancelled, all setting items are default settings, please modify in time${plain}"
fi
}

Expand All @@ -109,22 +109,22 @@ install_x-ui() {
if [ $# == 0 ]; then
last_version=$(curl -Ls "https://api.github.com/repos/vaxilu/x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
if [[ ! -n "$last_version" ]]; then
echo -e "${red}检测 x-ui 版本失败,可能是超出 Github API 限制,请稍后再试,或手动指定 x-ui 版本安装${plain}"
echo -e "${red}The failure of the X-UI version may be beyond the GitHub API limit, please try it later, or manually specify the X-UI version installation${plain}"
exit 1
fi
echo -e "检测到 x-ui 最新版本:${last_version},开始安装"
echo -e "detected x-ui The latest version of: ${last_version}, start installation"
wget -N --no-check-certificate -O /usr/local/x-ui-linux-${arch}.tar.gz https://github.com/vaxilu/x-ui/releases/download/${last_version}/x-ui-linux-${arch}.tar.gz
if [[ $? -ne 0 ]]; then
echo -e "${red}下载 x-ui 失败,请确保你的服务器能够下载 Github 的文件${plain}"
echo -e "${red}Failed to download x-ui, please make sure your server can download Github files${plain}"
exit 1
fi
else
last_version=$1
url="https://github.com/vaxilu/x-ui/releases/download/${last_version}/x-ui-linux-${arch}.tar.gz"
echo -e "开始安装 x-ui v$1"
echo -e "start installation x-ui v$1"
wget -N --no-check-certificate -O /usr/local/x-ui-linux-${arch}.tar.gz ${url}
if [[ $? -ne 0 ]]; then
echo -e "${red}下载 x-ui v$1 失败,请确保此版本存在${plain}"
echo -e "${red}Failed to download x-ui v$1, please make sure this version exists${plain}"
exit 1
fi
fi
Expand All @@ -138,38 +138,38 @@ install_x-ui() {
cd x-ui
chmod +x x-ui bin/xray-linux-${arch}
cp -f x-ui.service /etc/systemd/system/
wget --no-check-certificate -O /usr/bin/x-ui https://raw.githubusercontent.com/vaxilu/x-ui/main/x-ui.sh
wget --no-check-certificate -O /usr/bin/x-ui https://raw.githubusercontent.com/msameim181/x-ui/main/install.sh
chmod +x /usr/local/x-ui/x-ui.sh
chmod +x /usr/bin/x-ui
config_after_install
#echo -e "如果是全新安装,默认网页端口为 ${green}54321${plain},用户名和密码默认都是 ${green}admin${plain}"
#echo -e "请自行确保此端口没有被其他程序占用,${yellow}并且确保 54321 端口已放行${plain}"
# echo -e "若想将 54321 修改为其它端口,输入 x-ui 命令进行修改,同样也要确保你修改的端口也是放行的"
#echo -e ""
#echo -e "如果是更新面板,则按你之前的方式访问面板"
#echo -e ""
# echo -e "If it is a fresh installation, the default web port is ${green}54321${plain}, and the default username and password are ${green}admin${plain}"
# echo -e "Please make sure this port is not occupied by other programs, ${yellow} and make sure port 54321 is released ${plain}"
# echo -e "If you want to modify 54321 to another port, enter the x-ui command to modify it, and also make sure that the port you modify is also released"
# echo -e ""
# echo -e "If it's the update panel, access the panel as you did before"
# echo -e ""
systemctl daemon-reload
systemctl enable x-ui
systemctl start x-ui
echo -e "${green}x-ui v${last_version}${plain} 安装完成,面板已启动,"
echo -e "${green}x-ui v${last_version}${plain} The installation is complete, the panel is launched."
echo -e ""
echo -e "x-ui 管理脚本使用方法: "
echo -e "x-ui How to use the management script: "
echo -e "----------------------------------------------"
echo -e "x-ui - 显示管理菜单 (功能更多)"
echo -e "x-ui start - 启动 x-ui 面板"
echo -e "x-ui stop - 停止 x-ui 面板"
echo -e "x-ui restart - 重启 x-ui 面板"
echo -e "x-ui status - 查看 x-ui 状态"
echo -e "x-ui enable - 设置 x-ui 开机自启"
echo -e "x-ui disable - 取消 x-ui 开机自启"
echo -e "x-ui log - 查看 x-ui 日志"
echo -e "x-ui v2-ui - 迁移本机器的 v2-ui 账号数据至 x-ui"
echo -e "x-ui update - 更新 x-ui 面板"
echo -e "x-ui install - 安装 x-ui 面板"
echo -e "x-ui uninstall - 卸载 x-ui 面板"
echo -e "x-ui - Show admin menu (more functions)"
echo -e "x-ui start - Start the x-ui panel"
echo -e "x-ui stop - stop x-ui panel"
echo -e "x-ui restart - restart x-ui panel"
echo -e "x-ui status - View x-ui status"
echo -e "x-ui enable - Set x-ui to start automatically at boot"
echo -e "x-ui disable - Cancel x-ui boot auto-start"
echo -e "x-ui log - View x-ui logs"
echo -e "x-ui v2-ui - Migrate the v2-ui account data of this machine to x-ui"
echo -e "x-ui update - Update x-ui panel"
echo -e "x-ui install - install x-ui panel"
echo -e "x-ui uninstall - uninstall x-ui panel"
echo -e "----------------------------------------------"
}

echo -e "${green}开始安装${plain}"
echo -e "${green}start installation${plain}"
install_base
install_x-ui $1
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func runWebServer() {
}

sigCh := make(chan os.Signal, 1)
//信号量捕获处理
//Semaphore capture processing
signal.Notify(sigCh, syscall.SIGHUP, syscall.SIGTERM, syscall.SIGKILL)
for {
sig := <-sigCh
Expand Down
Loading