diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml new file mode 100644 index 0000000..b5d7ca9 --- /dev/null +++ b/.github/workflows/link-checker.yml @@ -0,0 +1,25 @@ +name: Documentation + +on: + push: + branches: + - master + - develop + pull_request: + branches: + - master + - develop + +jobs: + link-checker: + name: Check links + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v4 + + - name: Check the links + uses: lycheeverse/lychee-action@v1 + with: + args: --max-concurrency 1 -v *.md **/*.md + fail: true diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 0000000..ead2f4a --- /dev/null +++ b/.lycheeignore @@ -0,0 +1,3 @@ +http://localhost:8029/ +https://platform.openai.com/api-keys +https://mastodon.social/@gurubaseio \ No newline at end of file diff --git a/README.md b/README.md index 7ea2159..3e4cab5 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ [![Twitter](https://img.shields.io/badge/Twitter-%231DA1F2.svg?logo=x&logoColor=white)](https://twitter.com/gurubaseio) [![Mastodon](https://img.shields.io/badge/Mastodon-%236364FF.svg?logo=mastodon&logoColor=white)](https://mastodon.social/@gurubaseio) [![Bluesky](https://img.shields.io/badge/Bluesky-%230285FF.svg?logo=bluesky&logoColor=white)](https://bsky.app/profile/gurubase.bsky.social) -[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Gurubase/gurubase/blob/main/LICENSE) +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Gurubase/gurubase/blob/master/LICENSE) - [What is Gurubase](#what-is-gurubase) diff --git a/src/gurubase-backend/ARCHITECTURE.md b/src/gurubase-backend/ARCHITECTURE.md index 0a638ae..47db9c0 100644 --- a/src/gurubase-backend/ARCHITECTURE.md +++ b/src/gurubase-backend/ARCHITECTURE.md @@ -6,7 +6,7 @@ Gurubase is a scalable RAG (Retrieval Augmented Generation) system built to prov ## System Components -![Gurubase Architecture](architecture.png) +![Gurubase Architecture](imgs/architecture.png) ### Frontend (Next.js) - Built with Next.js @@ -195,7 +195,7 @@ The task is run in three stages: An example of the summarization process looks like this: -![Data Source Summarization](ds-summarization.png) +![Data Source Summarization](imgs/ds-summarization.png) In this example, the red summarizations are the initial summarizations, and the blue summarizations are the recursive summarizations. And summarization 11 is the final summarization of the whole guru type. While the first stage creates summarizations 1-6, the second stage creates summarizations 7 and 8, and the third stage creates summarizations 9-11. @@ -295,7 +295,7 @@ For any questions related to date, remember today's date is {date}. #### 2. Context Retrieval -![Context Retrieval](context-retrieval.png) +![Context Retrieval](imgs/context-retrieval.png) The `vector_db_fetch` function in `backend/core/utils.py` is responsible for context retrieval. It happens in multiple stages: diff --git a/src/gurubase-backend/INTEGRATION_README.md b/src/gurubase-backend/INTEGRATION_README.md index 83472d5..4d1e661 100644 --- a/src/gurubase-backend/INTEGRATION_README.md +++ b/src/gurubase-backend/INTEGRATION_README.md @@ -77,7 +77,7 @@ - `${backend_url}/slack/events` 8. Go to Intergrations and add this as Redirect URL: - `${frontend_url}/OAuth` -9. Add these as Bot and User Token scopes: +9. Go to OAuth & Permissions and add these as Bot and User Token scopes: - Bot - `channels:history` - `channels.join` @@ -87,7 +87,7 @@ - `groups:read` - `im:history` - `im:read` - - `npim:read` + - `mpim:read` - User - `channels:history` - `channels:read` @@ -99,7 +99,7 @@ 11. Enable it 12. Set this as request url: - `${backend_url}/slack/events` -13. Add these as Subscribe to bot events: +13. Go to Event Subscriptions and add these as Subscribe to bot events: - message.channels 14. Go to Manage Distribution 15. Click and confirm "Remove Hard Coded Information" diff --git a/src/gurubase-backend/backend/backend/settings.py b/src/gurubase-backend/backend/backend/settings.py index 91c225e..79422d7 100644 --- a/src/gurubase-backend/backend/backend/settings.py +++ b/src/gurubase-backend/backend/backend/settings.py @@ -28,11 +28,13 @@ ROOT_PASSWORD = config('ROOT_PASSWORD', default='ChangeMe') SENTRY_ENABLED = config('SENTRY_ENABLED', default=False, cast=bool) -if SENTRY_ENABLED: + +if SENTRY_ENABLED or ENV == "selfhosted": import sentry_sdk from sentry_sdk.integrations.celery import CeleryIntegration - from sentry_sdk.integrations.django import DjangoIntegration - SENTRY_DSN = config('SENTRY_DSN') + from sentry_sdk.integrations.django import DjangoIntegration + # Use the configured DSN or fallback to selfhosted DSN - https://sentry.zendesk.com/hc/en-us/articles/26741783759899-My-DSN-key-is-publicly-visible-is-this-a-security-vulnerability + SENTRY_DSN = config('SENTRY_DSN', default="https://004f52d6be335c0087a2c582f238ede2@o1185050.ingest.us.sentry.io/4508715634982912") sentry_sdk.init( dsn=SENTRY_DSN, integrations=[DjangoIntegration(), CeleryIntegration(monitor_beat_tasks=False)], @@ -411,7 +413,7 @@ SLACK_CLIENT_ID = config('SLACK_CLIENT_ID', default='') SLACK_CLIENT_SECRET = config('SLACK_CLIENT_SECRET', default='') -PROD_BACKEND_URL = config('PROD_BACKEND_URL', default='https://kubernetesguru-backend-api.getanteon.com') +PROD_BACKEND_URL = config('PROD_BACKEND_URL', default='https://api.gurubase.io') API_CONCURRENCY_THROTTLE_RATE = config('API_CONCURRENCY_THROTTLE_RATE', default='10/m') diff --git a/src/gurubase-backend/backend/core/auth.py b/src/gurubase-backend/backend/core/auth.py index 7250475..05e7bb9 100644 --- a/src/gurubase-backend/backend/core/auth.py +++ b/src/gurubase-backend/backend/core/auth.py @@ -190,7 +190,7 @@ def wrapper(request, *args, **kwargs): if widget_id_obj.domain_url: origin = request.headers.get('Origin') if not origin or not origin.rstrip('/').endswith(widget_id_obj.domain_url): - return Response({'msg': 'Invalid domain'}, status=status.HTTP_401_UNAUTHORIZED) + return Response({'msg': 'Invalid domain. Please check your domain URL in Gurubase platform'}, status=status.HTTP_401_UNAUTHORIZED) request.guru_type = widget_id_obj.guru_type return view_func(request, *args, **kwargs) diff --git a/src/gurubase-backend/backend/core/migrations/0029_merge_20250126_1945.py b/src/gurubase-backend/backend/core/migrations/0029_merge_20250126_1945.py new file mode 100644 index 0000000..10590a3 --- /dev/null +++ b/src/gurubase-backend/backend/core/migrations/0029_merge_20250126_1945.py @@ -0,0 +1,14 @@ +# Generated by Django 4.2.18 on 2025-01-26 19:45 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0022_merge_0021_apikey_name_0021_merge_20250120_0950'), + ('core', '0028_alter_integration_unique_together'), + ] + + operations = [ + ] diff --git a/src/gurubase-backend/architecture.png b/src/gurubase-backend/imgs/architecture.png similarity index 100% rename from src/gurubase-backend/architecture.png rename to src/gurubase-backend/imgs/architecture.png diff --git a/src/gurubase-backend/imgs/context-retrieval.png b/src/gurubase-backend/imgs/context-retrieval.png new file mode 100644 index 0000000..25468de Binary files /dev/null and b/src/gurubase-backend/imgs/context-retrieval.png differ diff --git a/src/gurubase-backend/ds-summarization.png b/src/gurubase-backend/imgs/ds-summarization.png similarity index 100% rename from src/gurubase-backend/ds-summarization.png rename to src/gurubase-backend/imgs/ds-summarization.png diff --git a/src/gurubase-frontend/src/components/Integrations/IntegrationContent.jsx b/src/gurubase-frontend/src/components/Integrations/IntegrationContent.jsx index a14f397..b949c92 100644 --- a/src/gurubase-frontend/src/components/Integrations/IntegrationContent.jsx +++ b/src/gurubase-frontend/src/components/Integrations/IntegrationContent.jsx @@ -62,7 +62,7 @@ const IntegrationContent = ({ type, customGuru, error }) => { description: "By connecting your account, you can easily share all your posts and invite your friends.", iconSize: "w-5 h-5", - url: `https://slack.com/oauth/v2/authorize?client_id=8327841447732.8318709976774&scope=app_mentions:read,channels:history,channels:join,channels:read,chat:write,groups:history,groups:read,groups:write,im:history,im:read,im:write,mpim:read,mpim:write,channels:manage&user_scope=channels:history,channels:read,chat:write,groups:history,groups:read,im:history,channels:write,groups:write,mpim:write,im:write`, + url: `https://slack.com/oauth/v2/authorize?client_id=1269209097589.8354424793156&scope=assistant:write,channels:history,channels:join,channels:read,chat:write,groups:history,groups:read,im:history,im:read,mpim:read&user_scope=channels:history,channels:read,chat:write,groups:history,groups:read,im:history`, icon: SlackIcon }, discord: {