- Replace hand-written node:sqlite queries with a Prisma client using the better-sqlite3 driver adapter - Version the schema with migrations: baseline table, timestamp normalisation, and WAL journal mode - Store timestamps with an explicit UTC offset so they stop being parsed as local time - Show created/updated times on the edit page, formatted with dayjs - Move the root redirect into next.config to avoid a prerender error - Run migrations from the container entrypoint before starting the server BREAKING CHANGE: DNSMASQ_ADMIN_DB_PATH is replaced by DATABASE_URL, which must be a Prisma connection URL (file:./data/dnsmasq-admin.db). Existing database files are migrated in place and need no conversion.
28 lines
1.3 KiB
Bash
28 lines
1.3 KiB
Bash
# Copy to .env (NOT .env.local) and adjust for your setup.
|
|
#
|
|
# Why .env and not .env.local: Next.js reads both, but the Prisma CLI only reads whatever its
|
|
# config file loads — prisma.config.ts imports dotenv/config, which reads `.env`. Keeping
|
|
# DATABASE_URL there means `prisma migrate deploy` and the app agree on the same database.
|
|
#
|
|
# Every value below is optional except DATABASE_URL — the app falls back to local paths under
|
|
# ./data so it runs with almost no configuration.
|
|
|
|
# Prisma connection URL for the SQLite database — the single source of truth for records.
|
|
# Docker: /data/dnsmasq-admin.db
|
|
# Relative paths resolve against the project root, not prisma/schema.prisma.
|
|
DATABASE_URL="file:./data/dnsmasq-admin.db"
|
|
|
|
# Managed dnsmasq config file this app regenerates on every apply.
|
|
# Docker: /etc/dnsmasq.d/dnsmasq-admin.conf
|
|
DNSMASQ_ADMIN_CONF_PATH=./data/dnsmasq-admin.conf
|
|
|
|
# Container restarted over the Docker socket after an apply.
|
|
DNSMASQ_CONTAINER_NAME=dnsmasq
|
|
|
|
# Docker socket. If it is missing (e.g. developing on Windows), the restart is skipped and
|
|
# reported in the UI rather than failing.
|
|
DNSMASQ_ADMIN_DOCKER_SOCKET=/var/run/docker.sock
|
|
|
|
# DNS server used by the /resolve page. Point this at your dnsmasq container or LAN IP.
|
|
DNSMASQ_SERVER_IP=127.0.0.1
|