PostgreSQL backup tool with Point-In-Time-Recovery and restore verification
TypeScript backupbackupsdatabasedatabase-backupdevopsdockergolangkubernetesmariadbmongodbmysqlpgpostgrespostgresqls3self-hostedsystem-administrationtoolsweb-ui
1. Backend
- 1.1 Create the migration stub with
goose -dir backend/migrations create add_telegram_bot_api_url sqland fill it to add a nullablebot_api_url TEXTcolumn totelegram_notifiersin Up and drop it in Down, matching20260622120000_add_telegram_proxy.sql. AddBotAPIURL string(json:"botApiUrl", columnbot_api_url) toTelegramNotifierand copy it unconditionally inUpdate, leavingHideSensitiveDataandEncryptSensitiveDatauntouched. Add a controller test that saves a Telegram notifier with a Bot API URL, reads it back withbotApiUrlin clear and the bot token and proxy URL empty, then updates it with an empty URL and reads it back empty; verify withjust test-package ./internal/features/notifiers/...inbackend/ - 1.2 Add
validateBotAPIURLinbackend/internal/features/notifiers/models/telegram/bot_api_url.gothat acceptshttp/httpswith a host and rejects user info, a query and a fragment, and call it fromValidatewhen the field is set. Add table tests onValidateinmodel_test.gobeside the proxy tests for every valid and rejected URL in the spec, and a controller test that saving an invalid or credential-bearing URL is rejected and leaves the stored notifier unchanged; verify withjust test-package ./internal/features/notifiers/...inbackend/ - 1.3 Make
Sendbuild the address from the validated Bot API URL with the trailing slash trimmed, or fromhttps://api.telegram.orgwhen the field is empty. Add a unit test inmodel_test.gothat an empty Bot API URL yieldshttps://api.telegram.org/bot<token>/sendMessage, and controller tests withhttptestservers: a saved notifier with a prefixed, slash-terminated URL sent throughPOST /notifiers/:id/testdelivers/<prefix>/bot<token>/sendMessagewith itschat_id; an unsaved notifier sent throughPOST /notifiers/direct-testreaches the server the same way; a direct test with an invalid URL and with a URL holding user info returns an error while the server records no request; a notifier with a Bot API URL and a proxy pointing at anhttptestproxy makes the proxy receive the request for the Bot API URL; a prefixed URL pointing at a closed server yields an error that names the host and not the token; verify withjust test-package ./internal/features/notifiers/...inbackend/ - 1.4 Add
RedactSecretInText(text, secret string) stringtobackend/internal/features/notifiers/models/url_credentials.go, replacing every occurrence of the secret with the existingredactedURLSegmentmarker, with a unit test inurl_credentials_test.go, and apply it to the non-OK response body in the TelegramSend. Add a controller test where the Bot API server answers 404 with a body echoing the request path and the test-send error keeps the body withredactedin place of the token; verify withjust test-package ./internal/features/notifiers/...inbackend/
2. Frontend
- 2.1 Add
botApiUrl?: stringtoTelegramNotifier.ts, mirror the backend rules invalidateTelegramNotifier.ts, and add the valid and rejected spec URLs tovalidateTelegramNotifier.test.ts; verify withpnpm testandpnpm typecheckinfrontend/ - 2.2 Move
AdvancedSettingsToggleComponentfromfeatures/databases/ui/edit/toshared/ui/with the label as a prop, moveAdvancedFieldRowComponentfromEditEmailNotifierComponent.tsxtoshared/ui/, export both fromshared/ui/index.ts, switch the five database forms and the email form to them, delete the email form's inline header, and renamenotifiers.email.advancedSettingstonotifiers.advancedSettingsin all six dictionaries; verify withpnpm lint,pnpm typecheckandpnpm testinfrontend/ - 2.3 Add the Bot API URL label, placeholder and tooltip (official API when empty, the URL receives the bot token, a bot must be moved to a self-hosted server first) to all six dictionaries, written in each language per the translation rules; verify with
pnpm test(the dictionary placeholder test) andpnpm typecheckinfrontend/ - 2.4 Add the collapsible advanced settings section to
EditTelegramNotifierComponent.tsx, holding the new Bot API URL field and the existing proxy switch and proxy URL, starting open whenbotApiUrlis set orisProxyEnabledis true. AddEditTelegramNotifierComponent.test.tsxrendering withrenderToStaticMarkup: a new notifier renders without the proxy and Bot API URL labels, a notifier with a proxy and one with a Bot API URL render with them; verify withpnpm testinfrontend/ - 2.5 Show the Bot API URL in
ShowTelegramNotifierComponent.tsxwhen it is set, withShowTelegramNotifierComponent.test.tsxchecking that the URL is rendered when set and absent otherwise; verify withpnpm testinfrontend/
3. Final checks
- 3.1 Run
just formatandjust lintat the repository root andpnpm buildinfrontend/, and fix every finding in the touched files; verify all three exit cleanly