Guides

Data and reset

Where Pretend keeps its data, and three ways to wipe it.

Where data lives

Everything Pretend stores lives under DATA_DIR, which is /app/.data in the image:

  • the SQLite database, with every email, contact, broadcast and setting;
  • attachments/, the files sent with emails.

Mount one volume there and your data survives container restarts and image upgrades.

Terminal
docker volume inspect pretend-data

Database migrations run when the container starts, so pulling a newer image upgrades the data in place.

Reset all data

Pick whichever fits your workflow. Each one deletes every captured email, contact and setting.

From the dashboard: go to Settings › Emulator and choose reset.

Over HTTP, for example in a test setup hook:

cURL
curl -X POST http://localhost:3000/_pretend/reset

Inside the container:

Terminal
docker exec pretend node scripts/reset.mjs

tip

Resetting before each end-to-end test run gives every run an empty inbox to assert against.

Delete everything

To remove the container and its volume entirely:

Terminal
docker rm -f pretend && docker volume rm pretend-data