Compare commits

...

3 commits

Author SHA1 Message Date
Tara Rostami
baec373660
Merge e675c1d762 into e3120c4028 2025-03-17 09:13:11 +01:00
somebodywashere
e3120c4028
Updates to CF cert issue (#2780) 2025-03-17 09:12:52 +01:00
Shishkevich D.
7ae855e7c9
chore: some improvements (#2782)
* chore: improve outbound link input

* chore: ui improvement
2025-03-17 08:26:59 +07:00
15 changed files with 59 additions and 27 deletions

View file

@ -506,12 +506,12 @@
</a-form>
</a-tab-pane>
<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-button @click="convertLink" type="primary">
<a-icon type="form"></a-icon>
</a-button>
</a-form-item>
<a-space direction="vertical" :size="10" style="margin-top: 10px;">
<a-input addon-before='{{ i18n "pages.xray.outbound.link" }}' v-model.trim="outModal.link" placeholder="vmess:// vless:// trojan:// ss://">
<a-icon slot="addonAfter" type="form" @click="convertLink"></a-icon>
</a-input>
<textarea style="position:absolute; left: -800px;" id="outboundJson"></textarea>
</a-space>
</a-tab-pane>
</a-tabs>
{{end}}

View file

@ -377,7 +377,7 @@
<template #title>{{ i18n "pages.settings.tgNotifyCpu" }}</template>
<template #description>{{ i18n "pages.settings.tgNotifyCpuDesc" }}</template>
<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>
</a-setting-list-item>
</a-collapse-panel>

View file

@ -429,6 +429,7 @@
"type" = "Type"
"bridge" = "Bridge"
"portal" = "Portal"
"link" = "Link"
"intercon" = "Interconnection"
"settings" = "Settings"
"accountInfo" = "Account Information"

View file

@ -431,6 +431,7 @@
"type" = "Tipo"
"bridge" = "puente"
"portal" = "portal"
"link" = "Enlace"
"intercon" = "Interconexión"
"settings" = "Configuración"
"accountInfo" = "Información de la Cuenta"

View file

@ -431,6 +431,7 @@
"type" = "نوع"
"bridge" = "پل"
"portal" = "پورتال"
"link" = "لینک"
"intercon" = "اتصال میانی"
"settings" = "تنظیمات"
"accountInfo" = "اطلاعات حساب"

View file

@ -430,6 +430,7 @@
"type" = "Tipe"
"bridge" = "Jembatan"
"portal" = "Portal"
"link" = "Tautan"
"intercon" = "Interkoneksi"
"settings" = "Pengaturan"
"accountInfo" = "Informasi Akun"

View file

@ -431,6 +431,7 @@
"type" = "タイプ"
"bridge" = "ブリッジ"
"portal" = "ポータル"
"link" = "リンク"
"intercon" = "インターコネクション"
"settings" = "設定"
"accountInfo" = "アカウント情報"

View file

@ -431,6 +431,7 @@
"type" = "Tipo"
"bridge" = "Ponte"
"portal" = "Portal"
"link" = "Link"
"intercon" = "Interconexão"
"settings" = "Configurações"
"accountInfo" = "Informações da Conta"

View file

@ -431,6 +431,7 @@
"type" = "Тип"
"bridge" = "Мост"
"portal" = "Портал"
"link" = "Ссылка"
"intercon" = "Соединение"
"settings" = "Настройки"
"accountInfo" = "Информация об учетной записи"

View file

@ -431,6 +431,7 @@
"type" = "Tür"
"bridge" = "Köprü"
"portal" = "Portal"
"link" = "Bağlantı"
"intercon" = "Bağlantı"
"settings" = "Ayarlar"
"accountInfo" = "Hesap Bilgileri"

View file

@ -431,6 +431,7 @@
"type" = "Тип"
"bridge" = "Міст"
"portal" = "Портал"
"link" = "Посилання"
"intercon" = "Взаємозв'язок"
"settings" = "Налаштування"
"accountInfo" = "Інформація про обліковий запис"

View file

@ -431,6 +431,7 @@
"type" = "Loại"
"bridge" = "Cầu"
"portal" = "Cổng thông tin"
"link" = "Liên kết"
"intercon" = "Kết nối"
"settings" = "cài đặt"
"accountInfo" = "Thông tin tài khoản"

View file

@ -431,6 +431,7 @@
"type" = "类型"
"bridge" = "Bridge"
"portal" = "Portal"
"link" = "链接"
"intercon" = "互连"
"settings" = "设置"
"accountInfo" = "帐户信息"

View file

@ -431,6 +431,7 @@
"type" = "類型"
"bridge" = "Bridge"
"portal" = "Portal"
"link" = "連結"
"intercon" = "互連"
"settings" = "設定"
"accountInfo" = "帳戶資訊"

58
x-ui.sh
View file

@ -1127,7 +1127,7 @@ ssl_cert_issue() {
# issue the certificate
~/.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
LOGE "Issuing certificate failed, please check logs."
rm -rf ~/.acme.sh/${domain}
@ -1208,13 +1208,6 @@ ssl_cert_issue_CF() {
fi
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:"
read -p "Input your domain here: " CF_Domain
@ -1242,7 +1235,7 @@ ssl_cert_issue_CF() {
export CF_Email="${CF_AccountEmail}"
# 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
LOGE "Certificate issuance failed, script exiting..."
exit 1
@ -1251,16 +1244,44 @@ ssl_cert_issue_CF() {
fi
# 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
LOGE "Failed to create directory: ${certPath}/${CF_Domain}"
LOGE "Failed to create directory: ${certPath}"
exit 1
fi
~/.acme.sh/acme.sh --installcert -d ${CF_Domain} -d *.${CF_Domain} \
--fullchain-file ${certPath}/${CF_Domain}/fullchain.pem \
--key-file ${certPath}/${CF_Domain}/privkey.pem
reloadCmd="x-ui restart"
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
LOGE "Certificate installation failed, script exiting..."
exit 1
@ -1275,15 +1296,15 @@ ssl_cert_issue_CF() {
exit 1
else
LOGI "The certificate is installed and auto-renewal is turned on. Specific information is as follows:"
ls -lah ${certPath}/${CF_Domain}
chmod 755 ${certPath}/${CF_Domain}
ls -lah ${certPath}/*
chmod 755 ${certPath}/*
fi
# 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
if [[ "$setPanel" == "y" || "$setPanel" == "Y" ]]; then
local webCertFile="${certPath}/${CF_Domain}/fullchain.pem"
local webKeyFile="${certPath}/${CF_Domain}/privkey.pem"
local webCertFile="${certPath}/fullchain.pem"
local webKeyFile="${certPath}/privkey.pem"
if [[ -f "$webCertFile" && -f "$webKeyFile" ]]; then
/usr/local/x-ui/x-ui cert -webCert "$webCertFile" -webCertKey "$webKeyFile"
@ -1585,7 +1606,6 @@ install_iplimit() {
# Launching fail2ban
if ! systemctl is-active --quiet fail2ban; then
systemctl start fail2ban
systemctl enable fail2ban
else
systemctl restart fail2ban
fi