Skip to content
ITSEC-ASIA-IDPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

OneProMag

Simple, modern pentest project management. Track engagements per client, assign pentesters, and manage client retest requests — Postgres-backed, Docker-first, no build step.

docker db stack build


Quick start — Docker

docker compose up --build
# → http://localhost:3131

That is the whole setup: the app plus a PostgreSQL 17 database, wired together. Data lives in the onepromag-pgdata volume, so it survives every rebuild.

docker compose up --build -d     # run in the background
docker compose logs -f           # follow logs
docker compose down              # stop (data is kept)
docker compose down -v           # stop and delete the database volume

Port 3131 already taken? Pick another host port without editing any file:

APP_PORT=8080 docker compose up --build
# → http://localhost:8080

SQLite fallback (no database container)

The data layer supports both engines behind one interface. To run without Postgres at all:

DB=sqlite docker compose up --build onepromag
# SQLite file in the `onepromag-data` volume, no db container started

This is the escape hatch if you want a single-container deployment, or need to roll back after migrating. See Database for the trade-offs.

Quick start — without Docker

Requires Node.js ≥ 22.5. Postgres path needs a reachable server; SQLite path needs nothing.

npm install          # installs `pg` (the only dependency)
npm start            # → http://localhost:3131, SQLite by default
# against PostgreSQL instead
DB=postgres PGHOST=localhost PGUSER=onepromag PGPASSWORD=... PGDATABASE=onepromag npm start

# or shorthand (reads DATABASE_URL / PGHOST env vars)
DATABASE_URL=postgres://user:pass@localhost:5432/onepromag npm start

Engine selection order:

  1. DB=postgres / DB=sqlite if set explicitly
  2. otherwise Postgres if DATABASE_URL or PGHOST is set
  3. otherwise SQLite

Other scripts:

npm test              # the API suite (node:test, no dependencies)
PORT=4173 npm start   # different port
npm run dev           # auto-restart on file change
npm run reset-db      # wipe the SQLite file, re-seed on next start

Tests

npm test runs test/api.test.js with node --test — no framework, no HTTP client, no fixtures file. It sets DATA_DIR to a temp directory, DB=sqlite and SEED_DEMO=1, boots the database, and calls the route handlers directly (api['DELETE /api/projects/:id']({ user, params })), which is possible because api is a plain map and the demo seed is the fixture.

Fifty-nine cases. The table lists the ones worth reading — each is a bug this app has actually had or could have shipped:

case what it protects
a Member cannot delete a project, and the project survives the delete rule
a Lead can delete a project the rule is not "nobody can"
a Member can still create and edit a project the rule is not over-applied
a Member cannot delete a retest, but can move it the same, on retests
a Member cannot delete a device, but can edit one the device inventory
dropping a device column needs a lead, renaming does not the column purge
creating a retest on a Done project leaves it Done 8ad1ceb
a Member may only change their own availability the availability gate
only a pentester can be attached as a pentester assignment validation
a Hold retest is listed as open work, not as history 6418855
the retest queue counts every non-Done retest the same rule, one level up
a lead can add an intern under a member, a sub lead or themselves the intern level
an intern cannot supervise another intern "who is training whom"
an intern must report to somebody no orphan trainees
a member cannot create an intern only supervisors add people
an intern is on the board and knows who supervises them the interns table
a fresh database has the columns the code selects the fresh-install path
an upload round-trips byte-identical, and its download is attachment attachments are not corrupted by base64
a Member uploads but cannot delete a file the delete rule, on files
an empty, malformed or oversized upload is refused nothing half-written reaches the disk
deleting a project removes its folder attachments do not outlive their project
both seeded checklists have ten items with text the seed is usable, not empty scaffolding
bulk paste splits section | title | help the paste box produces the rows it promises
attaching a checklist writes no answers Open is an absence, not a row
a project's category attaches its default, once auto-attach is additive and idempotent
a template in use cannot be deleted RESTRICT, reported as 409
an item cannot cite another project's file evidence stays with its engagement
pentest notes: one field per project, and a no-op save keeps the stamp saving twice saves once; the two note fields do not overwrite each other
a note saved in the same millisecond as the last one still persists a save is judged by its text, never by whether the clock moved
the Tests and Findings libraries are readable by a Member, and complete reference text nobody can edit is text nobody can fix
a Member cannot delete a pentest note the delete rule, on the log

.github/workflows/test.yml runs it on every push and pull request. There is no browser test: the UI is verified in the container, and a screenshot is worth more than a DOM assertion for a page whose point is how it looks.

Demo accounts

Seeded by docker-compose.yml / npm start on a fresh database (SEED_DEMO unset). The production file seeds none of this — see Running in production.

The login screen shows these as a Demo accounts box with a "Use" button, and only when the server reports that the demo seed ran. On a production install the box is not rendered at all, so no credentials are ever advertised to a visitor.

Username Password Role Level
admin admin123 Admin Lead
rafi pentester123 Pentester Lead
dewi pentester123 Pentester Sub Lead
bagas pentester123 Pentester Member
sinta pentester123 Pentester Member
yoga pentester123 Pentester Sub Lead
fajar pentester123 Pentester Member
nadia pentester123 Pentester Member
adit intern123 Pentester Intern
laras intern123 Pentester Intern
rina manager123 Project Manager —
hendra manager123 Project Manager —

The pentest tree has two branches: admin → dewi → bagas, sinta and rafi → yoga → fajar, nadia. That is what the team status board renders as Lead, Sub Lead, Member, Member, Lead, Sub Lead, Member, Member. Fajar ships with a manual Exam status so both an automatic and a manual row are visible out of the box.

adit (intern under Bagas) and laras (intern under Rafi) are the two supervision cases an intern can have — a member and a lead — and they populate the board's interns table, which is empty until an intern exists.

Three applications ship with sub apps so the third level is visible out of the box: Brilink (MPOS, Mobile, Web), Brimo (Mobile, Web) and Dompet Kita App (Personal, Partner). The projects Mobile Banking App v4.2 and Brimo iOS Build point at Brimo Mobile; every other project tests the application as a whole.

rina and hendra are Project Managers (PM) — a separate role, not part of the pentest tree; it is the role that usually owns engagements. Bank Nusantara and Dompet Kita name both of them as default SVs; the other three clients name one each, so you can see both the single-SV and the multi-SV auto-selection behaviour on the create form.

New accounts can also be created from the Register link on the login page. Self-registration always produces an ordinary pentester at level Member — the role, level and reporting line are decided by the server, never by the request, so nobody can register themselves an admin. Promote someone (or mint a Project Manager) from the Admin panel. Demo data is only seeded into an empty database.


Running in production

docker compose -f docker-compose.prod.yml up -d --build

That is the whole thing. No .env, no flags, no proxy to configure: the app comes up on the same http://localhost:3131 you use in development, against Postgres, with production behaviour switched on. Ports and addresses stay put; what changes is how it survives being left alone.

What the production file adds

docker-compose.yml is the development file — it publishes 3131 and runs the app straight from the working tree. docker-compose.prod.yml runs the same image unattended:

dev prod
Restart unless-stopped same, plus init: true so SIGTERM reaches node and it closes the listener instead of being killed after the grace period
Healthcheck GET / GET /healthz — includes a database round trip, so "up" means "can actually work"
Root filesystem writable read-only; only /tmp (tmpfs 32 MB) and /data are writable
Capabilities default cap_drop: ALL + no-new-privileges
Logs unlimited 10 MB × 3 files per service
Database port not published not published (same)
Boot ordering parallel app waits for db to be healthy, not merely started
Postgres shared memory 64 MB shm_size: 256mb
Default password onepromag onepromag, and the boot log says so

The password warning is the one setting this file cannot invent for you:

  Warning        → database password is still the default "onepromag"
                   set POSTGRES_PASSWORD in .env before exposing this

Create .env with POSTGRES_PASSWORD=$(openssl rand -base64 24) (plus anything from deploy/.env.example) and it stops printing that line.

Two public surfaces, both closed by default

dev prod
SEED_DEMO demo fixtures on a fresh database 0 — no fixtures, no demo logins shown on the login screen
ALLOW_REGISTER open self-registration 0 — POST /api/auth/register answers 403, the login screen shows no Register link

Both are decisions of the server and are reported to the client by GET /api/auth/me ({"demo":false,"allowRegister":false}), so the login screen cannot advertise something the server would refuse.

No demo data — one admin instead

docker-compose.yml seeds fixtures (ten people, five clients, seven projects, notes, a device inventory); docker-compose.prod.yml sets SEED_DEMO=0 and seeds none of it. A fresh production database contains exactly:

  • the schema,
  • the nine built-in categories and statuses — these are structure, not fixtures: every project row stores one of their keys, so an empty table would make the project form unusable,
  • one admin account.
  Demo data      → off (SEED_DEMO=0) — schema and built-in properties only

  Admin login:
    admin / ew9ZzsqI_OSm
    Created just now — change it after signing in (top right → Change password)

That block is printed on every start, not once — docker compose up scrolls, -d shows nothing, and a container rebuilt a week later has no memory of the password:

  Admin login:
    admin / ew9ZzsqI_OSm
    Still the bootstrap password — change it (top right → Change password)
docker compose -f docker-compose.prod.yml logs onepromag | grep -A2 "Admin login"

While the password is still the bootstrap one it is remembered in /data/.bootstrap-admin.json (mode 0600, inside the data volume — the same trust boundary as the database) so it can be re-shown. The moment the password stops matching the hash in the database the file is deleted and the log says so instead of printing a password that no longer works:

  Admin login     → password changed or unknown; reset it with:
                    node server/cli.js passwd admin

Set ADMIN_PASSWORD and the file is never used: the password is printed from the environment. The generated one is only ever a starting point; set ADMIN_PASSWORD in .env when it has to be known in advance (provisioning, a password supervisor). ADMIN_USERNAME and ADMIN_NAME are optional. After that first admin exists, every other account is created in Admin panel → Manage users, or by SEED_DEMO=1 on a throwaway demo box.

Lost it? Logs are the only copy, so there is a way back in that does not involve deleting the database:

docker compose -f docker-compose.prod.yml exec onepromag node server/cli.js users
docker compose -f docker-compose.prod.yml exec -e NEW_PASSWORD='…' \
  onepromag node server/cli.js passwd admin

passwd takes NEW_PASSWORD, or generates one and prints it (and remembers it, so the boot log keeps showing a password that actually works), and clears that account's other sessions — a reset usually follows "someone else may have this password". Neither command needs the web server to be up.

Because the production stack has its own volume, it never inherits development fixtures in the first place — see Two independent installs below. An older install that already shares them can drop the prod volume and start over: docker compose -f docker-compose.prod.yml down -v (destroys that stack's data).

TLS is opt-in, because it needs something a file cannot invent

A certificate needs a hostname that resolves to the machine. With one:

# .env
DOMAIN=onepromag.example.com
[email protected]
POSTGRES_PASSWORD=<openssl rand -base64 24>
APP_BIND=127.0.0.1          # the proxy becomes the only way in
COOKIE_SECURE=1             # optional; the cookie follows the request anyway

docker compose -f docker-compose.prod.yml --profile tls up -d --build

Caddy then terminates TLS, renews the certificate, serves gzip/zstd, and adds HSTS, nosniff, X-Frame-Options: DENY and a Referrer-Policy. Ports 80 and 443 must be free and reachable. With DOMAIN=localhost (the default) the same profile runs on a self-signed certificate — useful to prove the path works, not useful for real users.

The session cookie decides Secure from the request, so both worlds work with no configuration: Secure when the request arrives over TLS (directly, or via an X-Forwarded-Proto: https header from a terminator), no Secure over plain http. COOKIE_SECURE=1/0 overrides that guess if your proxy does not send the header. This matters because a Secure cookie issued over http:// is dropped by the browser, and the login then looks broken rather than misconfigured.

Health

GET /healthz answers two questions at once: the process is up, and SELECT 1 against Postgres succeeded within two seconds. It returns 503 with {"ok":false,"db":"down"} while the database is unreachable and 200 again once it returns — no restart needed. Docker's healthcheck uses it, Caddy's upstream check can use it, and so can any monitor. It needs no session and reveals nothing but a boolean plus an uptime counter.

Backups (on by default)

mkdir -p backups
docker compose -f docker-compose.prod.yml up -d        # app + db + backup
docker compose -f docker-compose.prod.yml stop backup  # if you really want to

The backup service is not behind a profile. A backup that only exists when someone remembers a flag is a backup that does not exist, and the first symptom would be a corrupt volume with nothing to restore from. It costs one idle container.

Every BACKUP_INTERVAL_SECONDS (default 86400) the container writes two artefacts and deletes pairs older than BACKUP_KEEP_DAYS (14):

  • backups/onepromag-YYYY-MM-DD-HHMM.sql.gz — the database, --no-owner --no-privileges, so it restores into any cluster;
  • backups/onepromag-YYYY-MM-DD-HHMM-uploads.tar.gz — the attachment bytes, which live on disk under /data/uploads and are therefore not in the dump.

A restore needs both, in that order:

gunzip -c backups/onepromag-2026-10-26-1355.sql.gz \
  | docker exec -i $(docker compose -f docker-compose.prod.yml ps -q db) \
      psql -U onepromag -d onepromag

docker run --rm -i -v onepromag-prod_onepromag-data:/data alpine:3 \
  tar -xzf - -C /data < backups/onepromag-2026-10-26-1355-uploads.tar.gz

Restoring only the dump gives every list, note and checklist answer back while each attachment download answers 410 The stored file is missing — the archive exists precisely so that pair cannot be forgotten. If docker compose logs backup says UPLOADS FAILED, the dump is still good and the bytes are simply absent from that run.

mkdir -p backups first and set HOST_UID=$(id -u) / HOST_GID=$(id -g) in .env, otherwise the files land root-owned. ./backups is git-ignored; copy it off the machine if losing the host is in scope.

Two things make a failed dump loud instead of silent, and both matter:

  • the script runs set -euo pipefail. Without it the shell tests gzip's exit status, so a failed pg_dump (database locked, still starting, mid-upgrade) produced backups/onepromag-….sql.gz containing 20 bytes, printed success, and then the prune deleted the last real dump — verified against postgres:17-alpine;
  • a dump smaller than 10 kB is treated as a failure and renamed to backups/failed-YYYY-MM-DD-HHMM.sql.gz, which the prune never keeps as if it were a backup. docker compose logs backup shows the line per run.

Two independent installs

docker-compose.prod.yml declares name: onepromag-prod, so it is its own compose project with its own volumes. Without that, compose derives the project from the directory name — the same name the development file gets — and both files mount the same Postgres volume, which is how a database seeded with demo fixtures during development ends up being "production". SEED_DEMO=0 stops new fixtures; it cannot un-seed rows that already exist.

So the two stacks are separate:

dev prod
Compose project onepromag (directory name) onepromag-prod
Database volume onepromag_onepromag-pgdata onepromag-prod_onepromag-pgdata
Network subnet 10.77.0.0/24 10.78.0.0/24
Port 3131 (APP_PORT) 3131 (APP_PORT)

They can both run at once if the ports differ (APP_PORT=3135 docker compose up -d) — the separated subnets are what make that possible.

Moving real content from dev to prod

The stacks no longer share a database, so anything worth keeping has to be moved:

# dump from dev (its db container is named onepromag-db)
docker exec onepromag-db pg_dump -U onepromag --no-owner --no-privileges onepromag \
  | gzip > dev.sql.gz

# load into prod (its db container is onepromag-prod-db-1)
gunzip -c dev.sql.gz \
  | docker exec -i $(docker compose -f docker-compose.prod.yml ps -q db) \
      psql -U onepromag -d onepromag

# the dump carries dev's users, including the demo accounts — remove them in
# Admin panel → Manage users, and change the admin password

For a clean start instead, do nothing: a fresh prod volume already comes up with one admin and no fixtures.

Upgrading

git pull
docker compose -f docker-compose.prod.yml up -d --build

Migrations run on boot and are safe to re-run; sessions are in the database, so a rebuild does not log anyone out. Two limits worth knowing:

  • One app container. The category/status list is cached in process memory and cleared by the replica that writes it, so a second replica would serve a stale list until it restarted. Everything else — sessions, passwords, data — is in Postgres.
  • Do not enable the SQLite fallback in production. It would put the whole database inside one container's volume with no online backup path.

Features

Auth

  • Username + password login with scrypt hashing and per-user random salt
  • Server-side sessions (HttpOnly, SameSite=Lax cookie), 14-day expiry
  • Self-service registration with username/password validation — on by default, closed by the production compose file (ALLOW_REGISTER=0). Closed means the endpoint answers 403 and the login screen offers no Register link, just "Accounts are created by an administrator". On a real installation every account comes from Admin panel → Manage users or its import, where role, level and reporting line are set deliberately instead of being guessed.
  • Light & dark theme, remembered in localStorage

Signing in

The login field accepts either a username or an email address. A username always wins the lookup — usernames are unique and validated, while emails are free text an admin or the user themselves typed in — so someone whose name happens to look like a colleague's address can still sign in as themselves. Emails match case-insensitively.

If two accounts share an email, the login is refused with 409 That email is used by more than one account. Sign in with your username instead. Guessing which account was meant would sign people into the wrong one, which is worse than an error message.

Roles & hierarchy

Every pentester carries a sub-role, ordered Lead → Sub Lead → Member → Intern. An intern is the trainee level: they test alongside whoever supervises them, they get their own table on the team status board, and they are otherwise an ordinary pentester — assignable to projects, with their own availability and notes.

  • The level is shown as a small pill on cards, in the drawer and in the picker.
  • In the project drawer the team is grouped by level so you can see who runs it.
  • The account menu visualises the hierarchy with your level highlighted.
  • Admin, Lead and Sub Lead can manage the client/application catalogue and see the Admin panel. Members cannot.
  • Everyone signed in can view, create and edit. A Member files the retest request, moves the engagement along, writes the device inventory and the notes — that is the job, and gating it would mean waiting for a lead to type.
  • Only Admin, Lead and Sub Lead can delete — a project, a retest request, a device, or a column of the device sheet (which takes every value in that column with it). Deleting cascades to the retests and the team assignment, there is no soft delete and no undo, so the confirmation dialog is not the only gate. The server answers 403 with Only admin, lead or sub lead can delete …; the UI hides the delete buttons for Members as well, but the rule lives on the server because the API is reachable directly.

Besides Pentester and Admin there is a third role, Project Manager (role: 'Project Manager' in ENUMS.role, printed as PM):

  • A PM owns engagements rather than testing them, so PMs never appear in the "Who pentest" picker and never appear on the team status board.
  • The role is not called Supervisor. Supervisor (SV) is the name of the field on a project — "who owns this engagement" — and that field accepts a Project Manager or a Pentester, or nobody at all. A small team has no separate PM account, so the lead who won the work owns it directly.
  • Every user row carries phone and email. The drawer renders them as tel: / mailto: links, and the admin pages show them on each card.
  • SVs are curated under Admin panel → Manage users.

Who is online

The topbar carries a quiet presence badge where the global search used to be: the faces of whoever else was active in the last couple of minutes, plus the count. One click opens the list — name, level and role each — and clicking a person opens their card, so "is the lead at their desk" costs one click instead of an email.

  • Nothing is stored to say "online" that is not already true. Every authenticated request stamps users.last_seen_at; an account is online while that stamp is inside a two-minute window. No socket, no heartbeat endpoint, no second table.
  • The badge is the ping. Its own poll every 45 seconds is an authenticated request like any other, so simply having the app open keeps you listed. The poll also stops when the tab is hidden and fires again the moment it comes back — a tab that was asleep is stale exactly when someone looks at it.
  • Writes are throttled to one per account per 20 seconds (touchPresence), in memory, because a page load is a dozen requests and the badge does not need to know about the other eleven. Twenty seconds is a fifth of the window, so the answer never lags visibly.
  • Alone, the badge says so: a person glyph and 1 on a grey pill, tooltip Just you online right now. Green only ever means "another person is here", which is why there is no dot: a dot that is always on says nothing.
  • On a phone the faces go and the number stays — the pill is a tap target, not a table.

Project list

  • Grid card view is the default; table view is one click away, both remembered
  • Live search across name, client, application and notes (160 ms debounce, keeps focus). The box carries a × while it has text, and Esc empties it, because clearing a filter should not need a select-all.
  • Filters: client, application, category, status. Status filtering replaced the old "By status" sidebar group — one control instead of six nav rows. Environment and method are no longer filterable (they remain project fields and are still accepted by the API)
  • The app opens on Active projects, which is the day-to-day view
  • Sidebar scopes, in order: Active projects / All projects / My active projects / My all projects, plus a separate Admin panel group for privileged users (and Team status, Users and Devices above the scopes)

Reading a list

The four project lists share one layout, so learning one teaches all four.

  • The row is the button. It highlights on hover and tints the project name; there is no chevron, because an arrow at the end of a row advertises a control that does not exist.
  • Columns are aligned to what they hold: the single-value columns (SV, retest count) sit on their centres, status on the right edge, and pentesters stay flush left — an avatar stack is read name by name from the left, and the + that adds one belongs at its natural end rather than moving with each project's headcount.
  • A retest row is not highlighted. It says Retest - <project> and carries a Retest badge, which is enough; tinting it made the row look selected, and a list where one row always looks selected is a list you stop trusting.
  • The breadcrumb wraps, it does not truncate. On a card, Bank Nusantara – Brimo – Brimo Mobile gets two lines instead of Bank Nusantara – Brim…: the part that gets cut is exactly the sub app, which is the part you cannot guess.
  • On a phone the table keeps two columns — project and status — instead of scrolling seven. Category, supervisor, pentesters and the retest count are in the drawer, one tap away; a row you must scroll sideways to read is an inventory seen through a letterbox.

Paging

The four project lists — Active projects, All projects, My active projects, My all projects — page at 50 rows by default, with 50 / 100 / 200 / All in the bar under the results. The choice is remembered per browser, so a team that prefers 100 does not say so every day; All is an explicit option rather than a magic number.

  • The bar states the range and the total (Showing 51–100 of 137) and offers « First · ‹ Prev · Page 2 of 3 · Next › · Last »; on a phone only the step-by-step pair remains, because four buttons do not fit.
  • Paging counts rows, so a page of 50 in an active list includes the retest rows that belong to it.
  • Changing the scope, a filter or the search returns to page 1; saving a status does not, because the query did not change — you stay on the page you were reading.
  • On a single page the navigation buttons are dropped and only the range plus the size picker remain.

Retests get their own rows in the active lists

An open retest is work, so Active projects and My active projects list it as its own row, labelled Retest - <project>, next to the engagement.

Open means "not Done". Every other status counts — Incoming, Ready, Ongoing, Hold, and any status an admin adds — because a request on Hold is paused work, not history. It used to be hardcoded to Incoming/Ongoing, which made a paused retest invisible: it was not a row in either active list, it did not count in the Retest queue card, and if its engagement was already Done the whole piece of work disappeared from the app. The rule now lives in one place on the server (retestOpen()), so the rows, the queue counter, the board chips and the "status in use" check cannot drift apart:

Core Banking Web Portal          2 retests   Ongoing
Retest - Core Banking Web Portal  Retest      Ongoing     ← this request
Retest - Core Banking Web Portal  Retest      Incoming    ← that request

One engagement with two outstanding requests is three rows, because they are three things to do. Each retest row has its own status control, and choosing a status there changes that retest — not the project, which keeps its own status and its own control on its own row. The list header counts them separately (4 projects +2 retests), and a status filter applies to each row's own status.

Rows are ordered by status — the same order the server uses for engagements (Ongoing, Incoming, Ready, Hold, Done) — and a retest is placed by its own status, not by its project's. A retest row therefore sits in the Ongoing block even when the engagement it belongs to is Hold, and it stays directly beneath its project when the two share a status.

A finished engagement is not listed as itself in an active list, even when it owes a retest: the pending retest is the row that stands for the work

Retest - Core Banking Web Portal   Retest   Ongoing      ← project is Done

Without that rule a Done project appeared under "Active projects" and the page contradicted its own title. The Active counter and the sidebar badge count engagements that are not Done (4 above), so the badge, the stat card and the project rows always agree; the retest rows are the extra +N. Filter the status column to Done and those engagements are listed normally — the scope stops hiding them because you asked for them.

Retest rows appear only in the active lists. All projects stays a catalogue of engagements and keeps the retest count column; All projects → a project (and the drawer's retest queue) remains where the whole history lives.

Users

The staff directory: everyone with a login, one row each, as a table of Full name · Role · E-mail · Number phone. Reachable from the sidebar by anyone — a tester looking for the project supervisor who owns the engagement should not have to ask an admin.

The list is divided by role — Project supervisors first, then Pentesters — each with its own count, because the question is "who do I ask about this project", not "who exists". Administrator accounts are not listed: an admin is operations, they belong in Manage users, and showing them here invites asking the wrong person about a retest. The search box filters across both groups and hides a group with no matches.

The Role column carries the account's role and, for pentesters, their level as a chip (Lead, Sub Lead, Member, Intern), because "Pentester" alone does not tell you which one to ask. The e-mail and the number are mailto:/tel: links, so they work from a phone; clicking the avatar opens that person's card.

This is deliberately not the admin tree. Looking someone up is a lookup, and hierarchy is the wrong shape for it, so the page is sorted alphabetically and has one search box over every column. The phone is also matched on digits alone, with +62 and 0 treated as the same prefix — a number read off the screen as +62 812 1000 0005 is typed back as 0812 1000 0005.

Managing the same people — creating accounts, importing a team, moving someone in the reporting tree — is Admin panel → Manage users (Accounts and roles below).

Information center

Free-form notes for every client, every application and every sub app, so the next tester on an engagement does not have to rediscover the environment.

Reached from the sidebar. Two panes: the target tree on the left with per-target note counts, the note library on the right.

The left tree is one collapsible group per client, with its applications nested underneath and the sub apps of those applications nested once more. A client with a dozen applications used to push everything else out of reach, and a flat list made it hard to see which applications belonged together. Each group has a chevron; the group holding the current selection is always open, so clicking an application — or a sub app — can never leave the active row hidden inside a collapsed parent.

A sub app is a target of its own: Brilink MPOS and Brilink Web are different products and find different things, so each one has its own notes, its own table sheet and its own Dev/Prod pair. Nothing is shared upwards: a note filed on a sub app does not appear on the application, and a note on the application does not appear on its sub apps. The level only shows up for applications that actually have sub apps, and deleting one deletes the notes and sheets filed on it (a row whose target is gone can never be read again — the picker no longer lists it and GET /api/info 404s). Deleting an application or a client does the same for every level below it, and pruneOrphanNotes() sweeps any that a manual database edit left behind.

The table sheet behaves like the Devices sheet

The fixed Table document and the Devices inventory are the same table in the same clothes: one sticky uppercase header, one row rhythm, one set of controls — and, on first sight, no controls at all. That is deliberate rather than cosmetic: a tester who has learned the Devices table already knows this one.

Keeping them identical takes one thing worth knowing: they must share a single rule set, not two that look alike. The sheet originally had its own .ic-table block, and over a few months the two drifted — the sheet's rows were 47px against the inventory's 40px, its headers aligned top against middle, and every cell carried pre-wrap and tabular-nums the inventory never got. Nothing was individually wrong; the two had simply been edited by different changes. The sheet now wears .dev-table and emits the same view-mode markup devicesTableHTML emits, so a change to one is a change to both, and no rule has to state that they match.

Sharing the markup matters more than sharing the colours. An earlier version already shared every cell property and still looked like a different table, because the sheet kept a grip column, two per-row buttons, a + in the header and a trailing Add row while it was being read. Those controls made its rows taller and put widgets along both edges that the inventory's first page does not have. Devices had already settled that argument: nothing is draggable, deletable or addable until you press Edit all rows. The sheet obeys the same rule through its own Edit button.

One difference is intentional and is the only one: on a phone the sheet keeps its table (a credentials grid means nothing as a stack of cards, because the row/column relationship is the information) while the inventory switches to cards.

Reading the sheet is exactly reading the inventory. Editing it opens the grid editor, where the structural work happens:

  • Drag a column by its grip to reorder it. The header label and every cell below it move together, because moving the header alone would silently re-label the data.
  • Move a row up or down with the arrows at the end of the row, or drag it.
  • Add a column or a row with the buttons under the grid.
  • Delete a row or a column with the × beside it. The last remaining row and column cannot be deleted — a table with nothing in it has nowhere to type.

The sheet saves on Save, so a reorder survives a reload. Saving sends only the table half of the document, so dragging a column can never blank the prose below it.

Note cards render the identical table, because it is the same call: a card has no order of its own to persist, so nothing there is draggable either.

When the table is wider than the pane, a fade and a Scroll sideways for the remaining columns hint appear on the side that has more to show — the same wrapper, the same measurement and the same function the inventory uses. Both are measured on load as well as on scroll; otherwise a wide table just looks cut off until you happen to drag it.

Dev and Prod sheets on applications

Every application — and every sub app of one — carries two independent sets of those documents, one per environment, selected with a Dev / Prod switch above the blocks. Dev is the default — production testing is the exception, and landing on Prod by accident would be a foot-gun, so the switch always opens on Dev even if the last target you looked at was on Prod. Clients have no environment: a client is an organisation, not a deployment.

The two sets are genuinely separate: documents is keyed on (scope, scope_id, env), so writing the Prod sheet leaves the Dev notes and table completely untouched, and the seeded demo application shows visibly different content on each page.

Clients have no Prod sheet. A client is an organisation, not a deployment, so the switch is not rendered for a client and the API refuses env=Prod on a client scope with 400 Only applications have a production environment rather than writing to a row nobody would ever open.

Switching environment while a block is being edited discards the unsaved edit instead of carrying it across — a half-written Dev note must never land in Prod.

Two things sit below the fixed sheets and they are deliberately named apart: the Notes document (one prose page per sheet) and the Extra notes list (separate cards, the list counted and labelled "Filed on the Dev/Prod sheet"). Without distinct names the two read as competing places to write a note.

Notes are filed per sheet too. Everything on the page below the sheets — the note cards, their editor and the search results — belongs to the environment you are currently looking at. A note written on Dev does not appear on Prod and vice versa, each note stores its own env, and the note dialog names the sheet it will land on (Brilink — Bank Nusantara · Prod sheet). Editing a note keeps it on the sheet it already belongs to, so a Prod note opened while the page happens to be on Dev is never silently re-filed. Jumping to a note from search switches to that note's own sheet first — otherwise a Prod match would land on the Dev page and look missing. Search results carry a small DEV / PROD tag next to the application name, and so does every note card — the switch scrolls out of view, so a card without its own marker would lose the only clue to which environment it belongs to. Client-level notes are always Dev, because a client has no production page.

Each sheet heading repeats the environment as a Dev / PROD pill, and a Prod heading also carries a rose rule down its left edge. The switch sits above both blocks, so a reader who has scrolled into the table would otherwise have no way to tell whether the credentials in front of them are production ones.

Each target owns, above the note list, two fixed documents: the Table first and the Notes underneath. The table is the reference material a tester opens the page for; the prose reads as commentary below it. Both always exist, so there is nothing to name before you can start writing — pick the target, click Edit on either block, write, Save.

Block Storage Edited by
Table (first) documents.table_json an Edit button reveals the same grid editor the table notes use. Columns can be reordered by dragging them, or with the arrow buttons
Notes (below) documents.text_body an Edit button reveals a Markdown textarea; Ctrl/⌘+Enter saves, Escape or Cancel discards

Markdown in the notes block

The notes sheet renders Markdown, because a pentest note is a document — headings, numbered steps, fenced commands — far more often than it is a wall of prose. A fenced code block keeps its exact alignment, which is what the old monospaced block was really for.

Supported: #–###### headings (# maps to <h2>, since an <h1> inside a card is wrong), **bold**, *italic*/_italic_, `inline code`, ``` fenced blocks, -/1. lists, > blockquotes, --- rules, | pipe | tables, and [label](url) links.

The renderer escapes every character of input before it emits any tag of its own, and only http(s), mailto and tel links survive — anything else (including javascript:) is left as literal text. That matters because all signed-in users share these documents.

Blocks render read-only until Edit is clicked. That is deliberate: a credentials grid you can clobber with a stray keystroke is a support ticket waiting to happen, and read-only is what makes the text comfortably readable while browsing. Only one block is in edit mode at a time, and leaving it without saving never writes anything.

Saving one block never touches the other: the API takes text and table independently and only updates the fields present in the request. A target with no saved document yet returns an empty one rather than a 404, so the page always renders the same two blocks — with an invitation to start writing instead of something that looks broken.

Stored in documents, keyed by (scope, scope_id, env) — the same client/application pairing the notes use, plus the environment — and rows are removed with their target. updated_by is kept so the footer can say who last touched it.

The rest of the pane is the note list.

Field Notes
Title required for tables; for text notes a body alone is still valid
Type Text or Table
Category free text with a few suggestions (General, Credential, Common Error, Link, Access, Config) — not an enum, because every client records different things
Content depends on the type: a plain-text body, or a grid
Pinned floats to the top of the list

Text notes (the cards in the list below, not the block) are deliberately not a fixed schema and not parsed Markdown: the body is escaped and rendered in a monospaced block, so pasted credentials, indented logs and quoted error text survive exactly as typed. Wrap anything that needs to stay aligned in a fenced block when writing the block above. Anything with credential and common_error columns would force every client's habits into one shape, which is the opposite of what this page is for.

Table notes are for the case where a plain block is the wrong shape — credentials above all. The grid is built in the editor and stored as JSON in info_entries.data ({"columns":[…],"rows":[[…]]}), with kind='table'. It is rendered as a real <table>, so alignment is the browser's job rather than a column-counting exercise.

Editing a table: + Row / + Column add, and each header carries move-left, move-right and delete controls while each row carries move-up, move-down and delete. Moving a column moves its cells with it — otherwise the data would stay behind and silently reassign itself to a different label. Enter in a cell adds a row below and lands in it, Tab from the last cell adds the next row, and pasting a tab/newline block fills downwards from the focused cell, which is how a credentials dump actually arrives. The grid is bounded (40 columns, 500 rows, 2000 characters per cell) so one note cannot become a multi-megabyte row.

Search covers every note regardless of which client or application it belongs to — title, body, category and the contents of table cells. Each hit names its client and application and shows the matching fragment; clicking one jumps to that note on its own page. GET /api/info/search?q= needs at least two characters.

Deleting a client or application deletes its notes with it. scope_id cannot be a foreign key (it points at clients or applications depending on scope), so nothing cascades at the SQL level: the delete handlers remove the dependent notes explicitly, and the application ids are read before the client row goes, because applications declare ON DELETE CASCADE and would otherwise vanish first. A boot-time sweep also deletes notes whose target no longer exists, so rows orphaned by older releases do not linger unreachable.

Notes hang off a client or an application (info_entries.scope / scope_id); the two lists are independent, so a client-level note is shared context and an application note is specific to that app. Pinning does not move the updated_at timestamp — a bookmark is not an edit, and bumping it made every pinned note claim "edited just now" and reshuffled the order.

Everyone can read and write notes; the author is recorded and shown in the footer.

  • Contact details, from the account menu → Edit contact. A user can change their own phone number and email. Name, role, level and reporting line are not editable there: those are set by whoever administers the team, and a self-service form that could change them would be a privilege escalation in one field. The form shows those fixed values so it is clear why they are absent. Email is shape-checked but not uniqueness-checked — the login path refuses an ambiguous shared address instead of this form quietly taking an address off a colleague. Your email doubles as a login name.

  • Change password, from the account menu (click your name at the bottom of the sidebar). Requires the current password, enforces the same 6-character minimum the API uses, and signs out every OTHER device on success while keeping the current one signed in. A wrong current password is a 400, never a 401, so a typo cannot trip the global "session expired" handler and throw you back to the login screen.

  • Sidebar counts are deliberately uneven: Team status, All projects and My all projects carry none — the four stat cards already report those totals, so a second copy on the nav row was redundant ink. Active projects, My active projects and the Admin-panel rows keep theirs because nothing else on screen shows them

  • Sidebar numbers are deliberately uneven. Active projects, My active, My all and every Admin-panel row carry a live count; Team status and All projects carry none. A count is only worth showing when it tells you something at a glance — the team size and the grand total do not change often enough to earn the ink, and putting a number on every row made the two that matter (your own workload) invisible. GET /api/stats returns mineActive and mineAll computed with the same predicate as GET /api/projects?mine=1, so a count can never disagree with the list it links to

  • Active projects = everything still in flight. A project whose pentest is Done but which still has an open client retest stays here — the retest is work that is not finished yet

  • My active projects = the Active rule, narrowed to engagements you are on; My all projects = every engagement you are on, finished or not

  • Finished engagements are reached through the status filter (Done), which is the only place they appear now that the dedicated Finished page is gone. An explicit status filter always wins over the Active scope, so picking Done while on Active projects does show them

  • An open client retest appears in the Active view as its own Retest - <name> row, so it is obvious the pending work is a re-verification and not a new test

  • Stat cards: Total projects / Ready / Active / Retest queue — Ready is the "report being prepared" bucket, sitting next to Active

  • The stat cards follow the scope. On a company scope they report every project; on My active projects / My all projects they report only yours. A small marker above the strip says which ("Everyone's projects" / "Only your projects") so the numbers changing never looks like a glitch. Both variants come from one SQL shape in GET /api/stats (scopes.all / scopes.mine) so the two can't drift, and each card is verified to equal the length of the list it sits above

  • Quick status — click a project's status pill (table row, grid card, or drawer) to change status in one click, without opening the edit form

  • Quick assign — the + beside the pentester avatars (table row and grid card) opens a focused Who pentest dialog with just the picker, not the whole project form. Notes get the same treatment: Edit notes opens a one-textarea dialog. Each of these PATCHes only its own field, so nothing else about the project moves

  • The Project column owns the spare width. Table layout is auto, so every column would otherwise share the surplus — the name column ended up narrower than Category. Giving width: 1% to every column except the first makes the project name the only shrink-to-fit cell, so it absorbs all the remaining space (~576px of 1138 at 1440 wide) while the badges keep their natural size

  • Delete sits beside Edit in the drawer header rather than in a separate danger zone at the bottom of the Overview tab

  • The drawer is a glance; /project/<id> is the project. The Expand button in the drawer header (and the footer, next to the updated stamp) closes the drawer and opens the same panels on a full page, where the team, the retests and the notes fit side by side. The drawer's footer no longer carries a duplicate Edit: one Edit lives in the header, where the Delete it sits beside already was. Both surfaces render tabBody() and wire it with bindProjectActions(), so a status button cannot mean one thing in the drawer and another on the page

  • The page keeps the tabs, and the tab is in the URL. /project/12 is Overview, /project/12/retests is Retests, and so on for attachments and notes. Overview is the bare path so the common case stays short; the others are spelled out, because the tab you were reading is part of the address — a reload, a bookmark or a link to a colleague must land on it, not on Overview. Tab switches are pushState (Back undoes a tab click), the sidebar's project row stays lit throughout, and a segment that is not a tab falls back to the list. The Checklist tab leaves the page for /project/12/checklist, exactly as in the drawer: a real list is longer than a panel.

  • Table columns: Project / Category / SV / Pentesters / Retests / Status. There is no Client column — the client is folded under the project name as Client – Application (e.g. Bank Nusantara – Qitta), so nothing is lost while the table gains a whole column of breathing room.

  • Every pentester gets an avatar — the stack is never capped and there is no +N counter. A counter told you how many but not who, so a five-person project looked the same as a two-person one until you opened it. Seven avatars still fit a 196px cell with room to spare, so the count was buying nothing.

  • Category is a single pill. A Mobile project reads Mobile Android rather than a Mobile pill stacked above a separate Android pill, which in a narrow cell wrapped onto its own line and looked like two unrelated labels.

  • The SV column is icon-only: the supervisor's avatar, with their full name in the tooltip. Clicking it opens that person's detail card (see People below). The Project column absorbs the spare width (see Quick assign above for how) and its Client – Application sub-line wraps, so long names stay on one line instead of truncating

  • One search box, in the filter bar, next to the filters it combines with. A second "Search projects…" in the topbar did the same thing from further away and promised ⌘K for it; both are gone.

Devices

The hardware inventory: the phones, terminals and miscellaneous kit the team actually tests with, so nobody re-images a device someone already prepared.

Reached from the sidebar. Four type tabs, and each type has its own columns — a deliberate difference from the Information center's free-form tables, because a phone and a payment terminal have nothing to compare:

Type Columns
Android Name Device · Version · Root · ROM · Who Used · Notes
iOS Name Device · Version · UUID · Who Used · Notes
EDC Name Device · Unique ID (SN) · Type · Supplier · Who Used · Password · Kernel · Android · Notes
Misc Name Device · Who Used · Notes

Import in the page head loads one type at a time — the type decides which columns exist, so it is chosen in the dialog rather than guessed from the data. Two shapes are read, and only the device name is required:

  • a bare list — cells are read positionally in that type's column order, and anything past the last column is appended to Notes rather than dropped;
  • a file with a header row — columns are matched by label, in any order (SN, Name, Supplier, Type fills an EDC row correctly), which is what a spreadsheet export actually looks like. One matching cell is not enough to be treated as a header, so a device whose values happen to spell a column name is still a device.

The column sets above are the prescribed defaults, and each type's layout is then editable — the equivalent of the Information center's grid editor, scoped to an inventory sheet. The Add column button in the edit bar opens the editor that renames, reorders, hides, adds or deletes columns for that type only; the arrangement is saved per type.

Built-in columns are real columns in the devices table (DEVICE_FIELDS in server/db.js is the single authority on which kind owns which field); columns you add yourself are stored as keys in a devices.extra JSON blob. Deleting a custom column deletes its values with it, since nothing would ever display them again.

The layout itself lives in the device_columns table. On the first read of a kind it is seeded from DEVICE_FIELDS — so the default is exactly the list in the table above — and then persisted, which is what lets a user delete even a prescribed column without it reappearing on the next load. Marking a column hidden keeps its data; it only stops being rendered and stops being asked for in the form.

Columns can be reordered by dragging a column header sideways, or by the arrows in the Columns editor. A hidden column keeps its slot: the saved config is rebuilt by substituting the new visible order into the non-hidden positions, so hiding a column and then moving its neighbours does not shuffle it to the end.

Adding things: the trailing row under the last row holds Add a row, which inserts an empty row without leaving the grid; the edit bar above the table holds Add column, immediately left of Add device. In view mode there is no trailing row at all.

Each add-control sits with its own kind. A row belongs to the body of the table, so adding one is a row-level action at the bottom of that body. A column is a property of the sheet's schema, like the record itself, so adding one is a sheet-level action in the bar that already creates records. Add column sits directly beside Add device rather than further left, so the two ways to grow this sheet are one click apart. The header + that also added a column was removed: three entry points for two actions is a coin toss, and the header one sat exactly where a column's own control would go.

Reading and correcting are two modes

The sheet has a deliberate split, driven by the two different jobs it serves:

View mode is for reading, and it is deliberately quiet. The page header shows a single Edit all rows button. Rows carry no Edit or Delete buttons, there is no actions column, and no drag handles exist anywhere — not the per-row grip on the left, not the per-column grip in the header. Adding a device also lives in edit mode, so a first-time reader sees a plain table of facts and exactly one thing they can do to change it.

This is why view mode has no grip column: a grip is the one piece of chrome whose only purpose is to say "this moves". Leaving it in view mode advertised an interaction the mode then refused, so the handle promised something the page would not do. With it removed, the leftover width goes to the data columns instead of an empty 30px strip.

The single exception is an empty tab, where the header shows an Add device button instead of Edit all rows. A tab with no rows has nothing to edit, so offering only "Edit all rows" there would be a dead end.

Edit mode is for correcting, and it is where every mutating control lives. One click on Edit all rows reveals: the per-row drag grips, the per-column drag grips, the actions column with per-row Edit and Delete, a trailing row holding Add a row, and a bar above the table holding Add column, Add device, Discard and Save all. Every editing affordance appears together and disappears together, so the page never mixes "you can change this" with "you cannot change this".

The reasoning is the same in both directions: the two "add" buttons sit at the end of the grid because both mean "one more of the thing in this table", Add device opens a form so it stays in the bar with the ways out of the mode, and per-row buttons belong where you are already working on rows. Keeping the two adds together also removes the coin-toss problem: there used to be a Columns button in the bar, a + in the header row and a trailing row, which is three places to look for two actions.

Editing every row at once

Correcting a whole inventory one dialog at a time is slow, so Edit all rows turns the visible sheet into a grid of inputs: every cell of every row on the current tab becomes editable in place, and a bar above the table summarises the batch.

  • The bar names the scope — Editing N rows — because Save covers the rows on screen, not the whole table. A user who searched or switched tab should never assume it reaches rows they cannot see. For the same reason only visible rows are collected, and only cells whose text actually differs from the stored value are sent: writing the whole sheet would stamp updated_at on untouched rows and could overwrite a concurrent edit.
  • Add device stays in the bar and opens the usual form. Adding a device is a mutation, so it belongs with the other mutations rather than beside a read-only table. Because the form is a modal the batch state is untouched while you fill it in, so adding a device mid-edit does not discard anything you have typed.
  • A live counter (3 changed, mirrored in Save all (3)) reads the inputs rather than a change log, so retyping the same text goes back to zero instead of looking like an edit.
  • The search box is disabled while the grid is open; a control that silently does nothing is worse than one that visibly steps aside. (The trailing row is not hidden any more — it becomes the Add a row button.)
  • Only one grid is rendered in this mode, not the usual desktop-table-plus-mobile-card pair: a hidden twin took part in Tab order and in the dirty count, so one real edit could read as two changes.
  • Dragging rows and columns, and adding a row, all work while editing. The grid is one place to do everything: the column grips stay live in the header, the row grips stay live on the left, and the table's trailing row is an Add a row button that appends an empty editable row. An added row is tinted, counts as a change as soon as it has text, and its drag grip is deliberately inert (greyed, not-allowed cursor) because a row that has no id yet cannot be reordered — it is created on Save, not on click, so changing your mind leaves no junk behind. Reordering while editing re-sequences the stored rows immediately and keeps every typed value, so a move never costs you work.
  • On a phone the grid stacks into cards instead of scrolling sideways. A 654px sheet in a 356px viewport clipped the name field to 111px and pushed each row's Edit/Delete buttons 240px off-screen with nothing to say so. Stacked, every field carries its small uppercase label (the header is off-screen on a phone, so the label is the only thing naming the value), the name input fills the card, and the row actions sit at the bottom behind a divider because they act on the whole card rather than on the field above them. It is the same markup and the same handlers — only the layout changes, and the desktop view is still a real table with its sticky header.
  • Enter saves, Escape discards (asking first only when something would be lost), and Tab wraps from the last cell back to the first so the caret never leaves the sheet. A blank device name is caught in the browser and its cell highlighted, since that is the one thing the grid can produce that the API refuses.

The API side is PATCH /api/devices/bulk with { updates: [{ id, ...cells }] }. It is a convenience over the single-row route, not a different contract: every row is validated exactly as a PATCH /api/devices/:id would be, and the whole batch is rejected if any row is bad — a partial save would leave the sheet half-updated with no way to tell which cells landed. Duplicate ids, more than 500 rows, and a missing id are refused outright, and a blank name reports the offending row (Device name is required (row 12)), because "Device name is required" alone is useless when twenty rows are on screen.

While a row is dragged, three things are drawn: the row in hand is tinted with a primary edge marker, a single T-shaped insertion marker appears in the gap the row will occupy — a 4px horizontal bar plus a 4x15 vertical tick in the grip column — and a small DROP HERE pill sits beside that bar. The pill is a real element, not a pseudo-element: is-drop-before already spends both of a row's pseudo-elements on the bar and the tick, and sharing ::before applied the bar's right: 96px and gradient rules to the label, stretching it into a second full-width bar. It is anchored inside the target row rather than above it, because a pill hung above the first row painted underneath the sticky header and was invisible exactly where a top-of-table drop needed it. The bar stops at the actions column instead of running the full table width, and a first-row drop lifts the tick into the gap above the header line so "the very top" cannot be read as "under the header". No marker is drawn when the drop would not change the order (dropping a row on itself, or above/below its own position).

Three rules keep the marker from being a source of bugs. A pseudo-element is never generated on the drop row beyond the two the bar needs: an extra ::after on a display: table-row makes the browser wrap it in an anonymous table cell, which adds a phantom column and redistributes every width — measured as the header left edges drifting 564/601/789/932/1070/1283/1317 to 564/601/789/931/1068/1280/1314 the instant a marker appeared. Second, it must cost zero layout: the bar is an inset box-shadow on the cells and the tick is an absolutely positioned ::after in a grip cell that is position: relative at all times, never only during a drag. Making the drop row itself position: relative grew the table by 11px, which popped the scroll wrapper's vertical scrollbar, narrowed every column (the last header moved 1331px → 1250px) and re-flowed the whole table under the cursor — reported as "when you move slowly, suddenly name device changes to version, version to root", and it also invalidated hit-testing so an upward drag landed a row off. Third, the gap the marker lights is exactly the gap the row drops into, in both directions: dragging up to the upper half of row 2 lands above row 2, dragging down to the lower half of row 2 lands below it. Verified across ten drag paths with the marker gap and the resulting index asserted against each other.

dragover fires on every pixel of movement, so the marker is treated as state: the class is only touched when the target row or side actually changes, and the dragged row's own class is set once at dragstart and cleared once at dragend. Mutating the drag source during dragover made Chromium abandon the gesture — drop never fired, dragend reported dropEffect: 'none', and the reorder was silently discarded for roughly one drag in three. As a second line of defence, dragend commits whatever move the on-screen marker was already promising when no drop arrived, because the marker is a visible statement of intent and honouring it is better than losing the gesture.

Rows can be reordered by dragging the grip in the leftmost column, or with the arrow buttons in the same column for keyboard and touch use; the order is stored in devices.position (0 means "never reordered", so a freshly seeded type still falls back to alphabetical). The table scrolls horizontally inside its own wrapper rather than widening the page, and the scroll edge is faded so the last partially visible column reads as "there is more" instead of as clipping.

The Columns editor caps its list at roughly eight rows so a long layout cannot push the Save button off screen. When there is more below, a dashed Show more columns (N more) button appears under the list; it disappears at the end, and a newly added column auto-scrolls into view so pressing Add column visibly does something.

Fields a type does not own are dropped, not stored. Posting {"kind":"Android","serial":"…"} returns a device with no serial, and switching an existing row from Android to Misc wipes version and rom. This is what keeps the data honest: a field could otherwise sit on a row that never renders it and then reappear, looking like corruption, if the type were changed back.

Type names are Android, iOS, EDC, Misc — note the lowercase i in iOS, which is how the type is spelled everywhere (label and value alike).

Search matches every column of the visible table, plus the name and the person, so typing a ROM string or a serial finds the device. The per-tab counts come from their own query, so they keep showing the true total for each type even while a search filters the visible list down to nothing.

At ≤760px the table becomes one card per device with a labelled field list, because a nine-column sheet cannot be read on a phone by scrolling sideways.

Project fields

Field Values
Name free text, required
Client searchable dropdown — type to filter the client catalogue
Application searchable dropdown — only the apps that belong to the chosen client
Category from the property list — Web · Mobile · API · EDC out of the box, editable in Admin panel → Properties
Platform Android · iOS · API (mobile backend) — only for Category = Mobile
Env Dev (default) · Prod
Method Black Box · Grey Box (default) · White Box
Status from the property list — Incoming · Ready · Ongoing · Done · Hold out of the box, editable in Admin panel → Properties
Start date date — not asked on create; stamped with today the first time the project moves to Ongoing; editable afterwards
End date date — not asked on create; stamped with today when it moves to Done; cleared again if it is re-opened
Project supervisor one SV — searchable dropdown of Project Manager and Pentester users (a small team has no separate PM account, so a lead can own the engagement). Auto-selected from the chosen client's default SVs; still editable, and may be left empty
Sub app optional — the chosen application's sub apps, only shown when it has any. Leave it on Whole application for a normal engagement
Who pentest multiple pentesters, picker with a name search box
Notes free text (scope, creds location, out-of-scope)

Defaults on create: Dev / Grey Box / Incoming / Web.

Manage users (Admin panel)

Admin panel → Manage users is the one page for every account: the pentest tree on top, the project managers below, and a tab when you only want one of them.

The two used to be separate pages. They were built on the same users table, the same create path and the same question — who works here? — so adding a person began with a guess about which page they belonged on, and the two pages drifted into different copy for the same account. One page, one New user form (pick the role and the fields follow) and one Import now cover both.

Everything on that page is a users row with a role of Pentester or Project Manager; the difference is what the role owns. A pentester joins the reporting tree below. A project manager sits outside it and owns engagements.

Both roles carry the same contact details — a phone number and an e-mail — and both are set in the same place: Edit (the pencil) on the person's row. They are then printed on the row itself (and on the person card you get by clicking the avatar), because a field nobody can see from the list reads as a field that does not exist. On a member row the contact line is the first thing to go below 1100px, where the name, level, project count and two buttons already fill the line.

Pentester hierarchy

Pentesters are organised in a four-level reporting tree:

Lead
  ├── Sub Lead        (reports to a Lead)
  └── Member          (reports to a Sub Lead or a Lead)
        └── Intern    (reports to a Member, a Sub Lead or a Lead)

Below a lead the tree is a set, not a chain. A member answers to whoever runs their work: the sub lead on a team big enough to have one, the lead directly on a small one. An intern answers to whoever is training them, which is usually a member and often the lead. The two levels above stay strict — a sub lead can only report to a lead — because "who owns this engagement" has exactly one answer.

Open Admin panel → Manage users to see the tree, add people under a branch, move someone to a different supervisor, or remove them. Every row carries the buttons for what can hang off it: + Sub lead, + Member and + Intern on a lead, + Member and + Intern on a sub lead, + Intern on a member row. Each button carries that person as the supervisor, so adding someone to a specific person is one click and no picker — the dropdown is still there when the person belongs somewhere else.

The reporting line is stored as users.parent_id, and the server enforces the rules:

  • a Lead cannot have a parent
  • a Sub Lead must report to a Lead
  • a Member must report to a Sub Lead or a Lead — never to another member
  • an Intern must report to a Member, a Sub Lead or a Lead — and never to another intern, so "who is training whom" stays answerable
  • nobody can report to themselves, and reporting loops are rejected
  • a supervisor who still has people under them cannot be deleted (the API returns 409 and names how many reports must be moved first)

Importing a team

Adding nineteen people one modal at a time is not a thing anyone does, so the page carries an Import button. It takes a pasted list or a file (.csv, .tsv, .txt) and shows every parsed row before anything is written.

Only the full name is required. Everything else is optional, and is recognised by shape rather than by column position, because a team list arrives from a spreadsheet as often as from a chat message:

# Field Behaviour
1 Full name required
2 Username else first.last from the name; .2, .3 appended when already taken
3 Password else the dialog's default — pentester123 / manager123 per role
— Phone / e-mail recognised by shape, anywhere on the line: any cell containing @ is the address (and is validated — rina@bank is rejected rather than silently becoming a username), a cell of six or more digits is the phone. Both are stored on the account and printed on the person's row
4 Level Lead, Sub Lead, Member or Intern, picked up wherever it appears
5 Reports to name or username of the parent; blank means "the nearest legal parent"

All four of these parse to the same person:

Dewi Lestari
Dewi Lestari, Sub Lead
Dewi Lestari, dewi, pentester123, Sub Lead, Rafi Pratama
Dewi Lestari, +62 812 0000 0000, [email protected]

The preview shows a Contact column per row, so what will be stored as the phone and e-mail is visible before anything is written — a paste that silently dropped them would otherwise look identical to one that carried them.

Rows are created in listed order, so a file can build its own tree: a Lead first, then the Sub Leads that report to them, then the members. A row that cannot be created — a taken username, a password under six characters, a member with no sub lead above them in the file — is marked in the preview and skipped rather than fatal: the import runs one request per row, and the dialog is left holding only the lines that failed, so the fix is an edit rather than a rewrite from memory.

Only admins, leads and sub leads can open the admin panel.

Client is not free text. It is a <select> fed from the client catalogue, so the list stays clean and consistent. Choosing a client narrows the Application dropdown to that client's own applications — the server rejects any mismatched pair, so a project can never point at someone else's app.

When Category = Mobile, a Mobile platform control appears with Android, iOS and API (a mobile backend). Switching away from Mobile clears it, so web/EDC projects never carry a stale platform.

Who pentest is a picker listing every pentester sorted by hierarchy, each row showing their level pill. A search box above it filters by name; your selection survives filtering because rows are hidden rather than re-rendered.

Team status board

Team status is the first item in the sidebar's Workspace group, above Active projects. The board answers one question: who is busy and who is idle right now?

Column Meaning
Pentester Avatar, name and level pill. The name opens the person card
Status On Project · Idle · Leave · Exam · Research/Learning · Other — click it to change; the pill doubles as the menu
Projects & retests Every project they are currently on, as chips with the engagement's status dot (no "+N more" truncation — this is the widest column and long names wrap); each chip opens the project, and the row carries a quick Assign project button. Open retest requests on their projects appear too, as Retest - <project> chips in the retest queue's amber dashed style
Idle since While idle: number of days plus the date they last finished something. Someone who has never closed a project starts counting from today, since there is no evidence of an earlier idle start. The badge turns amber past two weeks and rose past two months — a bench problem should be visible without reading the number
Notes Free text, editable in place. A row with no note shows only a pencil on hover (always on touch); rows you cannot edit show nothing rather than a dash

The four cards above the table (Team size · On project · Idle · Unavailable) are also the filter: pressing one narrows the list to it and pressing it again clears it. They read from the same numbers they set, so they can never disagree with the rows underneath. A search box beside them matches a name, level, status, note, project or retest — typing brimo finds the people on the Brimo engagement, which is the question this page exists to answer. Both filters live in a "Showing N of M" line with a Clear button, because a filter that hides people silently is how a board starts lying.

Interns get their own table, below the bench, with its own heading and count. An intern is a person learning the job: putting them in the tree beside the people training them answers "who is on the bench" with a list you have to read every level pill to interpret, and it hides the one thing a supervisor wants from that level — who each trainee is attached to, which the row says in words (under Bagas Nugroho). The table is sorted by supervisor, then name, and it only exists once an intern does: a team with none keeps the single unlabelled table it always had.

Rows are pentesters only: project managers own engagements rather than test them, and Administrators are operations — both live in Users and Manage users, not on the bench. Hiding an admin whose reports are pentesters does not orphan them: a sub lead whose lead is not shown becomes a top-level row carrying its own members, so nobody disappears from the board.

Rows follow the reporting tree — a lead, then that lead's sub lead with its members, then the next sub lead, and so on. The nesting is drawn rather than announced: each level indents and carries a hairline down its left edge, so "these two report to Dewi" is visible in the shape of the table, with no group header taking a row of its own.

A retest belongs to a project, not to a person: whoever is assigned to the project does it. So an open retest (any status but Done) is listed beside the engagements that own it, and it counts as work — a pentester whose only outstanding job is a retest on a finished engagement is On Project, not idle, which is what stops their idle clock from running against them. The project chip itself only appears while the engagement is unfinished; the retest chip appears regardless, which is the case retests exist for.

Below 1000px the five columns cannot fit — at 1000px the content area is only ~660px, which squeezed each chip to three words a line and put the avatar on top of the name. So the table stacks: the header is hidden, the person and status share the first line, and the remaining fields appear below under small uppercase labels (PROJECTS & RETESTS, IDLE SINCE, NOTES). Fields with no value are omitted rather than showing a dash, nothing scrolls sideways, and the tree indent is dropped because the card is already inset.

Automatic status. On Project and Idle are derived on the server, on every read, from the real assignment table:

  • On Project — the pentester sits on at least one project whose status is not Done
  • Idle — every project they are on is Done, or they are on nothing

Both update themselves the moment a project or a retest moves to Done, so the board never drifts from the project list. Derived statuses carry a small auto marker so they can be told apart from a manual one.

Manual status. Leave, Exam, Research/Learning and Other are stored on the user row and override the automatic value until cleared with Back to automatic. Use them for things the project data cannot know.

Permissions. Admin, Lead and Sub Lead may set the status and the note for anybody. A Member may only change their own row — enforced in the API (403 You can only change your own availability), not just hidden in the UI.

Totals. The four cards above the table show how many people are on a project, how many are idle together with the total idle days across the team, how many are unavailable, and the team size. idle_since is the newest ended_at among a person's projects, falling back to their retests.

Properties (Admin panel)

Admin panel → Properties is the CRUD page for the two lists every project is filed under: categories and statuses.

They used to be two hard-coded arrays, one copy in the client and one on the server. They are rows now, which is what lets an admin add Cloud as a category or rename Ongoing to In progress without a deploy.

The page has one table per kind — Label · Stored key · Looks like — with reorder arrows, edit and delete:

  • Label is the word every badge, picker and filter prints.
  • Stored key is what projects.category / projects.status actually contain. It is never editable: renaming is a display change, so projects keep their place and nothing has to be migrated. The edit dialog says which key you are renaming.
  • Looks like is the live badge. The colour picker in the dialog is made of the badges themselves, so the choice is made by looking at it.
  • Order is the order of the project form, the quick-status menu and the filters.

The nine seeded rows are marked built in and cannot be deleted — the code compares against those keys ('Done' is what makes a project finished, 'Mobile' is the only category that owns the platform field, open retests count statuses 'Incoming'/'Ongoing'). Their label, colour and order are fully editable. A property an admin adds is ordinary and can be deleted as soon as nothing uses it; deleting one that is still in use is refused with the count, the same rule as deleting a client or a project supervisor.

Clients & applications (catalogue)

Each client owns a list of applications — for example Bank Nusantara owns Qitta, Brimo, Brilink and Nusantara Corporate Portal. Manage them from Admin panel → Clients & apps:

  • create, rename and delete clients
  • add, edit and remove applications per client
  • import a list of clients, with their applications, from a paste or a file
  • see how many projects use each client, and each app's project count
  • deleting a client or app still in use is refused with a clear message, so project history is never silently orphaned

Importing clients

Import in the page head takes one client per line and writes nothing until the preview has been read. Only the client name is required:

Bank Nusantara (BN)
Bank Mandiri; BM; Mobile Banking / Internet Banking
Bluewave Finance; BF; Paylater App;;Jakarta, contact: Ops
  • a short name goes in parentheses after the name, or in its own short cell;
  • a cell separated by / or | becomes that client's applications, created right after the client;
  • everything left over becomes notes;
  • a name already in the catalogue is marked Already in the catalogue and skipped, so re-importing a list after fixing two lines does not duplicate the rest.

Only Admin, Lead and Sub Lead see and can use the Admin panel.

Project managers (same page)

The Project managers half of that page manages the Project Manager role.

Supervisor (SV) is the field, not the role. A project has exactly one project supervisor (projects.supervisor_id), and that slot may be empty: a client may name no default, and a project may simply have nobody accountable yet. The supervisor does not have to be an account whose role is Project Manager — a Pentester can hold it too, because a small team has no separate management account and the lead who wins the work is the one who owns it. The picker lists both, tagged PM or PT, project managers first.

A client can name several default SVs (client_supervisors, a many-to-many join), which is what drives auto-selection:

  • Open New project, choose a client, and the SV dropdown is filled in for you.
  • A client with one default SV selects that SV and says so in the hint.
  • A client with several selects the first, and the hint turns amber and names the count so it is obvious a choice was involved — never a silent pick.
  • A client with none leaves the field empty and says so — an empty SV is a legitimate state, not an unset field.
  • The value is always editable, and editing an existing project never re-triggers the auto-pick: touching the client on an existing engagement must not silently reassign its owner.

The supervisor page lists every SV with contact details and the clients they are the default for. Deleting a SV that still owns projects is refused server-side (Cannot delete: N project(s) are still owned by this supervisor. Reassign them first.) with the same warning surfaced in the confirmation dialog before the request.

On the project list the SV appears in its own SV column, immediately left of Pentesters, and as a tagged SV line on each card. The column shows only the supervisor's avatar — the name is on the tooltip, because a clickable face identifies a person faster than a repeated full name, and it keeps the row narrow.

Sub apps (Client → Application → Sub app)

The catalogue has an optional third level. A client owns applications, and an application may own sub apps — the separate products delivered under it, named however the team names them:

Bank Nusantara
  └─ Brilink
       ├─ Brilink MPOS     <- sub app
       ├─ Brilink Mobile
       └─ Brilink Web
  └─ Qitta                (no sub apps)

A sub app is just a name (plus free notes). It is not a platform build: the Android and iOS builds of one product are the same sub app, because they are the same thing to test. What makes it a separate entry is that a tester files findings, notes and projects against it separately from its siblings.

  • Optional at every level. An application with no sub apps is normal; the client card shows one quiet + Sub app line and nothing else. A project points at a sub app only when the engagement is about that product rather than the application as a whole.
  • Managed where applications are. Admin panel → Clients & apps, under each application: + Sub app adds one, the pencil edits it, the trash deletes it (with its notes and sheets). Creating and renaming is open to everyone signed in, like every other create; deleting a sub app is a delete (admin, lead or sub lead), because the projects that point at it fall back to the whole application.
  • One application's sub apps only. The project form's Sub app field lists the sub apps of the application currently selected, and it only appears when that application has any. Changing the application clears the sub app — one means nothing outside its parent, and keeping a stale one would be a lie.
  • Where it shows. Everywhere as the last part of one plain breadcrumb — Bank Nusantara – Brilink – Brilink MPOS — under the project name in the table, under the client on the card, and under the title in the drawer, where a Sub app row repeats it in the detail grid. No chip, no second colour: it is part of where the engagement sits, not a tag on it. Projects without one print nothing extra.
  • Notes live on it too. The Information center treats a sub app as a target in its own right — its own note cards and its own Dev/Prod sheets, nested in the tree under its application. See Information center.

People

Any avatar of a project manager or a Pentester is a button — in the table, on a card, in the drawer, and on the team status board. Clicking one opens a person card:

  • name, level and role, @username, and current availability (with the auto marker when the status is derived rather than set by hand);
  • phone and e-mail as tel: / mailto: links;
  • their availability note, when they have one;
  • Project supervisor for — every engagement they own, as a chip (hidden when they own none, and for pentesters who are not SVs);
  • Pentesting — every project they are assigned to, with N active · M done (omitted entirely for a SV, who does not sit on the test bench);
  • Reporting to this person — their direct reports in the hierarchy.

Opened from a project row, the same card is compact: it answers who is this and stops. The "Project supervisor for" and "Pentesting" blocks are dropped there, because you clicked a face on a project and the list of everything that person works on is noise — the full card is one click away on the team board or in Users, where "how busy is this person" is the actual question.

Clicking a project chip closes the person card and opens that project, so you are never stacked two dialogs deep. The card is a read-only view; the API behind it is GET /api/people/:id.

The avatar is a 24px disc, well under the 44px minimum touch target, so each one carries a transparent ::after that opens the hit area to 44px without moving any layout. Inside a stacked group of avatars that area grows vertically only — a full 44px circle would sit on top of the neighbouring face and steal its tap, so the avatar you hit is always the one under your finger.

Retests (client request queue)

A retest is not a per-finding record — it is a client request to test again. Raising one does not touch the project's status. A finished engagement stays finished; the request is the thing that is open, and it appears in Active projects as its own Retest - <name> row (with its own status control) and in the Retest queue card until it is closed. Closing a project and then queueing a retest therefore never reopens the engagement behind the project supervisor's back.

A project can carry unlimited retests, each with:

  • auto code (RT-007-01, RT-007-02, …) derived from the highest existing sequence, so deleting one never causes a duplicate
  • a name taken from the project (Retest of <project>) — a retest is a re-verification of that project, so it is not given a free-text title
  • request date
  • its own status (Incoming / Ready / Ongoing / Done / Hold)
  • start and end dates, under exactly the same rules as a project: not asked when the request is created, stamped with today on the move to Ongoing and Done, and editable in the retest form afterwards
  • notes

A retest does not ask who requested it — it is a client request, not something the signed-in user is asking for.

Create, edit and delete them from the project drawer → Retests tab, where each request carries its own pencil and trash. Nothing destructive sits in a list: a project row is a single click target, so a trash on it is one mis-aim away from a dialog nobody asked for. The list's Retests column only reports (a count, or a Retest badge on the retest's own row), and projects show a retest count badge — any retest that is not Done counts as open (highlighted in the sidebar and stat cards).


Attachments (project drawer → Files)

Every engagement can carry its own files: the signed scope, the client's asset list, a screenshot of the finding, the finished report. Upload from the drawer, download with a click, delete with a lead's account.

Where the bytes live ${DATA_DIR}/uploads/<projectId>/<uuid> — a volume, not the database
Where the facts live project_files: name, mime, size, who uploaded it, stored name
Limit 20 MB per file, checked in the browser and again on the server
Upload the Upload button, or drag files into the Files tab (a batch goes one file at a time)
Transport base64 JSON POST — no multipart dependency, one code path
Download Content-Disposition: attachment, application/octet-stream, never the stored mime

Why the filesystem and not the database. Two hundred megabytes of reports in Postgres would make every nightly dump 200 MB, kept for KEEP_DAYS, and a big insert would hold the write lock while it streamed. The trade is that the files have to be backed up separately — which the backup service now does, with the matching restore step in Backups. A backup that silently omits the files is worse than no attachments at all, because it looks complete.

Why the download never echoes the uploaded mime type. Serving a client-uploaded text/html or image/svg+xml inline from our own origin is stored XSS — the CSP stops the obvious payloads, not the point. The bytes go out as application/octet-stream with nosniff, so the browser saves them instead of rendering them.

Deleting a project deletes its folder; deleting one file deletes its bytes and, when it was the last, the empty folder. Both read the stored names before the rows cascade — the same trap that once leaked variant notes.

Security checklists (project → Checklist tab, Admin panel → Checklists)

A project works through one checklist: Open · Pass · Fail · N/A per item, a note that explains a Fail, and optionally one of the project's files as evidence. Three templates ship, all ordinary editable rows afterwards: OWASP Top 10:2025 and OWASP API Security Top 10 2023 (twenty and ten checks) plus Web hardening basics. The seed is versioned by seed_key, so a release that changes a shipped list replaces the items instead of adding a second copy beside it — and a retired list goes away rather than sitting next to its successor.

A template carries a category (Web · Mobile · API · EDC, the same values a project carries) and at most one template per category is its default. Saving a project attaches its category's default when the project has no checklist yet, which is why a Web project arrives with the 2025 list already waiting. A list chosen by hand is never overwritten by that rule; changing it is the page's Change button, and a template can always be swapped for another one.

The Checklist tab is an ordinary tab — the items sit in the panel, grouped by section, answered in place, and the badge counts the failures. The same panel is painted on the drawer and on /project/<id>/checklist, which is what keeps a status button from meaning one thing in the drawer and another on the page. Swapping the checklist underneath answered work is a delete: a lead or sub-lead, with the answer count named in the dialog.

The Admin panel manages the templates, and one template is edited on its own page (/admin/checklists/<id>, or /admin/checklists/new) rather than in a dialog — a real list is a hundred rows tall, and a modal is the wrong shape for it. The index is three columns: the checklist (with its category and a default badge), its item count, and the actions; the name itself opens the editor. On that page the items are grouped by section, each row carries its section as a select (No section is a legal section: a flat list is a checklist too), and Paste a list still takes Section | What to check | How to check it per line. Saving rewrites positions from the order on screen, so moving a row with the arrows is a real reorder.

A project links one template, it does not copy it
Checklists per project exactly one — UNIQUE (project_id); attaching another replaces it
An unanswered item has no row — Open is the absence of an answer, not a stored one
Deleting a template refused while a project uses it, naming how many
Deleting a project takes its answers with it; the template is untouched
Editing a template changes what every linked project shows — on purpose

Linking is the reason a typo fix reaches forty engagements at once. The price is that editing mid-engagement moves the goalposts for a project already in flight; this records how an engagement was tested, it does not certify it, so the trade is the right way round. Attaching a 120-item template writes nothing, which is why a checklist can be linked to a project that has not started yet.

Tests and Findings (the two reference libraries)

Two read-only pages in the sidebar's workspace group, both open to anyone signed in:

  • Tests (/tests) — how to test each area of the checklist, in the order you would actually work: what the category means, the steps, what a pass looks like, the tools, and where people over-call it. One guide per risk category in the two default templates: A01–A10 for OWASP Top 10:2025 and API1–API10 for the API list.
  • Findings (/findings) — twenty common findings, each a description, an impact and a mitigation, with a severity and a CWE. Written to be pasted into a report and then edited, not to be read once.

They are one body of knowledge read two ways, so they link to each other: a guide lists the findings it produces, and a finding's How to test this opens the guide that proves it. Both jumps go through the nav so the address bar keeps telling the truth, and both clear a filter that would hide the thing you asked for.

The content ships in server/knowledge.js rather than in a table. This is fixed reference text, not something a user creates: a table would mean a schema bump to fix a sentence and a seed-version dance so a reworded guide does not overwrite an edit nobody can make. The checklists are rows because an admin owns them; these are pages, so the route is a two-line read of an array.

The whole library is fetched once and filtered in the browser, and the count always reads showing N of M over the whole library — a filter that hides material says so, the same rule the Team board follows.

Database

PostgreSQL is the default because the data is inherently relational (projects ↔ users many-to-many, projects → retests one-to-many) and the dashboard aggregates counts per project on every list request.

PostgreSQL (default) SQLite (fallback)
Storage onepromag-pgdata volume onepromag-data volume
Services app + db app only
Multiple app instances ✅ ❌ (shared volume corrupts)
Concurrent writers ✅ row locks single writer, serialised
Backup pg_dump VACUUM INTO
Setup docker compose up --build DB=sqlite ... up --build onepromag

devices is the one table whose columns are the union of four different field sets rather than a per-kind table — see Devices for why the API drops fields a kind does not own. devices.extra is TEXT NOT NULL DEFAULT '{}' and holds the values of user-added columns; devices.position is the dragged row order, defaulting to 0 so a never-reordered table keeps its alphabetical sort. device_columns(kind, key, label, position, hidden, builtin) is the saved layout per type, seeded from DEVICE_FIELDS on first read.

Both engines run the same SQL through server/drivers/. Application code always writes ? placeholders; the Postgres driver rewrites them to $1..$n.

Schema

users.availability and users.availability_note hold the manual status; both default to '', which means automatic. The On Project / Idle value is never stored — it is computed from project_pentesters + projects.status on every request, which is why the board cannot go stale.

users.phone and users.email are plain TEXT NOT NULL DEFAULT '' — not unique, not validated beyond the obvious, because the source of truth for a person's contact details is HR, not this app.

users.last_seen_at is TEXT NOT NULL DEFAULT '' and holds the last authenticated request, written at most every 20 seconds. It is a presence hint, not an audit log: nothing else reads it, nothing else writes it, and an empty value simply means "not seen since this column existed" (v1.18).

projects.supervisor_id is INTEGER REFERENCES users(id) ON DELETE SET NULL: exactly one SV per project (possibly none), and deleting a SV cannot orphan-project the row (the delete is separately refused while any project still points at it). client_supervisors(client_id, user_id) is the many-to-many of a client's default SVs. Every one of these columns is added by addColumnIfMissing() in both migration paths (the v1.6 block), so an existing database upgrades in place.

application_variants(application_id, name, notes, created_at) is the optional third catalogue level, UNIQUE (application_id, name) and ON DELETE CASCADE from its application — a sub app has no meaning without the app it belongs to. projects.variant_id is INTEGER REFERENCES application_variants(id) ON DELETE SET NULL: deleting a sub app returns its projects to the whole application instead of taking them with it. The API rejects a sub app that belongs to a different application, so the pairing cannot drift (resolveVariantId), and a project whose application changes drops its sub app rather than keeping one that no longer applies.

v1.19 — attachments and checklists. Five tables, no changes to existing ones:

  • project_files(project_id → projects CASCADE, name, mime, size, stored_name, uploaded_by → users SET NULL, created_at)
  • checklists(name UNIQUE, description, created_at)
  • checklist_items(checklist_id → checklists CASCADE, section, title, help, position)
  • project_checklists(project_id → projects CASCADE, checklist_id → checklists **RESTRICT**, created_at, UNIQUE(project_id, checklist_id))
  • project_checklist_items(project_checklist_id, item_id, status, note, file_id → project_files SET NULL, updated_by, updated_at, PRIMARY KEY(project_checklist_id, item_id))

stored_name is a random uuid, never the uploaded filename: the name a user typed can contain a path separator, a second extension, or 255 bytes of anything. The catalogue name is kept purely for display. RESTRICT on checklist_id is what makes "you cannot delete a template a project is using" a property of the database rather than a promise the route remembers to keep.

v1.20 — category, one default per category, a versioned seed. checklists gained category, is_default, seed_key and seed_version, all added by addColumnIfMissing() in both migration paths. is_default is BOOLEAN on Postgres and INTEGER on SQLite, so every statement that touches it uses the TRUE/FALSE literal: a bound JS boolean is rejected by the SQLite driver and = 1 is a type error on Postgres (operator does not exist: boolean = integer). seed_version is what lets a release replace a shipped list's items in place instead of adding a second copy beside it.

v1.23 — the working note is one field, and the timeline table is gone. projects.pentest_notes TEXT NOT NULL DEFAULT '', beside the existing notes. v1.22 briefly modelled this as project_pentest_notes, one row per entry, ordered by an entry_date you picked. That was the wrong shape for the question being asked: reading an engagement back is one question — what did we find? — and answering it out of nine entries dated across three days is the reading work the field was supposed to save. migratePentestNotesIntoColumn() carries the newest entry per project into the column, logs how many it carried, then drops the table; a database that never had it skips the whole step.

The route stayed separate from PATCH /api/projects/:id (PUT /api/projects/:id/pentest-notes), so saving a long note cannot overwrite the name, status or dates somebody else was not looking at. There is no delete route: emptying the field is the deletion, which is also why the endpoint takes a PUT — sending it twice leaves one note, so a retried save is safe.

v1.21 — one checklist per project. CREATE UNIQUE INDEX idx_project_checklists_one ON project_checklists(project_id). A database that predates the rule can hold duplicates, so dedupeProjectChecklists() runs before createIndexes() on both engines: it keeps the newest link for each project (and drops the answers on the others) and logs how many it removed. The invariant then lives in the engine, not in every route that might forget it.

Notes and Pentest notes, both edited in place

Two long-text fields on a project, answering different questions:

Notes what was agreed with the client: scope, credentials location, out-of-scope items. Changes rarely.
Pentest notes what was tested and what it showed. Written while the work happens.

They stay separate fields because the person asking what did we agree? is rarely asking what did we find?, and one box would make the second answer overwrite the first.

Both are edited where they are read. The Edit button turns the text you are looking at into the text you are typing — no dialog. A modal was the wrong shape for these two specifically: the text is the whole content of the tab, and a 7-row box under a dimmed page meant holding one version in your head to compare it with the other. Cancel restores what was there (typed text does not linger in a hidden box), the textarea grows with its content so a long note is not read through a scrollbar, Ctrl/Cmd+Enter saves and Escape abandons.

Saving without changing anything does not move the project's updated_at, the same rule every other edit follows. Emptying the box clears the note — there is no delete button for a field, and none is needed.

Renamed in v1.13: the supervisor columns

The role stayed Project Manager. What was renamed is the field that says who owns an engagement: client_managers → client_supervisors and projects.manager_id → projects.supervisor_id, because that field is called Supervisor (SV) now. migrateSupervisorNames() handles a database that arrives in either state — old names only (a plain RENAME), or both present (the old addColumnIfMissing('projects','manager_id') minted the column in one release, the new one would mint supervisor_id in the next) — by copying the values across and then dropping the old column/table. It is guarded and idempotent, and runs before createIndexes() so the new indexes exist on old installs too.

One release in between also rewrote the role value to 'Supervisor'. The same migration now repairs that with UPDATE users SET role = 'Project Manager' WHERE role = 'Supervisor': the account type was never meant to change, only the field.

documents is keyed by (scope, scope_id, env) — the same client / application / variant pairing info_entries uses, plus which environment the sheet describes — and holds text_body plus table_json (the identical JSON grid shape as info_entries.data, so one parser serves both). updated_by is ON DELETE SET NULL: the document outlives the person who last edited it. Saving is a single upsert, so a first save and a later one take the same code path.

info_entries.env follows the same idea one column over: a note records which sheet it was written on, added by addColumnIfMissing('info_entries','env',...) in the v1.11 block of both migrations. Unlike documents there is no primary-key change involved — notes are identified by their own id — so the plain ADD COLUMN suffices and existing notes default to Dev, which is exactly where they were displayed before the column existed.

env is added by addColumnIfMissing('documents','env',...) in the v1.10 block of both migrations. Widening a primary key cannot be done with CREATE TABLE IF NOT EXISTS or ADD COLUMN, so migrateDocumentsKey() rebuilds the table once on installs that predate the column: it renames the old table, creates the new (scope, scope_id, env) key, copies every existing row over as Dev, and drops the old one. It is guarded by a check on the current key columns, so it is a no-op afterwards, and on Postgres it is a DROP CONSTRAINT / ADD PRIMARY KEY pair instead of a rebuild.

schema/sqlite.sql and schema/postgres.sql are kept in lockstep — same tables, same ISO-8601 TEXT timestamps (no timestamptz), so the JSON API is identical on both. Applying is idempotent (CREATE ... IF NOT EXISTS) and runs on every boot.

Two rules keep an in-place upgrade from being a one-way door:

  • A failed migration stops the boot. addColumnIfMissing() used to log one line and carry on, which left the app running against half a schema: /healthz only runs SELECT 1, so the container reported healthy while every page that named the missing column returned 500. It now collects the failures and initDatabase() throws, so the container restarts instead of serving broken pages.
  • The rebuild of documents runs in one transaction, with a DROP TABLE IF EXISTS documents_old recovery step. It was rename → create → copy → drop with no BEGIN, and a crash in the middle left the old table behind and no new one — after which every boot died on table documents_old already exists. On a named volume that is a permanently bricked install, not a bad test run.

SCHEMA_VERSION (in db.js) is the shape this release expects, and it is recorded in schema_migrations at the end of every successful boot, so an operator can ask a volume what it has been through instead of guessing from the catalog:

docker compose -f docker-compose.prod.yml exec db \
  psql -U onepromag -d onepromag -c 'SELECT * FROM schema_migrations'

Retest code generation

RT-<project>-<seq> is computed from the highest existing sequence for that project, not COUNT(*) (counting repeats a code as soon as one is deleted). Generation happens inside a transaction with the project row locked (SELECT ... FOR UPDATE on Postgres, BEGIN IMMEDIATE on SQLite), and UNIQUE (project_id, code) is the backstop. Verified with 40 concurrent creates on each engine: 40 distinct codes, zero duplicates, zero errors.

Backups

# Postgres — consistent dump
docker exec onepromag-db pg_dump -U onepromag onepromag > backup-$(date +%F).sql

# SQLite — safe online snapshot (WAL-aware; do not cp the file while running)
docker exec onepromag node -e "
  const {DatabaseSync} = require('node:sqlite');
  new DatabaseSync('/data/app.db').exec(\"VACUUM INTO '/data/backup-' + Date.now() + '.db'\");
"

Migrating existing SQLite data to Postgres

Start the stack on Postgres, log in, and re-create the records — or script the copy with pg_dump-friendly inserts. Because both schemas share column names, a row-for-row copy is all that is required; there are no type conversions unless you switch the timestamp columns to timestamptz.


Operating without the UI

server/cli.js covers the cases the web app cannot: you are locked out, or you want to check who exists before signing in.

npm run cli users                     # id, username, name, role, level, contact
npm run cli passwd <username>         # NEW_PASSWORD=… or generated + printed

Same commands inside a container:

docker compose -f docker-compose.prod.yml exec onepromag node server/cli.js users
docker compose -f docker-compose.prod.yml exec -e NEW_PASSWORD='…' \
  onepromag node server/cli.js passwd admin

passwd accepts an e-mail address as well as a username, and drops that user's other sessions.

Project structure

OneProMag/
├── Dockerfile
├── docker-compose.yml       development: publishes 3131, no TLS
├── docker-compose.prod.yml  deployment: Caddy + TLS, nothing else published
├── deploy/
│   ├── Caddyfile            TLS, compression, security headers, access log
│   └── .env.example         template for the production .env
├── .github/workflows/test.yml   npm test on every push
├── .dockerignore
├── .gitignore
├── package.json
├── docs/                    design notes and the spec behind each change
├── tasks/                   plan.md, todo.md — what is next and what it cost
├── test/api.test.js         node:test suite — permissions, transitions, schema
├── server/
│   ├── index.js         HTTP server, routing, static files, boot sequence
│   ├── cli.js           `users` / `passwd` — operations without the web server
│   ├── db.js            engine selection, schema apply, seed data
│   ├── auth.js          scrypt hashing, sessions, user CRUD
│   ├── api.js           assembles the route table, one file per resource
│   ├── shared.js        helpers more than one resource needs
│   ├── knowledge.js     the guides and common findings, as content not rows
│   ├── routes/
│   │   ├── people.js     accounts, presence, directory, hierarchy, availability, stats
│   │   ├── projects.js   project rows + retests
│   │   ├── catalogue.js  properties, clients, applications, variants
│   │   ├── info.js       notes, sheets, search
│   │   ├── devices.js    device rows, columns, order
│   │   ├── files.js      project attachments, streamed downloads
│   │   ├── checklists.js checklist templates, items, answers
│   │   ├── pentest-notes.js  the one working note per project
│   │   └── knowledge.js  the Tests and Findings libraries (read-only)
│   ├── schema/
│   │   ├── sqlite.sql
│   │   └── postgres.sql
│   └── drivers/
│       ├── shared.js    placeholder rewriting, transaction lock
│       ├── sqlite.js    node:sqlite adapter
│       └── postgres.js  pg Pool adapter
├── public/
│   ├── index.html
│   ├── css/styles.css   design tokens, components, responsive
│   └── js/
│       ├── app.js       entry point: boot, resize, 401 reset
│       ├── state.js     the one shared store, nav paths, form drafts
│       ├── shared.js    small helpers every page uses
│       ├── shell.js     sidebar, topbar, page title, navigation
│       ├── auth.js      sign-in, register, change password
│       ├── projects.js  project list, filters, paging, project form
│       ├── drawer.js    the project drawer: overview, retests, notes
│       ├── devices.js   devices sheet, columns, bulk edit
│       ├── info.js      information center, notes and table sheets
│       ├── team.js      team status board
│       ├── directory.js read-only people directory
│       ├── users.js     Manage users (Admin panel)
│       ├── admin.js     Admin panel shell
│       ├── properties.js categories and statuses (Admin panel)
│       ├── checklists.js checklists: item editor (drawer + page), Admin panel
│       ├── project-page.js one project, on its own URL (/project/<id>/<tab>)
│       ├── notes-editor.js the two long-text fields, edited in place
│       ├── library.js   the Tests and Findings pages
│       ├── files.js     project attachments: upload, download, delete
│       ├── api.js       fetch wrapper
│       ├── ui.js        modal/toast/badge/segmented primitives, team + SV cell
│       ├── props.js     categories/statuses registry (filled at boot)
│       └── icons.js     inline SVG icon set, platform/subrole maps
├── backups/             created when the backup profile runs (git-ignored)
└── data/app.db          only created in SQLite mode

API

All endpoints except /api/auth/* require a session cookie.

POST /api/auth/password takes { currentPassword, newPassword }. It answers 400 for a wrong current password, a password under 6 characters, or a new password identical to the old one, and 200 {ok:true} otherwise — revoking every other session for that user so a stolen cookie dies with the old password.

Method Path Purpose
POST /api/auth/login sign in with a username or an email
POST /api/auth/register self-register (always Member)
POST /api/auth/logout destroy session
GET /api/auth/me current user (or null)
POST /api/auth/password change own password
PATCH /api/auth/profile change own phone + email; role, level and name are not accepted
GET /api/docs/:scope/:scopeId?env= the fixed text + table document for a target and environment (env is Dev by default); an empty one if never saved
PATCH /api/docs/:scope/:scopeId save either half (text and/or table) for env; the omitted half is untouched
GET /api/info?scope=&scopeId=&env= notes for a client / application on one sheet (env defaults to Dev; a client only ever has Dev)
GET /api/info/search?q= search every note (title, body, category, table cells); ≥2 chars
POST /api/info add a note; env files it on the Dev or Prod sheet
PATCH /api/info/:id edit or pin a note; env moves it between sheets
DELETE /api/info/:id delete a note
GET /api/devices?kind=&q= device inventory; returns devices, per-kind counts, columns (the saved layout per type), fields, labels, kinds
PATCH /api/devices/columns/:kind replace one type's column layout (key, label, hidden, builtin)
PATCH /api/devices/order {kind, ids} — persist a dragged row order into position
POST /api/devices add a device — fields the kind does not own are ignored
PATCH /api/devices/:id update; changing kind drops the old kind's fields
PATCH /api/devices/bulk {updates:[{id,...cells}]} — save many rows at once; all-or-nothing, max 500, rejects duplicate ids
DELETE /api/devices/:id delete a device
GET /api/presence who was active in the last two minutes (online[] with self, count); the call itself records that you are here
GET /api/users list pentesters (sorted by hierarchy), SVs excluded
GET /api/directory the staff directory: every account, name · role · level · e-mail · phone, alphabetical
GET /api/people/:id one person + supervisorOf, pentesterOn, reports
GET /api/supervisors list project supervisors
POST /api/supervisors add a SV: { username, name, password, phone, email }
PATCH /api/supervisors/:id rename / update { name, phone, email }
DELETE /api/supervisors/:id remove (409 while they still own projects)
GET /api/stats dashboard counters + clients/apps; mineActive/mineAll mirror ?mine=1
GET /healthz readiness: process up and a database round trip; 503 + {ok:false,db:"down"} when Postgres is unreachable
GET /api/properties project categories + statuses (key, label, tone, position, locked)
POST /api/properties/:kind add a property (category | status): { label, tone } — the key is derived
PATCH /api/properties/:kind/:id rename / recolour / reposition one property
PATCH /api/properties/order { kind, ids } — persist a reordered list
DELETE /api/properties/:kind/:id remove (409 when built in, or while projects/retests still use it)
GET /api/projects list + filter (q, clientId, applicationId, status, category, env, method, mine, pentester, queue, activeOnly, finishedOnly, excludeStatus, inStatus) — queue and finishedOnly no longer have a sidebar page, but the API keeps them
GET /api/availability team board: status, current projects, idle-since, totals
PATCH /api/availability/:id set { status, note }; members may only patch themselves
POST /api/projects/:id/pentesters quick-assign from the board: { userId }; admin/lead/sub lead only
DELETE /api/projects/:id/pentesters/:userId remove a pentester from a project from the board
GET /api/pentesters flat list + nested tree (Lead → Sub Lead → Member → Intern)
POST /api/pentesters add a pentester (parent validated against the level)
PATCH /api/pentesters/:id rename, change level, or re-parent
DELETE /api/pentesters/:id remove (blocked while they still manage someone)
POST /api/projects create project
GET /api/projects/:id project detail + its retests
PATCH /api/projects/:id update project
DELETE /api/projects/:id delete project (+ cascade retests)
POST /api/projects/:id/retests add retest request
PATCH /api/retests/:id update retest
DELETE /api/retests/:id delete retest
GET /api/clients list clients
POST /api/clients create client (Admin/Lead/Sub Lead); { supervisorIds: [] } sets default SVs
PATCH /api/clients/:id rename / edit client, incl. supervisorIds
DELETE /api/clients/:id delete client (409 while in use)
GET /api/applications list applications
POST /api/applications create application
PATCH /api/applications/:id edit application
DELETE /api/applications/:id delete application (409 while in use)

Search is case-insensitive on both engines (LOWER() on both sides — PostgreSQL's LIKE is case-sensitive by default, SQLite's is not).

Design notes

  • Design tokens — every color, radius, shadow and font is a CSS variable in public/css/styles.css; [data-theme="dark"] redefines the palette.
  • Contrast — all text meets WCAG AA (≥4.5:1) against its own surface in both themes.
  • Typography — Inter with a tight tracking scale for headings; JetBrains Mono for retest codes; tabular-nums for counters.
  • Accessibility — semantic buttons, aria-labels on icon-only controls, visible :focus-visible rings, prefers-reduced-motion support, Escape closes modals/drawer.
  • Responsive — card grid reflows to 1 column, sidebar becomes a slide-over drawer, forms collapse to a single column below 620px.
  • Security — all user text is HTML-escaped on render; SQL uses prepared statements; passwords are scrypt-hashed; cookies are HttpOnly; app runs as non-root in Docker.

Requirements

  • Docker with Compose v2 (docker compose ...) — nothing else, for the Docker path
  • Node.js ≥ 22.5 and npm install — only for the non-Docker path

Configuration

Variable Default Meaning
DB auto postgres or sqlite; overrides detection
PORT 3131 HTTP port inside the container / process
HOST 0.0.0.0 bind address
DATABASE_URL — full Postgres connection string; implies Postgres
PGHOST localhost Postgres host (db inside compose)
PGPORT 5432 Postgres port
PGUSER onepromag Postgres user
PGPASSWORD — Postgres password
PGDATABASE onepromag Postgres database
DATA_DIR ./data SQLite file location (/data inside the image)
APP_PORT 3131 compose only — host port to publish (both files)
TZ Asia/Jakarta timezone inside the container. A container defaults to UTC, so without this the automatic start/end date stamps would record the wrong day. Set your own zone, e.g. TZ=Europe/Amsterdam.
ONEPROMAG_SUBNET 10.77.0.0/24 compose only — Docker subnet for the app network
ALLOW_REGISTER 1 public self-registration. The production compose file sets 0.
SEED_DEMO 1 0 skips the demo fixtures and creates a single admin instead. The production compose file sets 0.
ADMIN_USERNAME / ADMIN_NAME admin / Administrator used only while the users table is empty, with SEED_DEMO=0
ADMIN_PASSWORD generated same — when unset a random password is printed once in the boot log
COOKIE_SECURE auto Secure on the session cookie is decided from the request: on over TLS (or X-Forwarded-Proto: https), off over plain http. 1/0 overrides that for proxies that do not send the header.
APP_BIND 0.0.0.0 compose only — set 127.0.0.1 when a proxy is the only intended way in
POSTGRES_PASSWORD onepromag compose only — the prod file warns in its boot log while it is still the default
HOST_UID / HOST_GID 0 compose only — owner of the files the backup container writes to ./backups

docker compose up --build starts both services, so Postgres is what you get out of the box. Override the database password for anything beyond local use:

POSTGRES_PASSWORD=$(openssl rand -base64 24) docker compose up --build

Troubleshooting

  • all predefined address pools have been fully subnetted — this host has exhausted Docker's address pool. The compose file pins an explicit subnet (10.77.0.0/24) on a user-defined network to avoid the pool; override with ONEPROMAG_SUBNET if it collides with your LAN.
  • Port 3131 is already in use — use APP_PORT=8080 docker compose up --build.
  • App container restarts, waiting for postgres — the app retries the connection for ~30s. Check docker compose logs db; if the password volume was initialised with a different password, run docker compose down -v to reset.
  • ExperimentalWarning: SQLite is an experimental feature — only appears in SQLite mode on Node 22. The image uses Node 24 where node:sqlite is stable.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages