Commit Graph

137 Commits

Author SHA1 Message Date
keyhan abbe821d91 Improve delete UX and prepaid credit time display.
Show minutes and local expiry for resource credits; add shared delete hook with row/card loading overlays, detail-page deleting modal, and disabled controls to prevent double-delete.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-24 00:33:16 +03:30
keyhan 695e05f948 Add managed databases and services with billing-aligned upgrades.
Introduce product types for managed PostgreSQL, Redis, and RabbitMQ with a dedicated dashboard, Helm-only deploy pipeline, external access, snapshots with progress, and prorated resource or storage upgrades matching application billing rules. PVCs use an expandable StorageClass with automatic migration when legacy disks cannot resize in place.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-23 19:00:09 +03:30
keyhan 736509708b Add persistent deployment progress bar with minimize support.
Deployments can continue in the background via a dashboard progress bar; tables use truncation and admin migration status for cleaner layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 22:41:31 +03:30
keyhan 18c6abd0e8 Add service credential visibility.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 00:35:01 +03:30
keyhan 41a276d16d Add application migration workflow.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 00:31:29 +03:30
keyhan fda8384a5c Improve cluster allocation strategy.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 23:18:50 +03:30
keyhan 72a1519ea0 Add automatic cluster pool allocation.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 23:08:06 +03:30
keyhan 97e4c865b6 Require paid access before redeploy.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 22:37:13 +03:30
keyhan e4fe8f63cb Hide stop action for failed apps.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 22:31:21 +03:30
keyhan 68d1ccb196 Track cancelled deployments separately.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 22:15:43 +03:30
keyhan d5e6ab0f68 Add invoice PDF download and unified payment.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 22:01:44 +03:30
keyhan 8b197e69bc Add invoice payment management.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 21:34:47 +03:30
keyhan 880521c576 Wait for all app workloads before marking deployments running.
Deployment success now reflects readiness across the application, database, and enabled add-on workloads so scheduling or resource failures do not appear as a running app.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 19:46:20 +03:30
keyhan a7293973d5 Add staff password reset, raise code upload limit, and guard restore sizing.
Admins and technical staff can reset passwords via PATCH /users/:id/password with scoped permissions for technical users; deploy/source uploads allow up to 10GiB and block deploy when allocated storage is smaller than uploaded archive or DB dump, with an inline error modal.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-16 01:03:07 +03:30
keyhan 67b41ae311 Align admin optional-services billing UI with runtimes and bill RAM proportionally.
Split optional pricing vs deploy defaults and move custom domain to its own card; parse Mi as decimal GB so fractional memory scales linearly with per-GB rates. Deploy wizard hides env and optional services for WordPress and sanitizes create payloads.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-16 00:39:37 +03:30
keyhan 3a4fffcec4 Reorder deploy wizard: env vars on step 1, app storage on step 3.
Move Environment Variables to Basic Info and Application Data Storage to Resources so users configure them earlier and later in the flow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 19:30:30 +03:30
keyhan 055e7a7c8d Add optional service pricing matrix and fix admin catalog save.
Users pick per-service CPU/memory/storage at deploy; admins manage unit rates and deploy defaults. PATCH sends only fields accepted by the pricing-catalog DTO.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 19:16:20 +03:30
keyhan bb27c90ae4 Make billing catalog dynamic for all runtimes and bill optional service resources.
Derive admin tabs and addon rows from enums, and add Redis/RabbitMQ/ES CPU/RAM/disk to deploy cost using the app runtime unit rates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 18:22:35 +03:30
keyhan 35235fe0fc Replace billing plans with per-runtime usage pricing catalog.
Store explicit hourly/monthly/yearly rates in pricing_rates and addon_rates, compute deploy costs without cycle conversion, and simplify admin UI and wallet payment to cycle-only.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 18:10:54 +03:30
keyhan 5239e8aa94 Add prepaid resource credits with prorated deploy billing.
When users delete an app before plan expiry, remaining resources become credits for a new deploy. The deploy calculator shows covered vs additional charges, prices optional services correctly, and prorates extras to days left on the credit.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 17:37:44 +03:30
keyhan 35dd771f63 Add unified logs platform with Helm-managed central Elasticsearch.
Deploy cloudhost-logging on cluster registration, ship app and optional service logs to ES with owner isolation, and fix Kibana 8.12 auth via kibana_system.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 15:56:33 +03:30
keyhan 2303985d0c Add time-limited external access for optional services and database.
Users can open temporary NodePort access with auto-revoke via Bull jobs and a dashboard UI to manage active grants.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 13:58:08 +03:30
keyhan c7981074d4 fix(ui): keep resource scaling form values while user is editing
Skip syncing form state from the 5s resources poll when the form is
dirty, and reset dirty only after apply or workload tab change.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 01:11:10 +03:30
keyhan 7c7e8ae254 fix(deploy): persist replica snapshot before stop for restore on start
Read live deployment replica counts from K8s before scaling to zero,
store them on the application as suspendedReplicas, and use that snapshot
when resuming so Start restores the pre-stop replica layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 01:03:52 +03:30
keyhan 195b3f5bab fix(deploy): stop scales all app workloads and sets status stopped
Use suspendApplication on stop so app, database, Redis, and RabbitMQ
deployments scale to zero. Start uses resumeApplication to bring the
full stack back. Deployment status is updated to stopped/running.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 00:57:31 +03:30
keyhan abd8848180 feat(laravel): auto-set APP_URL from platform or custom domain
Inject APP_URL for Laravel/PHP apps when missing: on create from the
platform subdomain, on custom-domain verification from the verified host,
and at deploy time as a safety net. Never overwrites user-provided values.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 00:51:09 +03:30
keyhan b6c8996a2c fix(laravel): align Composer build stage with app PHP version
Use php-cli matching phpVersion instead of composer:2 (PHP 8.5), skip
artisan during dump-autoload, and fail loudly on composer install instead
of swallowing lock-file/platform errors with || true.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 00:35:57 +03:30
keyhan 5fd4069821 fix(laravel): apply runtime DB config and startup entrypoint
Laravel images no longer bake config:cache at build time, which ignored
K8s DB env vars. Add DB_CONNECTION, clear config on boot, generate APP_KEY
when missing, run migrations, and rebuild caches at container start.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 00:30:17 +03:30
keyhan cca6cdc1a5 Improve Laravel deploy support and add .env import to deploy wizard.
Set Laravel DB env vars in Helm and Kubernetes, fix default port to 80 with a storage-aware entrypoint, and let users upload a .env file during deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 18:49:40 +03:30
keyhan b24d1505b6 feat: per-workload resources, storage GiB metrics, optional service disks
- Expose DB/Redis/RabbitMQ usage plus sidecars in getResourceUsage
- Storage API: GiB fields, Redis/Rabbit PVC usage, fix du/exec container names
- PATCH /resources accepts workload; persist entity fields only for app
- App detail: workload cards, disk bars, DB expand, scale target select

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 16:28:01 +03:30
keyhan 0c0a6cd5be fix: reliable source upload, build cancel, WordPress port 80 default
- Replace port-forward/netcat PVC upload with kubectl cp for integrity
- Add build cancellation API and session cleanup; deploy catches cancel
- Default port 80 for WordPress, PHP, and Laravel on create
- Build progress modal with cancel; Helm/K8s adjustments for deployments
- Update build and kubernetes specs

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 16:03:45 +03:30
keyhan 3d56a2cc5d feat(logging): add logs dashboard page
Add dashboard UI to browse application logs with filters for app,
level, time range, and full-text search.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 12:42:00 +03:30
keyhan 393be5d32f feat(logging): add Elasticsearch admin and user logs API
Add admin endpoints for stack deploy/status and user-facing logs
query API. Register controllers and service in KubernetesModule.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 12:41:58 +03:30
keyhan 5ab7a6081e feat(logging): add ElasticsearchService for cluster deployment
Deploy and manage central Elasticsearch + Kibana via K8s API, with
health checks, credentials, and per-user log query helpers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 12:41:56 +03:30
keyhan e7b5284dfc feat(logging): add Elasticsearch K8s stack manifest
Add namespace, secrets, Elasticsearch StatefulSet, Kibana deployment,
and Fluent Bit RBAC for the central logging stack.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 12:41:54 +03:30
keyhan 583c4c4c90 feat(deploy): add DNS verification with modal before proceeding to next step
Add standalone DNS check endpoint and verify DNS on Next click in the
deploy wizard (step 2). Show error modal with CNAME instructions when
DNS is not configured instead of disabling the Next button. Also make
the custom domain clickable in the app detail header.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 01:20:57 +03:30
keyhan e8be7fbf03 fix(deploy): move custom domain toggle from Review to Optional Services step
The custom domain option now lives in Step 2 alongside Redis, RabbitMQ,
and Elasticsearch, styled consistently as a toggle card. The Review step
remains a read-only summary.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 00:53:04 +03:30
keyhan 30ccfa4ee2 fix: update cost estimate on domain toggle, switch to English, fix toggle overflow
- Cost calculation now reads custom domain price from PlatformSetting
  as fallback when no CUSTOM_DOMAIN_ADDON pricing rule exists
- Convert all custom domain UI text from Persian to English
- Fix toggle switch overflow by adding shrink-0, min-w-0, and proper
  absolute positioning

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 00:49:20 +03:30
keyhan 435cf92817 feat: add custom domain support with SSL, DNS verification, and billing
Users can assign a custom domain to their app with automatic SSL via
cert-manager. Includes DNS verification flow (CNAME check), Persian
instructions, admin-configurable pricing via PlatformSetting, and
integration into the deploy wizard cost calculation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 00:36:29 +03:30
keyhan d87b50c6a4 fix(build): use kubectl cp for reliable source upload and fix Python/Django CMD
- Replace k8s.Exec WebSocket with kubectl cp for binary file transfer to PVC
- Fix Python Dockerfile CMD: switch from JSON exec form to shell form to avoid
  invalid JSON escape sequences (\|) causing shell parse errors
- Fix Django Dockerfile CMD with same shell form approach
- Add retry logic for ECONNRESET during build job polling
- Update seed.ts default admin email to match actual database

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 00:10:04 +03:30
keyhan 9937ee457d fix: resolve critical deployment issues across Helm charts, Dockerfile, and K8s fallback
- Add helm/kubectl binaries and chart directory to backend Dockerfile
- Extend Helm templates for MongoDB/MariaDB database support (env vars, probes, ports)
- Add Redis and RabbitMQ Helm templates (deployment, service, secret, PVC)
- Add generic app-storage PVC and Fluent Bit sidecar with ES authentication
- Fix imagePullSecrets in K8s API fallback, prevent secret regeneration on redeploy
- Clean up Redis/RabbitMQ/FluentBit resources on app deletion without removing shared secrets
- Fix HelmService chartPath resolution for production Docker builds

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 19:16:07 +03:30
keyhan 38748b0827 add optinal apps 2026-04-23 15:26:49 +03:30
keyhan f481a57d8f fix(snapshots): add sleep after dump/archive for exec retrieval
- Job containers now sleep 120s after completing dump/archive
- This allows exec to retrieve files before container exits
- Wait for DUMP_DONE/ARCHIVE_DONE marker before attempting exec
- Cleanup job immediately after retrieval
- Fix Helm registry-pull-secret ownership conflict with lookup
2026-04-22 18:49:03 +03:30
keyhan b8355f1fc1 fix(helm): skip registry-pull-secret if already exists in namespace
- Use Helm lookup to check if secret exists before creating
- Add helm.sh/resource-policy: keep to prevent deletion
- Use pre-install hook to avoid ownership conflicts between releases
2026-04-22 18:17:31 +03:30
keyhan 0ba0ee3586 fix(k8s): restore direct K8s API deploy as fallback when Helm unavailable
- deployApplication now tries Helm first, falls back to direct K8s API
- Restored all private methods: ensureNamespace, applySecret, applyDeployment,
  applyService, applyIngress, applyWordPressPvc, deployDatabase, createDbSecret, createPVC
- Added ManifestContext interface
- Added DATABASE_URL env var, PGDATA, health probes for DB, ingressClassName
2026-04-22 17:59:59 +03:30
keyhan 5f77c07183 docs: rewrite ARCHITECTURE.md, README.md; add CHANGELOG and CONTRIBUTING
- ARCHITECTURE.md: all modules, Helm charts, billing/lifecycle flow, WordPress
- README.md: updated features, API endpoints, configuration, project structure
- CHANGELOG.md: full changelog for all unreleased changes
- CONTRIBUTING.md: commit conventions, documentation requirements, PR checklist
2026-04-22 16:45:30 +03:30
keyhan e10f9c5235 feat(frontend): lifecycle status, wallet balance, admin billing UI
- Wallet balance display in dashboard header
- Lifecycle status badges (color-coded) in apps list
- Plan expiry countdown column
- Admin apps: suspended/pending-deletion summary cards
- Admin billing: lifecycle settings management
- Updated TypeScript types for lifecycle and billing
2026-04-22 16:44:58 +03:30
keyhan 5f6eccc483 fix(apps): always attempt K8s cleanup on delete, cluster service fixes
- Delete endpoint no longer requires clusterId && latestImageTag
- Clusters: getDefault fallback logic, reassign apps on delete
- Unit tests for cluster default/delete logic
2026-04-22 16:44:43 +03:30
keyhan 8ca787d46e feat(lifecycle): add billing lifecycle with auto-suspend/delete
- New AppLifecycleService with cron-based scanner (60s interval)
- State machine: ACTIVE → SUSPENDED → PENDING_DELETION → DELETED
- Auto-renew hourly plans from wallet
- Admin-configurable grace periods via PlatformSettings table
- New LifecycleController (GET/PATCH /lifecycle/settings)
- PlatformSetting entity for runtime admin config
- BillingService: calculateCostForApp, deductWallet
- Application entity: planId, billingCycle, lifecycleStatus, planExpiresAt
- New enums: AppLifecycleStatus, BillingCycle
2026-04-22 16:44:20 +03:30
keyhan 0e408d1baa fix(build): runtime detection, WordPress support, Laravel inline configs
- detectRuntime reads parent directory not zip file itself
- Full WordPress Dockerfile with custom entrypoint for wp-content merging
- Laravel: inline nginx.conf and supervisord.conf generation
- composer.lock made optional
- ConfigMap cleanup in finally block
- Unit tests for WordPress build flow
2026-04-22 16:43:59 +03:30