devpush 0.0.0-stage → 1.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -2
- package/agent-release.json +37 -0
- package/dist/package/LICENSE.md +21 -0
- package/dist/package/migrate.mjs +182 -0
- package/dist/package/plugins.mjs +125 -0
- package/dist/package/vite.mjs +439 -0
- package/package.json +168 -3
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon.svg +1 -0
- package/public/logo-email.png +0 -0
- package/public/robots.txt +3 -0
- package/public/social.png +0 -0
- package/src/cloudflare-runtime.d.ts +78 -0
- package/src/components/about-dialog.tsx +70 -0
- package/src/components/copy-button.tsx +74 -0
- package/src/components/logo-mark.tsx +20 -0
- package/src/components/pending-collection.tsx +103 -0
- package/src/components/resource-avatar.tsx +65 -0
- package/src/components/route-error-state.tsx +95 -0
- package/src/components/section-navigation.tsx +39 -0
- package/src/components/settings-layout.tsx +111 -0
- package/src/components/storage-capabilities.tsx +11 -0
- package/src/components/table-pager.tsx +101 -0
- package/src/components/ui/alert-dialog.tsx +180 -0
- package/src/components/ui/alert.tsx +78 -0
- package/src/components/ui/avatar.tsx +58 -0
- package/src/components/ui/badge.tsx +49 -0
- package/src/components/ui/button-group.tsx +38 -0
- package/src/components/ui/button.tsx +67 -0
- package/src/components/ui/card.tsx +82 -0
- package/src/components/ui/chart.tsx +307 -0
- package/src/components/ui/checkbox.tsx +30 -0
- package/src/components/ui/combobox.tsx +256 -0
- package/src/components/ui/dialog.tsx +163 -0
- package/src/components/ui/dropdown-menu.tsx +110 -0
- package/src/components/ui/empty.tsx +65 -0
- package/src/components/ui/field.tsx +192 -0
- package/src/components/ui/input-group.tsx +118 -0
- package/src/components/ui/input-otp.tsx +70 -0
- package/src/components/ui/input.tsx +19 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/pagination.tsx +34 -0
- package/src/components/ui/popover.tsx +86 -0
- package/src/components/ui/select.tsx +145 -0
- package/src/components/ui/skeleton.tsx +19 -0
- package/src/components/ui/sonner.tsx +47 -0
- package/src/components/ui/switch.tsx +31 -0
- package/src/components/ui/table.tsx +81 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/tooltip.tsx +55 -0
- package/src/features/admin/admin-settings.tsx +1048 -0
- package/src/features/auth/current-user-context-query.ts +11 -0
- package/src/features/auth/login-form.tsx +442 -0
- package/src/features/auth/sign-out-menu-item.tsx +42 -0
- package/src/features/deployments/deployment-actions.tsx +336 -0
- package/src/features/deployments/deployment-alias-badge.tsx +35 -0
- package/src/features/deployments/deployment-detail.tsx +596 -0
- package/src/features/deployments/deployment-filters.ts +66 -0
- package/src/features/deployments/deployment-list.tsx +465 -0
- package/src/features/deployments/deployment-visit-links.tsx +104 -0
- package/src/features/deployments/deployments-page.tsx +376 -0
- package/src/features/logs/log-scroll-area.tsx +69 -0
- package/src/features/notifications/email-preferences.tsx +232 -0
- package/src/features/onboarding/profile-onboarding.tsx +162 -0
- package/src/features/plugins/contributions.tsx +118 -0
- package/src/features/projects/backup-job-logs.tsx +143 -0
- package/src/features/projects/backup-policy-delete-dialog.tsx +82 -0
- package/src/features/projects/backup-restore-actions.tsx +573 -0
- package/src/features/projects/backup-status-icon.tsx +33 -0
- package/src/features/projects/backup-target-list.tsx +222 -0
- package/src/features/projects/backup-timestamp.tsx +32 -0
- package/src/features/projects/backup-volume-picker.tsx +158 -0
- package/src/features/projects/compose-service-input.tsx +64 -0
- package/src/features/projects/deploy-readiness.ts +28 -0
- package/src/features/projects/environment-dot.tsx +91 -0
- package/src/features/projects/log-keyword-filter.tsx +48 -0
- package/src/features/projects/manual-deploy-dialog.tsx +563 -0
- package/src/features/projects/pending-section.ts +26 -0
- package/src/features/projects/project-backup-details-pending.tsx +305 -0
- package/src/features/projects/project-backup-details.tsx +936 -0
- package/src/features/projects/project-backup-policy.tsx +644 -0
- package/src/features/projects/project-backup-utils.ts +190 -0
- package/src/features/projects/project-backups-pending.tsx +136 -0
- package/src/features/projects/project-backups.tsx +876 -0
- package/src/features/projects/project-environment-settings.tsx +1128 -0
- package/src/features/projects/project-heading.tsx +68 -0
- package/src/features/projects/project-layout.tsx +188 -0
- package/src/features/projects/project-logs.tsx +461 -0
- package/src/features/projects/project-overview.tsx +280 -0
- package/src/features/projects/project-route-pending.tsx +1064 -0
- package/src/features/projects/project-routing-settings.tsx +663 -0
- package/src/features/projects/project-settings-section.tsx +64 -0
- package/src/features/projects/project-settings-utils.ts +101 -0
- package/src/features/projects/project-settings.tsx +1472 -0
- package/src/features/projects/repository-picker-dialog.tsx +404 -0
- package/src/features/repositories/new-project-dialog-launcher.tsx +44 -0
- package/src/features/repositories/new-project-dialog.tsx +1204 -0
- package/src/features/repositories/new-project-pending.tsx +28 -0
- package/src/features/repositories/repository-list-pending.tsx +59 -0
- package/src/features/servers/server-availability-alert.tsx +44 -0
- package/src/features/servers/server-availability.ts +29 -0
- package/src/features/servers/server-avatar.tsx +52 -0
- package/src/features/servers/server-detail-pending.tsx +315 -0
- package/src/features/servers/server-detail.tsx +855 -0
- package/src/features/servers/server-metric-chart-pending.tsx +38 -0
- package/src/features/servers/server-metric-chart.tsx +182 -0
- package/src/features/servers/server-metric-format.ts +50 -0
- package/src/features/servers/server-metrics-pending.tsx +75 -0
- package/src/features/servers/server-metrics.tsx +136 -0
- package/src/features/servers/team-servers.tsx +432 -0
- package/src/features/settings/settings-route-pending.tsx +406 -0
- package/src/features/teams/backup-storage-settings.tsx +483 -0
- package/src/features/teams/navigation.ts +51 -0
- package/src/features/teams/new-team-dialog.tsx +132 -0
- package/src/features/teams/pending-section.ts +19 -0
- package/src/features/teams/team-header.tsx +1286 -0
- package/src/features/teams/team-heading.tsx +57 -0
- package/src/features/teams/team-home.tsx +391 -0
- package/src/features/teams/team-invite.tsx +155 -0
- package/src/features/teams/team-route-pending.tsx +505 -0
- package/src/features/teams/team-settings.tsx +1555 -0
- package/src/features/teams/use-workspace-updates.ts +126 -0
- package/src/features/users/api-keys-settings.tsx +544 -0
- package/src/features/users/api-scope-selection.tsx +269 -0
- package/src/features/users/connected-apps-settings.tsx +449 -0
- package/src/features/users/mcp-consent.tsx +220 -0
- package/src/features/users/profile-picture.tsx +171 -0
- package/src/features/users/user-settings.tsx +1064 -0
- package/src/lib/account-settings-schema.ts +78 -0
- package/src/lib/action-feedback.ts +81 -0
- package/src/lib/admin-search-schema.ts +8 -0
- package/src/lib/agent-release.d.mts +21 -0
- package/src/lib/agent-release.mjs +90 -0
- package/src/lib/allowlist-schema.ts +79 -0
- package/src/lib/api-key-schema.ts +176 -0
- package/src/lib/auth/client.ts +20 -0
- package/src/lib/avatar-schema.ts +11 -0
- package/src/lib/backup-cron.ts +118 -0
- package/src/lib/backup-database.ts +41 -0
- package/src/lib/backup-feature.ts +2 -0
- package/src/lib/backup-paths.ts +7 -0
- package/src/lib/backup-policy-schema.ts +85 -0
- package/src/lib/backup-resource-schema.ts +12 -0
- package/src/lib/backup-restore-schema.ts +15 -0
- package/src/lib/backup-storage-schema.ts +55 -0
- package/src/lib/deferred-module.ts +38 -0
- package/src/lib/deployment-logs-query.ts +63 -0
- package/src/lib/display-name.ts +7 -0
- package/src/lib/error-message.ts +119 -0
- package/src/lib/form-errors.ts +10 -0
- package/src/lib/internal-redirect.ts +25 -0
- package/src/lib/manual-deploy-options-query.ts +21 -0
- package/src/lib/notification-preferences.ts +43 -0
- package/src/lib/onboarding.ts +11 -0
- package/src/lib/operation-logs-query.ts +51 -0
- package/src/lib/page-head.ts +14 -0
- package/src/lib/project-context-query.ts +257 -0
- package/src/lib/project-creation-schema.ts +64 -0
- package/src/lib/project-env-schema.ts +23 -0
- package/src/lib/project-environments-schema.ts +56 -0
- package/src/lib/project-routing-schema.ts +94 -0
- package/src/lib/project-runtime-config.ts +131 -0
- package/src/lib/project-settings-schema.ts +75 -0
- package/src/lib/public-api-schema.ts +128 -0
- package/src/lib/public-error.ts +337 -0
- package/src/lib/query.ts +13 -0
- package/src/lib/repository-selection-query.ts +11 -0
- package/src/lib/resource-cache.ts +30 -0
- package/src/lib/runtime-id.ts +19 -0
- package/src/lib/search.ts +14 -0
- package/src/lib/server-context-query.ts +43 -0
- package/src/lib/server-name-schema.ts +11 -0
- package/src/lib/settings-conflict.ts +45 -0
- package/src/lib/settings-version.ts +7 -0
- package/src/lib/team-context-query.ts +126 -0
- package/src/lib/team-context-schema.ts +8 -0
- package/src/lib/team-forms-schema.ts +45 -0
- package/src/lib/team-role.ts +13 -0
- package/src/lib/team-settings-schema.ts +48 -0
- package/src/lib/urls.ts +3 -0
- package/src/lib/use-avatar-input.ts +61 -0
- package/src/lib/use-refresh-error.ts +18 -0
- package/src/lib/use-settings-version.ts +23 -0
- package/src/lib/utils.ts +6 -0
- package/src/lib/validation.ts +5 -0
- package/src/lib/workspace-updates.ts +53 -0
- package/src/package/config.ts +10 -0
- package/src/package/env.mjs +54 -0
- package/src/package/migrate-api.d.ts +5 -0
- package/src/package/migrate.ts +56 -0
- package/src/package/plugins.ts +141 -0
- package/src/package/sqlite.mjs +2 -0
- package/src/package/vite-api.d.ts +5 -0
- package/src/package/vite.ts +324 -0
- package/src/package/watch-guard.cjs +26 -0
- package/src/plugins/client.ts +57 -0
- package/src/plugins/contract.ts +188 -0
- package/src/plugins/default.server.ts +4 -0
- package/src/plugins/default.ui.ts +4 -0
- package/src/plugins/operations.ts +45 -0
- package/src/plugins/server.ts +197 -0
- package/src/plugins/version.ts +1 -0
- package/src/routeTree.gen.ts +1275 -0
- package/src/router.tsx +46 -0
- package/src/routes/$teamSlug.index.tsx +53 -0
- package/src/routes/$teamSlug.new-project.tsx +13 -0
- package/src/routes/$teamSlug.projects.$projectName.backups.$backupId.tsx +40 -0
- package/src/routes/$teamSlug.projects.$projectName.backups.tsx +82 -0
- package/src/routes/$teamSlug.projects.$projectName.deployments.$deploymentId.tsx +52 -0
- package/src/routes/$teamSlug.projects.$projectName.deployments.tsx +86 -0
- package/src/routes/$teamSlug.projects.$projectName.logs.tsx +55 -0
- package/src/routes/$teamSlug.projects.$projectName.settings.tsx +51 -0
- package/src/routes/$teamSlug.projects.$projectName.tsx +106 -0
- package/src/routes/$teamSlug.projects.tsx +40 -0
- package/src/routes/$teamSlug.servers.$serverId.tsx +31 -0
- package/src/routes/$teamSlug.servers.index.tsx +59 -0
- package/src/routes/$teamSlug.servers.tsx +7 -0
- package/src/routes/$teamSlug.settings.tsx +56 -0
- package/src/routes/$teamSlug.tsx +86 -0
- package/src/routes/[.]well-known.oauth-authorization-server.api.auth.ts +13 -0
- package/src/routes/[.]well-known.oauth-protected-resource.mcp.ts +6 -0
- package/src/routes/__root.tsx +155 -0
- package/src/routes/admin.tsx +55 -0
- package/src/routes/api/agents/certificates.ts +21 -0
- package/src/routes/api/agents/credentials/rotate.ts +22 -0
- package/src/routes/api/agents/heartbeat.ts +42 -0
- package/src/routes/api/agents/job-logs.ts +22 -0
- package/src/routes/api/agents/jobs/complete.ts +22 -0
- package/src/routes/api/agents/jobs/next.ts +29 -0
- package/src/routes/api/agents/jobs/progress.ts +32 -0
- package/src/routes/api/agents/jobs/status.ts +22 -0
- package/src/routes/api/agents/register.ts +45 -0
- package/src/routes/api/agents/runtime-logs.ts +22 -0
- package/src/routes/api/agents/switch.ts +25 -0
- package/src/routes/api/auth/$.ts +38 -0
- package/src/routes/api/cron/backups.ts +33 -0
- package/src/routes/api/cron/maintenance.ts +30 -0
- package/src/routes/api/github/install.callback.ts +51 -0
- package/src/routes/api/github/install.ts +41 -0
- package/src/routes/api/github/webhook.ts +11 -0
- package/src/routes/api/health.ts +19 -0
- package/src/routes/api/install/agent.$token.ts +50 -0
- package/src/routes/api/install/agent.binary.ts +83 -0
- package/src/routes/api/install/agent.checksum.ts +45 -0
- package/src/routes/api/install/agent.ts +26 -0
- package/src/routes/api/plugins/$.ts +11 -0
- package/src/routes/api/v1/$.ts +15 -0
- package/src/routes/api/workspaces/updates.ts +8 -0
- package/src/routes/auth.login.tsx +50 -0
- package/src/routes/deployments.$deploymentId.unavailable.tsx +21 -0
- package/src/routes/index.tsx +23 -0
- package/src/routes/invites.$token.tsx +35 -0
- package/src/routes/mcp.ts +13 -0
- package/src/routes/oauth.consent.tsx +54 -0
- package/src/routes/onboarding.tsx +37 -0
- package/src/routes/onboarding.workspace.tsx +44 -0
- package/src/routes/settings.tsx +30 -0
- package/src/routes/uploads/avatars/$fileName.ts +44 -0
- package/src/server/admin/access.ts +67 -0
- package/src/server/admin/functions.ts +122 -0
- package/src/server/admin/service.ts +260 -0
- package/src/server/agents/backup-state.ts +210 -0
- package/src/server/agents/certificates.ts +96 -0
- package/src/server/agents/claims.ts +116 -0
- package/src/server/agents/cleanup.ts +52 -0
- package/src/server/agents/compatibility.ts +116 -0
- package/src/server/agents/completion.ts +83 -0
- package/src/server/agents/container-cleanup-state.ts +51 -0
- package/src/server/agents/deployment-state.ts +111 -0
- package/src/server/agents/job-payloads.ts +159 -0
- package/src/server/agents/jobs.ts +1293 -0
- package/src/server/agents/protocol.ts +400 -0
- package/src/server/agents/reconciliation.ts +43 -0
- package/src/server/agents/runtime-logs.ts +337 -0
- package/src/server/agents/runtime-state.ts +125 -0
- package/src/server/api/admission.ts +12 -0
- package/src/server/api/authorization.ts +115 -0
- package/src/server/api/credentials.ts +569 -0
- package/src/server/api/cursors.ts +72 -0
- package/src/server/api/errors.ts +24 -0
- package/src/server/api/functions.ts +60 -0
- package/src/server/api/handler.ts +274 -0
- package/src/server/api/mutation-operations.ts +913 -0
- package/src/server/api/operation-context.ts +139 -0
- package/src/server/api/operation-contract.ts +1099 -0
- package/src/server/api/operations.ts +64 -0
- package/src/server/api/read-operations.ts +891 -0
- package/src/server/api/retention.ts +33 -0
- package/src/server/auth/access.ts +109 -0
- package/src/server/auth/auth-methods.ts +28 -0
- package/src/server/auth/better-auth.ts +518 -0
- package/src/server/auth/context.ts +28 -0
- package/src/server/auth/email-change.ts +47 -0
- package/src/server/auth/email-delivery.ts +51 -0
- package/src/server/auth/provider-identity.ts +19 -0
- package/src/server/auth/provider-tokens.ts +27 -0
- package/src/server/auth/session.server.ts +19 -0
- package/src/server/backups/database-commands.ts +40 -0
- package/src/server/backups/destination.ts +12 -0
- package/src/server/backups/feature.ts +6 -0
- package/src/server/backups/policy-validation.ts +51 -0
- package/src/server/backups/queue-state.ts +137 -0
- package/src/server/backups/service.ts +918 -0
- package/src/server/backups/storage-functions.ts +42 -0
- package/src/server/backups/storage-state.ts +67 -0
- package/src/server/backups/storage.ts +237 -0
- package/src/server/config.ts +274 -0
- package/src/server/db/atomic.ts +16 -0
- package/src/server/db/d1-connection.ts +83 -0
- package/src/server/db/errors.ts +17 -0
- package/src/server/db/index.cloudflare.ts +15 -0
- package/src/server/db/index.ts +35 -0
- package/src/server/db/libsql-connection.ts +72 -0
- package/src/server/db/log-schema.ts +102 -0
- package/src/server/db/migrate-libsql.ts +29 -0
- package/src/server/db/migrate-sqlite.ts +47 -0
- package/src/server/db/migration-history.ts +12 -0
- package/src/server/db/migrations-logs/0000_initial.sql +48 -0
- package/src/server/db/migrations-logs/0001_runtime_log_order.sql +2 -0
- package/src/server/db/migrations-logs/meta/0000_snapshot.json +327 -0
- package/src/server/db/migrations-logs/meta/0001_snapshot.json +329 -0
- package/src/server/db/migrations-logs/meta/_journal.json +20 -0
- package/src/server/db/migrations-sqlite/0000_initial.sql +894 -0
- package/src/server/db/migrations-sqlite/0001_agent_indexes.sql +5 -0
- package/src/server/db/migrations-sqlite/meta/0000_snapshot.json +5816 -0
- package/src/server/db/migrations-sqlite/meta/0001_snapshot.json +5841 -0
- package/src/server/db/migrations-sqlite/meta/_journal.json +20 -0
- package/src/server/db/oauth-schema.ts +216 -0
- package/src/server/db/remote-config.ts +47 -0
- package/src/server/db/schema.ts +1218 -0
- package/src/server/db/sqlite-connection.ts +94 -0
- package/src/server/db/sqlite-files.ts +27 -0
- package/src/server/db/sqlite-params.ts +19 -0
- package/src/server/db/worker-connection.ts +47 -0
- package/src/server/deleted-resources.ts +133 -0
- package/src/server/deletion-recovery.ts +272 -0
- package/src/server/email/layout.tsx +85 -0
- package/src/server/email/notification-template.tsx +62 -0
- package/src/server/email/otp-template.tsx +48 -0
- package/src/server/email/service.ts +251 -0
- package/src/server/email/team-invite-template.tsx +59 -0
- package/src/server/email/theme.ts +10 -0
- package/src/server/github/http.ts +14 -0
- package/src/server/github/install-state.ts +48 -0
- package/src/server/github/service.ts +831 -0
- package/src/server/github/webhook-handler.ts +198 -0
- package/src/server/github/webhooks.ts +205 -0
- package/src/server/http/auth.ts +11 -0
- package/src/server/http/error-diagnostics.ts +66 -0
- package/src/server/http/plugin-request.ts +15 -0
- package/src/server/http/proxy-request.ts +53 -0
- package/src/server/http/public-errors.ts +48 -0
- package/src/server/http/rate-limit.ts +59 -0
- package/src/server/http/request-body.ts +54 -0
- package/src/server/http/request-ip.ts +54 -0
- package/src/server/http/security-headers.ts +36 -0
- package/src/server/install/agent-binary.ts +230 -0
- package/src/server/install/agent-script.ts +565 -0
- package/src/server/install/release-binary.ts +65 -0
- package/src/server/logs/budget.ts +72 -0
- package/src/server/logs/cleanup.ts +64 -0
- package/src/server/logs/deployments.ts +98 -0
- package/src/server/logs/operations.ts +145 -0
- package/src/server/logs/retention.ts +39 -0
- package/src/server/maintenance.ts +61 -0
- package/src/server/mcp/connections.ts +358 -0
- package/src/server/mcp/functions.ts +63 -0
- package/src/server/mcp/handler.ts +295 -0
- package/src/server/mcp/oauth-discovery.cloudflare.ts +6 -0
- package/src/server/mcp/oauth-discovery.ts +8 -0
- package/src/server/mcp/oauth-provider.ts +220 -0
- package/src/server/mcp/urls.ts +20 -0
- package/src/server/notifications/functions.ts +51 -0
- package/src/server/notifications/observe.ts +303 -0
- package/src/server/notifications/outbox.ts +335 -0
- package/src/server/notifications/preferences.ts +131 -0
- package/src/server/notifications/query.ts +16 -0
- package/src/server/plugins/scope.ts +17 -0
- package/src/server/plugins/server-context.ts +157 -0
- package/src/server/plugins/services.server.ts +10 -0
- package/src/server/plugins/workspace-access.ts +74 -0
- package/src/server/projects/backup-policy-state.ts +68 -0
- package/src/server/projects/backups.ts +219 -0
- package/src/server/projects/compose-metadata.ts +174 -0
- package/src/server/projects/configuration-state.ts +90 -0
- package/src/server/projects/context.ts +909 -0
- package/src/server/projects/creation-state.ts +46 -0
- package/src/server/projects/deletion-state.ts +69 -0
- package/src/server/projects/deployment-config.ts +139 -0
- package/src/server/projects/deployment-logs.ts +97 -0
- package/src/server/projects/deployments.ts +1123 -0
- package/src/server/projects/domain-state.ts +71 -0
- package/src/server/projects/environment-branches.ts +75 -0
- package/src/server/projects/environment-state.ts +158 -0
- package/src/server/projects/environments.ts +424 -0
- package/src/server/projects/functions.ts +748 -0
- package/src/server/projects/generated-hostname.ts +77 -0
- package/src/server/projects/hostnames.ts +244 -0
- package/src/server/projects/mappers.ts +457 -0
- package/src/server/projects/names.ts +41 -0
- package/src/server/projects/project-env-vars.ts +28 -0
- package/src/server/projects/queue-state.ts +118 -0
- package/src/server/projects/repository.ts +368 -0
- package/src/server/projects/route-state.ts +37 -0
- package/src/server/projects/runtime-logs.ts +97 -0
- package/src/server/projects/settings-context.ts +58 -0
- package/src/server/projects/settings.ts +738 -0
- package/src/server/projects/types.ts +355 -0
- package/src/server/realtime/agent-events.ts +32 -0
- package/src/server/realtime/node-broadcaster.ts +71 -0
- package/src/server/realtime/node-handler.ts +55 -0
- package/src/server/realtime/service.ts +125 -0
- package/src/server/realtime/workspace-object.cloudflare.ts +62 -0
- package/src/server/realtime/workspace-object.ts +3 -0
- package/src/server/resources/color.ts +13 -0
- package/src/server/runtime/background.ts +21 -0
- package/src/server/runtime/node-asset-cache-plugin.ts +12 -0
- package/src/server/runtime/node-scheduler-plugin.ts +17 -0
- package/src/server/runtime/node-scheduler.ts +51 -0
- package/src/server/runtime/platform-env.cloudflare.ts +17 -0
- package/src/server/runtime/platform-env.ts +19 -0
- package/src/server/runtime/scheduled-task-error.ts +9 -0
- package/src/server/scheduled-tasks.ts +28 -0
- package/src/server/secrets/crypto.ts +56 -0
- package/src/server/servers/functions.ts +233 -0
- package/src/server/servers/lifecycle.ts +122 -0
- package/src/server/servers/metric-history-schema.ts +24 -0
- package/src/server/servers/metric-history.ts +55 -0
- package/src/server/servers/monitoring.ts +592 -0
- package/src/server/servers/service.ts +1211 -0
- package/src/server/servers/status.ts +32 -0
- package/src/server/servers/switch.ts +96 -0
- package/src/server/settings-version.ts +43 -0
- package/src/server/storage/capabilities.ts +6 -0
- package/src/server/storage/local-object-store.cloudflare.ts +7 -0
- package/src/server/storage/local-object-store.ts +50 -0
- package/src/server/storage/object-store.ts +160 -0
- package/src/server/teams/creation.ts +51 -0
- package/src/server/teams/delete-policy.ts +13 -0
- package/src/server/teams/deletion-state.ts +80 -0
- package/src/server/teams/functions.ts +324 -0
- package/src/server/teams/invitations.ts +38 -0
- package/src/server/teams/membership.ts +86 -0
- package/src/server/teams/queries.ts +261 -0
- package/src/server/teams/service.ts +1127 -0
- package/src/server/teams/types.ts +101 -0
- package/src/server/uploads/avatar.ts +133 -0
- package/src/server/users/deletion-state.ts +93 -0
- package/src/server/users/functions.ts +160 -0
- package/src/server/users/onboarding.ts +17 -0
- package/src/server/users/service.ts +644 -0
- package/src/server.ts +55 -0
- package/src/styles/shadcn.css +653 -0
- package/src/styles/theme.css +76 -0
- package/src/styles.css +177 -0
- package/wrangler.template.jsonc +37 -0
|
@@ -0,0 +1,936 @@
|
|
|
1
|
+
import { mutationErrorOptions, afterMutation } from '#devpush/lib/action-feedback'
|
|
2
|
+
import { isValidCron } from '#devpush/lib/backup-cron'
|
|
3
|
+
import { showSettingsConflict } from '#devpush/lib/settings-conflict'
|
|
4
|
+
import { BackupTargetList } from './backup-target-list'
|
|
5
|
+
import { Alert, AlertDescription } from '#devpush/components/ui/alert'
|
|
6
|
+
import { canManageTeamSettings } from '#devpush/lib/team-role'
|
|
7
|
+
import { BackupPolicyDeleteDialog } from './backup-policy-delete-dialog'
|
|
8
|
+
import { backupConfigSchema } from '#devpush/lib/backup-policy-schema'
|
|
9
|
+
import { formErrors } from '#devpush/lib/form-errors'
|
|
10
|
+
import type { FormErrors } from '#devpush/lib/form-errors'
|
|
11
|
+
import { Link, useParams, useRouter } from '@tanstack/react-router'
|
|
12
|
+
import { useQueryClient } from '@tanstack/react-query'
|
|
13
|
+
import {
|
|
14
|
+
LockIcon,
|
|
15
|
+
SettingsIcon,
|
|
16
|
+
TrashIcon,
|
|
17
|
+
TriangleAlertIcon,
|
|
18
|
+
} from 'lucide-react'
|
|
19
|
+
import { useEffect, useRef, useState } from 'react'
|
|
20
|
+
import { toast } from 'sonner'
|
|
21
|
+
|
|
22
|
+
import { Button } from '#devpush/components/ui/button'
|
|
23
|
+
import { ButtonGroup } from '#devpush/components/ui/button-group'
|
|
24
|
+
import {
|
|
25
|
+
Tooltip,
|
|
26
|
+
TooltipContent,
|
|
27
|
+
TooltipTrigger,
|
|
28
|
+
} from '#devpush/components/ui/tooltip'
|
|
29
|
+
import {
|
|
30
|
+
Empty,
|
|
31
|
+
EmptyContent,
|
|
32
|
+
EmptyDescription,
|
|
33
|
+
EmptyHeader,
|
|
34
|
+
EmptyTitle,
|
|
35
|
+
} from '#devpush/components/ui/empty'
|
|
36
|
+
import {
|
|
37
|
+
Field,
|
|
38
|
+
FieldDescription,
|
|
39
|
+
FieldError,
|
|
40
|
+
FieldGroup,
|
|
41
|
+
FieldLabel,
|
|
42
|
+
} from '#devpush/components/ui/field'
|
|
43
|
+
import { Input } from '#devpush/components/ui/input'
|
|
44
|
+
import {
|
|
45
|
+
InputGroup,
|
|
46
|
+
InputGroupInput,
|
|
47
|
+
InputGroupAddon,
|
|
48
|
+
} from '#devpush/components/ui/input-group'
|
|
49
|
+
import { SettingsLayout } from '#devpush/components/settings-layout'
|
|
50
|
+
import {
|
|
51
|
+
Select,
|
|
52
|
+
SelectContent,
|
|
53
|
+
SelectItem,
|
|
54
|
+
SelectTrigger,
|
|
55
|
+
SelectValue,
|
|
56
|
+
} from '#devpush/components/ui/select'
|
|
57
|
+
import { Switch } from '#devpush/components/ui/switch'
|
|
58
|
+
import { EnvironmentDot } from '#devpush/features/projects/environment-dot'
|
|
59
|
+
import { ProjectHeading } from './project-heading'
|
|
60
|
+
import { getPublicErrorMessage } from '#devpush/lib/public-error'
|
|
61
|
+
import { setProjectContextQueryData } from '#devpush/lib/project-context-query'
|
|
62
|
+
import {
|
|
63
|
+
saveProjectBackupPolicyAction,
|
|
64
|
+
deleteProjectBackupPolicyAction,
|
|
65
|
+
} from '#devpush/server/projects/functions'
|
|
66
|
+
import type {
|
|
67
|
+
ProjectBackupConfig,
|
|
68
|
+
ProjectContext,
|
|
69
|
+
} from '#devpush/server/projects/types'
|
|
70
|
+
|
|
71
|
+
import {
|
|
72
|
+
backupCronPresets as cronPresets,
|
|
73
|
+
backupDetailSections,
|
|
74
|
+
getDatabaseServiceOptions,
|
|
75
|
+
getSchedulePresetValue,
|
|
76
|
+
} from './project-backup-utils'
|
|
77
|
+
import {
|
|
78
|
+
BackupPolicySaveActions,
|
|
79
|
+
BackupPolicySection,
|
|
80
|
+
ComposeRequiredEmpty,
|
|
81
|
+
RetentionFieldGroup,
|
|
82
|
+
} from './project-backup-policy'
|
|
83
|
+
import type {
|
|
84
|
+
BackupPolicyDraft,
|
|
85
|
+
BackupPolicyErrorField,
|
|
86
|
+
BackupPolicyErrorSection,
|
|
87
|
+
} from './project-backup-policy'
|
|
88
|
+
|
|
89
|
+
export function ProjectBackupDetails({
|
|
90
|
+
backupId,
|
|
91
|
+
context,
|
|
92
|
+
}: {
|
|
93
|
+
backupId: string
|
|
94
|
+
context: ProjectContext
|
|
95
|
+
}) {
|
|
96
|
+
const canManage = canManageTeamSettings(context.team.role)
|
|
97
|
+
const params = useParams({ strict: false })
|
|
98
|
+
const router = useRouter()
|
|
99
|
+
const queryClient = useQueryClient()
|
|
100
|
+
const teamSlug =
|
|
101
|
+
typeof params.teamSlug === 'string' ? params.teamSlug : context.team.slug
|
|
102
|
+
const projectName =
|
|
103
|
+
typeof params.projectName === 'string'
|
|
104
|
+
? params.projectName
|
|
105
|
+
: context.project.name
|
|
106
|
+
const [backupConfigs, setBackupConfigs] = useState(context.backupConfigs)
|
|
107
|
+
const backup = backupConfigs.find((item) => item.id === backupId)
|
|
108
|
+
const [name, setName] = useState(backup?.name ?? '')
|
|
109
|
+
const [environmentId, setEnvironmentId] = useState(
|
|
110
|
+
backup?.environmentId ?? context.environments.at(0)?.id ?? '',
|
|
111
|
+
)
|
|
112
|
+
const [enabled, setEnabled] = useState(backup?.enabled ?? true)
|
|
113
|
+
const [cron, setCron] = useState(backup?.schedule.cron ?? '0 2 * * *')
|
|
114
|
+
const [schedulePresetValue, setSchedulePresetValue] = useState(
|
|
115
|
+
getSchedulePresetValue(backup?.schedule.cron ?? '0 2 * * *'),
|
|
116
|
+
)
|
|
117
|
+
const [storageId, setStorageId] = useState(
|
|
118
|
+
backup?.destination.storageId ?? '',
|
|
119
|
+
)
|
|
120
|
+
const [prefix, setPrefix] = useState(backup?.destination.prefix ?? '')
|
|
121
|
+
const [localRetentionCount, setLocalRetentionCount] = useState(
|
|
122
|
+
String(backup?.retention.local.count ?? 7),
|
|
123
|
+
)
|
|
124
|
+
const [localRetentionDays, setLocalRetentionDays] = useState(
|
|
125
|
+
String(backup?.retention.local.days ?? 0),
|
|
126
|
+
)
|
|
127
|
+
const [localRetentionMaxStorageGb, setLocalRetentionMaxStorageGb] = useState(
|
|
128
|
+
String(backup?.retention.local.maxStorageGb ?? 0),
|
|
129
|
+
)
|
|
130
|
+
const [remoteRetentionEnabled, setRemoteRetentionEnabled] = useState(
|
|
131
|
+
backup?.retention.remote.enabled ?? false,
|
|
132
|
+
)
|
|
133
|
+
const [remoteRetentionCount, setRemoteRetentionCount] = useState(
|
|
134
|
+
String(backup?.retention.remote.count ?? 7),
|
|
135
|
+
)
|
|
136
|
+
const [remoteRetentionDays, setRemoteRetentionDays] = useState(
|
|
137
|
+
String(backup?.retention.remote.days ?? 0),
|
|
138
|
+
)
|
|
139
|
+
const [remoteRetentionMaxStorageGb, setRemoteRetentionMaxStorageGb] =
|
|
140
|
+
useState(String(backup?.retention.remote.maxStorageGb ?? 0))
|
|
141
|
+
const [volumeMode, setVolumeMode] = useState<
|
|
142
|
+
'none' | 'allNamed' | 'selected'
|
|
143
|
+
>(backup?.volumes.mode ?? 'allNamed')
|
|
144
|
+
const [volumeNames, setVolumeNames] = useState(backup?.volumes.names ?? [])
|
|
145
|
+
const [databaseDumps, setDatabaseDumps] = useState(
|
|
146
|
+
backup?.databaseDumps ?? [],
|
|
147
|
+
)
|
|
148
|
+
const [fieldError, setFieldError] = useState<{
|
|
149
|
+
field: BackupPolicyErrorField
|
|
150
|
+
message: string
|
|
151
|
+
section: BackupPolicyErrorSection
|
|
152
|
+
} | null>(null)
|
|
153
|
+
const [deleteOpen, setDeleteOpen] = useState(false)
|
|
154
|
+
const deleteSettingsVersion = useRef(backup?.settingsVersion)
|
|
155
|
+
const [isSaving, setIsSaving] = useState(false)
|
|
156
|
+
const [schemaErrors, setSchemaErrors] = useState<FormErrors>({})
|
|
157
|
+
const previousBackup = useRef(backup)
|
|
158
|
+
const draftRevision = useRef(backup?.settingsVersion)
|
|
159
|
+
const refreshSavedDraft = useRef(false)
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
if (fieldError)
|
|
162
|
+
document
|
|
163
|
+
.getElementById(fieldError.section)
|
|
164
|
+
?.querySelector<HTMLElement>('[aria-invalid="true"]')
|
|
165
|
+
?.focus()
|
|
166
|
+
}, [fieldError])
|
|
167
|
+
const isCustomSchedule = schedulePresetValue === 'custom'
|
|
168
|
+
const missingComposeFile = context.project.runtimeConfig.path === null
|
|
169
|
+
const composeServices =
|
|
170
|
+
context.composeMetadata?.services ??
|
|
171
|
+
context.routes.map((route) => route.service)
|
|
172
|
+
const composeVolumes = context.composeMetadata?.volumes ?? []
|
|
173
|
+
const databaseServiceOptions = getDatabaseServiceOptions({
|
|
174
|
+
services: composeServices,
|
|
175
|
+
databaseDumps,
|
|
176
|
+
})
|
|
177
|
+
const volumeOptions = Array.from(
|
|
178
|
+
new Set([...composeVolumes, ...volumeNames]),
|
|
179
|
+
).sort()
|
|
180
|
+
const hasChanges = backup
|
|
181
|
+
? JSON.stringify(getBackupDraft()) !== JSON.stringify(toBackupDraft(backup))
|
|
182
|
+
: false
|
|
183
|
+
|
|
184
|
+
useEffect(() => {
|
|
185
|
+
setBackupConfigs(context.backupConfigs)
|
|
186
|
+
}, [context.backupConfigs])
|
|
187
|
+
|
|
188
|
+
useEffect(() => {
|
|
189
|
+
if (!backup) {
|
|
190
|
+
return
|
|
191
|
+
}
|
|
192
|
+
const previous = previousBackup.current
|
|
193
|
+
previousBackup.current = backup
|
|
194
|
+
if (
|
|
195
|
+
!refreshSavedDraft.current &&
|
|
196
|
+
previous?.id === backup.id &&
|
|
197
|
+
JSON.stringify(getBackupDraft()) !==
|
|
198
|
+
JSON.stringify(toBackupDraft(previous))
|
|
199
|
+
)
|
|
200
|
+
return
|
|
201
|
+
refreshSavedDraft.current = false
|
|
202
|
+
draftRevision.current = backup.settingsVersion
|
|
203
|
+
setName(backup.name)
|
|
204
|
+
setEnvironmentId(backup.environmentId)
|
|
205
|
+
setEnabled(backup.enabled)
|
|
206
|
+
setCron(backup.schedule.cron)
|
|
207
|
+
setSchedulePresetValue(getSchedulePresetValue(backup.schedule.cron))
|
|
208
|
+
setStorageId(backup.destination.storageId ?? '')
|
|
209
|
+
setPrefix(backup.destination.prefix ?? '')
|
|
210
|
+
setLocalRetentionCount(String(backup.retention.local.count))
|
|
211
|
+
setLocalRetentionDays(String(backup.retention.local.days))
|
|
212
|
+
setLocalRetentionMaxStorageGb(String(backup.retention.local.maxStorageGb))
|
|
213
|
+
setRemoteRetentionEnabled(backup.retention.remote.enabled)
|
|
214
|
+
setRemoteRetentionCount(String(backup.retention.remote.count))
|
|
215
|
+
setRemoteRetentionDays(String(backup.retention.remote.days))
|
|
216
|
+
setRemoteRetentionMaxStorageGb(String(backup.retention.remote.maxStorageGb))
|
|
217
|
+
setVolumeMode(backup.volumes.mode)
|
|
218
|
+
setVolumeNames(backup.volumes.names)
|
|
219
|
+
setDatabaseDumps(backup.databaseDumps)
|
|
220
|
+
setFieldError(null)
|
|
221
|
+
}, [backup])
|
|
222
|
+
|
|
223
|
+
if (!backup) {
|
|
224
|
+
return (
|
|
225
|
+
<Empty className="min-h-60 border bg-card text-card-foreground">
|
|
226
|
+
<EmptyHeader>
|
|
227
|
+
<EmptyTitle>Backup policy not found.</EmptyTitle>
|
|
228
|
+
<EmptyDescription>
|
|
229
|
+
This backup policy may have been deleted.
|
|
230
|
+
</EmptyDescription>
|
|
231
|
+
</EmptyHeader>
|
|
232
|
+
<EmptyContent>
|
|
233
|
+
<Button asChild>
|
|
234
|
+
<Link
|
|
235
|
+
to="/$teamSlug/projects/$projectName/backups"
|
|
236
|
+
params={{ teamSlug, projectName }}
|
|
237
|
+
>
|
|
238
|
+
Back to backups
|
|
239
|
+
</Link>
|
|
240
|
+
</Button>
|
|
241
|
+
</EmptyContent>
|
|
242
|
+
</Empty>
|
|
243
|
+
)
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const currentBackup = backup
|
|
247
|
+
const backupIdValue = currentBackup.id
|
|
248
|
+
|
|
249
|
+
function getBackupDraft(): BackupPolicyDraft {
|
|
250
|
+
return {
|
|
251
|
+
name,
|
|
252
|
+
environmentId,
|
|
253
|
+
enabled,
|
|
254
|
+
cron,
|
|
255
|
+
storageId,
|
|
256
|
+
prefix,
|
|
257
|
+
localRetentionCount,
|
|
258
|
+
localRetentionDays,
|
|
259
|
+
localRetentionMaxStorageGb,
|
|
260
|
+
remoteRetentionEnabled,
|
|
261
|
+
remoteRetentionCount,
|
|
262
|
+
remoteRetentionDays,
|
|
263
|
+
remoteRetentionMaxStorageGb,
|
|
264
|
+
volumeMode,
|
|
265
|
+
volumeNames,
|
|
266
|
+
databaseDumps,
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function resetDraft() {
|
|
271
|
+
setSchemaErrors({})
|
|
272
|
+
|
|
273
|
+
setName(currentBackup.name)
|
|
274
|
+
setEnvironmentId(currentBackup.environmentId)
|
|
275
|
+
setEnabled(currentBackup.enabled)
|
|
276
|
+
setCron(currentBackup.schedule.cron)
|
|
277
|
+
setSchedulePresetValue(getSchedulePresetValue(currentBackup.schedule.cron))
|
|
278
|
+
setStorageId(currentBackup.destination.storageId ?? '')
|
|
279
|
+
setPrefix(currentBackup.destination.prefix ?? '')
|
|
280
|
+
setLocalRetentionCount(String(currentBackup.retention.local.count))
|
|
281
|
+
setLocalRetentionDays(String(currentBackup.retention.local.days))
|
|
282
|
+
setLocalRetentionMaxStorageGb(
|
|
283
|
+
String(currentBackup.retention.local.maxStorageGb),
|
|
284
|
+
)
|
|
285
|
+
setRemoteRetentionEnabled(currentBackup.retention.remote.enabled)
|
|
286
|
+
setRemoteRetentionCount(String(currentBackup.retention.remote.count))
|
|
287
|
+
setRemoteRetentionDays(String(currentBackup.retention.remote.days))
|
|
288
|
+
setRemoteRetentionMaxStorageGb(
|
|
289
|
+
String(currentBackup.retention.remote.maxStorageGb),
|
|
290
|
+
)
|
|
291
|
+
setVolumeMode(currentBackup.volumes.mode)
|
|
292
|
+
setVolumeNames(currentBackup.volumes.names)
|
|
293
|
+
setDatabaseDumps(currentBackup.databaseDumps)
|
|
294
|
+
setFieldError(null)
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
async function save() {
|
|
298
|
+
if (!canManage || isSaving || !hasChanges) return
|
|
299
|
+
|
|
300
|
+
setSchemaErrors({})
|
|
301
|
+
setFieldError(null)
|
|
302
|
+
const trimmedName = name.trim()
|
|
303
|
+
const trimmedCron = cron.trim()
|
|
304
|
+
const selectedVolumeNames = volumeNames
|
|
305
|
+
.map((item) => item.trim())
|
|
306
|
+
.filter(Boolean)
|
|
307
|
+
const normalizedRetention = {
|
|
308
|
+
local: {
|
|
309
|
+
count: Number(localRetentionCount),
|
|
310
|
+
days: Number(localRetentionDays),
|
|
311
|
+
maxStorageGb: Number(localRetentionMaxStorageGb),
|
|
312
|
+
},
|
|
313
|
+
remote: {
|
|
314
|
+
enabled: remoteRetentionEnabled,
|
|
315
|
+
count: Number(remoteRetentionCount),
|
|
316
|
+
days: Number(remoteRetentionDays),
|
|
317
|
+
maxStorageGb: Number(remoteRetentionMaxStorageGb),
|
|
318
|
+
},
|
|
319
|
+
}
|
|
320
|
+
const normalizedDumps = databaseDumps.map((dump) => ({
|
|
321
|
+
service: dump.service.trim(),
|
|
322
|
+
engine: dump.engine,
|
|
323
|
+
database: dump.database.trim(),
|
|
324
|
+
}))
|
|
325
|
+
|
|
326
|
+
if (!trimmedName) {
|
|
327
|
+
setFieldError({
|
|
328
|
+
field: 'name',
|
|
329
|
+
message: 'Backup policy name is required.',
|
|
330
|
+
section: 'general',
|
|
331
|
+
})
|
|
332
|
+
return
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
if (
|
|
336
|
+
!context.environments.some(
|
|
337
|
+
(environment) => environment.id === environmentId,
|
|
338
|
+
)
|
|
339
|
+
) {
|
|
340
|
+
setFieldError({
|
|
341
|
+
field: 'environment',
|
|
342
|
+
message: 'Select an environment.',
|
|
343
|
+
section: 'general',
|
|
344
|
+
})
|
|
345
|
+
return
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
if (!isValidCron(trimmedCron)) {
|
|
349
|
+
setFieldError({
|
|
350
|
+
field: 'schedule',
|
|
351
|
+
message: 'Use a five-field cron schedule, e.g. 0 2 * * *.',
|
|
352
|
+
section: 'general',
|
|
353
|
+
})
|
|
354
|
+
return
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (
|
|
358
|
+
remoteRetentionEnabled &&
|
|
359
|
+
!context.backupStorage?.some((item) => item.id === storageId)
|
|
360
|
+
) {
|
|
361
|
+
setFieldError({
|
|
362
|
+
field: 'storageId',
|
|
363
|
+
message: 'Select a workspace backup storage destination.',
|
|
364
|
+
section: 'destination',
|
|
365
|
+
})
|
|
366
|
+
return
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if (volumeMode === 'selected' && selectedVolumeNames.length === 0) {
|
|
370
|
+
setFieldError({
|
|
371
|
+
field: 'volumes',
|
|
372
|
+
message: 'Select at least one named volume or choose no volumes.',
|
|
373
|
+
section: 'volumes',
|
|
374
|
+
})
|
|
375
|
+
return
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
const nextConfigs = backupConfigs.map((item) =>
|
|
379
|
+
item.id === backupIdValue
|
|
380
|
+
? {
|
|
381
|
+
...item,
|
|
382
|
+
name: trimmedName,
|
|
383
|
+
environmentId,
|
|
384
|
+
enabled,
|
|
385
|
+
schedule: { cron: trimmedCron },
|
|
386
|
+
destination: {
|
|
387
|
+
storageId: storageId || undefined,
|
|
388
|
+
prefix: prefix.trim() || undefined,
|
|
389
|
+
},
|
|
390
|
+
retention: normalizedRetention,
|
|
391
|
+
volumes: {
|
|
392
|
+
mode: volumeMode,
|
|
393
|
+
names: volumeMode === 'selected' ? selectedVolumeNames : [],
|
|
394
|
+
},
|
|
395
|
+
databaseDumps: normalizedDumps,
|
|
396
|
+
}
|
|
397
|
+
: item,
|
|
398
|
+
)
|
|
399
|
+
|
|
400
|
+
const candidate = nextConfigs.find((item) => item.id === backupIdValue)
|
|
401
|
+
const parsed = backupConfigSchema.safeParse(candidate)
|
|
402
|
+
if (!parsed.success) {
|
|
403
|
+
const errors = formErrors(parsed.error.issues)
|
|
404
|
+
if (errors.form) toast.error(errors.form)
|
|
405
|
+
setSchemaErrors(errors)
|
|
406
|
+
const firstField = Object.keys(errors)[0]
|
|
407
|
+
document
|
|
408
|
+
.querySelector<HTMLElement>(`[data-validation-field="${firstField}"]`)
|
|
409
|
+
?.focus()
|
|
410
|
+
return
|
|
411
|
+
}
|
|
412
|
+
setIsSaving(true)
|
|
413
|
+
|
|
414
|
+
try {
|
|
415
|
+
const nextContext = await saveProjectBackupPolicyAction({
|
|
416
|
+
data: {
|
|
417
|
+
projectId: context.project.id,
|
|
418
|
+
settingsVersion: draftRevision.current!,
|
|
419
|
+
teamSlug,
|
|
420
|
+
projectName,
|
|
421
|
+
policy: parsed.data,
|
|
422
|
+
},
|
|
423
|
+
})
|
|
424
|
+
await setProjectContextQueryData(queryClient, nextContext, 'backups')
|
|
425
|
+
refreshSavedDraft.current = true
|
|
426
|
+
setBackupConfigs(nextContext.backupConfigs)
|
|
427
|
+
toast.success('Backup policy saved.')
|
|
428
|
+
setFieldError(null)
|
|
429
|
+
} catch (error) {
|
|
430
|
+
if (showSettingsConflict(error)) return
|
|
431
|
+
toast.error(
|
|
432
|
+
getPublicErrorMessage(
|
|
433
|
+
error,
|
|
434
|
+
'Unable to save backup policy. Please try again.',
|
|
435
|
+
),
|
|
436
|
+
...mutationErrorOptions(error),
|
|
437
|
+
)
|
|
438
|
+
} finally {
|
|
439
|
+
setIsSaving(false)
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
async function deletePolicy() {
|
|
444
|
+
if (isSaving) return
|
|
445
|
+
setIsSaving(true)
|
|
446
|
+
|
|
447
|
+
try {
|
|
448
|
+
const nextContext = await deleteProjectBackupPolicyAction({
|
|
449
|
+
data: {
|
|
450
|
+
projectId: context.project.id,
|
|
451
|
+
settingsVersion: deleteSettingsVersion.current!,
|
|
452
|
+
teamSlug,
|
|
453
|
+
projectName,
|
|
454
|
+
policyId: backupIdValue,
|
|
455
|
+
},
|
|
456
|
+
})
|
|
457
|
+
await setProjectContextQueryData(queryClient, nextContext, 'backups')
|
|
458
|
+
setBackupConfigs(nextContext.backupConfigs)
|
|
459
|
+
toast.success('Backup policy deleted.')
|
|
460
|
+
await afterMutation(
|
|
461
|
+
() =>
|
|
462
|
+
router.navigate({
|
|
463
|
+
to: '/$teamSlug/projects/$projectName/backups',
|
|
464
|
+
params: { teamSlug, projectName },
|
|
465
|
+
}),
|
|
466
|
+
'The action completed, but opening the next page failed. Please reload.',
|
|
467
|
+
)
|
|
468
|
+
} finally {
|
|
469
|
+
setIsSaving(false)
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
const latestCompletedRun = context.backupRuns.find(
|
|
474
|
+
(run) =>
|
|
475
|
+
run.configId === backup.id && !['queued', 'running'].includes(run.status),
|
|
476
|
+
)
|
|
477
|
+
|
|
478
|
+
return (
|
|
479
|
+
<div className="space-y-8">
|
|
480
|
+
<ProjectHeading
|
|
481
|
+
teamSlug={teamSlug}
|
|
482
|
+
project={context.project}
|
|
483
|
+
crumbs={[
|
|
484
|
+
<Link
|
|
485
|
+
to="/$teamSlug/projects/$projectName/backups"
|
|
486
|
+
params={{ teamSlug, projectName }}
|
|
487
|
+
className="truncate hover:underline"
|
|
488
|
+
>
|
|
489
|
+
Backups
|
|
490
|
+
</Link>,
|
|
491
|
+
<span className="truncate">{backup.name}</span>,
|
|
492
|
+
]}
|
|
493
|
+
/>
|
|
494
|
+
|
|
495
|
+
{latestCompletedRun?.status === 'failed' ? (
|
|
496
|
+
<Alert variant="destructive">
|
|
497
|
+
<TriangleAlertIcon />
|
|
498
|
+
<AlertDescription>
|
|
499
|
+
{latestCompletedRun.errorMessage ??
|
|
500
|
+
'The latest backup failed. Check the configuration and run this policy again.'}
|
|
501
|
+
{latestCompletedRun.localRecoveryAvailable
|
|
502
|
+
? ' Local backup available for restoration.'
|
|
503
|
+
: ''}
|
|
504
|
+
</AlertDescription>
|
|
505
|
+
</Alert>
|
|
506
|
+
) : null}
|
|
507
|
+
{backup.retention.remote.enabled &&
|
|
508
|
+
!context.backupStorage?.some(
|
|
509
|
+
(item) => item.id === backup.destination.storageId,
|
|
510
|
+
) ? (
|
|
511
|
+
<Alert variant="destructive">
|
|
512
|
+
<TriangleAlertIcon />
|
|
513
|
+
<AlertDescription>
|
|
514
|
+
The storage destination is unavailable. Select another destination
|
|
515
|
+
before running this policy. Backups will not silently fall back to
|
|
516
|
+
local storage.
|
|
517
|
+
</AlertDescription>
|
|
518
|
+
</Alert>
|
|
519
|
+
) : null}
|
|
520
|
+
|
|
521
|
+
<form
|
|
522
|
+
id="backup-policy-form"
|
|
523
|
+
noValidate
|
|
524
|
+
onChangeCapture={() => {
|
|
525
|
+
setSchemaErrors({})
|
|
526
|
+
|
|
527
|
+
setFieldError(null)
|
|
528
|
+
}}
|
|
529
|
+
onSubmit={(event) => {
|
|
530
|
+
event.preventDefault()
|
|
531
|
+
void save()
|
|
532
|
+
}}
|
|
533
|
+
>
|
|
534
|
+
<fieldset disabled={isSaving || !canManage}>
|
|
535
|
+
<SettingsLayout
|
|
536
|
+
navigation={backupDetailSections
|
|
537
|
+
.filter((section) => canManage || section.id !== 'danger')
|
|
538
|
+
.map((section) => ({
|
|
539
|
+
href: `#${section.id}`,
|
|
540
|
+
label: section.label,
|
|
541
|
+
destructive: section.id === 'danger',
|
|
542
|
+
}))}
|
|
543
|
+
>
|
|
544
|
+
<BackupPolicySection
|
|
545
|
+
id="general"
|
|
546
|
+
title="General"
|
|
547
|
+
description="Name, environment, and schedule for this backup policy."
|
|
548
|
+
footer={
|
|
549
|
+
<BackupPolicySaveActions
|
|
550
|
+
canManage={canManage}
|
|
551
|
+
hasChanges={hasChanges}
|
|
552
|
+
isSaving={isSaving}
|
|
553
|
+
onCancel={resetDraft}
|
|
554
|
+
onSave={save}
|
|
555
|
+
form="backup-policy-form"
|
|
556
|
+
/>
|
|
557
|
+
}
|
|
558
|
+
>
|
|
559
|
+
<FieldGroup>
|
|
560
|
+
<Field orientation="horizontal">
|
|
561
|
+
<Switch
|
|
562
|
+
id={`backup-policy-enabled-${backup.id}`}
|
|
563
|
+
checked={enabled}
|
|
564
|
+
onCheckedChange={setEnabled}
|
|
565
|
+
/>
|
|
566
|
+
<FieldLabel htmlFor={`backup-policy-enabled-${backup.id}`}>
|
|
567
|
+
Enabled
|
|
568
|
+
</FieldLabel>
|
|
569
|
+
</Field>
|
|
570
|
+
|
|
571
|
+
<Field
|
|
572
|
+
data-invalid={fieldError?.field === 'name' ? true : undefined}
|
|
573
|
+
>
|
|
574
|
+
<FieldLabel htmlFor={`backup-policy-name-${backup.id}`}>
|
|
575
|
+
Name
|
|
576
|
+
</FieldLabel>
|
|
577
|
+
<Input
|
|
578
|
+
id={`backup-policy-name-${backup.id}`}
|
|
579
|
+
required
|
|
580
|
+
data-validation-field="name"
|
|
581
|
+
aria-describedby={
|
|
582
|
+
schemaErrors['name'] ? 'name-error' : undefined
|
|
583
|
+
}
|
|
584
|
+
maxLength={100}
|
|
585
|
+
aria-invalid={
|
|
586
|
+
Boolean(schemaErrors['name']) ||
|
|
587
|
+
fieldError?.field === 'name'
|
|
588
|
+
}
|
|
589
|
+
value={name}
|
|
590
|
+
onChange={(event) => setName(event.target.value)}
|
|
591
|
+
/>
|
|
592
|
+
<FieldError id="name-error">
|
|
593
|
+
{schemaErrors['name']}
|
|
594
|
+
</FieldError>
|
|
595
|
+
{fieldError?.field === 'name' ? (
|
|
596
|
+
<FieldError>{fieldError.message}</FieldError>
|
|
597
|
+
) : null}
|
|
598
|
+
</Field>
|
|
599
|
+
|
|
600
|
+
<Field
|
|
601
|
+
data-invalid={
|
|
602
|
+
fieldError?.field === 'environment' ? true : undefined
|
|
603
|
+
}
|
|
604
|
+
>
|
|
605
|
+
<FieldLabel>Environment</FieldLabel>
|
|
606
|
+
<Select
|
|
607
|
+
value={environmentId}
|
|
608
|
+
onValueChange={setEnvironmentId}
|
|
609
|
+
>
|
|
610
|
+
<SelectTrigger
|
|
611
|
+
className="w-full"
|
|
612
|
+
aria-invalid={fieldError?.field === 'environment'}
|
|
613
|
+
>
|
|
614
|
+
<SelectValue placeholder="Select environment" />
|
|
615
|
+
</SelectTrigger>
|
|
616
|
+
<SelectContent>
|
|
617
|
+
{context.environments.map((item) => (
|
|
618
|
+
<SelectItem key={item.id} value={item.id}>
|
|
619
|
+
<span className="inline-flex items-center gap-2">
|
|
620
|
+
<EnvironmentDot color={item.color} />
|
|
621
|
+
{item.name}
|
|
622
|
+
</span>
|
|
623
|
+
</SelectItem>
|
|
624
|
+
))}
|
|
625
|
+
</SelectContent>
|
|
626
|
+
</Select>
|
|
627
|
+
{fieldError?.field === 'environment' ? (
|
|
628
|
+
<FieldError>{fieldError.message}</FieldError>
|
|
629
|
+
) : null}
|
|
630
|
+
</Field>
|
|
631
|
+
|
|
632
|
+
<Field
|
|
633
|
+
data-invalid={
|
|
634
|
+
fieldError?.field === 'schedule' ? true : undefined
|
|
635
|
+
}
|
|
636
|
+
>
|
|
637
|
+
<FieldLabel>Schedule</FieldLabel>
|
|
638
|
+
<div className="grid gap-2 sm:grid-cols-2">
|
|
639
|
+
<Select
|
|
640
|
+
value={schedulePresetValue}
|
|
641
|
+
onValueChange={(value) => {
|
|
642
|
+
setSchedulePresetValue(value)
|
|
643
|
+
if (value !== 'custom') {
|
|
644
|
+
setCron(value)
|
|
645
|
+
}
|
|
646
|
+
}}
|
|
647
|
+
>
|
|
648
|
+
<SelectTrigger className="w-full">
|
|
649
|
+
<SelectValue placeholder="Preset" />
|
|
650
|
+
</SelectTrigger>
|
|
651
|
+
<SelectContent>
|
|
652
|
+
{cronPresets.map((preset) => (
|
|
653
|
+
<SelectItem key={preset.value} value={preset.value}>
|
|
654
|
+
{preset.label}
|
|
655
|
+
</SelectItem>
|
|
656
|
+
))}
|
|
657
|
+
<SelectItem value="custom">
|
|
658
|
+
Custom (cron schedule)
|
|
659
|
+
</SelectItem>
|
|
660
|
+
</SelectContent>
|
|
661
|
+
</Select>
|
|
662
|
+
<InputGroup
|
|
663
|
+
className={
|
|
664
|
+
isCustomSchedule
|
|
665
|
+
? undefined
|
|
666
|
+
: 'bg-accent/50 text-muted-foreground'
|
|
667
|
+
}
|
|
668
|
+
>
|
|
669
|
+
<InputGroupInput
|
|
670
|
+
aria-invalid={fieldError?.field === 'schedule'}
|
|
671
|
+
value={cron}
|
|
672
|
+
placeholder="0 2 * * *"
|
|
673
|
+
readOnly={!isCustomSchedule}
|
|
674
|
+
onChange={(event) => setCron(event.target.value)}
|
|
675
|
+
/>
|
|
676
|
+
{isCustomSchedule ? null : (
|
|
677
|
+
<InputGroupAddon align="inline-end">
|
|
678
|
+
<LockIcon />
|
|
679
|
+
</InputGroupAddon>
|
|
680
|
+
)}
|
|
681
|
+
</InputGroup>
|
|
682
|
+
</div>
|
|
683
|
+
<FieldDescription>Backup schedules use UTC.</FieldDescription>
|
|
684
|
+
{fieldError?.field === 'schedule' ? (
|
|
685
|
+
<FieldError>{fieldError.message}</FieldError>
|
|
686
|
+
) : null}
|
|
687
|
+
</Field>
|
|
688
|
+
</FieldGroup>
|
|
689
|
+
</BackupPolicySection>
|
|
690
|
+
|
|
691
|
+
<BackupPolicySection
|
|
692
|
+
id="destination"
|
|
693
|
+
title="Remote backups"
|
|
694
|
+
description="Upload backup artifacts to remote object storage."
|
|
695
|
+
footer={
|
|
696
|
+
<BackupPolicySaveActions
|
|
697
|
+
canManage={canManage}
|
|
698
|
+
hasChanges={hasChanges}
|
|
699
|
+
isSaving={isSaving}
|
|
700
|
+
onCancel={resetDraft}
|
|
701
|
+
onSave={save}
|
|
702
|
+
form="backup-policy-form"
|
|
703
|
+
/>
|
|
704
|
+
}
|
|
705
|
+
>
|
|
706
|
+
<FieldGroup>
|
|
707
|
+
<Field orientation="horizontal" className="justify-start">
|
|
708
|
+
<Switch
|
|
709
|
+
id={`backup-remote-enabled-${backup.id}`}
|
|
710
|
+
checked={remoteRetentionEnabled}
|
|
711
|
+
onCheckedChange={setRemoteRetentionEnabled}
|
|
712
|
+
/>
|
|
713
|
+
<FieldLabel htmlFor={`backup-remote-enabled-${backup.id}`}>
|
|
714
|
+
Enable remote backups
|
|
715
|
+
</FieldLabel>
|
|
716
|
+
</Field>
|
|
717
|
+
<Field>
|
|
718
|
+
<FieldLabel htmlFor={`backup-storage-${backup.id}`}>
|
|
719
|
+
Storage destination
|
|
720
|
+
</FieldLabel>
|
|
721
|
+
<ButtonGroup className="w-full">
|
|
722
|
+
<Select
|
|
723
|
+
value={storageId}
|
|
724
|
+
onValueChange={setStorageId}
|
|
725
|
+
disabled={
|
|
726
|
+
!remoteRetentionEnabled ||
|
|
727
|
+
!context.backupStorage?.length
|
|
728
|
+
}
|
|
729
|
+
>
|
|
730
|
+
<SelectTrigger
|
|
731
|
+
id={`backup-storage-${backup.id}`}
|
|
732
|
+
aria-invalid={fieldError?.field === 'storageId'}
|
|
733
|
+
className="min-w-0 flex-1 w-auto"
|
|
734
|
+
>
|
|
735
|
+
<SelectValue placeholder="Select workspace storage" />
|
|
736
|
+
</SelectTrigger>
|
|
737
|
+
<SelectContent>
|
|
738
|
+
{(context.backupStorage ?? []).map((item) => (
|
|
739
|
+
<SelectItem key={item.id} value={item.id}>
|
|
740
|
+
{item.name} · {item.bucket}
|
|
741
|
+
</SelectItem>
|
|
742
|
+
))}
|
|
743
|
+
</SelectContent>
|
|
744
|
+
</Select>
|
|
745
|
+
{canManage ? (
|
|
746
|
+
<Tooltip>
|
|
747
|
+
<TooltipTrigger asChild>
|
|
748
|
+
<Button
|
|
749
|
+
asChild
|
|
750
|
+
variant="outline"
|
|
751
|
+
size="icon"
|
|
752
|
+
aria-label="Manage backup storage"
|
|
753
|
+
>
|
|
754
|
+
<Link
|
|
755
|
+
to="/$teamSlug/settings"
|
|
756
|
+
params={{ teamSlug }}
|
|
757
|
+
hash="backup-storage"
|
|
758
|
+
>
|
|
759
|
+
<SettingsIcon />
|
|
760
|
+
</Link>
|
|
761
|
+
</Button>
|
|
762
|
+
</TooltipTrigger>
|
|
763
|
+
<TooltipContent>Manage backup storage</TooltipContent>
|
|
764
|
+
</Tooltip>
|
|
765
|
+
) : null}
|
|
766
|
+
</ButtonGroup>
|
|
767
|
+
<FieldDescription>
|
|
768
|
+
Owners and admins manage storage connections in workspace
|
|
769
|
+
settings.
|
|
770
|
+
</FieldDescription>
|
|
771
|
+
<FieldError>
|
|
772
|
+
{fieldError?.field === 'storageId'
|
|
773
|
+
? fieldError.message
|
|
774
|
+
: schemaErrors['destination.storageId']}
|
|
775
|
+
</FieldError>
|
|
776
|
+
</Field>
|
|
777
|
+
</FieldGroup>
|
|
778
|
+
</BackupPolicySection>
|
|
779
|
+
|
|
780
|
+
<BackupPolicySection
|
|
781
|
+
id="retention"
|
|
782
|
+
title="Retention"
|
|
783
|
+
description="Limits retained local and remote backup generations by count, age, and storage."
|
|
784
|
+
footer={
|
|
785
|
+
<BackupPolicySaveActions
|
|
786
|
+
canManage={canManage}
|
|
787
|
+
hasChanges={hasChanges}
|
|
788
|
+
isSaving={isSaving}
|
|
789
|
+
onCancel={resetDraft}
|
|
790
|
+
onSave={save}
|
|
791
|
+
form="backup-policy-form"
|
|
792
|
+
/>
|
|
793
|
+
}
|
|
794
|
+
>
|
|
795
|
+
<div className="grid gap-6">
|
|
796
|
+
<RetentionFieldGroup
|
|
797
|
+
title="Local backups"
|
|
798
|
+
errorPrefix="retention.local"
|
|
799
|
+
errors={schemaErrors}
|
|
800
|
+
description="Applies to backup files kept on the server. A value of 0 disables that local limit."
|
|
801
|
+
count={localRetentionCount}
|
|
802
|
+
days={localRetentionDays}
|
|
803
|
+
maxStorageGb={localRetentionMaxStorageGb}
|
|
804
|
+
fieldError={fieldError?.field === 'retention'}
|
|
805
|
+
onCountChange={setLocalRetentionCount}
|
|
806
|
+
onDaysChange={setLocalRetentionDays}
|
|
807
|
+
onMaxStorageGbChange={setLocalRetentionMaxStorageGb}
|
|
808
|
+
/>
|
|
809
|
+
<RetentionFieldGroup
|
|
810
|
+
title="Remote backups"
|
|
811
|
+
errorPrefix="retention.remote"
|
|
812
|
+
errors={schemaErrors}
|
|
813
|
+
description="Applies to uploaded remote backup objects. A value of 0 disables that remote limit."
|
|
814
|
+
enabled={remoteRetentionEnabled}
|
|
815
|
+
count={remoteRetentionCount}
|
|
816
|
+
days={remoteRetentionDays}
|
|
817
|
+
maxStorageGb={remoteRetentionMaxStorageGb}
|
|
818
|
+
fieldError={fieldError?.field === 'retention'}
|
|
819
|
+
onCountChange={setRemoteRetentionCount}
|
|
820
|
+
onDaysChange={setRemoteRetentionDays}
|
|
821
|
+
onMaxStorageGbChange={setRemoteRetentionMaxStorageGb}
|
|
822
|
+
/>
|
|
823
|
+
{fieldError?.field === 'retention' ? (
|
|
824
|
+
<FieldError>{fieldError.message}</FieldError>
|
|
825
|
+
) : null}
|
|
826
|
+
</div>
|
|
827
|
+
</BackupPolicySection>
|
|
828
|
+
|
|
829
|
+
{(['volumes', 'databases'] as const).map((kind) => (
|
|
830
|
+
<BackupPolicySection
|
|
831
|
+
key={kind}
|
|
832
|
+
id={kind}
|
|
833
|
+
title={kind === 'volumes' ? 'Volumes' : 'Databases'}
|
|
834
|
+
description={
|
|
835
|
+
kind === 'volumes'
|
|
836
|
+
? 'Archive files from named Compose volumes. Use database backups for running databases.'
|
|
837
|
+
: 'Create engine-specific dumps from services. Leave Database blank to include all databases in that service. Credentials come from the service’s database environment variables.'
|
|
838
|
+
}
|
|
839
|
+
footer={
|
|
840
|
+
missingComposeFile ? undefined : (
|
|
841
|
+
<BackupPolicySaveActions
|
|
842
|
+
canManage={canManage}
|
|
843
|
+
hasChanges={hasChanges}
|
|
844
|
+
isSaving={isSaving}
|
|
845
|
+
onCancel={resetDraft}
|
|
846
|
+
onSave={save}
|
|
847
|
+
form="backup-policy-form"
|
|
848
|
+
/>
|
|
849
|
+
)
|
|
850
|
+
}
|
|
851
|
+
>
|
|
852
|
+
{missingComposeFile ? (
|
|
853
|
+
<ComposeRequiredEmpty />
|
|
854
|
+
) : (
|
|
855
|
+
<BackupTargetList
|
|
856
|
+
kind={kind}
|
|
857
|
+
volumes={{ mode: volumeMode, names: volumeNames }}
|
|
858
|
+
dumps={databaseDumps}
|
|
859
|
+
volumeOptions={volumeOptions}
|
|
860
|
+
serviceOptions={databaseServiceOptions}
|
|
861
|
+
onVolumesChange={(value) => {
|
|
862
|
+
setVolumeMode(value.mode)
|
|
863
|
+
setVolumeNames(value.names)
|
|
864
|
+
}}
|
|
865
|
+
onDumpsChange={setDatabaseDumps}
|
|
866
|
+
errors={schemaErrors}
|
|
867
|
+
/>
|
|
868
|
+
)}
|
|
869
|
+
{fieldError?.section === kind ? (
|
|
870
|
+
<FieldError>{fieldError.message}</FieldError>
|
|
871
|
+
) : null}
|
|
872
|
+
</BackupPolicySection>
|
|
873
|
+
))}
|
|
874
|
+
|
|
875
|
+
{canManage ? (
|
|
876
|
+
<BackupPolicySection
|
|
877
|
+
id="danger"
|
|
878
|
+
title="Danger"
|
|
879
|
+
description="Delete this backup policy. Existing backup runs are kept."
|
|
880
|
+
>
|
|
881
|
+
<Button
|
|
882
|
+
type="button"
|
|
883
|
+
variant="destructive"
|
|
884
|
+
onClick={() => {
|
|
885
|
+
deleteSettingsVersion.current =
|
|
886
|
+
currentBackup.settingsVersion
|
|
887
|
+
setDeleteOpen(true)
|
|
888
|
+
}}
|
|
889
|
+
disabled={isSaving}
|
|
890
|
+
>
|
|
891
|
+
<TrashIcon data-icon="inline-start" />
|
|
892
|
+
Delete policy
|
|
893
|
+
</Button>
|
|
894
|
+
<BackupPolicyDeleteDialog
|
|
895
|
+
name={backup.name}
|
|
896
|
+
open={deleteOpen}
|
|
897
|
+
onOpenChange={(open) => {
|
|
898
|
+
if (open)
|
|
899
|
+
deleteSettingsVersion.current =
|
|
900
|
+
currentBackup.settingsVersion
|
|
901
|
+
setDeleteOpen(open)
|
|
902
|
+
}}
|
|
903
|
+
onDelete={deletePolicy}
|
|
904
|
+
/>
|
|
905
|
+
{fieldError?.section === 'danger' ? (
|
|
906
|
+
<FieldError>{fieldError.message}</FieldError>
|
|
907
|
+
) : null}
|
|
908
|
+
</BackupPolicySection>
|
|
909
|
+
) : null}
|
|
910
|
+
</SettingsLayout>
|
|
911
|
+
</fieldset>
|
|
912
|
+
</form>
|
|
913
|
+
</div>
|
|
914
|
+
)
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
function toBackupDraft(backup: ProjectBackupConfig): BackupPolicyDraft {
|
|
918
|
+
return {
|
|
919
|
+
name: backup.name,
|
|
920
|
+
environmentId: backup.environmentId,
|
|
921
|
+
enabled: backup.enabled,
|
|
922
|
+
cron: backup.schedule.cron,
|
|
923
|
+
storageId: backup.destination.storageId ?? '',
|
|
924
|
+
prefix: backup.destination.prefix ?? '',
|
|
925
|
+
localRetentionCount: String(backup.retention.local.count),
|
|
926
|
+
localRetentionDays: String(backup.retention.local.days),
|
|
927
|
+
localRetentionMaxStorageGb: String(backup.retention.local.maxStorageGb),
|
|
928
|
+
remoteRetentionEnabled: backup.retention.remote.enabled,
|
|
929
|
+
remoteRetentionCount: String(backup.retention.remote.count),
|
|
930
|
+
remoteRetentionDays: String(backup.retention.remote.days),
|
|
931
|
+
remoteRetentionMaxStorageGb: String(backup.retention.remote.maxStorageGb),
|
|
932
|
+
volumeMode: backup.volumes.mode,
|
|
933
|
+
volumeNames: backup.volumes.names,
|
|
934
|
+
databaseDumps: backup.databaseDumps,
|
|
935
|
+
}
|
|
936
|
+
}
|