diff --git a/docker/.env.example b/docker/.env.example index 745ac3472..494c5d18e 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -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 \ No newline at end of file diff --git a/docker/docker-compose-dev.yaml b/docker/docker-compose-dev.yaml index 1016ae3be..680743fe8 100644 --- a/docker/docker-compose-dev.yaml +++ b/docker/docker-compose-dev.yaml @@ -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} diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index d5a784485..7c17bb65e 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -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 diff --git a/wren-launcher/commands/launch.go b/wren-launcher/commands/launch.go index 8214db921..15931371d 100644 --- a/wren-launcher/commands/launch.go +++ b/wren-launcher/commands/launch.go @@ -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 diff --git a/wren-launcher/utils/docker.go b/wren-launcher/utils/docker.go index 01dd959d0..1d5a5b6e1 100644 --- a/wren-launcher/utils/docker.go +++ b/wren-launcher/utils/docker.go @@ -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"