Resolve conflicts against upstream's refactors: - server/db/sqlite/schema/schema.ts: adopt upstream's reindented sqliteTable(name, cols, indexes) form for sites/resources, re-applying the headers -> requestHeaders/responseHeaders split. Kept in sync with the Postgres schema. - server/lib/traefik/headersMiddleware.ts: extend upstream's extracted buildCustomHeadersMiddleware helper to take requestHeaders and responseHeaders and emit both customRequestHeaders and customResponseHeaders. - server/lib/traefik/getTraefikConfig.ts and server/private/lib/traefik/getTraefikConfig.ts: keep upstream's helper extraction and appendPathMatch refactor, dropping the superseded inline blocks. Also carry the feature forward onto code that moved upstream: - The resource settings UI moved from resources/proxy/[niceId]/proxy to resources/public/[niceId]/http, which dropped this branch's changes in the previous merge. Re-add the request/response header inputs there and rename the vestigial headers field on the tcp page. - messages/da-DK.json is new upstream and still had the old customHeaders key; rename it in line with the other locales. Per the contributing docs, versioned migrations are intentionally omitted so maintainers can write them at release time. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Database
Pangolin can use a Postgres or SQLite database to store its data.
Development
Postgres
To use Postgres, edit server/db/index.ts to export all from server/db/pg/index.ts:
export * from "./pg";
Make sure you have a valid config file with a connection string:
postgres:
connection_string: postgresql://postgres:postgres@localhost:5432
You can run an ephemeral Postgres database for local development using Docker:
docker run -d \
--name postgres \
--rm \
-p 5432:5432 \
-e POSTGRES_PASSWORD=postgres \
-v $(mktemp -d):/var/lib/postgresql/data \
postgres:17
Schema
server/db/pg/schema.ts and server/db/sqlite/schema.ts contain the database schema definitions. These need to be kept in sync with with each other.
Stick to common data types and avoid Postgres-specific features to ensure compatibility with SQLite.
SQLite
To use SQLite, edit server/db/index.ts to export all from server/db/sqlite/index.ts:
export * from "./sqlite";
No edits to the config are needed. If you keep the Postgres config, it will be ignored.
Generate and Push Migrations
Ensure drizzle-kit is installed.
Postgres
You must have a connection string in your config file, as shown above.
npm run db:generate
npm run db:push
SQLite
npm run db:generate
npm run db:push
Build Time
There is a dockerfile for each database type. The dockerfile swaps out the server/db/index.ts file to use the correct database type.