Skip to content

Commit

Permalink
Small tweaks to get Egynte to work on our cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
Weves committed Dec 11, 2024
1 parent 8d83ae2 commit f028823
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 2 additions & 6 deletions backend/danswer/server/documents/standard_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from fastapi import Depends
from fastapi import HTTPException
from fastapi import Query
from fastapi import Request
from pydantic import BaseModel
from sqlalchemy.orm import Session

Expand Down Expand Up @@ -58,7 +57,6 @@ class AuthorizeResponse(BaseModel):

@router.get("/authorize/{source}")
def oauth_authorize(
request: Request,
source: DocumentSource,
desired_return_url: Annotated[str | None, Query()] = None,
_: User = Depends(current_user),
Expand All @@ -71,13 +69,11 @@ def oauth_authorize(
raise HTTPException(status_code=400, detail=f"Unknown OAuth source: {source}")

connector_cls = oauth_connectors[source]
base_url = str(request.base_url)
if "127.0.0.1" in base_url:
base_url = base_url.replace("127.0.0.1", "localhost")
base_url = WEB_DOMAIN

# store state in redis
if not desired_return_url:
desired_return_url = f"{WEB_DOMAIN}/admin/connectors/{source}?step=0"
desired_return_url = f"{base_url}/admin/connectors/{source}?step=0"
redis_client = get_redis_client(tenant_id=tenant_id)
state = str(uuid.uuid4())
redis_client.set(
Expand Down
5 changes: 5 additions & 0 deletions deployment/docker_compose/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ services:
- GITHUB_CONNECTOR_BASE_URL=${GITHUB_CONNECTOR_BASE_URL:-}
- MAX_DOCUMENT_CHARS=${MAX_DOCUMENT_CHARS:-}
- MAX_FILE_SIZE_BYTES=${MAX_FILE_SIZE_BYTES:-}
# Egnyte OAuth Configs
- EGNYTE_CLIENT_ID=${EGNYTE_CLIENT_ID:-}
- EGNYTE_CLIENT_SECRET=${EGNYTE_CLIENT_SECRET:-}
- EGNYTE_BASE_DOMAIN=${EGNYTE_BASE_DOMAIN:-}
- EGNYTE_LOCALHOST_OVERRIDE=${EGNYTE_LOCALHOST_OVERRIDE:-}
# Celery Configs (defaults are set in the supervisord.conf file.
# prefer doing that to have one source of defaults)
- CELERY_WORKER_INDEXING_CONCURRENCY=${CELERY_WORKER_INDEXING_CONCURRENCY:-}
Expand Down

0 comments on commit f028823

Please sign in to comment.