mirror of
https://github.com/aiclientproxy/proxycast.git
synced 2026-09-24 23:10:56 +08:00
更新前端端口与安全提示
This commit is contained in:
Generated
+20
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "proxycast",
|
||||
"version": "0.14.2",
|
||||
"version": "0.14.6",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "proxycast",
|
||||
"version": "0.14.2",
|
||||
"version": "0.14.6",
|
||||
"dependencies": {
|
||||
"@radix-ui/react-dialog": "^1.1.2",
|
||||
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
||||
@@ -97,6 +97,7 @@
|
||||
"integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.27.1",
|
||||
"@babel/generator": "^7.28.5",
|
||||
@@ -2780,6 +2781,7 @@
|
||||
"integrity": "sha512-LPM2G3Syo1GLzXLGJAKdqoU35XvrWzGJ21/7sgZTUpbkBaOasTj8tjwn6w+hCkqaa1TfJ/w67rJSwYItlJ2mYw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"undici-types": "~6.21.0"
|
||||
}
|
||||
@@ -2797,6 +2799,7 @@
|
||||
"integrity": "sha512-cisd7gxkzjBKU2GgdYrTdtQx1SORymWyaAFhaxQPK9bYO9ot3Y5OikQRvY0VYQtvwjeQnizCINJAenh/V7MK2w==",
|
||||
"devOptional": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/prop-types": "*",
|
||||
"csstype": "^3.2.2"
|
||||
@@ -2808,6 +2811,7 @@
|
||||
"integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==",
|
||||
"devOptional": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"peerDependencies": {
|
||||
"@types/react": "^18.0.0"
|
||||
}
|
||||
@@ -2847,6 +2851,7 @@
|
||||
"integrity": "sha512-N9lBGA9o9aqb1hVMc9hzySbhKibHmB+N3IpoShyV6HyQYRGIhlrO5rQgttypi+yEeKsKI4idxC8Jw6gXKD4THA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "8.49.0",
|
||||
"@typescript-eslint/types": "8.49.0",
|
||||
@@ -3169,6 +3174,7 @@
|
||||
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
@@ -3387,6 +3393,7 @@
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"baseline-browser-mapping": "^2.9.0",
|
||||
"caniuse-lite": "^1.0.30001759",
|
||||
@@ -3734,6 +3741,7 @@
|
||||
"integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.8.0",
|
||||
"@eslint-community/regexpp": "^4.12.1",
|
||||
@@ -4368,6 +4376,7 @@
|
||||
"integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"jiti": "bin/jiti.js"
|
||||
}
|
||||
@@ -4846,6 +4855,7 @@
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.11",
|
||||
"picocolors": "^1.1.1",
|
||||
@@ -5068,6 +5078,7 @@
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
|
||||
"integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"loose-envify": "^1.1.0"
|
||||
},
|
||||
@@ -5080,6 +5091,7 @@
|
||||
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",
|
||||
"integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"loose-envify": "^1.1.0",
|
||||
"scheduler": "^0.23.2"
|
||||
@@ -5572,6 +5584,7 @@
|
||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
@@ -5647,6 +5660,7 @@
|
||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
@@ -5759,6 +5773,7 @@
|
||||
"integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.21.3",
|
||||
"postcss": "^8.4.43",
|
||||
@@ -5819,6 +5834,7 @@
|
||||
"integrity": "sha512-E4t7DJ9pESL6E3I8nFjPa4xGUd3PmiWDLsDztS2qXSJWfHtbQnwAWylaBvSNY48I3vr8PTqIZlyK8TE3V3CA4Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vitest/expect": "4.0.16",
|
||||
"@vitest/mocker": "4.0.16",
|
||||
@@ -6375,6 +6391,7 @@
|
||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
@@ -6388,6 +6405,7 @@
|
||||
"integrity": "sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.27.0",
|
||||
"fdir": "^6.5.0",
|
||||
|
||||
@@ -153,7 +153,7 @@ export function Dashboard() {
|
||||
|
||||
const serverUrl = status
|
||||
? `http://${status.host}:${status.port}`
|
||||
: "http://localhost:3001";
|
||||
: "http://localhost:8999";
|
||||
|
||||
const getProviderName = (id: string) => {
|
||||
switch (id) {
|
||||
|
||||
@@ -148,7 +148,7 @@ export function ApiServerPage() {
|
||||
...config,
|
||||
server: {
|
||||
...config.server,
|
||||
port: parseInt(editPort) || 3001,
|
||||
port: parseInt(editPort) || 8999,
|
||||
api_key: editApiKey,
|
||||
},
|
||||
};
|
||||
@@ -236,8 +236,8 @@ export function ApiServerPage() {
|
||||
|
||||
const serverUrl = status
|
||||
? `http://${status.host}:${status.port}`
|
||||
: "http://localhost:3001";
|
||||
const apiKey = config?.server.api_key || "proxycast-key";
|
||||
: `http://localhost:${config?.server.port ?? 8999}`;
|
||||
const apiKey = config?.server.api_key ?? "";
|
||||
|
||||
// Test endpoints
|
||||
const testEndpoints = [
|
||||
|
||||
@@ -142,7 +142,7 @@ const presets: Record<AppType, ProviderPreset[]> = {
|
||||
name: "ProxyCast",
|
||||
category: "proxy",
|
||||
iconColor: "#3b82f6",
|
||||
defaultBaseUrl: "http://127.0.0.1:3001",
|
||||
defaultBaseUrl: "http://127.0.0.1:8999",
|
||||
},
|
||||
// 从凭证池导入
|
||||
{
|
||||
@@ -192,7 +192,7 @@ model = "gpt-4o"
|
||||
iconColor: "#3b82f6",
|
||||
defaultCodexAuth: {
|
||||
api_key: "proxycast",
|
||||
api_base_url: "http://127.0.0.1:3001/v1",
|
||||
api_base_url: "http://127.0.0.1:8999/v1",
|
||||
},
|
||||
},
|
||||
// 从凭证池导入
|
||||
@@ -228,7 +228,7 @@ model = "gpt-4o"
|
||||
iconColor: "#3b82f6",
|
||||
defaultGeminiEnv: {
|
||||
GEMINI_API_KEY: "proxycast",
|
||||
GOOGLE_GEMINI_BASE_URL: "http://127.0.0.1:3001",
|
||||
GOOGLE_GEMINI_BASE_URL: "http://127.0.0.1:8999",
|
||||
GEMINI_MODEL: "gemini-2.0-flash",
|
||||
},
|
||||
},
|
||||
@@ -562,7 +562,7 @@ export function ProviderForm({
|
||||
const config = await getConfig();
|
||||
const proxyApiKey = config.server.api_key || "";
|
||||
const proxyHost = config.server.host || "127.0.0.1";
|
||||
const proxyPort = config.server.port || 3001;
|
||||
const proxyPort = config.server.port || 8999;
|
||||
const proxyBaseUrl = `http://${proxyHost}:${proxyPort}`;
|
||||
|
||||
if (appType === "claude") {
|
||||
@@ -681,7 +681,7 @@ export function ProviderForm({
|
||||
const config = await getConfig();
|
||||
const proxyApiKey = config.server.api_key || "";
|
||||
const proxyHost = config.server.host || "127.0.0.1";
|
||||
const proxyPort = config.server.port || 3001;
|
||||
const proxyPort = config.server.port || 8999;
|
||||
const proxyBaseUrl = `http://${proxyHost}:${proxyPort}`;
|
||||
|
||||
if (appType === "claude") {
|
||||
|
||||
@@ -53,7 +53,7 @@ const providerModels: Record<PoolProviderType, string[]> = {
|
||||
],
|
||||
openai: [], // 自定义 API,无预设模型
|
||||
claude: [], // 自定义 API,无预设模型
|
||||
codex: ["gpt-4o", "gpt-4o-mini", "o1", "o1-mini", "o3-mini"], // Codex OAuth
|
||||
codex: ["gpt-4o", "gpt-4o-mini", "o1", "o1-mini", "o3-mini"], // Codex(OAuth / API Key)
|
||||
claude_oauth: [
|
||||
"claude-3-5-sonnet-latest",
|
||||
"claude-3-5-haiku-latest",
|
||||
|
||||
@@ -56,7 +56,7 @@ const providerLabels: Record<PoolProviderType, string> = {
|
||||
antigravity: "Antigravity (Gemini 3 Pro)",
|
||||
openai: "OpenAI",
|
||||
claude: "Claude (Anthropic)",
|
||||
codex: "Codex (OpenAI OAuth)",
|
||||
codex: "Codex (OAuth / API Key)",
|
||||
claude_oauth: "Claude OAuth",
|
||||
iflow: "iFlow",
|
||||
};
|
||||
|
||||
@@ -173,7 +173,7 @@ export function ProxySettings() {
|
||||
...config,
|
||||
server: {
|
||||
...config.server,
|
||||
port: parseInt(e.target.value) || 3001,
|
||||
port: parseInt(e.target.value) || 8999,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -88,7 +88,8 @@ export function RemoteManagementSettings() {
|
||||
}
|
||||
|
||||
const rm = config.remote_management;
|
||||
const isEnabled = rm.secret_key && rm.secret_key.length > 0;
|
||||
const isEnabled = Boolean(rm.secret_key && rm.secret_key.length > 0);
|
||||
const remoteAccessSupported = false;
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
@@ -121,6 +122,13 @@ export function RemoteManagementSettings() {
|
||||
)}
|
||||
|
||||
<div className="p-4 rounded-lg border space-y-4">
|
||||
{!remoteAccessSupported && (
|
||||
<div className="flex items-start gap-2 rounded-lg bg-yellow-50 dark:bg-yellow-900/20 p-3 text-sm text-yellow-700 dark:text-yellow-400">
|
||||
<AlertTriangle className="h-4 w-4 shrink-0 mt-0.5" />
|
||||
<span>当前版本未启用 TLS,暂不支持远程管理访问,请保持关闭。</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 管理密钥 */}
|
||||
<div>
|
||||
<label className="block text-sm font-medium mb-1.5">管理密钥</label>
|
||||
@@ -179,7 +187,7 @@ export function RemoteManagementSettings() {
|
||||
|
||||
{/* 允许远程访问 */}
|
||||
<label
|
||||
className={`flex items-center justify-between p-3 rounded-lg border cursor-pointer hover:bg-muted/50 ${!isEnabled ? "opacity-50 pointer-events-none" : ""}`}
|
||||
className={`flex items-center justify-between p-3 rounded-lg border cursor-pointer hover:bg-muted/50 ${!isEnabled || !remoteAccessSupported ? "opacity-50 pointer-events-none" : ""}`}
|
||||
>
|
||||
<div>
|
||||
<span className="text-sm font-medium">允许远程访问</span>
|
||||
@@ -194,7 +202,7 @@ export function RemoteManagementSettings() {
|
||||
updateRemoteManagement({ allow_remote: e.target.checked })
|
||||
}
|
||||
className="w-4 h-4 rounded border-gray-300"
|
||||
disabled={!isEnabled}
|
||||
disabled={!isEnabled || !remoteAccessSupported}
|
||||
/>
|
||||
</label>
|
||||
|
||||
@@ -222,7 +230,7 @@ export function RemoteManagementSettings() {
|
||||
</label>
|
||||
|
||||
{/* 警告提示 */}
|
||||
{isEnabled && rm.allow_remote && (
|
||||
{remoteAccessSupported && isEnabled && rm.allow_remote && (
|
||||
<div className="flex items-start gap-2 rounded-lg bg-yellow-50 dark:bg-yellow-900/20 p-3 text-sm text-yellow-700 dark:text-yellow-400">
|
||||
<AlertTriangle className="h-4 w-4 shrink-0 mt-0.5" />
|
||||
<span>
|
||||
|
||||
@@ -89,6 +89,7 @@ export function TlsSettings() {
|
||||
);
|
||||
}
|
||||
|
||||
const tlsSupported = false;
|
||||
const tls = config.server.tls;
|
||||
const isConfigValid = !tls.enable || (tls.cert_path && tls.key_path);
|
||||
|
||||
@@ -121,6 +122,16 @@ export function TlsSettings() {
|
||||
)}
|
||||
|
||||
<div className="p-4 rounded-lg border space-y-4">
|
||||
{!tlsSupported && (
|
||||
<div className="flex items-start gap-2 rounded-lg bg-yellow-50 dark:bg-yellow-900/20 p-3 text-sm text-yellow-700 dark:text-yellow-400">
|
||||
<AlertTriangle className="h-4 w-4 shrink-0 mt-0.5" />
|
||||
<span>
|
||||
当前版本暂不支持 TLS。启用后服务将无法启动,请使用反向代理或 TLS
|
||||
终止。
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 启用开关 */}
|
||||
<label className="flex items-center justify-between p-3 rounded-lg border cursor-pointer hover:bg-muted/50">
|
||||
<div>
|
||||
@@ -133,12 +144,17 @@ export function TlsSettings() {
|
||||
type="checkbox"
|
||||
checked={tls.enable}
|
||||
onChange={(e) => updateTls({ enable: e.target.checked })}
|
||||
disabled={!tlsSupported}
|
||||
className="w-4 h-4 rounded border-gray-300"
|
||||
/>
|
||||
</label>
|
||||
|
||||
{/* 证书路径 */}
|
||||
<div className={tls.enable ? "" : "opacity-50 pointer-events-none"}>
|
||||
<div
|
||||
className={
|
||||
tls.enable && tlsSupported ? "" : "opacity-50 pointer-events-none"
|
||||
}
|
||||
>
|
||||
<label className="block text-sm font-medium mb-1.5">
|
||||
证书文件路径 {tls.enable && <span className="text-red-500">*</span>}
|
||||
</label>
|
||||
@@ -165,7 +181,11 @@ export function TlsSettings() {
|
||||
</div>
|
||||
|
||||
{/* 私钥路径 */}
|
||||
<div className={tls.enable ? "" : "opacity-50 pointer-events-none"}>
|
||||
<div
|
||||
className={
|
||||
tls.enable && tlsSupported ? "" : "opacity-50 pointer-events-none"
|
||||
}
|
||||
>
|
||||
<label className="block text-sm font-medium mb-1.5">
|
||||
私钥文件路径 {tls.enable && <span className="text-red-500">*</span>}
|
||||
</label>
|
||||
@@ -201,7 +221,7 @@ export function TlsSettings() {
|
||||
|
||||
<button
|
||||
onClick={handleSave}
|
||||
disabled={saving || (tls.enable && !isConfigValid)}
|
||||
disabled={saving || !tlsSupported || (tls.enable && !isConfigValid)}
|
||||
className="w-full px-4 py-2 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 disabled:opacity-50"
|
||||
>
|
||||
{saving ? "保存中..." : "保存 TLS 设置"}
|
||||
|
||||
@@ -136,7 +136,7 @@ const presets: Record<AppType, ProviderPreset[]> = {
|
||||
name: "ProxyCast",
|
||||
category: "proxy",
|
||||
iconColor: "#3b82f6",
|
||||
defaultBaseUrl: "http://127.0.0.1:3001",
|
||||
defaultBaseUrl: "http://127.0.0.1:8999",
|
||||
},
|
||||
// 自定义
|
||||
{
|
||||
@@ -179,7 +179,7 @@ model = "gpt-4o"
|
||||
iconColor: "#3b82f6",
|
||||
defaultCodexAuth: {
|
||||
api_key: "proxycast",
|
||||
api_base_url: "http://127.0.0.1:3001/v1",
|
||||
api_base_url: "http://127.0.0.1:8999/v1",
|
||||
},
|
||||
},
|
||||
// 自定义
|
||||
@@ -208,7 +208,7 @@ model = "gpt-4o"
|
||||
iconColor: "#3b82f6",
|
||||
defaultGeminiEnv: {
|
||||
GEMINI_API_KEY: "proxycast",
|
||||
GOOGLE_GEMINI_BASE_URL: "http://127.0.0.1:3001",
|
||||
GOOGLE_GEMINI_BASE_URL: "http://127.0.0.1:8999",
|
||||
GEMINI_MODEL: "gemini-2.0-flash",
|
||||
},
|
||||
},
|
||||
@@ -487,7 +487,7 @@ export function ProviderForm({
|
||||
const config = await getConfig();
|
||||
const proxyApiKey = config.server.api_key || "";
|
||||
const proxyHost = config.server.host || "127.0.0.1";
|
||||
const proxyPort = config.server.port || 3001;
|
||||
const proxyPort = config.server.port || 8999;
|
||||
const proxyBaseUrl = `http://${proxyHost}:${proxyPort}`;
|
||||
|
||||
if (appType === "claude") {
|
||||
|
||||
Reference in New Issue
Block a user