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,663 @@
|
|
|
1
|
+
import type { ServerSummary } from '#devpush/server/teams/types'
|
|
2
|
+
import {
|
|
3
|
+
Alert,
|
|
4
|
+
AlertTitle,
|
|
5
|
+
AlertDescription,
|
|
6
|
+
AlertAction,
|
|
7
|
+
} from '#devpush/components/ui/alert'
|
|
8
|
+
import { ComposeServiceInput } from './compose-service-input'
|
|
9
|
+
import type { ReactNode } from 'react'
|
|
10
|
+
import type { FormErrors } from '#devpush/lib/form-errors'
|
|
11
|
+
import {
|
|
12
|
+
ArrowRightIcon,
|
|
13
|
+
LoaderIcon,
|
|
14
|
+
LockIcon,
|
|
15
|
+
PlusIcon,
|
|
16
|
+
Trash2Icon,
|
|
17
|
+
TriangleAlertIcon,
|
|
18
|
+
} from 'lucide-react'
|
|
19
|
+
|
|
20
|
+
import { Button } from '#devpush/components/ui/button'
|
|
21
|
+
import {
|
|
22
|
+
Empty,
|
|
23
|
+
EmptyContent,
|
|
24
|
+
EmptyDescription,
|
|
25
|
+
EmptyHeader,
|
|
26
|
+
EmptyTitle,
|
|
27
|
+
} from '#devpush/components/ui/empty'
|
|
28
|
+
import { Field, FieldError } from '#devpush/components/ui/field'
|
|
29
|
+
import { Input } from '#devpush/components/ui/input'
|
|
30
|
+
import {
|
|
31
|
+
InputGroup,
|
|
32
|
+
InputGroupInput,
|
|
33
|
+
InputGroupAddon,
|
|
34
|
+
} from '#devpush/components/ui/input-group'
|
|
35
|
+
import {
|
|
36
|
+
Select,
|
|
37
|
+
SelectContent,
|
|
38
|
+
SelectItem,
|
|
39
|
+
SelectTrigger,
|
|
40
|
+
SelectValue,
|
|
41
|
+
} from '#devpush/components/ui/select'
|
|
42
|
+
import { Switch } from '#devpush/components/ui/switch'
|
|
43
|
+
import { EnvironmentDot } from '#devpush/features/projects/environment-dot'
|
|
44
|
+
import type {
|
|
45
|
+
ProjectDomain,
|
|
46
|
+
ProjectEnvironmentConfig,
|
|
47
|
+
ProjectRoute,
|
|
48
|
+
} from '#devpush/server/projects/types'
|
|
49
|
+
import { ProjectSettingsActionTooltip as IconActionTooltip } from './project-settings-section'
|
|
50
|
+
import { getEffectiveProjectRoutes as getEffectiveRouteDefinitions } from './project-settings-utils'
|
|
51
|
+
|
|
52
|
+
export type ProjectRouteDefinition = ProjectRoute
|
|
53
|
+
|
|
54
|
+
export type ProjectDomainAlias = {
|
|
55
|
+
id: string
|
|
56
|
+
host: string
|
|
57
|
+
environment: string
|
|
58
|
+
baseRoute: string
|
|
59
|
+
https: boolean
|
|
60
|
+
status?: ProjectDomain['status']
|
|
61
|
+
message?: string | null
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function RouteSettingsTable({
|
|
65
|
+
services = [],
|
|
66
|
+
routes,
|
|
67
|
+
environments,
|
|
68
|
+
onChange,
|
|
69
|
+
errors = {},
|
|
70
|
+
}: {
|
|
71
|
+
services?: string[]
|
|
72
|
+
routes: Array<ProjectRouteDefinition>
|
|
73
|
+
errors?: FormErrors
|
|
74
|
+
environments: Array<ProjectEnvironmentConfig>
|
|
75
|
+
onChange: (routes: Array<ProjectRouteDefinition>) => void
|
|
76
|
+
}) {
|
|
77
|
+
function updateRoute(index: number, next: Partial<ProjectRouteDefinition>) {
|
|
78
|
+
onChange(
|
|
79
|
+
routes.map((route, routeIndex) =>
|
|
80
|
+
routeIndex === index ? { ...route, ...next } : route,
|
|
81
|
+
),
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function addRoute() {
|
|
86
|
+
onChange([
|
|
87
|
+
...routes,
|
|
88
|
+
{
|
|
89
|
+
path: '/',
|
|
90
|
+
service: '',
|
|
91
|
+
port: 80,
|
|
92
|
+
stripPrefix: false,
|
|
93
|
+
},
|
|
94
|
+
])
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function removeRoute(index: number) {
|
|
98
|
+
onChange(routes.filter((_, routeIndex) => routeIndex !== index))
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<div className="space-y-4">
|
|
103
|
+
{routes.length > 0 ? (
|
|
104
|
+
<>
|
|
105
|
+
<div>
|
|
106
|
+
<div className="grid w-full grid-cols-[minmax(8rem,0.8fr)_minmax(0,1.1fr)_1rem_minmax(0,1.1fr)_minmax(5.5rem,0.4fr)_3.5rem_2.5rem] gap-x-2 border-b pb-2 text-sm font-medium">
|
|
107
|
+
<div>Scope</div>
|
|
108
|
+
<div>Path</div>
|
|
109
|
+
<div />
|
|
110
|
+
<div>Service</div>
|
|
111
|
+
<div>Port</div>
|
|
112
|
+
<div>Strip</div>
|
|
113
|
+
<div />
|
|
114
|
+
</div>
|
|
115
|
+
{routes.map((route, index) => (
|
|
116
|
+
<div
|
|
117
|
+
className="grid w-full grid-cols-[minmax(8rem,0.8fr)_minmax(0,1.1fr)_1rem_minmax(0,1.1fr)_minmax(5.5rem,0.4fr)_3.5rem_2.5rem] items-start gap-x-2 border-b py-2"
|
|
118
|
+
key={index}
|
|
119
|
+
>
|
|
120
|
+
<RoutingField
|
|
121
|
+
name={`routes.${index}.environmentId`}
|
|
122
|
+
errors={errors}
|
|
123
|
+
>
|
|
124
|
+
<Select
|
|
125
|
+
value={route.environmentId ?? '__all__'}
|
|
126
|
+
onValueChange={(value) =>
|
|
127
|
+
updateRoute(index, {
|
|
128
|
+
environmentId: value === '__all__' ? undefined : value,
|
|
129
|
+
})
|
|
130
|
+
}
|
|
131
|
+
>
|
|
132
|
+
<SelectTrigger
|
|
133
|
+
{...routingFieldProps(
|
|
134
|
+
`routes.${index}.environmentId`,
|
|
135
|
+
errors,
|
|
136
|
+
)}
|
|
137
|
+
aria-label="Route scope"
|
|
138
|
+
className="w-full"
|
|
139
|
+
>
|
|
140
|
+
<SelectValue />
|
|
141
|
+
</SelectTrigger>
|
|
142
|
+
<SelectContent>
|
|
143
|
+
<SelectItem value="__all__">All environments</SelectItem>
|
|
144
|
+
{environments.map((optionEnvironment) => (
|
|
145
|
+
<SelectItem
|
|
146
|
+
key={optionEnvironment.id}
|
|
147
|
+
value={optionEnvironment.id}
|
|
148
|
+
>
|
|
149
|
+
<EnvironmentOptionLabel
|
|
150
|
+
color={optionEnvironment.color}
|
|
151
|
+
label={optionEnvironment.name}
|
|
152
|
+
/>
|
|
153
|
+
</SelectItem>
|
|
154
|
+
))}
|
|
155
|
+
</SelectContent>
|
|
156
|
+
</Select>
|
|
157
|
+
</RoutingField>
|
|
158
|
+
<RoutingField name={`routes.${index}.path`} errors={errors}>
|
|
159
|
+
<Input
|
|
160
|
+
{...routingFieldProps(`routes.${index}.path`, errors)}
|
|
161
|
+
aria-label="Route path"
|
|
162
|
+
required
|
|
163
|
+
value={route.path}
|
|
164
|
+
onChange={(event) =>
|
|
165
|
+
updateRoute(index, { path: event.target.value })
|
|
166
|
+
}
|
|
167
|
+
placeholder="/"
|
|
168
|
+
/>
|
|
169
|
+
</RoutingField>
|
|
170
|
+
<ArrowRightIcon className="mx-auto mt-2 size-4 shrink-0 text-muted-foreground" />
|
|
171
|
+
<RoutingField name={`routes.${index}.service`} errors={errors}>
|
|
172
|
+
<ComposeServiceInput
|
|
173
|
+
{...routingFieldProps(`routes.${index}.service`, errors)}
|
|
174
|
+
services={services}
|
|
175
|
+
aria-label="Route service"
|
|
176
|
+
required
|
|
177
|
+
value={route.service}
|
|
178
|
+
onValueChange={(service) => updateRoute(index, { service })}
|
|
179
|
+
placeholder="web"
|
|
180
|
+
/>
|
|
181
|
+
</RoutingField>
|
|
182
|
+
<RoutingField name={`routes.${index}.port`} errors={errors}>
|
|
183
|
+
<Input
|
|
184
|
+
{...routingFieldProps(`routes.${index}.port`, errors)}
|
|
185
|
+
aria-label="Route port"
|
|
186
|
+
required
|
|
187
|
+
step={1}
|
|
188
|
+
type="number"
|
|
189
|
+
min={1}
|
|
190
|
+
max={65535}
|
|
191
|
+
value={route.port}
|
|
192
|
+
onChange={(event) =>
|
|
193
|
+
updateRoute(index, { port: Number(event.target.value) })
|
|
194
|
+
}
|
|
195
|
+
placeholder="3000"
|
|
196
|
+
/>
|
|
197
|
+
</RoutingField>
|
|
198
|
+
<div className="flex h-8 items-center gap-2">
|
|
199
|
+
<Switch
|
|
200
|
+
aria-label="Strip route prefix"
|
|
201
|
+
checked={route.stripPrefix}
|
|
202
|
+
onCheckedChange={(checked) =>
|
|
203
|
+
updateRoute(index, { stripPrefix: checked })
|
|
204
|
+
}
|
|
205
|
+
/>
|
|
206
|
+
</div>
|
|
207
|
+
<div className="-mr-2 flex justify-end">
|
|
208
|
+
<IconActionTooltip label="Remove route">
|
|
209
|
+
<Button
|
|
210
|
+
variant="destructive"
|
|
211
|
+
size="icon"
|
|
212
|
+
type="button"
|
|
213
|
+
aria-label="Remove route"
|
|
214
|
+
onClick={() => removeRoute(index)}
|
|
215
|
+
>
|
|
216
|
+
<Trash2Icon />
|
|
217
|
+
</Button>
|
|
218
|
+
</IconActionTooltip>
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
))}
|
|
222
|
+
</div>
|
|
223
|
+
<Button variant="outline" type="button" onClick={addRoute}>
|
|
224
|
+
<PlusIcon data-icon="inline-start" />
|
|
225
|
+
Add route
|
|
226
|
+
</Button>
|
|
227
|
+
</>
|
|
228
|
+
) : (
|
|
229
|
+
<Empty className="min-h-40">
|
|
230
|
+
<EmptyHeader>
|
|
231
|
+
<EmptyTitle>No routes configured.</EmptyTitle>
|
|
232
|
+
<EmptyDescription>
|
|
233
|
+
Services remain private until you add a public route.
|
|
234
|
+
</EmptyDescription>
|
|
235
|
+
</EmptyHeader>
|
|
236
|
+
<EmptyContent>
|
|
237
|
+
<Button variant="outline" type="button" onClick={addRoute}>
|
|
238
|
+
<PlusIcon data-icon="inline-start" />
|
|
239
|
+
Add route
|
|
240
|
+
</Button>
|
|
241
|
+
</EmptyContent>
|
|
242
|
+
</Empty>
|
|
243
|
+
)}
|
|
244
|
+
</div>
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export function ManagedIngressWarnings({
|
|
249
|
+
warnings,
|
|
250
|
+
}: {
|
|
251
|
+
warnings: Array<string>
|
|
252
|
+
}) {
|
|
253
|
+
if (warnings.length === 0) {
|
|
254
|
+
return null
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return (
|
|
258
|
+
<details className="rounded-lg border bg-muted/30 px-3 py-2 text-sm">
|
|
259
|
+
<summary className="cursor-pointer select-none font-medium">
|
|
260
|
+
{warnings.length} Compose{' '}
|
|
261
|
+
{warnings.length === 1 ? 'adjustment' : 'adjustments'}
|
|
262
|
+
</summary>
|
|
263
|
+
<ul className="mt-2 list-disc space-y-1 pl-5 text-muted-foreground">
|
|
264
|
+
{warnings.map((warning) => (
|
|
265
|
+
<li key={warning}>{warning}</li>
|
|
266
|
+
))}
|
|
267
|
+
</ul>
|
|
268
|
+
</details>
|
|
269
|
+
)
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export function EnvironmentOptionLabel({
|
|
273
|
+
color,
|
|
274
|
+
label,
|
|
275
|
+
}: {
|
|
276
|
+
color?: string
|
|
277
|
+
label: string
|
|
278
|
+
}) {
|
|
279
|
+
return (
|
|
280
|
+
<span className="flex min-w-0 items-center gap-x-2">
|
|
281
|
+
{color ? <EnvironmentDot color={color} /> : null}
|
|
282
|
+
<span className="truncate">{label}</span>
|
|
283
|
+
</span>
|
|
284
|
+
)
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export function DomainSettingsTable({
|
|
288
|
+
servers = [],
|
|
289
|
+
domains,
|
|
290
|
+
environments,
|
|
291
|
+
routes,
|
|
292
|
+
onChange,
|
|
293
|
+
onVerify,
|
|
294
|
+
verifyingDomainId,
|
|
295
|
+
verificationDisabled,
|
|
296
|
+
errors = {},
|
|
297
|
+
}: {
|
|
298
|
+
servers?: Pick<
|
|
299
|
+
ServerSummary,
|
|
300
|
+
'id' | 'name' | 'publicAddress' | 'publicIpv4' | 'publicIpv6'
|
|
301
|
+
>[]
|
|
302
|
+
domains: Array<ProjectDomainAlias>
|
|
303
|
+
errors?: FormErrors
|
|
304
|
+
environments: Array<ProjectEnvironmentConfig>
|
|
305
|
+
routes: Array<ProjectRouteDefinition>
|
|
306
|
+
onChange: (domains: Array<ProjectDomainAlias>) => void
|
|
307
|
+
onVerify: (domainId: string) => Promise<void>
|
|
308
|
+
verifyingDomainId: string | null
|
|
309
|
+
verificationDisabled: boolean
|
|
310
|
+
}) {
|
|
311
|
+
function updateDomain(id: string, next: Partial<ProjectDomainAlias>) {
|
|
312
|
+
onChange(
|
|
313
|
+
domains.map((domain) =>
|
|
314
|
+
domain.id === id ? { ...domain, ...next } : domain,
|
|
315
|
+
),
|
|
316
|
+
)
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
function addDomain() {
|
|
320
|
+
onChange([
|
|
321
|
+
...domains,
|
|
322
|
+
{
|
|
323
|
+
id: crypto.randomUUID(),
|
|
324
|
+
host: '',
|
|
325
|
+
environment: environments.at(0)?.id ?? 'production',
|
|
326
|
+
baseRoute: '',
|
|
327
|
+
https: true,
|
|
328
|
+
status: undefined,
|
|
329
|
+
message: null,
|
|
330
|
+
},
|
|
331
|
+
])
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function removeDomain(id: string) {
|
|
335
|
+
onChange(domains.filter((domain) => domain.id !== id))
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
return (
|
|
339
|
+
<div className="space-y-4">
|
|
340
|
+
{domains.length > 0 ? (
|
|
341
|
+
<>
|
|
342
|
+
<div>
|
|
343
|
+
<div className="grid w-full grid-cols-[minmax(0,1.4fr)_minmax(0,1.05fr)_minmax(0,1.05fr)_3.5rem_2.5rem] gap-x-2 border-b pb-2 text-sm font-medium">
|
|
344
|
+
<div>Host</div>
|
|
345
|
+
<div>Environment</div>
|
|
346
|
+
<div>Base route</div>
|
|
347
|
+
<div>HTTPS</div>
|
|
348
|
+
<div />
|
|
349
|
+
</div>
|
|
350
|
+
{domains.map((domain, index) => {
|
|
351
|
+
const environment = environments.find(
|
|
352
|
+
(item) => item.id === domain.environment,
|
|
353
|
+
)
|
|
354
|
+
const server = servers.find(
|
|
355
|
+
(item) => item.id === environment?.effectiveServerId,
|
|
356
|
+
)
|
|
357
|
+
const address = server?.publicAddress
|
|
358
|
+
const addresses = [
|
|
359
|
+
...new Set(
|
|
360
|
+
[server?.publicIpv4, server?.publicIpv6, address].filter(
|
|
361
|
+
(value): value is string => Boolean(value),
|
|
362
|
+
),
|
|
363
|
+
),
|
|
364
|
+
]
|
|
365
|
+
|
|
366
|
+
const rowErrors: FormErrors = { ...errors }
|
|
367
|
+
const hostError =
|
|
368
|
+
errors[`verification.${domain.id}`] ??
|
|
369
|
+
(domain.status === 'failed' ? domain.message : null)
|
|
370
|
+
|
|
371
|
+
return (
|
|
372
|
+
<div
|
|
373
|
+
className="grid w-full grid-cols-[minmax(0,1.4fr)_minmax(0,1.05fr)_minmax(0,1.05fr)_3.5rem_2.5rem] items-start gap-x-2 border-b py-2"
|
|
374
|
+
key={domain.id}
|
|
375
|
+
>
|
|
376
|
+
<RoutingField
|
|
377
|
+
name={`domains.${index}.host`}
|
|
378
|
+
errors={rowErrors}
|
|
379
|
+
>
|
|
380
|
+
<InputGroup
|
|
381
|
+
className={
|
|
382
|
+
domain.status !== undefined ? 'bg-accent/50' : undefined
|
|
383
|
+
}
|
|
384
|
+
>
|
|
385
|
+
<InputGroupInput
|
|
386
|
+
{...routingFieldProps(
|
|
387
|
+
`domains.${index}.host`,
|
|
388
|
+
rowErrors,
|
|
389
|
+
)}
|
|
390
|
+
aria-label="Domain host"
|
|
391
|
+
required
|
|
392
|
+
maxLength={253}
|
|
393
|
+
value={domain.host}
|
|
394
|
+
readOnly={domain.status !== undefined}
|
|
395
|
+
onChange={(event) => {
|
|
396
|
+
if (domain.status !== undefined) return
|
|
397
|
+
updateDomain(domain.id, {
|
|
398
|
+
host: event.target.value,
|
|
399
|
+
status: undefined,
|
|
400
|
+
message: null,
|
|
401
|
+
})
|
|
402
|
+
}}
|
|
403
|
+
placeholder="myapp.com"
|
|
404
|
+
/>
|
|
405
|
+
{domain.status !== undefined ? (
|
|
406
|
+
<InputGroupAddon align="inline-end">
|
|
407
|
+
<IconActionTooltip label="Add and verify a new host before removing this one.">
|
|
408
|
+
<span>
|
|
409
|
+
<LockIcon className="size-4 shrink-0" />
|
|
410
|
+
</span>
|
|
411
|
+
</IconActionTooltip>
|
|
412
|
+
</InputGroupAddon>
|
|
413
|
+
) : null}
|
|
414
|
+
</InputGroup>
|
|
415
|
+
</RoutingField>
|
|
416
|
+
<RoutingField
|
|
417
|
+
name={`domains.${index}.environmentId`}
|
|
418
|
+
errors={rowErrors}
|
|
419
|
+
>
|
|
420
|
+
<Select
|
|
421
|
+
value={domain.environment}
|
|
422
|
+
onValueChange={(value) =>
|
|
423
|
+
updateDomain(domain.id, { environment: value })
|
|
424
|
+
}
|
|
425
|
+
>
|
|
426
|
+
<SelectTrigger
|
|
427
|
+
{...routingFieldProps(
|
|
428
|
+
`domains.${index}.environmentId`,
|
|
429
|
+
errors,
|
|
430
|
+
)}
|
|
431
|
+
aria-label="Domain environment"
|
|
432
|
+
className="w-full"
|
|
433
|
+
>
|
|
434
|
+
<SelectValue />
|
|
435
|
+
</SelectTrigger>
|
|
436
|
+
<SelectContent>
|
|
437
|
+
{environments.map((optionEnvironment) => (
|
|
438
|
+
<SelectItem
|
|
439
|
+
key={optionEnvironment.id}
|
|
440
|
+
value={optionEnvironment.id}
|
|
441
|
+
>
|
|
442
|
+
<EnvironmentOptionLabel
|
|
443
|
+
color={optionEnvironment.color}
|
|
444
|
+
label={optionEnvironment.name}
|
|
445
|
+
/>
|
|
446
|
+
</SelectItem>
|
|
447
|
+
))}
|
|
448
|
+
</SelectContent>
|
|
449
|
+
</Select>
|
|
450
|
+
</RoutingField>
|
|
451
|
+
<RoutingField
|
|
452
|
+
name={`domains.${index}.basePath`}
|
|
453
|
+
errors={rowErrors}
|
|
454
|
+
>
|
|
455
|
+
<Select
|
|
456
|
+
value={domain.baseRoute || 'all'}
|
|
457
|
+
onValueChange={(value) =>
|
|
458
|
+
updateDomain(domain.id, {
|
|
459
|
+
baseRoute: value === 'all' ? '' : value,
|
|
460
|
+
})
|
|
461
|
+
}
|
|
462
|
+
>
|
|
463
|
+
<SelectTrigger
|
|
464
|
+
{...routingFieldProps(
|
|
465
|
+
`domains.${index}.basePath`,
|
|
466
|
+
errors,
|
|
467
|
+
)}
|
|
468
|
+
aria-label="Domain base route"
|
|
469
|
+
className="w-full"
|
|
470
|
+
>
|
|
471
|
+
<SelectValue />
|
|
472
|
+
</SelectTrigger>
|
|
473
|
+
<SelectContent>
|
|
474
|
+
<SelectItem value="all">All routes</SelectItem>
|
|
475
|
+
{getEffectiveRouteDefinitions(
|
|
476
|
+
routes,
|
|
477
|
+
domain.environment,
|
|
478
|
+
).map((route) => (
|
|
479
|
+
<SelectItem value={route.path} key={route.path}>
|
|
480
|
+
{route.path}
|
|
481
|
+
</SelectItem>
|
|
482
|
+
))}
|
|
483
|
+
</SelectContent>
|
|
484
|
+
</Select>
|
|
485
|
+
</RoutingField>
|
|
486
|
+
<div className="flex h-8 items-center justify-center">
|
|
487
|
+
<Switch
|
|
488
|
+
aria-label="HTTPS"
|
|
489
|
+
checked={domain.https}
|
|
490
|
+
onCheckedChange={(checked) =>
|
|
491
|
+
updateDomain(domain.id, { https: checked })
|
|
492
|
+
}
|
|
493
|
+
/>
|
|
494
|
+
</div>
|
|
495
|
+
<div className="-mr-2 flex justify-end">
|
|
496
|
+
<IconActionTooltip label="Remove domain">
|
|
497
|
+
<Button
|
|
498
|
+
variant="destructive"
|
|
499
|
+
size="icon"
|
|
500
|
+
type="button"
|
|
501
|
+
aria-label="Remove domain"
|
|
502
|
+
onClick={() => removeDomain(domain.id)}
|
|
503
|
+
>
|
|
504
|
+
<Trash2Icon />
|
|
505
|
+
</Button>
|
|
506
|
+
</IconActionTooltip>
|
|
507
|
+
</div>
|
|
508
|
+
{hostError ||
|
|
509
|
+
domain.status === 'pending' ||
|
|
510
|
+
domain.status === 'failed' ||
|
|
511
|
+
domain.status === 'disabled' ? (
|
|
512
|
+
<Alert variant="warning" className="col-span-full mt-2">
|
|
513
|
+
<TriangleAlertIcon />
|
|
514
|
+
<AlertTitle>
|
|
515
|
+
{domain.status === 'disabled'
|
|
516
|
+
? `${domain.host} is disabled.`
|
|
517
|
+
: hostError || domain.status === 'failed'
|
|
518
|
+
? `${domain.host} is not configured correctly.`
|
|
519
|
+
: `${domain.host} is not yet verified.`}
|
|
520
|
+
</AlertTitle>
|
|
521
|
+
<AlertDescription className="[&_p:not(:last-child)]:mb-0">
|
|
522
|
+
<div className="flex flex-col gap-4">
|
|
523
|
+
{domain.status === 'disabled' ? (
|
|
524
|
+
<p>
|
|
525
|
+
Select an active environment and save the domain
|
|
526
|
+
before verifying.
|
|
527
|
+
</p>
|
|
528
|
+
) : address ? (
|
|
529
|
+
<>
|
|
530
|
+
<p>
|
|
531
|
+
Add one or both of the following DNS records at
|
|
532
|
+
your domain provider pointing to {server.name},
|
|
533
|
+
the server assigned to {environment?.name}.
|
|
534
|
+
Disable CDN/proxy mode while verifying this
|
|
535
|
+
domain. After changing the records, click Verify
|
|
536
|
+
to check status.
|
|
537
|
+
</p>
|
|
538
|
+
<div className="scrollbar overflow-x-auto rounded-md border">
|
|
539
|
+
<table className="w-full text-left text-sm">
|
|
540
|
+
<thead className="text-muted-foreground">
|
|
541
|
+
<tr>
|
|
542
|
+
<th className="px-3 py-2 font-medium first:pl-4 last:pr-4">
|
|
543
|
+
Type
|
|
544
|
+
</th>
|
|
545
|
+
<th className="px-3 py-2 font-medium first:pl-4 last:pr-4">
|
|
546
|
+
Name
|
|
547
|
+
</th>
|
|
548
|
+
<th className="px-3 py-2 font-medium first:pl-4 last:pr-4">
|
|
549
|
+
Value
|
|
550
|
+
</th>
|
|
551
|
+
</tr>
|
|
552
|
+
</thead>
|
|
553
|
+
<tbody className="font-mono text-xs">
|
|
554
|
+
{addresses.map((dnsAddress) => (
|
|
555
|
+
<tr key={dnsAddress} className="border-t">
|
|
556
|
+
<td className="px-3 py-2 first:pl-4 last:pr-4">
|
|
557
|
+
{dnsAddress.includes(':')
|
|
558
|
+
? 'AAAA'
|
|
559
|
+
: 'A'}
|
|
560
|
+
</td>
|
|
561
|
+
<td className="px-3 py-2 first:pl-4 last:pr-4">
|
|
562
|
+
{domain.host}
|
|
563
|
+
</td>
|
|
564
|
+
<td className="px-3 py-2 first:pl-4 last:pr-4">
|
|
565
|
+
{dnsAddress}
|
|
566
|
+
</td>
|
|
567
|
+
</tr>
|
|
568
|
+
))}
|
|
569
|
+
</tbody>
|
|
570
|
+
</table>
|
|
571
|
+
</div>
|
|
572
|
+
</>
|
|
573
|
+
) : (
|
|
574
|
+
<p>
|
|
575
|
+
{server
|
|
576
|
+
? 'The assigned server has no public IP address. Configure its public address before verifying.'
|
|
577
|
+
: 'Assign a server to this environment before configuring its DNS records.'}
|
|
578
|
+
</p>
|
|
579
|
+
)}
|
|
580
|
+
{hostError ? (
|
|
581
|
+
<p className="text-muted-foreground">
|
|
582
|
+
Error details: {hostError}
|
|
583
|
+
</p>
|
|
584
|
+
) : null}
|
|
585
|
+
</div>
|
|
586
|
+
</AlertDescription>
|
|
587
|
+
<AlertAction>
|
|
588
|
+
<Button
|
|
589
|
+
variant="default"
|
|
590
|
+
size="xs"
|
|
591
|
+
type="button"
|
|
592
|
+
disabled={
|
|
593
|
+
verificationDisabled ||
|
|
594
|
+
!domain.status ||
|
|
595
|
+
verifyingDomainId !== null
|
|
596
|
+
}
|
|
597
|
+
aria-label={`Verify ${domain.host || 'domain'}`}
|
|
598
|
+
onClick={() => void onVerify(domain.id)}
|
|
599
|
+
>
|
|
600
|
+
{verifyingDomainId === domain.id ? (
|
|
601
|
+
<LoaderIcon
|
|
602
|
+
data-icon="inline-start"
|
|
603
|
+
className="animate-spin"
|
|
604
|
+
/>
|
|
605
|
+
) : null}
|
|
606
|
+
Verify
|
|
607
|
+
</Button>
|
|
608
|
+
</AlertAction>
|
|
609
|
+
</Alert>
|
|
610
|
+
) : null}
|
|
611
|
+
</div>
|
|
612
|
+
)
|
|
613
|
+
})}
|
|
614
|
+
</div>
|
|
615
|
+
<Button variant="outline" type="button" onClick={addDomain}>
|
|
616
|
+
<PlusIcon data-icon="inline-start" />
|
|
617
|
+
Add domain
|
|
618
|
+
</Button>
|
|
619
|
+
</>
|
|
620
|
+
) : (
|
|
621
|
+
<Empty className="min-h-40">
|
|
622
|
+
<EmptyHeader>
|
|
623
|
+
<EmptyTitle>No custom domains.</EmptyTitle>
|
|
624
|
+
<EmptyDescription>
|
|
625
|
+
Add a domain and map it to an environment route.
|
|
626
|
+
</EmptyDescription>
|
|
627
|
+
</EmptyHeader>
|
|
628
|
+
<EmptyContent>
|
|
629
|
+
<Button variant="outline" type="button" onClick={addDomain}>
|
|
630
|
+
<PlusIcon data-icon="inline-start" />
|
|
631
|
+
Add domain
|
|
632
|
+
</Button>
|
|
633
|
+
</EmptyContent>
|
|
634
|
+
</Empty>
|
|
635
|
+
)}
|
|
636
|
+
</div>
|
|
637
|
+
)
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
function routingFieldProps(name: string, errors: FormErrors) {
|
|
641
|
+
return {
|
|
642
|
+
id: name,
|
|
643
|
+
'aria-invalid': Boolean(errors[name]),
|
|
644
|
+
'aria-describedby': errors[name] ? `${name}-error` : undefined,
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
function RoutingField({
|
|
649
|
+
name,
|
|
650
|
+
errors,
|
|
651
|
+
children,
|
|
652
|
+
}: {
|
|
653
|
+
name: string
|
|
654
|
+
errors: FormErrors
|
|
655
|
+
children: ReactNode
|
|
656
|
+
}) {
|
|
657
|
+
return (
|
|
658
|
+
<Field className="gap-1" data-invalid={Boolean(errors[name])}>
|
|
659
|
+
{children}
|
|
660
|
+
<FieldError id={`${name}-error`}>{errors[name]}</FieldError>
|
|
661
|
+
</Field>
|
|
662
|
+
)
|
|
663
|
+
}
|