Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions INSTRUCTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# RAGFlow with Supabase and Tailscale

This document provides instructions on how to configure this forked version of RAGFlow to use Supabase for database and storage, and Tailscale for remote access.

## Prerequisites

- A Supabase account (free tier is sufficient).
- A Tailscale account and Tailscale installed on both your local machine and the server where you will run RAGFlow.

## 1. Supabase Configuration

1. **Create a new Supabase project:**
- Go to your Supabase dashboard and create a new project.

2. **Get Database Credentials:**
- In your Supabase project, navigate to **Settings > Database**.
- Under **Connection info**, you will find the following:
- `Host`
- `Port`
- `Database name` (usually `postgres`)
- `User` (usually `postgres`)
- `Password`

3. **Get S3 Storage Credentials:**
- In your Supabase project, navigate to **Settings > Storage**.
- You will find the following:
- `Endpoint URL`
- `Region`
- To get the `Access Key` and `Secret Key`, you need to generate them. Go to **Storage > Settings > S3 Connection** and generate a new key pair.
- Create a new bucket in the Supabase Storage section. The name of this bucket will be your `S3_BUCKET`.

4. **Configure RAGFlow:**
- In the `docker` directory, copy the `.env.example` file to a new file named `.env`.
- Open the `.env` file and fill in the values for the PostgreSQL and S3 sections with the credentials you obtained from Supabase.

## 2. Running RAGFlow

Once you have configured your `.env` file, you can start RAGFlow using Docker Compose:

```bash
cd docker
docker-compose up -d
```

## 3. Tailscale Access

To access your RAGFlow instance from your local machine using Tailscale, you need to find the Tailscale IP address of your server.

1. **Find your server's Tailscale IP:**
- On your server, run the following command:
```bash
tailscale ip -4
```
- This will give you the Tailscale IP address of your server (e.g., `100.x.x.x`).

2. **Access RAGFlow:**
- On your local machine, open your web browser and go to `http://<your_server_tailscale_ip>:9380`.
- You should now be able to access the RAGFlow web interface.

## 4. Troubleshooting

- If you have any issues connecting to the database or storage, double-check your credentials in the `.env` file.
- Make sure that the bucket you created in Supabase Storage is public if you want to access the files directly.
- If you have trouble accessing RAGFlow through Tailscale, ensure that Tailscale is running on both your local machine and the server, and that there are no firewall rules blocking the connection.
70 changes: 70 additions & 0 deletions docker/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# -----------------------------------------------------------------------------
# RAGFlow Configuration
# -----------------------------------------------------------------------------
# This file contains the environment variables for configuring RAGFlow.
# Copy this file to .env and fill in the values for your environment.

# -----------------------------------------------------------------------------
# Supabase PostgreSQL Configuration
# -----------------------------------------------------------------------------
# To get these values, go to your Supabase project -> Settings -> Database
POSTGRES_HOST=your_supabase_host
POSTGRES_PORT=your_supabase_port
POSTGRES_DBNAME=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your_supabase_password

# -----------------------------------------------------------------------------
# Supabase S3 Storage Configuration
# -----------------------------------------------------------------------------
# To get these values, go to your Supabase project -> Settings -> Storage
S3_ACCESS_KEY=your_supabase_s3_access_key
S3_SECRET_KEY=your_supabase_s3_secret_key
S3_ENDPOINT_URL=your_supabase_s3_endpoint_url
S3_REGION=your_supabase_s3_region
S3_BUCKET=your_supabase_s3_bucket

# -----------------------------------------------------------------------------
# RAGFlow Service Configuration
# -----------------------------------------------------------------------------
SVR_HTTP_PORT=9380
TIMEZONE=Asia/Shanghai

# -----------------------------------------------------------------------------
# Vector Database (Infinity)
# -----------------------------------------------------------------------------
INFINITY_THRIFT_PORT=23817
INFINITY_HTTP_PORT=23820
INFINITY_PSQL_PORT=5432

# -----------------------------------------------------------------------------
# Redis Configuration
# -----------------------------------------------------------------------------
REDIS_PASSWORD=infini_rag_flow
REDIS_PORT=6379

# -----------------------------------------------------------------------------
# Elasticsearch/Opensearch Configuration (Optional)
# -----------------------------------------------------------------------------
# Only needed if you are using Elasticsearch or Opensearch
# STACK_VERSION=8.14.1
# ES_PORT=9200
# ELASTIC_PASSWORD=infini_rag_flow
# OS_PORT=9201
# OPENSEARCH_PASSWORD=infini_rag_flow_OS_01

# -----------------------------------------------------------------------------
# Other Settings
# -----------------------------------------------------------------------------
MEM_LIMIT=4g
RAGFLOW_IMAGE=infiniflow/ragflow:latest
SANDBOX_EXECUTOR_MANAGER_IMAGE=infiniflow/sandbox-executor-manager:latest
SANDBOX_EXECUTOR_MANAGER_PORT=9385
SANDBOX_EXECUTOR_MANAGER_POOL_SIZE=3
SANDBOX_BASE_PYTHON_IMAGE=infiniflow/sandbox-base-python:latest
SANDBOX_BASE_NODEJS_IMAGE=infiniflow/sandbox-base-nodejs:latest
SANDBOX_ENABLE_SECCOMP=false
SANDBOX_MAX_MEMORY=256m
SANDBOX_TIMEOUT=10s
HF_ENDPOINT=https://huggingface.co
MACOS=
227 changes: 0 additions & 227 deletions docker/docker-compose-base.yml

This file was deleted.

Loading