From 54956e03d92a4f95dc2e00c17a5f7f84604af214 Mon Sep 17 00:00:00 2001 From: ncc9275-svg Date: Fri, 14 Aug 2026 08:01:31 +0000 Subject: [PATCH 1/2] feat: add AIStudioToAPI application Add a Docker deployment configuration for AIStudioToAPI with secure initial credentials, persistent auth/data storage, lifecycle commands, and configurable port 7860. --- aistudio-to-api.conf | 77 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 aistudio-to-api.conf diff --git a/aistudio-to-api.conf b/aistudio-to-api.conf new file mode 100644 index 0000000..dbaf366 --- /dev/null +++ b/aistudio-to-api.conf @@ -0,0 +1,77 @@ +# --- 基础信息 / Basic Information --- +local app_id="aistudio-to-api" # 和文件名一致,用于安装状态检测 / Same as the filename, used for installation status detection. +local app_name="AIStudioToAPI" # 应用显示名称 +local app_text="将 Google AI Studio Build 封装为 OpenAI、Gemini、Anthropic 兼容 API" # 一句话简介 +local app_url="https://github.com/iBUHub/AIStudioToAPI" # 官网链接 +local docker_name="aistudio-to-api" # 容器启动后的名称 +local docker_port="7860" # 默认访问端口 +local app_size="2" # 占用空间大小(GB) + +# --- 核心逻辑 / Core Logic --- +docker_app_install() { + mkdir -p /home/docker/aistudio-to-api/{auth,data} && cd /home/docker/aistudio-to-api + + # 首次安装时生成独立的访问凭据,避免使用项目默认凭据。 + if [ ! -f .env ]; then + local api_key + local console_password + api_key=$(od -An -N 24 -tx1 /dev/urandom | tr -d ' \n') + console_password=$(od -An -N 24 -tx1 /dev/urandom | tr -d ' \n') + + cat > .env < docker-compose.yml < Date: Fri, 14 Aug 2026 08:17:27 +0000 Subject: [PATCH 2/2] fix: change default host port to 7891 Change the default host port from 7860 to 7891 while preserving the container's internal service port at 7860. --- aistudio-to-api.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aistudio-to-api.conf b/aistudio-to-api.conf index dbaf366..a1261bf 100644 --- a/aistudio-to-api.conf +++ b/aistudio-to-api.conf @@ -4,7 +4,7 @@ local app_name="AIStudioToAPI" # 应用显示名称 local app_text="将 Google AI Studio Build 封装为 OpenAI、Gemini、Anthropic 兼容 API" # 一句话简介 local app_url="https://github.com/iBUHub/AIStudioToAPI" # 官网链接 local docker_name="aistudio-to-api" # 容器启动后的名称 -local docker_port="7860" # 默认访问端口 +local docker_port="7891" # 默认访问端口 local app_size="2" # 占用空间大小(GB) # --- 核心逻辑 / Core Logic ---