diff --git a/aistudio-to-api.conf b/aistudio-to-api.conf new file mode 100644 index 0000000..a1261bf --- /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="7891" # 默认访问端口 +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 <