Browse Source

Improve local development setup

Duncan Ogilvie 2 weeks ago
parent
commit
5e73fd569d
3 changed files with 12 additions and 1 deletions
  1. 9 0
      .env.example
  2. 2 0
      README.md
  3. 1 1
      backend/dev.sh

+ 9 - 0
.env.example

@@ -7,6 +7,15 @@ OPENAI_API_KEY=''
 
 
 # AUTOMATIC1111_BASE_URL="http://localhost:7860"
 # AUTOMATIC1111_BASE_URL="http://localhost:7860"
 
 
+# For production, you should only need one host as
+# fastapi serves the svelte-kit built frontend and backend from the same host and port.
+# To test with CORS locally, you can set something like
+# CORS_ALLOW_ORIGIN='http://localhost:5173;http://localhost:8080'
+CORS_ALLOW_ORIGIN='*'
+
+# For production you should set this to match the proxy configuration (127.0.0.1)
+FORWARDED_ALLOW_IPS='*'
+
 # DO NOT TRACK
 # DO NOT TRACK
 SCARF_NO_ANALYTICS=true
 SCARF_NO_ANALYTICS=true
 DO_NOT_TRACK=true
 DO_NOT_TRACK=true

+ 2 - 0
README.md

@@ -181,6 +181,8 @@ After installation, you can access Open WebUI at [http://localhost:3000](http://
 
 
 We offer various installation alternatives, including non-Docker native installation methods, Docker Compose, Kustomize, and Helm. Visit our [Open WebUI Documentation](https://docs.openwebui.com/getting-started/) or join our [Discord community](https://discord.gg/5rJgQTnV4s) for comprehensive guidance.
 We offer various installation alternatives, including non-Docker native installation methods, Docker Compose, Kustomize, and Helm. Visit our [Open WebUI Documentation](https://docs.openwebui.com/getting-started/) or join our [Discord community](https://discord.gg/5rJgQTnV4s) for comprehensive guidance.
 
 
+Look at the [Local Development Guide](https://docs.openwebui.com/getting-started/advanced-topics/development) for instructions on setting up a local development environment.
+
 ### Troubleshooting
 ### Troubleshooting
 
 
 Encountering connection issues? Our [Open WebUI Documentation](https://docs.openwebui.com/troubleshooting/) has got you covered. For further assistance and to join our vibrant community, visit the [Open WebUI Discord](https://discord.gg/5rJgQTnV4s).
 Encountering connection issues? Our [Open WebUI Documentation](https://docs.openwebui.com/troubleshooting/) has got you covered. For further assistance and to join our vibrant community, visit the [Open WebUI Discord](https://discord.gg/5rJgQTnV4s).

+ 1 - 1
backend/dev.sh

@@ -1,2 +1,2 @@
 PORT="${PORT:-8080}"
 PORT="${PORT:-8080}"
-uvicorn open_webui.main:app --port $PORT --host 0.0.0.0 --forwarded-allow-ips '*' --reload
+uvicorn open_webui.main:app --port $PORT --host 0.0.0.0 --reload