Skip to content

Commit

Permalink
fix(platform): Enable auth on local-backend mode by default
Browse files Browse the repository at this point in the history
  • Loading branch information
majdyz committed Oct 23, 2024
1 parent f4dac22 commit 25d8595
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
4 changes: 2 additions & 2 deletions autogpt_platform/backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ PYRO_HOST=localhost
SENTRY_DSN=

## User auth with Supabase is required for any of the 3rd party integrations with auth to work.
ENABLE_AUTH=false
ENABLE_AUTH=true
SUPABASE_URL=http://localhost:8000
SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q
SUPABASE_JWT_SECRET=your-super-secret-jwt-token-with-at-least-32-characters-long

# For local development, you may need to set FRONTEND_BASE_URL for the OAuth flow for integrations to work.
# FRONTEND_BASE_URL=http://localhost:3000
FRONTEND_BASE_URL=http://localhost:3000

## == INTEGRATION CREDENTIALS == ##
# Each set of server side credentials is required for the corresponding 3rd party
Expand Down
5 changes: 3 additions & 2 deletions autogpt_platform/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,18 @@ We use the Poetry to manage the dependencies. To set up the project, follow thes
6. Migrate the database. Be careful because this deletes current data in the database.

```sh
docker compose up db redis -d
docker compose up db -d
poetry run prisma migrate deploy
```

## Running The Server

### Starting the server without Docker

Run the following command to build the dockerfiles:
Run the following command to run database in docker but the application locally:

```sh
docker compose --profile local up --build -d
poetry run app
```

Expand Down
2 changes: 1 addition & 1 deletion autogpt_platform/backend/backend/util/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class Config(UpdateTrackingModel["Config"], BaseSettings):
)

frontend_base_url: str = Field(
default="",
default="http://localhost:3000",
description="Can be used to explicitly set the base URL for the frontend. "
"This value is then used to generate redirect URLs for OAuth flows.",
)
Expand Down
20 changes: 20 additions & 0 deletions autogpt_platform/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,23 @@ services:
extends:
file: ./supabase/docker/docker-compose.yml
service: vector

local_dependencies:
<<: *supabase-services
profiles:
- local
image: busybox
command: /bin/true
depends_on:
- studio
- kong
- auth
- rest
- realtime
- storage
- imgproxy
- meta
- functions
- analytics
- db
- vector
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ export default class BaseAutoGPTServerAPI {

if (
response.status === 403 &&
response.statusText === "Not authenticated" &&
typeof window !== "undefined" // Check if in browser environment
) {
window.location.href = "/login";
Expand Down

0 comments on commit 25d8595

Please sign in to comment.