Skip to content
Merged

Dev #102

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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ prisma/*_data.csv
*.tsbuildinfo
next-env.d.ts

public/profiles/*
/data/profiles/*
/data/images/*
/data/prisma/*
/data/files/*
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## [0.1.28] - 2025-11-01

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

### Fixed
- Moved app icons to the app/ directory so icons load correctly in Next.js. (https://github.com/openchatui/openchat/commit/9d8c9bad349967614cee207a6e4b44eea7c1c505)

### Changed
- Updated docker-compose to persist SQLite at /app/data and clarified README setup and environment variables. (https://github.com/openchatui/openchat/commit/c6b0f5b27e4f2731145140cf7817365f53d64b93)
- Switched profile storage to /data and updated the upload endpoint to return /data/profiles URLs; adjusted .gitignore accordingly. (https://github.com/openchatui/openchat/commit/adab9d1be7f298e6dfeb0a59396c6daf2cc88078)

## [0.1.27] - 2025-10-31

### PR: [Dev](https://github.com/openchatui/openchat/pull/98)
Expand Down
29 changes: 11 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,37 +53,26 @@ 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 PORT=3000 \
-e AUTH_URL="http://localhost:3000" \
-e AUTH_SECRET="$(openssl rand -base64 32)" \
-v "$(pwd)/data/prisma:/prisma" \
-v "$(pwd)/data:/app/data" \
--restart unless-stopped \
ghcr.io/openchatui/openchatui:latest
```

> [!TIP]
> - Change the host port by editing the `-p` flag (e.g., `-p 3001:3001` together with `-e PORT=3001`).
> - If you prefer PostgreSQL, add `-e DB=postgres -e DATABASE_URL=postgresql://user:pass@host:5432/dbname`.
> - The container will generate a `AUTH_SECRET` if not provided; set it for persistence across restarts.
> - Optional (persist SQLite outside the image): mount a host folder at `/app/data` and set `SQLITE_URL=file:/app/data/openchat.db` (DB defaults to sqlite in the image). Avoid mounting `/prisma` to prevent overriding bundled migrations.
> - The container will generate an `AUTH_SECRET` if not provided; set it for persistence across restarts.

##### Optional: Public landing (disable auth)

Set `AUTH=false` to allow unauthenticated users to access the public landing page while keeping the `/admin` area protected and requiring admin login.

Examples:

```bash
docker run \
-p 3000:3000 \
-e AUTH_URL="http://localhost:3000" \
-e AUTH_SECRET="$(openssl rand -base64 32)" \
-e AUTH=false \
-v "$(pwd)/data/prisma:/prisma" \
--restart unless-stopped \
ghcr.io/openchatui/openchatui:latest
```

#### Docker Compose
A ready-to-use `docker-compose.yml` is included. It maps port `3000` and persists SQLite data to `./prisma`.
A ready-to-use `docker-compose.yml` is included. It maps port `3000` and persists SQLite data to `./data` mounted at `/app/data`.

Minimal compose file:
```yaml
Expand All @@ -92,8 +81,12 @@ services:
image: ghcr.io/openchatui/openchatui:latest
ports:
- "3000:3000"
environment:
PORT: "3000"
AUTH_URL: "http://localhost:3000"
AUTH_SECRET: "<generate-a-secret>"
volumes:
- ./prisma:/prisma
- ./data:/app/data
restart: unless-stopped
```

Expand All @@ -109,7 +102,7 @@ docker compose down

> [!TIP]
> - 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.
> - Optional (persist SQLite outside the image): mount `./data:/app/data` and set `SQLITE_URL=file:/app/data/openchat.db` (DB defaults to sqlite in the image). Avoid mounting `/prisma` to prevent overriding bundled migrations.
> - Switch to PostgreSQL: set `DB=postgres` and provide `DATABASE_URL` in `environment`. You can add a separate Postgres service if needed.

# Features
Expand Down
2 changes: 1 addition & 1 deletion app/api/v1/users/profile-image/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export async function POST(request: NextRequest): Promise<NextResponse> {
const filePath = path.join(profilesDir, filename)
await writeFile(filePath, buffer)

const url = `/profiles/${filename}`
const url = `/data/profiles/${filename}`
return NextResponse.json({ url })
} catch (error) {
return NextResponse.json({ error: "Upload failed" }, { status: 500 })
Expand Down
File renamed without changes
File renamed without changes
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:/app/prisma/dev.db"
# SQLITE_URL: "file:/app/data/openchat.db"
# DATABASE_URL: "postgresql://user:pass@host/db"
# NODE_ENV: "production"
# OPENAI_API_KEY: "sk-..."
Expand All @@ -25,5 +25,4 @@ services:
# DRIVE_CLIENT_SECRET: "your-google-client-secret"
volumes:
- ./data:/app/data
- ./public/profiles:/app/public/profiles
restart: unless-stopped
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.27",
"version": "0.1.28",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
Expand Down