mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-22 23:31:12 +02:00
add ZERO_MUTATE_URL and no-op mutate endpoint for zero-cache auth passthrough
This commit is contained in:
parent
0e49cc33f8
commit
5c98f1c717
4 changed files with 16 additions and 2 deletions
|
|
@ -85,13 +85,20 @@ EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
|
||||||
# ZERO_CVR_DB=postgresql://surfsense:surfsense@db:5432/surfsense
|
# ZERO_CVR_DB=postgresql://surfsense:surfsense@db:5432/surfsense
|
||||||
# ZERO_CHANGE_DB=postgresql://surfsense:surfsense@db:5432/surfsense
|
# ZERO_CHANGE_DB=postgresql://surfsense:surfsense@db:5432/surfsense
|
||||||
|
|
||||||
# URL where zero-cache sends queries for resolution (server-to-server).
|
# ZERO_QUERY_URL: where zero-cache forwards query requests for resolution.
|
||||||
# Default: http://frontend:3000/api/zero/query (Docker service networking).
|
# ZERO_MUTATE_URL: required by zero-cache when auth tokens are used, even though
|
||||||
|
# SurfSense does not use Zero mutators. Setting both URLs tells zero-cache to
|
||||||
|
# skip its own JWT verification and let the app endpoints handle auth instead.
|
||||||
|
# The mutate endpoint is a no-op that returns an empty response.
|
||||||
|
# Default: Docker service networking (http://frontend:3000/api/zero/...).
|
||||||
# Override when running the frontend outside Docker:
|
# Override when running the frontend outside Docker:
|
||||||
# ZERO_QUERY_URL=http://host.docker.internal:3000/api/zero/query
|
# ZERO_QUERY_URL=http://host.docker.internal:3000/api/zero/query
|
||||||
|
# ZERO_MUTATE_URL=http://host.docker.internal:3000/api/zero/mutate
|
||||||
# Override for custom domain:
|
# Override for custom domain:
|
||||||
# ZERO_QUERY_URL=https://app.yourdomain.com/api/zero/query
|
# ZERO_QUERY_URL=https://app.yourdomain.com/api/zero/query
|
||||||
|
# ZERO_MUTATE_URL=https://app.yourdomain.com/api/zero/mutate
|
||||||
# ZERO_QUERY_URL=http://frontend:3000/api/zero/query
|
# ZERO_QUERY_URL=http://frontend:3000/api/zero/query
|
||||||
|
# ZERO_MUTATE_URL=http://frontend:3000/api/zero/mutate
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Database (defaults work out of the box, change for security)
|
# Database (defaults work out of the box, change for security)
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,7 @@ services:
|
||||||
- ZERO_REPLICA_FILE=/data/zero.db
|
- ZERO_REPLICA_FILE=/data/zero.db
|
||||||
- ZERO_ADMIN_PASSWORD=${ZERO_ADMIN_PASSWORD:-surfsense-zero-admin}
|
- ZERO_ADMIN_PASSWORD=${ZERO_ADMIN_PASSWORD:-surfsense-zero-admin}
|
||||||
- ZERO_QUERY_URL=${ZERO_QUERY_URL:-http://frontend:3000/api/zero/query}
|
- ZERO_QUERY_URL=${ZERO_QUERY_URL:-http://frontend:3000/api/zero/query}
|
||||||
|
- ZERO_MUTATE_URL=${ZERO_MUTATE_URL:-http://frontend:3000/api/zero/mutate}
|
||||||
volumes:
|
volumes:
|
||||||
- zero_cache_data:/data
|
- zero_cache_data:/data
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
|
||||||
|
|
@ -171,6 +171,7 @@ services:
|
||||||
ZERO_REPLICA_FILE: /data/zero.db
|
ZERO_REPLICA_FILE: /data/zero.db
|
||||||
ZERO_ADMIN_PASSWORD: ${ZERO_ADMIN_PASSWORD:-surfsense-zero-admin}
|
ZERO_ADMIN_PASSWORD: ${ZERO_ADMIN_PASSWORD:-surfsense-zero-admin}
|
||||||
ZERO_QUERY_URL: ${ZERO_QUERY_URL:-http://frontend:3000/api/zero/query}
|
ZERO_QUERY_URL: ${ZERO_QUERY_URL:-http://frontend:3000/api/zero/query}
|
||||||
|
ZERO_MUTATE_URL: ${ZERO_MUTATE_URL:-http://frontend:3000/api/zero/mutate}
|
||||||
volumes:
|
volumes:
|
||||||
- zero_cache_data:/data
|
- zero_cache_data:/data
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
|
||||||
5
surfsense_web/app/api/zero/mutate/route.ts
Normal file
5
surfsense_web/app/api/zero/mutate/route.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
export async function POST() {
|
||||||
|
return NextResponse.json([]);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue