mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 21:42:24 +00:00
Compare commits
3 commits
9e32074e6b
...
baec373660
Author | SHA1 | Date | |
---|---|---|---|
![]() |
baec373660 | ||
![]() |
e3120c4028 | ||
![]() |
7ae855e7c9 |
15 changed files with 59 additions and 27 deletions
|
@ -506,12 +506,12 @@
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane key="2" tab="JSON" force-render="true">
|
<a-tab-pane key="2" tab="JSON" force-render="true">
|
||||||
<a-form-item style="margin: 10px 0"> Link: <a-input v-model.trim="outModal.link" style="width: 300px; margin-right: 5px;" placeholder="vmess:// vless:// trojan:// ss://"></a-input>
|
<a-space direction="vertical" :size="10" style="margin-top: 10px;">
|
||||||
<a-button @click="convertLink" type="primary">
|
<a-input addon-before='{{ i18n "pages.xray.outbound.link" }}' v-model.trim="outModal.link" placeholder="vmess:// vless:// trojan:// ss://">
|
||||||
<a-icon type="form"></a-icon>
|
<a-icon slot="addonAfter" type="form" @click="convertLink"></a-icon>
|
||||||
</a-button>
|
</a-input>
|
||||||
</a-form-item>
|
<textarea style="position:absolute; left: -800px;" id="outboundJson"></textarea>
|
||||||
<textarea style="position:absolute; left: -800px;" id="outboundJson"></textarea>
|
</a-space>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -377,7 +377,7 @@
|
||||||
<template #title>{{ i18n "pages.settings.tgNotifyCpu" }}</template>
|
<template #title>{{ i18n "pages.settings.tgNotifyCpu" }}</template>
|
||||||
<template #description>{{ i18n "pages.settings.tgNotifyCpuDesc" }}</template>
|
<template #description>{{ i18n "pages.settings.tgNotifyCpuDesc" }}</template>
|
||||||
<template #control>
|
<template #control>
|
||||||
<a-input-number :min="0" :min="100" v-model="allSetting.tgCpu"></a-switch>
|
<a-input-number :min="0" :min="100" v-model="allSetting.tgCpu" style="width: 100%;"></a-switch>
|
||||||
</template>
|
</template>
|
||||||
</a-setting-list-item>
|
</a-setting-list-item>
|
||||||
</a-collapse-panel>
|
</a-collapse-panel>
|
||||||
|
|
|
@ -429,6 +429,7 @@
|
||||||
"type" = "Type"
|
"type" = "Type"
|
||||||
"bridge" = "Bridge"
|
"bridge" = "Bridge"
|
||||||
"portal" = "Portal"
|
"portal" = "Portal"
|
||||||
|
"link" = "Link"
|
||||||
"intercon" = "Interconnection"
|
"intercon" = "Interconnection"
|
||||||
"settings" = "Settings"
|
"settings" = "Settings"
|
||||||
"accountInfo" = "Account Information"
|
"accountInfo" = "Account Information"
|
||||||
|
|
|
@ -431,6 +431,7 @@
|
||||||
"type" = "Tipo"
|
"type" = "Tipo"
|
||||||
"bridge" = "puente"
|
"bridge" = "puente"
|
||||||
"portal" = "portal"
|
"portal" = "portal"
|
||||||
|
"link" = "Enlace"
|
||||||
"intercon" = "Interconexión"
|
"intercon" = "Interconexión"
|
||||||
"settings" = "Configuración"
|
"settings" = "Configuración"
|
||||||
"accountInfo" = "Información de la Cuenta"
|
"accountInfo" = "Información de la Cuenta"
|
||||||
|
|
|
@ -431,6 +431,7 @@
|
||||||
"type" = "نوع"
|
"type" = "نوع"
|
||||||
"bridge" = "پل"
|
"bridge" = "پل"
|
||||||
"portal" = "پورتال"
|
"portal" = "پورتال"
|
||||||
|
"link" = "لینک"
|
||||||
"intercon" = "اتصال میانی"
|
"intercon" = "اتصال میانی"
|
||||||
"settings" = "تنظیمات"
|
"settings" = "تنظیمات"
|
||||||
"accountInfo" = "اطلاعات حساب"
|
"accountInfo" = "اطلاعات حساب"
|
||||||
|
|
|
@ -430,6 +430,7 @@
|
||||||
"type" = "Tipe"
|
"type" = "Tipe"
|
||||||
"bridge" = "Jembatan"
|
"bridge" = "Jembatan"
|
||||||
"portal" = "Portal"
|
"portal" = "Portal"
|
||||||
|
"link" = "Tautan"
|
||||||
"intercon" = "Interkoneksi"
|
"intercon" = "Interkoneksi"
|
||||||
"settings" = "Pengaturan"
|
"settings" = "Pengaturan"
|
||||||
"accountInfo" = "Informasi Akun"
|
"accountInfo" = "Informasi Akun"
|
||||||
|
|
|
@ -431,6 +431,7 @@
|
||||||
"type" = "タイプ"
|
"type" = "タイプ"
|
||||||
"bridge" = "ブリッジ"
|
"bridge" = "ブリッジ"
|
||||||
"portal" = "ポータル"
|
"portal" = "ポータル"
|
||||||
|
"link" = "リンク"
|
||||||
"intercon" = "インターコネクション"
|
"intercon" = "インターコネクション"
|
||||||
"settings" = "設定"
|
"settings" = "設定"
|
||||||
"accountInfo" = "アカウント情報"
|
"accountInfo" = "アカウント情報"
|
||||||
|
|
|
@ -431,6 +431,7 @@
|
||||||
"type" = "Tipo"
|
"type" = "Tipo"
|
||||||
"bridge" = "Ponte"
|
"bridge" = "Ponte"
|
||||||
"portal" = "Portal"
|
"portal" = "Portal"
|
||||||
|
"link" = "Link"
|
||||||
"intercon" = "Interconexão"
|
"intercon" = "Interconexão"
|
||||||
"settings" = "Configurações"
|
"settings" = "Configurações"
|
||||||
"accountInfo" = "Informações da Conta"
|
"accountInfo" = "Informações da Conta"
|
||||||
|
|
|
@ -431,6 +431,7 @@
|
||||||
"type" = "Тип"
|
"type" = "Тип"
|
||||||
"bridge" = "Мост"
|
"bridge" = "Мост"
|
||||||
"portal" = "Портал"
|
"portal" = "Портал"
|
||||||
|
"link" = "Ссылка"
|
||||||
"intercon" = "Соединение"
|
"intercon" = "Соединение"
|
||||||
"settings" = "Настройки"
|
"settings" = "Настройки"
|
||||||
"accountInfo" = "Информация об учетной записи"
|
"accountInfo" = "Информация об учетной записи"
|
||||||
|
|
|
@ -431,6 +431,7 @@
|
||||||
"type" = "Tür"
|
"type" = "Tür"
|
||||||
"bridge" = "Köprü"
|
"bridge" = "Köprü"
|
||||||
"portal" = "Portal"
|
"portal" = "Portal"
|
||||||
|
"link" = "Bağlantı"
|
||||||
"intercon" = "Bağlantı"
|
"intercon" = "Bağlantı"
|
||||||
"settings" = "Ayarlar"
|
"settings" = "Ayarlar"
|
||||||
"accountInfo" = "Hesap Bilgileri"
|
"accountInfo" = "Hesap Bilgileri"
|
||||||
|
|
|
@ -431,6 +431,7 @@
|
||||||
"type" = "Тип"
|
"type" = "Тип"
|
||||||
"bridge" = "Міст"
|
"bridge" = "Міст"
|
||||||
"portal" = "Портал"
|
"portal" = "Портал"
|
||||||
|
"link" = "Посилання"
|
||||||
"intercon" = "Взаємозв'язок"
|
"intercon" = "Взаємозв'язок"
|
||||||
"settings" = "Налаштування"
|
"settings" = "Налаштування"
|
||||||
"accountInfo" = "Інформація про обліковий запис"
|
"accountInfo" = "Інформація про обліковий запис"
|
||||||
|
|
|
@ -431,6 +431,7 @@
|
||||||
"type" = "Loại"
|
"type" = "Loại"
|
||||||
"bridge" = "Cầu"
|
"bridge" = "Cầu"
|
||||||
"portal" = "Cổng thông tin"
|
"portal" = "Cổng thông tin"
|
||||||
|
"link" = "Liên kết"
|
||||||
"intercon" = "Kết nối"
|
"intercon" = "Kết nối"
|
||||||
"settings" = "cài đặt"
|
"settings" = "cài đặt"
|
||||||
"accountInfo" = "Thông tin tài khoản"
|
"accountInfo" = "Thông tin tài khoản"
|
||||||
|
|
|
@ -431,6 +431,7 @@
|
||||||
"type" = "类型"
|
"type" = "类型"
|
||||||
"bridge" = "Bridge"
|
"bridge" = "Bridge"
|
||||||
"portal" = "Portal"
|
"portal" = "Portal"
|
||||||
|
"link" = "链接"
|
||||||
"intercon" = "互连"
|
"intercon" = "互连"
|
||||||
"settings" = "设置"
|
"settings" = "设置"
|
||||||
"accountInfo" = "帐户信息"
|
"accountInfo" = "帐户信息"
|
||||||
|
|
|
@ -431,6 +431,7 @@
|
||||||
"type" = "類型"
|
"type" = "類型"
|
||||||
"bridge" = "Bridge"
|
"bridge" = "Bridge"
|
||||||
"portal" = "Portal"
|
"portal" = "Portal"
|
||||||
|
"link" = "連結"
|
||||||
"intercon" = "互連"
|
"intercon" = "互連"
|
||||||
"settings" = "設定"
|
"settings" = "設定"
|
||||||
"accountInfo" = "帳戶資訊"
|
"accountInfo" = "帳戶資訊"
|
||||||
|
|
60
x-ui.sh
60
x-ui.sh
|
@ -1127,7 +1127,7 @@ ssl_cert_issue() {
|
||||||
|
|
||||||
# issue the certificate
|
# issue the certificate
|
||||||
~/.acme.sh/acme.sh --set-default-ca --server letsencrypt
|
~/.acme.sh/acme.sh --set-default-ca --server letsencrypt
|
||||||
~/.acme.sh/acme.sh --issue -d ${domain} --listen-v6 --standalone --httpport ${WebPort}
|
~/.acme.sh/acme.sh --issue -d ${domain} --listen-v6 --standalone --httpport ${WebPort} --force
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
LOGE "Issuing certificate failed, please check logs."
|
LOGE "Issuing certificate failed, please check logs."
|
||||||
rm -rf ~/.acme.sh/${domain}
|
rm -rf ~/.acme.sh/${domain}
|
||||||
|
@ -1208,13 +1208,6 @@ ssl_cert_issue_CF() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CF_Domain=""
|
CF_Domain=""
|
||||||
certPath="/root/cert-CF"
|
|
||||||
if [ ! -d "$certPath" ]; then
|
|
||||||
mkdir -p $certPath
|
|
||||||
else
|
|
||||||
rm -rf $certPath
|
|
||||||
mkdir -p $certPath
|
|
||||||
fi
|
|
||||||
|
|
||||||
LOGD "Please set a domain name:"
|
LOGD "Please set a domain name:"
|
||||||
read -p "Input your domain here: " CF_Domain
|
read -p "Input your domain here: " CF_Domain
|
||||||
|
@ -1242,7 +1235,7 @@ ssl_cert_issue_CF() {
|
||||||
export CF_Email="${CF_AccountEmail}"
|
export CF_Email="${CF_AccountEmail}"
|
||||||
|
|
||||||
# Issue the certificate using Cloudflare DNS
|
# Issue the certificate using Cloudflare DNS
|
||||||
~/.acme.sh/acme.sh --issue --dns dns_cf -d ${CF_Domain} -d *.${CF_Domain} --log
|
~/.acme.sh/acme.sh --issue --dns dns_cf -d ${CF_Domain} -d *.${CF_Domain} --log --force
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
LOGE "Certificate issuance failed, script exiting..."
|
LOGE "Certificate issuance failed, script exiting..."
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -1250,17 +1243,45 @@ ssl_cert_issue_CF() {
|
||||||
LOGI "Certificate issued successfully, Installing..."
|
LOGI "Certificate issued successfully, Installing..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install the certificate
|
# Install the certificate
|
||||||
mkdir -p ${certPath}/${CF_Domain}
|
certPath="/root/cert/${CF_Domain}"
|
||||||
|
if [ -d "$certPath" ]; then
|
||||||
|
rm -rf ${certPath}
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p ${certPath}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
LOGE "Failed to create directory: ${certPath}/${CF_Domain}"
|
LOGE "Failed to create directory: ${certPath}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
~/.acme.sh/acme.sh --installcert -d ${CF_Domain} -d *.${CF_Domain} \
|
reloadCmd="x-ui restart"
|
||||||
--fullchain-file ${certPath}/${CF_Domain}/fullchain.pem \
|
|
||||||
--key-file ${certPath}/${CF_Domain}/privkey.pem
|
|
||||||
|
|
||||||
|
LOGI "Default --reloadcmd for ACME is: ${yellow}x-ui restart"
|
||||||
|
LOGI "This command will run on every certificate issue and renew."
|
||||||
|
read -p "Would you like to modify --reloadcmd for ACME? (y/n): " setReloadcmd
|
||||||
|
if [[ "$setReloadcmd" == "y" || "$setReloadcmd" == "Y" ]]; then
|
||||||
|
echo -e "\n${green}\t1.${plain} Preset: x-ui restart ; systemctl reload nginx"
|
||||||
|
echo -e "${green}\t2.${plain} Input your own command"
|
||||||
|
echo -e "${green}\t0.${plain} Keep default reloadcmd"
|
||||||
|
read -p "Choose an option: " choice
|
||||||
|
case "$choice" in
|
||||||
|
1)
|
||||||
|
LOGI "Reloadcmd is: x-ui restart ; systemctl reload nginx"
|
||||||
|
reloadCmd="x-ui restart ; systemctl reload nginx"
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
read -p "Please enter your reloadcmd (example: x-ui restart ; systemctl reload nginx): " reloadCmd
|
||||||
|
LOGI "Your reloadcmd is: ${reloadCmd}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
LOGI "Keep default reloadcmd"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
~/.acme.sh/acme.sh --installcert -d ${CF_Domain} -d *.${CF_Domain} \
|
||||||
|
--key-file ${certPath}/privkey.pem \
|
||||||
|
--fullchain-file ${certPath}/fullchain.pem --reloadcmd "${reloadCmd}"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
LOGE "Certificate installation failed, script exiting..."
|
LOGE "Certificate installation failed, script exiting..."
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -1275,15 +1296,15 @@ ssl_cert_issue_CF() {
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
LOGI "The certificate is installed and auto-renewal is turned on. Specific information is as follows:"
|
LOGI "The certificate is installed and auto-renewal is turned on. Specific information is as follows:"
|
||||||
ls -lah ${certPath}/${CF_Domain}
|
ls -lah ${certPath}/*
|
||||||
chmod 755 ${certPath}/${CF_Domain}
|
chmod 755 ${certPath}/*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prompt user to set panel paths after successful certificate installation
|
# Prompt user to set panel paths after successful certificate installation
|
||||||
read -p "Would you like to set this certificate for the panel? (y/n): " setPanel
|
read -p "Would you like to set this certificate for the panel? (y/n): " setPanel
|
||||||
if [[ "$setPanel" == "y" || "$setPanel" == "Y" ]]; then
|
if [[ "$setPanel" == "y" || "$setPanel" == "Y" ]]; then
|
||||||
local webCertFile="${certPath}/${CF_Domain}/fullchain.pem"
|
local webCertFile="${certPath}/fullchain.pem"
|
||||||
local webKeyFile="${certPath}/${CF_Domain}/privkey.pem"
|
local webKeyFile="${certPath}/privkey.pem"
|
||||||
|
|
||||||
if [[ -f "$webCertFile" && -f "$webKeyFile" ]]; then
|
if [[ -f "$webCertFile" && -f "$webKeyFile" ]]; then
|
||||||
/usr/local/x-ui/x-ui cert -webCert "$webCertFile" -webCertKey "$webKeyFile"
|
/usr/local/x-ui/x-ui cert -webCert "$webCertFile" -webCertKey "$webKeyFile"
|
||||||
|
@ -1585,7 +1606,6 @@ install_iplimit() {
|
||||||
# Launching fail2ban
|
# Launching fail2ban
|
||||||
if ! systemctl is-active --quiet fail2ban; then
|
if ! systemctl is-active --quiet fail2ban; then
|
||||||
systemctl start fail2ban
|
systemctl start fail2ban
|
||||||
systemctl enable fail2ban
|
|
||||||
else
|
else
|
||||||
systemctl restart fail2ban
|
systemctl restart fail2ban
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue