chore/small refinements to launcher (#269)

* fix missing envs to posthog

* fix .env.example

* update add openai key instructions

* add missing env vars
This commit is contained in:
Chih-Yu Yeh
2024-05-20 16:17:02 +08:00
committed by GitHub
parent 59e87b766c
commit 1fac9b76f3
5 changed files with 38 additions and 8 deletions
+15 -5
View File
@@ -8,9 +8,10 @@ WREN_AI_SERVICE_PORT=5555
# version
# CHANGE THIS TO THE LATEST VERSION
WREN_ENGINE_VERSION=nightly
WREN_AI_SERVICE_VERSION=nightly
WREN_UI_VERSION=0.1.0
WREN_PRODUCT_VERSION=0.3.3
WREN_ENGINE_VERSION=0.4.3
WREN_AI_SERVICE_VERSION=0.3.6
WREN_UI_VERSION=0.5.4
WREN_BOOTSTRAP_VERSION=0.1.2
# keys
@@ -19,10 +20,19 @@ OPENAI_API_KEY=sk-1234567890
OPENAI_GENERATION_MODEL=gpt-3.5-turbo
# SQL Protocol
PG_USERNAME=wren-user
PG_USERNAME=wren-user-placeholder
# PG_PASSWORD will be replaced with random string by launcher
PG_PASSWORD=wren-pg-password
PG_PASSWORD=wren-pg-password-placeholder
# user id (uuid v4)
USER_UUID=
# for other services
POSTHOG_API_KEY=phc_nhF32aj4xHXOZb0oqr2cn4Oy9uiWzz6CCP4KZmRq9aE
POSTHOG_HOST=https://app.posthog.com
TELEMETRY_ENABLED=true
# the port exposes to the host
# OPTIONAL: change the port if you have a conflict
HOST_PORT=3000
AI_SERVICE_FORWARD_PORT=5555
+1 -1
View File
@@ -40,7 +40,7 @@ services:
pull_policy: always
platform: ${PLATFORM}
ports:
- ${WREN_AI_SERVICE_PORT}:${WREN_AI_SERVICE_PORT}
- ${AI_SERVICE_FORWARD_PORT}:${WREN_AI_SERVICE_PORT}
environment:
WREN_AI_SERVICE_PORT: ${WREN_AI_SERVICE_PORT}
OPENAI_API_KEY: ${OPENAI_API_KEY}
+17
View File
@@ -40,6 +40,8 @@ services:
platform: ${PLATFORM}
expose:
- ${WREN_AI_SERVICE_PORT}
ports:
- ${AI_SERVICE_FORWARD_PORT}:${WREN_AI_SERVICE_PORT}
environment:
WREN_AI_SERVICE_PORT: ${WREN_AI_SERVICE_PORT}
OPENAI_API_KEY: ${OPENAI_API_KEY}
@@ -79,6 +81,21 @@ services:
OPENAI_GENERATION_MODEL: ${OPENAI_GENERATION_MODEL}
PG_USERNAME: ${PG_USERNAME}
PG_PASSWORD: ${PG_PASSWORD}
# telemetry
WREN_ENGINE_PORT: ${WREN_ENGINE_PORT}
WREN_AI_SERVICE_VERSION: ${WREN_AI_SERVICE_VERSION}
WREN_UI_VERSION: ${WREN_UI_VERSION}
USER_UUID: ${USER_UUID}
POSTHOG_API_KEY: ${POSTHOG_API_KEY}
POSTHOG_HOST: ${POSTHOG_HOST}
TELEMETRY_ENABLED: ${TELEMETRY_ENABLED}
# client side
NEXT_PUBLIC_USER_UUID: ${USER_UUID}
NEXT_PUBLIC_POSTHOG_API_KEY: ${POSTHOG_API_KEY}
NEXT_PUBLIC_POSTHOG_HOST: ${POSTHOG_HOST}
NEXT_PUBLIC_TELEMETRY_ENABLED: ${TELEMETRY_ENABLED}
# configs
WREN_PRODUCT_VERSION: ${WREN_PRODUCT_VERSION}
ports:
# HOST_PORT is the port you want to expose to the host machine
- ${HOST_PORT}:3000
+1
View File
@@ -46,6 +46,7 @@ func evaluateTelemetryPreferences() (bool, error) {
func askForAPIKey() (string, error) {
// let users know we're asking for an API key
fmt.Println("Please provide your OpenAI API key")
fmt.Println("Please use the key with full permission, more details at https://help.openai.com/en/articles/8867743-assign-api-key-permissions")
validate := func(input string) error {
// check if input is a valid API key
+4 -2
View File
@@ -23,8 +23,10 @@ import (
)
const (
DOCKER_COMPOSE_YAML_URL string = "https://gist.githubusercontent.com/wwwy3y3/5fee68a54458a07abbeb573711652292/raw/4c1cd5933b475488e25fc0bc8f06deb4969a273c/docker-compose.yaml"
DOCKER_COMPOSE_ENV_URL string = "https://gist.githubusercontent.com/wwwy3y3/5fee68a54458a07abbeb573711652292/raw/4c1cd5933b475488e25fc0bc8f06deb4969a273c/.env.example"
// please change the version when the version is updated
WREN_PRODUCT_VERSION string = "0.3.3"
DOCKER_COMPOSE_YAML_URL string = "https://raw.githubusercontent.com/Canner/WrenAI/" + WREN_PRODUCT_VERSION + "/docker/docker-compose.yaml"
DOCKER_COMPOSE_ENV_URL string = "https://raw.githubusercontent.com/Canner/WrenAI/" + WREN_PRODUCT_VERSION + "/docker/.env.example"
// pg user
PG_USERNAME string = "wren-user"