{{ .ID }}
"
+"helpAdminCommands" = "Xray Coreを再起動するには:\r\n/restart force
\r\n\r\nクライアントの電子メールを検索するには:\r\n/usage [電子メール]
\r\n\r\nインバウンド(クライアントの統計情報を含む)を検索するには:\r\n/inbound [備考]
\r\n\r\nTelegramチャットID:\r\n/id
"
+"helpClientCommands" = "統計情報を検索するには、次のコマンドを使用してください:\r\n/usage [電子メール]
\r\n\r\nTelegramチャットID:\r\n/id
"
+"restartUsage" = "\r\n\r\n/restart force
"
+"restartSuccess" = "✅ 操作成功!"
+"restartFailed" = "❗ 操作エラー。\r\n\r\nエラー: {{ .Error }}
"
+"xrayNotRunning" = "❗ Xray Core は動作していません。"
+
+[tgbot.messages]
+"cpuThreshold" = "🔴 CPU使用率は{{ .Percent }}%、しきい値{{ .Threshold }}%を超えました"
+"selectUserFailed" = "❌ ユーザーの選択に失敗しました!"
+"userSaved" = "✅ Telegramユーザーが保存されました。"
+"loginSuccess" = "✅ パネルに正常にログインしました。\r\n"
+"loginFailed" = "❗️ パネルのログインに失敗しました。\r\n"
+"report" = "🕰 定期報告:{{ .RunTime }}\r\n"
+"datetime" = "⏰ 日時:{{ .DateTime }}\r\n"
+"hostname" = "💻 ホスト名:{{ .Hostname }}\r\n"
+"version" = "🚀 X-UI バージョン:{{ .Version }}\r\n"
+"xrayVersion" = "📡 Xray バージョン: {{ .XrayVersion }}\r\n"
+"ipv6" = "🌐 IPv6:{{ .IPv6 }}\r\n"
+"ipv4" = "🌐 IPv4:{{ .IPv4 }}\r\n"
+"ip" = "🌐 IP:{{ .IP }}\r\n"
+"ips" = "🔢 IPアドレス:\r\n{{ .IPs }}\r\n"
+"serverUpTime" = "⏳ サーバー稼働時間:{{ .UpTime }} {{ .Unit }}\r\n"
+"serverLoad" = "📈 サーバー負荷:{{ .Load1 }}, {{ .Load2 }}, {{ .Load3 }}\r\n"
+"serverMemory" = "📋 サーバーメモリ:{{ .Current }}/{{ .Total }}\r\n"
+"tcpCount" = "🔹 TCP接続数:{{ .Count }}\r\n"
+"udpCount" = "🔸 UDP接続数:{{ .Count }}\r\n"
+"traffic" = "🚦 トラフィック:{{ .Total }} (↑{{ .Upload }},↓{{ .Download }})\r\n"
+"xrayStatus" = "ℹ️ Xrayステータス:{{ .State }}\r\n"
+"username" = "👤 ユーザー名:{{ .Username }}\r\n"
+"password" = "👤 パスワード: {{ .Password }}\r\n"
+"time" = "⏰ 時間:{{ .Time }}\r\n"
+"inbound" = "📍 インバウンド:{{ .Remark }}\r\n"
+"port" = "🔌 ポート:{{ .Port }}\r\n"
+"expire" = "📅 有効期限:{{ .Time }}\r\n"
+"expireIn" = "📅 残り時間:{{ .Time }}\r\n"
+"active" = "💡 有効:{{ .Enable }}\r\n"
+"enabled" = "🚨 有効化済み:{{ .Enable }}\r\n"
+"online" = "🌐 接続ステータス:{{ .Status }}\r\n"
+"email" = "📧 メール:{{ .Email }}\r\n"
+"upload" = "🔼 アップロード↑:{{ .Upload }}\r\n"
+"download" = "🔽 ダウンロード↓:{{ .Download }}\r\n"
+"total" = "📊 合計:{{ .UpDown }} / {{ .Total }}\r\n"
+"TGUser" = "👤 Telegramユーザー:{{ .TelegramID }}\r\n"
+"exhaustedMsg" = "🚨 消耗済みの {{ .Type }}:\r\n"
+"exhaustedCount" = "🚨 消耗済みの {{ .Type }} 数量:\r\n"
+"onlinesCount" = "🌐 オンラインクライアント:{{ .Count }}\r\n"
+"disabled" = "🛑 無効化:{{ .Disabled }}\r\n"
+"depleteSoon" = "🔜 間もなく消耗:{{ .Deplete }}\r\n\r\n"
+"backupTime" = "🗄 バックアップ時間:{{ .Time }}\r\n"
+"refreshedOn" = "\r\n📋🔄 更新時間:{{ .Time }}\r\n\r\n"
+"yes" = "✅ はい"
+"no" = "❌ いいえ"
+
+[tgbot.buttons]
+"closeKeyboard" = "❌ キーボードを閉じる"
+"cancel" = "❌ キャンセル"
+"cancelReset" = "❌ リセットをキャンセル"
+"cancelIpLimit" = "❌ IP制限をキャンセル"
+"confirmResetTraffic" = "✅ トラフィックをリセットしますか?"
+"confirmClearIps" = "✅ IPをクリアしますか?"
+"confirmRemoveTGUser" = "✅ Telegramユーザーを削除しますか?"
+"confirmToggle" = "✅ ユーザーを有効/無効にしますか?"
+"dbBackup" = "データベースバックアップを取得"
+"serverUsage" = "サーバーの使用状況"
+"getInbounds" = "インバウンド情報を取得"
+"depleteSoon" = "間もなく消耗"
+"clientUsage" = "使用状況を取得"
+"onlines" = "オンラインクライアント"
+"commands" = "コマンド"
+"refresh" = "🔄 更新"
+"clearIPs" = "❌ IPをクリア"
+"removeTGUser" = "❌ Telegramユーザーを削除"
+"selectTGUser" = "👤 Telegramユーザーを選択"
+"selectOneTGUser" = "👤 1人のTelegramユーザーを選択:"
+"resetTraffic" = "📈 トラフィックをリセット"
+"resetExpire" = "📅 有効期限を変更"
+"ipLog" = "🔢 IPログ"
+"ipLimit" = "🔢 IP制限"
+"setTGUser" = "👤 Telegramユーザーを設定"
+"toggle" = "🔘 有効/無効"
+"custom" = "🔢 カスタム"
+"confirmNumber" = "✅ 確認: {{ .Num }}"
+"confirmNumberAdd" = "✅ 追加を確認:{{ .Num }}"
+"limitTraffic" = "🚧 トラフィック制限"
+"getBanLogs" = "禁止ログ"
+"allClients" = "すべてのクライアント"
+
+[tgbot.answers]
+"successfulOperation" = "✅ 成功!"
+"errorOperation" = "❗ 操作エラー。"
+"getInboundsFailed" = "❌ インバウンド情報の取得に失敗しました。"
+"getClientsFailed" = "❌ クライアントの取得に失敗しました。"
+"canceled" = "❌ {{ .Email }}:操作がキャンセルされました。"
+"clientRefreshSuccess" = "✅ {{ .Email }}:クライアントが正常に更新されました。"
+"IpRefreshSuccess" = "✅ {{ .Email }}:IPが正常に更新されました。"
+"TGIdRefreshSuccess" = "✅ {{ .Email }}:クライアントのTelegramユーザーが正常に更新されました。"
+"resetTrafficSuccess" = "✅ {{ .Email }}:トラフィックが正常にリセットされました。"
+"setTrafficLimitSuccess" = "✅ {{ .Email }}:トラフィック制限が正常に保存されました。"
+"expireResetSuccess" = "✅ {{ .Email }}:有効期限の日数が正常にリセットされました。"
+"resetIpSuccess" = "✅ {{ .Email }}:IP制限数が正常に保存されました:{{ .Count }}。"
+"clearIpSuccess" = "✅ {{ .Email }}:IPが正常にクリアされました。"
+"getIpLog" = "✅ {{ .Email }}:IPログの取得。"
+"getUserInfo" = "✅ {{ .Email }}:Telegramユーザー情報の取得。"
+"removedTGUserSuccess" = "✅ {{ .Email }}:Telegramユーザーが正常に削除されました。"
+"enableSuccess" = "✅ {{ .Email }}:正常に有効化されました。"
+"disableSuccess" = "✅ {{ .Email }}:正常に無効化されました。"
+"askToAddUserId" = "設定が見つかりませんでした!\r\n管理者に問い合わせて、設定にTelegramユーザーのChatIDを使用してください。\r\n\r\nあなたのユーザーChatID:{{ .TgUserID }}
"
+"chooseClient" = "インバウンド {{ .Inbound }} のクライアントを選択"
+"chooseInbound" = "インバウンドを選択"
diff --git a/x-ui.sh b/x-ui.sh
index 19f20aea..4b2e8a20 100644
--- a/x-ui.sh
+++ b/x-ui.sh
@@ -1116,76 +1116,119 @@ ssl_cert_issue() {
}
ssl_cert_issue_CF() {
- echo -E ""
- LOGD "******Instructions for use******"
- LOGI "This Acme script requires the following data:"
- LOGI "1.Cloudflare Registered e-mail"
- LOGI "2.Cloudflare Global API Key"
- LOGI "3.The domain name that has been resolved dns to the current server by Cloudflare"
- LOGI "4.The script applies for a certificate. The default installation path is /root/cert "
- confirm "Confirmed?[y/n]" "y"
+ local existing_webBasePath=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'webBasePath: .+' | awk '{print $2}')
+ local existing_port=$(/usr/local/x-ui/x-ui setting -show true | grep -Eo 'port: .+' | awk '{print $2}')
+ LOGI "****** Instructions for Use ******"
+ LOGI "Follow the steps below to complete the process:"
+ LOGI "1. Cloudflare Registered E-mail."
+ LOGI "2. Cloudflare Global API Key."
+ LOGI "3. The Domain Name."
+ LOGI "4. Once the certificate is issued, you will be prompted to set the certificate for the panel (optional)."
+ LOGI "5. The script also supports automatic renewal of the SSL certificate after installation."
+
+ confirm "Do you confirm the information and wish to proceed? [y/n]" "y"
+
if [ $? -eq 0 ]; then
- # check for acme.sh first
+ # Check for acme.sh first
if ! command -v ~/.acme.sh/acme.sh &>/dev/null; then
- echo "acme.sh could not be found. we will install it"
+ echo "acme.sh could not be found. We will install it."
install_acme
if [ $? -ne 0 ]; then
- LOGE "install acme failed, please check logs"
+ LOGE "Install acme failed, please check logs."
exit 1
fi
fi
+
CF_Domain=""
- CF_GlobalKey=""
- CF_AccountEmail=""
- certPath=/root/cert
+ certPath="/root/cert-CF"
if [ ! -d "$certPath" ]; then
- mkdir $certPath
+ mkdir -p $certPath
else
rm -rf $certPath
- mkdir $certPath
+ mkdir -p $certPath
fi
+
LOGD "Please set a domain name:"
- read -p "Input your domain here:" CF_Domain
- LOGD "Your domain name is set to:${CF_Domain}"
+ read -p "Input your domain here: " CF_Domain
+ LOGD "Your domain name is set to: ${CF_Domain}"
+
+ # Set up Cloudflare API details
+ CF_GlobalKey=""
+ CF_AccountEmail=""
LOGD "Please set the API key:"
- read -p "Input your key here:" CF_GlobalKey
- LOGD "Your API key is:${CF_GlobalKey}"
+ read -p "Input your key here: " CF_GlobalKey
+ LOGD "Your API key is: ${CF_GlobalKey}"
+
LOGD "Please set up registered email:"
- read -p "Input your email here:" CF_AccountEmail
- LOGD "Your registered email address is:${CF_AccountEmail}"
+ read -p "Input your email here: " CF_AccountEmail
+ LOGD "Your registered email address is: ${CF_AccountEmail}"
+
+ # Set the default CA to Let's Encrypt
~/.acme.sh/acme.sh --set-default-ca --server letsencrypt
if [ $? -ne 0 ]; then
- LOGE "Default CA, Lets'Encrypt fail, script exiting..."
+ LOGE "Default CA, Let'sEncrypt fail, script exiting..."
exit 1
fi
+
export CF_Key="${CF_GlobalKey}"
- export CF_Email=${CF_AccountEmail}
+ 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
if [ $? -ne 0 ]; then
LOGE "Certificate issuance failed, script exiting..."
exit 1
else
- LOGI "Certificate issued Successfully, Installing..."
+ LOGI "Certificate issued successfully, Installing..."
fi
- ~/.acme.sh/acme.sh --installcert -d ${CF_Domain} -d *.${CF_Domain} --ca-file /root/cert/ca.cer \
- --cert-file /root/cert/${CF_Domain}.cer --key-file /root/cert/${CF_Domain}.key \
- --fullchain-file /root/cert/fullchain.cer
+
+ # Install the certificate
+ mkdir -p ${certPath}/${CF_Domain}
+ if [ $? -ne 0 ]; then
+ LOGE "Failed to create directory: ${certPath}/${CF_Domain}"
+ 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
+
if [ $? -ne 0 ]; then
LOGE "Certificate installation failed, script exiting..."
exit 1
else
- LOGI "Certificate installed Successfully,Turning on automatic updates..."
+ LOGI "Certificate installed successfully, Turning on automatic updates..."
fi
+
+ # Enable auto-update
~/.acme.sh/acme.sh --upgrade --auto-upgrade
if [ $? -ne 0 ]; then
- LOGE "Auto update setup Failed, script exiting..."
- ls -lah cert
- chmod 755 $certPath
+ LOGE "Auto update setup failed, script exiting..."
exit 1
else
- LOGI "The certificate is installed and auto-renewal is turned on, Specific information is as follows"
- ls -lah cert
- chmod 755 $certPath
+ 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}
+ 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"
+
+ if [[ -f "$webCertFile" && -f "$webKeyFile" ]]; then
+ /usr/local/x-ui/x-ui cert -webCert "$webCertFile" -webCertKey "$webKeyFile"
+ LOGI "Panel paths set for domain: $CF_Domain"
+ LOGI " - Certificate File: $webCertFile"
+ LOGI " - Private Key File: $webKeyFile"
+ echo -e "${green}Access URL: https://${CF_Domain}:${existing_port}${existing_webBasePath}${plain}"
+ restart
+ else
+ LOGE "Error: Certificate or private key file not found for domain: $CF_Domain."
+ fi
+ else
+ LOGI "Skipping panel path setting."
fi
else
show_menu