Repository navigation
feat(security): remove the super password - #132
Merged
Merged
Conversation
Что: - Супер-пароль удалён целиком: таблицы super_password, super_session и super_password_token и колонка notification.superPassword (миграция 0212, DROP ... IF EXISTS), сервис, роутер superPassword, проверка в хуке better-auth, в WebSocket-терминалах и в общем middleware tRPC, реестр классификации процедур procedure-access.ts и его тест. - Убраны карточка Super password в Profile, глобальное окно разблокировки, страницы /super-password/lock и /dashboard/settings/super-password-reset, переключатель Super password в форме уведомлений, письма и оповещения о супер-пароле, SSH-команды reset-super-password и lock-super-session. - Панель ведёт себя так, как раньше для пользователя, который супер-пароль не задавал: API-ключи пишут и удаляют без открытого доступа; смена email и пароля, 2FA, passkey, API-ключи, участники и роли организации и терминалы не спрашивают супер-пароль. - TLS-файлы Traefik (acme.json, *.key, dynamic/certificates), файлы контейнеров и volumes самой панели, данные и удаление сертификатов и восстановление Traefik на странице Domains доступны owner и admin из браузера. Раньше для этого нужна была открытая супер-сессия. API-ключам они закрыты, как и раньше. - Показ сохранённого API-ключа работает из браузерной сессии без супер-пароля; API-ключам закрыт. - Без изменений: скрытие секретов в ответах API-ключей, запрет терминалов для API-ключей, проверки ролей и доступа к серверам. Общие помощники isApiKeySession и assertBrowserSession переехали в api-key-session.ts, проверка защищённых ресурсов - в protected-resource-access.ts. Зачем: - Решение владельца: второй пароль для опасных действий и для записи через API-ключи больше не нужен. Риски: - Украденная браузерная сессия owner или admin даёт всё, что даёт роль, включая терминалы и TLS-ключи; утекший API-ключ может писать и удалять. Секреты в ответах API-ключей по-прежнему скрыты. - Миграция 0212 удаляет хеши супер-паролей, супер-сессии и одноразовые ссылки. Откат на образ до этой версии потребует восстановить дамп БД, снятый перед обновлением. Проверки: - Команды и результаты: bunx tsc --noEmit в apps/dokploy, packages/server, apps/api, apps/schedules - exit 0; bun run server:build - exit 0; bunx biome check по изменённым файлам - без ошибок (2 старых предупреждения в terminal.ts); полный набор CI=true bunx vitest run --config __test__/vitest.config.ts - 4279 прошли, 14 упали в 4 файлах, которым нужен локальный Docker или которые падают только на Mac: application.real.test.ts и monitoring-setup.real.test.ts (ECONNREFUSED docker.sock), vector-validate.test.ts, acme-delete-usage.test.ts (тайминг под нагрузкой, отдельно 13 из 13); после форматирования затронутые папки тестов - 139 файлов, 2060 тестов прошли. - Миграция: drizzle-kit generate дал разницу со снимком 0211 ровно в 3 таблицы и 1 колонку. На локальном PostgreSQL 18 миграции до 0211 из AgentHits-Dev, затем строки в таблицах супер-пароля и уведомление с superPassword = true, затем 0212: таблиц super_* и колонки нет, пользователь и уведомление на месте, 213 записей о миграциях, повторный запуск без ошибок. - Ограничения: интерфейс в браузере не открывался; next build проверит CI. What: - The super password is removed entirely: the super_password, super_session and super_password_token tables and the notification.superPassword column (migration 0212, DROP ... IF EXISTS), the service, the superPassword router, the checks in the better-auth hook, the WebSocket terminals and the shared tRPC middleware, and the procedure classification registry procedure-access.ts with its test. - Gone from the UI and tooling: the Super password card in Profile, the global unlock dialog, the /super-password/lock and /dashboard/settings/super-password-reset pages, the Super password toggle in the notification form, the super password emails and alerts, and the reset-super-password and lock-super-session SSH commands. - The panel behaves as it did for a user who never set a super password: API keys write and delete without open access; email and password changes, 2FA, passkeys, API keys, organization members and roles, and terminals no longer ask for a super password. - Traefik TLS files (acme.json, *.key, dynamic/certificates), the panel's own container and volume files, certificate data, certificate deletion and Traefik recovery on the Domains page are open to owners and admins in a browser. They used to need an open super session. API keys stay locked out of them. - Revealing a stored API key works from a browser session without a super password; API keys cannot reveal keys. - Unchanged: secret scrubbing in API key responses, no terminals for API keys, role and server access checks. The shared isApiKeySession and assertBrowserSession helpers moved to api-key-session.ts, the protected resource check to protected-resource-access.ts. Why: - The owner's decision: a second password for dangerous actions and for API key writes is no longer wanted. Risks: - A stolen owner or admin browser session gets everything the role allows, terminals and TLS keys included; a leaked API key can write and delete. Secrets in API key responses stay hidden. - Migration 0212 drops the super password hashes, super sessions and one-time links. Rolling back to an image before this version needs the database dump taken before the update. Checks: - Commands and results: bunx tsc --noEmit in apps/dokploy, packages/server, apps/api, apps/schedules - exit 0; bun run server:build - exit 0; bunx biome check on changed files - no errors (2 old warnings in terminal.ts); full suite CI=true bunx vitest run --config __test__/vitest.config.ts - 4279 passed, 14 failed in 4 files that need local Docker or fail only on the Mac: application.real.test.ts and monitoring-setup.real.test.ts (ECONNREFUSED docker.sock), vector-validate.test.ts, acme-delete-usage.test.ts (timing under load, 13 of 13 alone); after formatting the touched test folders - 139 files, 2060 tests passed. - Migration: drizzle-kit generate differs from the 0211 snapshot by exactly 3 tables and 1 column. On a local PostgreSQL 18: migrations up to 0211 from AgentHits-Dev, then rows in the super password tables and a notification with superPassword = true, then 0212: no super_* tables, no column, the user and the notification intact, 213 migration records, a second run is a no-op. - Limitations: the UI was not opened in a browser; CI runs next build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Зачем
Решение владельца: супер-пароль больше не нужен. Это был второй пароль поверх входа. Пока доступ не открыт им на 24 часа, API-ключи не могли писать. Опасные действия (часть удалений, терминалы, API-ключи и пользователи, TLS-файлы) требовали ввода супер-пароля в браузере. PR удаляет функцию целиком: из кода, интерфейса и базы.
Что изменилось
Панель теперь ведёт себя так, как раньше вела себя для пользователя, который супер-пароль не задавал.
acme.json,*.key,dynamic/certificates), файлы контейнеров и volumes самой панели, сертификаты и их удаление на странице Domains, восстановление Traefik/super-password/lock,/dashboard/settings/super-password-reset, SSH-командыreset-super-passwordиlock-super-sessionsuper_password,super_session,super_password_token, колонкаnotification.superPassword0212_remove_super_passwordНе изменилось: секреты в ответах API-ключей по-прежнему скрыты. API-ключи не получают значения env, содержимое файлов контейнеров и volumes,
docker inspectи сами ключи, а терминалы им закрыты. Проверки ролей и доступа к серверам те же.Заодно ушёл реестр
procedure-access.ts: новые процедуры tRPC из апстрима больше не нужно в нём классифицировать.Риски
Проверки
tsc --noEmitвapps/dokploy,packages/server,apps/api,apps/schedules;bun run server:buildbiome checkпо изменённым файламapps/dokployvector-validate(известное падение на Mac), тайминговый тест блокировки сертификатов (отдельно 13 из 13)super_*и колонки нет, пользователь и уведомление на месте, повторный запуск без ошибокnext buildпроверяет CIСвязанный PR
agentHits/dokploy-mcp#17 убирает из MCP-сервера инструмент
superPassword-statusи пояснения к отказам супер-пароля. PR-ы независимы, их можно мержить в любом порядке.Что сделать после мержа
🤖 Generated with Claude Code