- Refines the overall structure of the CLI tools and MITM server functionalities.

- Add buildQwenBaseUrl function to construct URLs for Qwen resources.
- Update buildProviderUrl to support Qwen model requests.
- Enhance token refresh logic to include provider-specific data for Qwen.
- Refactor CLI Tools page to exclude MITM tools and streamline model retrieval.
- Introduce new components for MITM server management.
- Update API routes to handle Qwen-specific resource URLs and improve error handling.
This commit is contained in:
decolua
2026-03-05 11:25:03 +07:00
parent 40a53fbd33
commit 573b0f0241
29 changed files with 1490 additions and 438 deletions
+7 -3
View File
@@ -26,10 +26,14 @@ async function checkCertInstalled(certPath) {
function checkCertInstalledMac(certPath) {
return new Promise((resolve) => {
try {
// security outputs fingerprint without colons (e.g. "078B6B5F..."), strip them before grep
const fingerprint = getCertFingerprint(certPath).replace(/:/g, "");
exec(`security find-certificate -a -Z /Library/Keychains/System.keychain | grep -i "${fingerprint}"`, (error, stdout) => {
resolve(!error && !!stdout?.trim());
// security verify-cert returns 0 only if cert is trusted by system policy
exec(`security verify-cert -c "${certPath}" -p ssl -k /Library/Keychains/System.keychain 2>/dev/null`, (error) => {
if (!error) return resolve(true);
// Fallback: check if fingerprint appears in System keychain with trust
exec(`security dump-trust-settings -d 2>/dev/null | grep -i "${fingerprint}"`, (err2, stdout2) => {
resolve(!err2 && !!stdout2?.trim());
});
});
} catch {
resolve(false);