• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

teslamate-org / teslamate / 9a58556399ecb1c825054f247634391e5f859523
82%

Build:
DEFAULT BRANCH: main
Ran 24 Jul 2026 10:00AM UTC
Jobs 1
Files 81
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Jul 2026 09:53AM UTC coverage: 81.619% (+0.08%) from 81.537%
9a58556399ecb1c825054f247634391e5f859523

push

github

web-flow
refactor(nix,postgres): provision database declaratively, connect via socket (#5337)

* refactor(nix,postgres): provision database declaratively, connect via socket

Replace the single `initialScript` with declarative `ensureDatabases` and `ensureUsers`, freeing the `services.postgresql.initialScript` option, which is single-valued and could not be combined with other modules that need it (e.g. to `CREATE EXTENSION`).

TeslaMate now connects to a local PostgreSQL via the unix socket using peer authentication, so no password is sent over TCP and startup no longer depends on the password being set first. The role password is still applied at runtime from DATABASE_PASS via `postStart` (kept out of the Nix store) because Grafana and the TCP fallback still require it.

* fix(nix,maintenance): read RELEASE_COOKIE without sourcing the env file

Sourcing the environment file executed it as a shell script (arbitrary code execution if a secret contained $(...) or backticks) and broke on values containing quotes. Extract RELEASE_COOKIE literally with sed
instead and strip one optional surrounding pair of double quotes, so the value is handled safely whether or not it is quoted in the file.

* fix(nix,postgres): set role password safely for any value

The password was interpolated into the SQL string as '$DATABASE_PASS', which breaks (and risks SQL injection) for passwords containing single quotes. Read it from the environment with psql's \getenv and quote it with :'password', producing a correctly escaped SQL string literal. The password is no longer placed on the command line either. Requires PostgreSQL >= 14 for \getenv.

* fix(nix,maintenance): fail on empty RELEASE_COOKIE

* fix(nix,postgres): fail early with clear message if DATABASE_PASS is missing

* fix(nix,postgres): skip password setup on standby, assert supported version

Address review feedback: ALTER USER cannot run on a read-only standby (the password is replicated from the primary anyway), so post... (continued)

2007 of 2459 relevant lines covered (81.62%)

2946.6 hits per line

Jobs
ID Job ID Ran Files Coverage
1 9a58556399ecb1c825054f247634391e5f859523.1 24 Jul 2026 10:00AM UTC 81
81.62
GitHub Action Run
Source Files on build 9a58556399ecb1c825054f247634391e5f859523
  • Tree
  • List 81
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 9a585563 on github
  • Prev Build on main (#DF17F413...)
  • Next Build on main (#054A7152...)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc