Skip to content
Merged

Dev #98

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
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ POSTGRES_DIRECT_URL=
AUTH=
AUTH_TRUST_HOST=
AUTH_SECRET=
NEXTAUTH_URL=
AUTH_URL=

DRIVE_CLIENT_ID=
DRIVE_CLIENT_SECRET=
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
SQLITE_URL: file:./prisma/dev.db
DB: sqlite
AUTH_SECRET: test-secret
NEXTAUTH_URL: http://localhost:3000
AUTH_URL: http://localhost:3000
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [0.1.27] - 2025-10-31

### PR: [Dev](https://github.com/openchatui/openchat/pull/98)

### Changed
- Standardize environment variable from NEXTAUTH_URL to AUTH_URL across code, config, CI, and docs to align with Auth.js and simplify setup. (https://github.com/openchatui/openchat/commit/8268c21ec9561750b8fe638d8d97d7ace0fc1850)
- Set SQLite path in Dockerfile to /app/data/openchat.db to persist data in a mounted volume and avoid stage inconsistencies. (https://github.com/openchatui/openchat/commit/16c20992b076e39e244584e87d57aa64600546fe)
- Update docker-compose to reference SQLITE_URL=file:/app/prisma/dev.db and remove the unused prisma volume for a cleaner default. (https://github.com/openchatui/openchat/commit/1ecf4aa49e33441c0621b413ab24f7c3e4dabbf2)

## [0.1.26] - 2025-10-31

### PR: [dev to main: update apple icon and workflows ](https://github.com/openchatui/openchat/pull/91)
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ RUN pnpm install --frozen-lockfile
COPY prisma ./prisma
# Generate Prisma Client early so it is cached with node_modules
ENV DB=sqlite
ENV SQLITE_URL=file:./prisma/dev.db
ENV SQLITE_URL=file:/app/data/openchat.db
RUN pnpm exec prisma generate --schema prisma/schema.sqlite.prisma

FROM base AS builder
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Set build-time env vars so Next.js static generation doesn't fail
ENV DB=sqlite
ENV SQLITE_URL=file:./dev.db
ENV SQLITE_URL=file:/app/data/openchat.db
ENV AUTH_SECRET=build-time-secret-will-be-overridden
ENV AUTH_URL=http://localhost:3000
# Build Next.js
Expand All @@ -35,7 +35,7 @@ ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME=0.0.0.0
ENV DB=sqlite
ENV SQLITE_URL=file:./dev.db
ENV SQLITE_URL=file:/app/data/openchat.db
ENV AUTH_TRUST_HOST=true
ENV AUTH_URL=http://localhost:3000
ENV AUTH=true
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Pull and run with defaults (port 3000 inside the container):
docker pull ghcr.io/openchatui/openchatui:latest
docker run --name openchat \
-p 3000:3000 \
-e NEXTAUTH_URL="http://localhost:3000" \
-e AUTH_URL="http://localhost:3000" \
-e AUTH_SECRET="$(openssl rand -base64 32)" \
-v "$(pwd)/data/prisma:/prisma" \
--restart unless-stopped \
Expand All @@ -74,7 +74,7 @@ Examples:
```bash
docker run \
-p 3000:3000 \
-e NEXTAUTH_URL="http://localhost:3000" \
-e AUTH_URL="http://localhost:3000" \
-e AUTH_SECRET="$(openssl rand -base64 32)" \
-e AUTH=false \
-v "$(pwd)/data/prisma:/prisma" \
Expand Down Expand Up @@ -108,7 +108,7 @@ docker compose down
```

> [!TIP]
> - Change the external port by editing `ports` and the internal app port by `environment: PORT` and `NEXTAUTH_URL`.
> - Change the external port by editing `ports` and the internal app port by `environment: PORT` and `AUTH_URL`.
> - Persist data: by default `./prisma:/prisma` stores the SQLite database on the host.
> - Switch to PostgreSQL: set `DB=postgres` and provide `DATABASE_URL` in `environment`. You can add a separate Postgres service if needed.

Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
AUTH: "true"
DEBUG_AUTH: "true"
# DB: "sqlite"
# SQLITE_URL: "file:./dev.db"
# SQLITE_URL: "file:/app/prisma/dev.db"
# DATABASE_URL: "postgresql://user:pass@host/db"
# NODE_ENV: "production"
# OPENAI_API_KEY: "sk-..."
Expand All @@ -24,7 +24,6 @@ services:
# DRIVE_CLIENT_ID: "your-google-client-id"
# DRIVE_CLIENT_SECRET: "your-google-client-secret"
volumes:
- ./prisma:/prisma
- ./data:/app/data
- ./public/profiles:/app/public/profiles
restart: unless-stopped
2 changes: 1 addition & 1 deletion lib/api/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export async function httpFetch(input: RequestInfo, init?: RequestInit): Promise

// When behind a reverse proxy, forward the external host for Auth.js validation
// Auth.js with trustHost:true will validate against these headers
const externalUrl = process.env.AUTH_URL || process.env.NEXTAUTH_URL
const externalUrl = process.env.AUTH_URL
if (externalUrl) {
try {
const url = new URL(externalUrl)
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/drive/providers/google-drive.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function getUserAccount(userId: string) {
function getOAuthClient() {
const clientId = process.env.DRIVE_CLIENT_ID
const clientSecret = process.env.DRIVE_CLIENT_SECRET
const redirectUri = process.env.NEXTAUTH_URL+'/api/auth/callback/google-drive'
const redirectUri = process.env.AUTH_URL+'/api/auth/callback/google-drive'
if (!clientId || !clientSecret) {
return new google.auth.OAuth2()
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openchatui",
"version": "0.1.26",
"version": "0.1.27",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
Expand Down