fix: change appname to neoirc and default DB to /var/lib/neoirc/state.db
All checks were successful
check / check (push) Successful in 5s
All checks were successful
check / check (push) Successful in 5s
- Change Appname from "chat" to "neoirc" in cmd/chatd/main.go - Change default DBURL from file:./data.db to file:///var/lib/neoirc/state.db in both internal/config/config.go and internal/db/db.go fallback - Create /var/lib/neoirc/ directory in Dockerfile with proper ownership - Update README.md to reflect new defaults (DBURL, docker run example, SQLite backup/location docs) - Remove stale data.db reference from Makefile clean target The DB path remains configurable via DBURL environment variable. Closes #44
This commit is contained in:
13
README.md
13
README.md
@@ -1645,7 +1645,7 @@ directory is also loaded automatically via
|
||||
| Variable | Type | Default | Description |
|
||||
|--------------------|---------|--------------------------------------|-------------|
|
||||
| `PORT` | int | `8080` | HTTP listen port |
|
||||
| `DBURL` | string | `file:./data.db?_journal_mode=WAL` | SQLite connection string. For file-based: `file:./path.db?_journal_mode=WAL`. For in-memory (testing): `file::memory:?cache=shared`. |
|
||||
| `DBURL` | string | `file:///var/lib/neoirc/state.db?_journal_mode=WAL` | SQLite connection string. For file-based: `file:///path/to/db.db?_journal_mode=WAL`. For in-memory (testing): `file::memory:?cache=shared`. |
|
||||
| `DEBUG` | bool | `false` | Enable debug logging (verbose request/response logging) |
|
||||
| `MAX_HISTORY` | int | `10000` | Maximum messages retained per channel before rotation (planned) |
|
||||
| `SESSION_IDLE_TIMEOUT` | string | `24h` | Session idle timeout as a Go duration string (e.g. `24h`, `30m`). Sessions with no activity for this long are expired and the nick is released. |
|
||||
@@ -1667,7 +1667,7 @@ PORT=8080
|
||||
SERVER_NAME=My Chat Server
|
||||
MOTD=Welcome! Be excellent to each other.
|
||||
DEBUG=false
|
||||
DBURL=file:./data.db?_journal_mode=WAL
|
||||
DBURL=file:///var/lib/neoirc/state.db?_journal_mode=WAL
|
||||
SESSION_IDLE_TIMEOUT=24h
|
||||
```
|
||||
|
||||
@@ -1685,8 +1685,7 @@ docker build -t chat .
|
||||
|
||||
# Run
|
||||
docker run -p 8080:8080 \
|
||||
-v chat-data:/data \
|
||||
-e DBURL="file:/data/chat.db?_journal_mode=WAL" \
|
||||
-v chat-data:/var/lib/neoirc \
|
||||
-e SERVER_NAME="My Server" \
|
||||
-e MOTD="Welcome!" \
|
||||
chat
|
||||
@@ -1722,7 +1721,7 @@ make build
|
||||
|
||||
# Run
|
||||
./bin/chatd
|
||||
# Listens on :8080, creates ./data.db
|
||||
# Listens on :8080, writes to /var/lib/neoirc/state.db
|
||||
```
|
||||
|
||||
### Reverse Proxy (Production)
|
||||
@@ -1763,8 +1762,8 @@ seconds to accommodate long-poll connections.
|
||||
string). This allows concurrent reads during writes.
|
||||
- **Single writer**: SQLite allows only one writer at a time. For high-traffic
|
||||
servers, Postgres support is planned.
|
||||
- **Backup**: The database is a single file. Back it up with `sqlite3 data.db ".backup backup.db"` or just copy the file (safe with WAL mode).
|
||||
- **Location**: By default, `data.db` is created in the working directory.
|
||||
- **Backup**: The database is a single file. Back it up with `sqlite3 /var/lib/neoirc/state.db ".backup backup.db"` or just copy the file (safe with WAL mode).
|
||||
- **Location**: By default, `state.db` is created in `/var/lib/neoirc/`.
|
||||
Use the `DBURL` env var to place it elsewhere.
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user