mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-03-03 14:43:01 +00:00
Compare commits
3 commits
a0e48c2fce
...
1019e006e2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1019e006e2 | ||
|
|
4c797dc154 | ||
|
|
837dea04e8 |
4 changed files with 25 additions and 2 deletions
4
.env.example
Normal file
4
.env.example
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
XUI_DEBUG=true
|
||||||
|
XUI_DB_FOLDER=x-ui
|
||||||
|
XUI_LOG_FOLDER=x-ui
|
||||||
|
XUI_BIN_FOLDER=x-ui
|
||||||
5
CONTRIBUTING.md
Normal file
5
CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
## Local Development Setup
|
||||||
|
|
||||||
|
- Create a directory named `x-ui` in the project root
|
||||||
|
- Rename `.env.example` to `.env `
|
||||||
|
- Run `main.go`
|
||||||
14
install.sh
14
install.sh
|
|
@ -220,6 +220,20 @@ install_x-ui() {
|
||||||
chmod +x /usr/bin/x-ui
|
chmod +x /usr/bin/x-ui
|
||||||
config_after_install
|
config_after_install
|
||||||
|
|
||||||
|
# Etckeeper compatibility
|
||||||
|
if [ -d "/etc/.git" ]; then
|
||||||
|
if [ -f "/etc/.gitignore" ]; then
|
||||||
|
if ! grep -q "x-ui/x-ui.db" "/etc/.gitignore"; then
|
||||||
|
echo "" >> "/etc/.gitignore"
|
||||||
|
echo "x-ui/x-ui.db" >> "/etc/.gitignore"
|
||||||
|
echo -e "${green}Added x-ui.db to /etc/.gitignore for etckeeper${plain}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "x-ui/x-ui.db" > "/etc/.gitignore"
|
||||||
|
echo -e "${green}Created /etc/.gitignore and added x-ui.db for etckeeper${plain}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $release == "alpine" ]]; then
|
if [[ $release == "alpine" ]]; then
|
||||||
wget --inet4-only -O /etc/init.d/x-ui https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.rc
|
wget --inet4-only -O /etc/init.d/x-ui https://raw.githubusercontent.com/MHSanaei/3x-ui/main/x-ui.rc
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
|
|
|
||||||
|
|
@ -527,10 +527,10 @@
|
||||||
findOutboundTraffic(o) {
|
findOutboundTraffic(o) {
|
||||||
for (const otraffic of this.outboundsTraffic) {
|
for (const otraffic of this.outboundsTraffic) {
|
||||||
if (otraffic.tag == o.tag) {
|
if (otraffic.tag == o.tag) {
|
||||||
return SizeFormatter.sizeFormat(otraffic.up) + ' / ' + SizeFormatter.sizeFormat(otraffic.down);
|
return `↑ ${SizeFormatter.sizeFormat(otraffic.up)} / ${SizeFormatter.sizeFormat(otraffic.down)} ↓`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return SizeFormatter.sizeFormat(0) + ' / ' + SizeFormatter.sizeFormat(0);
|
return `${SizeFormatter.sizeFormat(0)} / ${SizeFormatter.sizeFormat(0)}`
|
||||||
},
|
},
|
||||||
findOutboundAddress(o) {
|
findOutboundAddress(o) {
|
||||||
serverObj = null;
|
serverObj = null;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue