Add `ALLOW_INSECURE_COOKIES` feature flag (#1076)
Browse filesFiles changed (4)
152 unmodified lines153154155152 unmodified linesALLOWED_USER_EMAILS=`[]` # if it's defined, only these emails will be allowed to use the appUSAGE_LIMITS=`{}`152 unmodified lines153154155156152 unmodified linesALLOWED_USER_EMAILS=`[]` # if it's defined, only these emails will be allowed to use the appUSAGE_LIMITS=`{}`ALLOW_INSECURE_COOKIES=false # recommended to keep this to false but set to true if you need to run over http without tls
23 unmodified lines2425262728293031703 unmodified lines73573673773873974023 unmodified lines3. [Web Search](#web-search)4. [Text Embedding Models](#text-embedding-models)5. [Extra parameters](#extra-parameters)6. [Deploying to a HF Space](#deploying-to-a-hf-space)7. [Building](#building)## No Setup Deploy703 unmodified lines]````## Deploying to a HF SpaceCreate a `DOTENV_LOCAL` secret to your HF space with the content of your .env.local, and they will be picked up automatically when you run.23 unmodified lines242526272829303132703 unmodified lines73673773873974074174274374474574674774874923 unmodified lines3. [Web Search](#web-search)4. [Text Embedding Models](#text-embedding-models)5. [Extra parameters](#extra-parameters)6. [Common issues](#common-issues)7. [Deploying to a HF Space](#deploying-to-a-hf-space)8. [Building](#building)## No Setup Deploy703 unmodified lines]````## Common issues### 403:You don't have access to this conversationMost likely you are running chat-ui over HTTP. The recommended option is to setup something like NGINX to handle HTTPS and proxy the requests to chat-ui. If you really need to run over HTTP you can add `ALLOW_INSECURE_COOKIES=true` to your `.env.local`.Make sure to set your `PUBLIC_ORIGIN` in your `.env.local` to the correct URL as well.## Deploying to a HF SpaceCreate a `DOTENV_LOCAL` secret to your HF space with the content of your .env.local, and they will be picked up automatically when you run.
9 unmodified lines10111213141539 unmodified lines555657585960619 unmodified linesOPENID_TOLERANCE,OPENID_RESOURCE,OPENID_CONFIG,} from "$env/static/private";import { sha256 } from "$lib/utils/sha256";import { z } from "zod";39 unmodified linespath: "/",// So that it works inside the space's iframesameSite: dev ? "lax" : "none",secure: !dev,httpOnly: true,expires: addWeeks(new Date(), 2),});9 unmodified lines1011121314151639 unmodified lines565758596061629 unmodified linesOPENID_TOLERANCE,OPENID_RESOURCE,OPENID_CONFIG,ALLOW_INSECURE_COOKIES,} from "$env/static/private";import { sha256 } from "$lib/utils/sha256";import { z } from "zod";39 unmodified linespath: "/",// So that it works inside the space's iframesameSite: dev ? "lax" : "none",secure: !dev && !(ALLOW_INSECURE_COOKIES === "true"),httpOnly: true,expires: addWeeks(new Date(), 2),});
1234565 unmodified lines12131415161718import { dev } from "$app/environment";import { base } from "$app/paths";import { COOKIE_NAME } from "$env/static/private";import { collections } from "$lib/server/database";import { redirect } from "@sveltejs/kit";5 unmodified linespath: "/",// So that it works inside the space's iframesameSite: dev ? "lax" : "none",secure: !dev,httpOnly: true,});throw redirect(303, `${base}/`);1234565 unmodified lines12131415161718import { dev } from "$app/environment";import { base } from "$app/paths";import { COOKIE_NAME, ALLOW_INSECURE_COOKIES } from "$env/static/private";import { collections } from "$lib/server/database";import { redirect } from "@sveltejs/kit";5 unmodified linespath: "/",// So that it works inside the space's iframesameSite: dev ? "lax" : "none",secure: !dev && !(ALLOW_INSECURE_COOKIES === "true"),httpOnly: true,});throw redirect(303, `${base}/`);
.env+1
README.md+11-2
src/lib/server/auth.ts+2-1
src/routes/logout/+page.server.ts+2-2