Compare commits

...

693 Commits

Author SHA1 Message Date
Mauricio Siu
847cf6118b Merge branch 'canary' into feat/introduce-server-pay 2025-09-07 17:03:18 -06:00
Mauricio Siu
24729f35ec fix(traefik): remove error toast on dashboard action failure 2025-09-07 14:03:10 -06:00
Mauricio Siu
3eaeaa1db4 chore(package): bump version from v0.25.0 to v0.25.1 2025-09-07 13:31:38 -06:00
Mauricio Siu
de4a00f1e9 Merge pull request #2556 from Dokploy/2552-traefik-container-no-auto-start
feat(settings): add error handling for unsupported resource types in …
2025-09-07 13:31:03 -06:00
Mauricio Siu
2f5cd620c5 feat(settings): add error handling for unsupported resource types in Traefik setup
- Introduced error handling for unsupported resource types in `readPorts` and `writeTraefikSetup` functions.
- Enhanced `initializeStandaloneTraefik` to include image pulling with error logging for better debugging.
2025-09-07 13:26:19 -06:00
Mauricio Siu
1763000070 Merge pull request #2545 from Dokploy/feat/clean-build-queue-on-build
feat(deployment): add cancellation functionality queue for deployments
2025-09-06 22:12:44 -06:00
Mauricio Siu
3519913886 fix(deployment): update stuck build notification time from 9 to 10 minutes 2025-09-06 22:09:48 -06:00
Mauricio Siu
63e578f13c refactor(deployment): update cancellation input schemas for applications and composes
- Removed the previous cancellation schemas for deployments.
- Replaced them with a unified input schema for finding applications and composes during cancellation requests.
- Ensured that the cancellation logic now utilizes the new input structure for better consistency.
2025-09-06 22:08:59 -06:00
autofix-ci[bot]
d80ada7c00 [autofix.ci] apply automated fixes 2025-09-07 04:06:08 +00:00
Mauricio Siu
766cd20e90 feat(deployment): improve stuck deployment detection and update status
- Enhanced the stuck deployment check to only consider the most recent deployment.
- Updated the logic to correctly identify if the most recent deployment has been running for more than 9 minutes.
- Added functionality to update the deployment status to "done" upon application and compose cancellation.
2025-09-06 22:05:39 -06:00
Mauricio Siu
4e69c70697 feat(deployment): add cancellation functionality for deployments
- Introduced a new endpoint for cancelling deployments, allowing users to cancel both application and compose deployments.
- Implemented validation schemas for cancellation requests.
- Enhanced the deployment dashboard to provide a cancellation option for stuck deployments.
- Updated server-side logic to handle cancellation requests and send appropriate events.
2025-09-06 21:53:15 -06:00
Mauricio Siu
3b7d009841 fix(search-command): remove console log for project debugging 2025-09-06 20:36:01 -06:00
Mauricio Siu
b4e29dab39 Merge pull request #2515 from divaltor/filter-projects-shortcut
feat(input): Add focus by Cmd + K shortcut to search input
2025-09-06 14:32:52 -06:00
Mauricio Siu
090ec2b3b9 Merge pull request #2540 from robgraeber/canary
fix: typo and improve grammar
2025-09-06 14:32:41 -06:00
Mauricio Siu
57dc24bcb1 feat(search-command): enhance service extraction and project navigation
- Introduced a new function `extractAllServicesFromProject` to aggregate services from all environments within a project, including environment details.
- Updated the project selection logic to navigate to the production environment of a project.
- Modified the display of services to include the environment name alongside the service name in the search results.
2025-09-06 14:30:59 -06:00
Mauricio Siu
f630b889c6 Merge branch 'canary' into filter-projects-shortcut 2025-09-06 14:19:35 -06:00
Rob Graeber
a2abb205fd fix: typo and improve grammar 2025-09-06 13:19:13 -07:00
Mauricio Siu
1f2dabb16b Merge pull request #2429 from CatPaulKatze/feat/ntfy
feat(notification): add ntfy notifications
2025-09-06 14:17:27 -06:00
Mauricio Siu
ffb69fedff feat: Add 'ntfy' notification type and related database schema changes
- Introduced a new notification type 'ntfy' to the public.notificationType enum.
- Created a new table 'ntfy' with fields for notification ID, server URL, topic, access token, and priority.
- Updated the existing 'notification' table to include a foreign key reference to the new 'ntfy' table.
2025-09-06 14:13:47 -06:00
Mauricio Siu
fbc087bd84 Merge branch 'canary' into feat/ntfy 2025-09-06 14:12:06 -06:00
Mauricio Siu
ccb995cb7d chore: remove SQL files and journal entries for 'bitter_starfox' and 'needy_rocket_raccoon' 2025-09-06 14:11:39 -06:00
Mauricio Siu
02685fde9d Merge pull request #2507 from Harikrishnan1367709/Allow-setting-a-title/description-for-deployments-via-API-or-CLI-#1485-Harikrishnan
feat: Add custom title/description support for API/CLI deployments (#1485)
2025-09-06 14:00:26 -06:00
autofix-ci[bot]
fc2bd44983 [autofix.ci] apply automated fixes 2025-09-06 19:49:09 +00:00
Mauricio Siu
30a2d78a5b Merge pull request #2502 from Harikrishnan1367709/Issue-1852-Harikrishnan
feat: Add default "Dokploy" option to server selection dropdown (#1852)
2025-09-06 13:47:42 -06:00
autofix-ci[bot]
081ba60f6e [autofix.ci] apply automated fixes 2025-09-06 19:36:11 +00:00
Vlad Vladov
2d41db7f37 feat(input): Replace Input with FocusShortcutInput 2025-09-05 18:19:16 +03:00
Vlad Vladov
d0f54f2067 feat(input): Add focus by Cmd + K shortcut to search input 2025-09-05 18:13:23 +03:00
Paul Sommer
6833713697 perf: remove unnecessary decoration boolean on the ntfy database schema 2025-09-05 11:35:28 +02:00
Mauricio Siu
d0489f6e11 Merge branch 'canary' into Issue-1852-Harikrishnan 2025-09-05 03:12:01 -06:00
Mauricio Siu
39872720dd refactor: remove debug logging from Docker resource type determination functions 2025-09-05 03:00:57 -06:00
Mauricio Siu
b90f0135d4 refactor: simplify Docker resource type determination logic by consolidating command structure 2025-09-05 02:50:37 -06:00
Mauricio Siu
35fc04dc8f feat: enhance error handling and logging in Docker resource type determination 2025-09-05 02:35:06 -06:00
Mauricio Siu
c6509efa65 feat: add debug logging for resource name and command in Docker resource type determination 2025-09-05 02:11:46 -06:00
Mauricio Siu
3891798b17 Merge pull request #2527 from Dokploy/fix/connect-network-after-creation-remote-servers
Fix/connect network after creation remote servers
2025-09-05 01:52:54 -06:00
Mauricio Siu
3662c1a684 fix: change Traefik container restart policy to 'always' and ensure it connects to the dokploy network 2025-09-05 01:49:47 -06:00
Mauricio Siu
d96e9071f2 feat: add logging for resource type determination and error handling in Docker resource management 2025-09-05 01:47:12 -06:00
Mauricio Siu
e637a4ad99 Merge pull request #2526 from Dokploy/2480-backup-process-exposes-s3-credentials-in-logs
feat: add validation to prevent use of 'production' as environment na…
2025-09-05 01:16:28 -06:00
Mauricio Siu
1ce15da7ce feat: add validation to prevent use of 'production' as environment name in creation and update operations, enhancing error handling in environment management 2025-09-05 01:14:44 -06:00
Mauricio Siu
0dca1b2216 Merge pull request #2489 from typed-sigterm/patch-2
fix: print error when docker build fails
2025-09-05 01:08:11 -06:00
Mauricio Siu
c73a14a379 Merge branch 'canary' into patch-2 2025-09-05 01:07:51 -06:00
Mauricio Siu
392e3434c4 refactor: make database root password optional in schema and mutation logic, enhancing flexibility in database configuration 2025-09-05 01:01:26 -06:00
Mauricio Siu
e3f3426f1c refactor: remove redundant password requirement validation from database schemas, improving consistency across database configurations 2025-09-05 01:00:18 -06:00
Mauricio Siu
a09cd06eea refactor: streamline conditional rendering for service creation dropdown in EnvironmentPage, improving code readability and maintainability 2025-09-05 00:56:37 -06:00
Mauricio Siu
87a41ca710 Merge pull request #2499 from Dokploy/324-environmentfoldergroup-features-on-projects
324 environmentfoldergroup features on projects
2025-09-05 00:25:34 -06:00
Mauricio Siu
35b7b5bd68 feat: implement environment access control and service filtering based on user permissions, enhancing security and usability in environment management 2025-09-05 00:23:01 -06:00
Mauricio Siu
16c37c3ceb feat: add accessedEnvironments field to user and member schemas, enhancing permission management for environment access 2025-09-05 00:13:04 -06:00
Mauricio Siu
42548f310e refactor: simplify project selection logic in EnvironmentPage by removing unnecessary filters, improving readability and performance 2025-09-04 23:50:10 -06:00
Mauricio Siu
47b66d0dc3 refactor: enhance access control in environment, mount, port, rollback, and schedule routers to ensure users can only interact with resources belonging to their organization 2025-09-04 23:32:25 -06:00
HarikrishnanD
32cbc5b4b7 feat: Add custom title/description for deployments via API/CLI - Add optional title/description fields to deployment schemas - Update TRPC and external API endpoints - Replace generic "Manual deployment" with custom titles - Maintain backward compatibility with default values Fixes #1485 2025-09-04 19:12:29 +05:30
Typed SIGTERM
15171622df fix 2025-09-04 20:08:50 +08:00
HarikrishnanD
46f1af3bb3 feat(ui): add conditional server dropdown with Dokploy default option - Add IS_CLOUD flag support for server selection dropdown - Show "Dokploy" as default option in self-hosted environments - Hide dropdown when no remote servers exist - Add conditional placeholder text and server count display - Handle "dokploy" value in form submission (converts to undefined) - Apply changes to all relevant components: add-application, add-compose, add-template, add-database, add-certificate, and AI step-one Resolves #1852 2025-09-04 13:54:19 +05:30
Mauricio Siu
d199a54033 refactor: update environment invalidation logic in AdvancedEnvironmentSelector to use byProjectId, improving data consistency and clarity 2025-09-03 23:56:31 -06:00
Mauricio Siu
fb749cd862 feat: implement comprehensive environment variable resolution in preparation functions, enhancing flexibility and support for nested references across services and environments 2025-09-03 21:41:11 -06:00
Mauricio Siu
4c5771b55b feat: add EnvironmentVariables component for managing environment variables, enhancing project configuration capabilities 2025-09-03 21:24:59 -06:00
Mauricio Siu
7e1de62ab1 refactor: enhance environment selector component and database schema to support new environment field, improving clarity and functionality in project management 2025-09-03 21:19:12 -06:00
Mauricio Siu
d67644e52f refactor: adjust environment page to correctly display project name and reintroduce duplicate project functionality, enhancing user navigation and clarity 2025-09-03 21:11:54 -06:00
Mauricio Siu
52e21dab4e refactor(ui): simplify server selection logic across components - Remove redundant server count check in server selection dropdowns across multiple components (AddApplication, AddCompose, AddDatabase, AddTemplate, StepOne, AddCertificate) to streamline UI behavior. 2025-09-03 20:45:47 -06:00
autofix-ci[bot]
4a3a7fa47b [autofix.ci] apply automated fixes 2025-09-04 02:43:53 +00:00
Mauricio Siu
aa7e382818 feat(readme): add sponsorship section for Tuple with logo 2025-09-03 03:00:48 -06:00
Mauricio Siu
87a9ed46ba refactor: update service extraction logic to utilize environment data, enhancing clarity and consistency in monitoring setup 2025-09-03 02:58:38 -06:00
HarikrishnanD
90d9880301 feat: add custom title/description support for API/CLI deployments - Add optional title and description fields to deployment schemas - Update TRPC endpoints to accept custom deployment titles/descriptions - Update external API to support custom deployment metadata - Maintain backward compatibility with existing deployments - Resolves issue #1485: Allow setting title/description for deployments via API/CLI 2025-09-03 09:05:33 +05:30
HarikrishnanD
940b9967b8 feat(ui): add default "Dokploy" option to server selection dropdown - Add "Dokploy" as default option in server selection dropdowns - Hide dropdown when only one server is available (servers.length <= 1) - Show dropdown only when multiple servers exist (servers.length > 1) - Update placeholder text from "Select a Server" to "Dokploy" - Fix issue where users couldn't switch back to default server - Update form submission logic to handle "dokploy" default value - Apply changes to all deployment components (application, compose, template, database, certificate, AI) Resolves #1852 2025-09-02 19:17:46 +05:30
Mauricio Siu
741085466b refactor: remove projectId references from service components, streamlining navigation and enhancing clarity in environment context 2025-09-02 00:25:09 -06:00
Mauricio Siu
11b0e21728 refactor: replace projectId with environmentId in database schema, enhancing clarity and consistency in environment management across services 2025-09-02 00:18:36 -06:00
autofix-ci[bot]
990b174110 [autofix.ci] apply automated fixes 2025-09-02 05:24:22 +00:00
Mauricio Siu
4c4c72bc9c refactor: update permissions handling to extract services from environments, improving data structure and clarity in user permissions management 2025-09-01 23:23:58 -06:00
autofix-ci[bot]
8f446d04f3 [autofix.ci] apply automated fixes 2025-09-02 05:20:20 +00:00
Mauricio Siu
e8a5f9c0a8 refactor: restructure application and rollback context to encapsulate project within environment, improving data organization and clarity across services 2025-09-01 23:19:53 -06:00
autofix-ci[bot]
c57c231c32 [autofix.ci] apply automated fixes 2025-09-02 05:16:09 +00:00
Mauricio Siu
8194929558 refactor: improve project navigation logic by ensuring proper handling of projectId and environmentId, enhancing routing clarity and user experience 2025-09-01 23:15:44 -06:00
autofix-ci[bot]
4a07118acd [autofix.ci] apply automated fixes 2025-09-02 05:10:56 +00:00
Mauricio Siu
be9e19e708 refactor: enhance project and environment handling across components and services by replacing projectId with environmentId, improving context clarity and authorization checks 2025-09-01 23:10:37 -06:00
Mauricio Siu
3e7eff11cd refactor: update application deployment logic to utilize environment context for project name and organization ID, enhancing clarity and consistency across services 2025-09-01 22:51:35 -06:00
Mauricio Siu
f8ebf77575 Merge pull request #2493 from nktnet1/fix-server-schedule-responsiveness
fix(ui): schedule responsiveness
2025-09-01 22:46:40 -06:00
Mauricio Siu
de3c845ab0 refactor: update duplicate project logic to use 'existing-environment' for improved clarity in project duplication context 2025-09-01 22:45:57 -06:00
autofix-ci[bot]
cb992259cf [autofix.ci] apply automated fixes 2025-09-02 04:42:24 +00:00
Mauricio Siu
883c3f9739 refactor: update DuplicateProject and AdvancedEnvironmentSelector components to utilize environmentId for improved context handling; enhance UI with project and environment selection features for better user experience 2025-09-01 22:40:51 -06:00
Mauricio Siu
766890192d refactor: streamline environment selector by utilizing findEnvironmentById for type definition; enhance service presence checks and UI layout for improved clarity 2025-09-01 21:33:13 -06:00
Mauricio Siu
1a9f131d39 refactor: enhance environment selector with service presence checks and alert notifications; update navigation links to include environment context for improved user experience 2025-09-01 21:18:56 -06:00
Mauricio Siu
59cbc8ee0d refactor: update environment selector and API routes to utilize environmentId for service management; enhance UI with Badge component for production environments 2025-09-01 21:09:30 -06:00
Mauricio Siu
e9322fc900 refactor: add environment name links to service components for improved navigation and context clarity 2025-09-01 20:58:22 -06:00
Mauricio Siu
39d48d8bdf refactor: update API and dashboard components to replace projectId with environmentId for improved context handling and authorization checks 2025-09-01 20:39:58 -06:00
Mauricio Siu
399bcb0302 refactor: update project and API components to utilize environment context for organization authorization checks and enhance service retrieval methods 2025-09-01 20:36:03 -06:00
Mauricio Siu
e0b6a8627a refactor: update database service components to utilize environment context for project name and organization authorization checks 2025-09-01 20:15:05 -06:00
Mauricio Siu
ecf7ae924f refactor: update routing in dashboard components to include environment context; add new service pages for MongoDB, MySQL, PostgreSQL, Redis, and MariaDB 2025-09-01 20:12:14 -06:00
Mauricio Siu
d57a0cf439 refactor: update API routes and services to use environment context for organization authorization checks; enhance service retrieval methods to include environment details 2025-09-01 20:05:36 -06:00
Mauricio Siu
52d2bd2114 refactor: remove EnvironmentManagement component and related environment selector from project dashboard; update environment page to use Badge component for production label 2025-09-01 19:52:30 -06:00
Mauricio Siu
72f8a28f4f refactor: update project structure to use environmentId instead of projectId across components and API routes; implement environment management features 2025-09-01 19:48:20 -06:00
Mauricio Siu
6fc325fe95 feat(environment): implement environment management with create, duplicate, and delete functionalities; add environment schema and database migrations 2025-09-01 17:36:27 -06:00
Mauricio Siu
fd199fdcc0 Merge pull request #2498 from Dokploy/2456-cannot-back-up-mariadb-database-access-denied-error
feat(database): enhance password validation for database schemas and …
2025-09-01 16:21:22 -06:00
Mauricio Siu
5e1a164a54 chore(pr-template): streamline checklist formatting and clarify issue closing instructions 2025-09-01 16:19:24 -06:00
Mauricio Siu
bc2b4f1369 feat(database): enhance password validation for database schemas and update input components for password visibility 2025-09-01 16:16:55 -06:00
Tam Nguyen
38abe03257 fix(ui): flex-wrap on schedule name and enabled 2025-08-31 10:36:07 +10:00
autofix-ci[bot]
22e40134ea [autofix.ci] apply automated fixes 2025-08-31 00:30:08 +00:00
Tam Nguyen
a2841fdd30 fix(ui): flex-wrap for cron and shell type 2025-08-31 10:27:12 +10:00
Tam Nguyen
468feaa092 fix(ui): improve server schedule responsiveness for mobile 2025-08-31 10:25:09 +10:00
Typed SIGTERM
caf244120c fix: print error when docker build fails 2025-08-30 13:41:40 +08:00
Mauricio Siu
7273c636a0 Merge pull request #2461 from Dokploy/fix/re-apply-database-migration-fix
Reapply "refactor: update database connection handling and remove unu…
2025-08-28 19:21:28 -06:00
Mauricio Siu
b9a8b27441 feat(notification): add 'ntfy' notification type and create associated table; update notification schema 2025-08-28 19:09:58 -06:00
Mauricio Siu
9f1f13b21b Merge branch 'canary' into feat/ntfy 2025-08-28 19:07:53 -06:00
Mauricio Siu
793a8ba760 chore: remove unused SQL file and related journal entry for 'flimsy_doctor_octopus' 2025-08-28 19:07:44 -06:00
Mauricio Siu
d6a0585bae chore(package): update dokploy version to v0.25.0 2025-08-28 19:03:37 -06:00
Mauricio Siu
935d1686f2 chore: add new branch for database migration fix in Dokploy workflow 2025-08-28 19:02:21 -06:00
Mauricio Siu
349248105a Merge pull request #2482 from Dokploy/2470-post-rediscreate-returns-true-instead-of-the-redis-payload
fix(redis): return newRedis object instead of true in redis router
2025-08-28 18:43:04 -06:00
Mauricio Siu
d922568510 fix(redis): return newRedis object instead of true in redis router 2025-08-28 18:42:21 -06:00
Mauricio Siu
44ae4df151 fix(settings): change user subscription query to protected procedure 2025-08-28 18:27:47 -06:00
Mauricio Siu
77fdda4c09 Merge pull request #2481 from Dokploy/feat/allow-chatwoot-on-paid-users
feat(settings): add user subscription check to dashboard layout
2025-08-28 18:27:05 -06:00
Mauricio Siu
8a1e36cc3b feat(settings): add user subscription check to dashboard layout 2025-08-28 18:26:05 -06:00
Mauricio Siu
1635bab44f Reapply "refactor: update database connection handling and remove unused migra…"
This reverts commit 17f333ac2a.
2025-08-24 23:49:48 -06:00
Mauricio Siu
4a52459015 Merge pull request #2460 from Dokploy/revert-2459-2234-database-migration-fails-with-password-authentication-failed-when-using-a-custom-postgres_password
Revert "refactor: update database connection handling and remove unused migra…"
2025-08-24 23:44:23 -06:00
Mauricio Siu
17f333ac2a Revert "refactor: update database connection handling and remove unused migra…" 2025-08-24 23:44:00 -06:00
Mauricio Siu
d770307d64 Merge pull request #2459 from Dokploy/2234-database-migration-fails-with-password-authentication-failed-when-using-a-custom-postgres_password
refactor: update database connection handling and remove unused migra…
2025-08-24 23:43:52 -06:00
Mauricio Siu
aa434cbdea feat(db): add database connection setup using drizzle-orm for PostgreSQL 2025-08-24 16:25:04 -06:00
Mauricio Siu
c42054b965 feat(migration): implement database migration functionality using drizzle-orm 2025-08-24 16:22:42 -06:00
Mauricio Siu
03588bf375 chore: remove console.log statement from esbuild configuration 2025-08-24 16:21:01 -06:00
Mauricio Siu
8c420ff4f5 refactor: update package.json to use TypeScript source files instead of compiled JavaScript 2025-08-24 16:20:32 -06:00
Mauricio Siu
cbf6f95891 refactor: update database connection handling and remove unused migration and seed files 2025-08-24 16:19:33 -06:00
Mauricio Siu
2d2a3d74ec Merge pull request #2412 from moosti/feat/two-factor-autofocus
feat: add autofocus to two-factor authentication input
2025-08-24 13:10:30 -06:00
Mauricio Siu
56b9fb531a Merge pull request #2447 from divaltor/volume-backup
feat(volume): Add possibility to keep latest N backups for custom apps
2025-08-24 00:44:27 -06:00
Mauricio Siu
59aaa1a47a fix(ui): adjust max width for volume backup dialog based on backup type 2025-08-24 00:40:17 -06:00
autofix-ci[bot]
5e4444610c [autofix.ci] apply automated fixes 2025-08-24 06:33:36 +00:00
Mauricio Siu
34e6cd87df Merge pull request #2410 from gentslava/fix/ollama-ai-provider
Ollama AI provider
2025-08-24 00:30:59 -06:00
Mauricio Siu
31b13b8d34 Merge pull request #2453 from Dokploy/2452-no-removal-of-preview-deployments-when-they-are-merged
fix: correct application not found error message and improve error ha…
2025-08-23 23:01:03 -06:00
Mauricio Siu
746cf76cf3 fix: correct application not found error message and improve error handling in removePreviewDeployment function 2025-08-23 22:59:52 -06:00
Mauricio Siu
46c53a05bf Merge pull request #2231 from PiquelChips/feat/label-previews
feat: preview deployments for pull requests with specific labels
2025-08-23 20:19:50 -06:00
Mauricio Siu
f97f6d8178 Merge branch 'feat/label-previews' of github.com:PiquelChips/dokploy into feat/label-previews 2025-08-23 20:19:34 -06:00
Mauricio Siu
c653dd604f feat: add previewLabels property to baseApp in drop and traefik test files 2025-08-23 20:19:14 -06:00
autofix-ci[bot]
40877e4370 [autofix.ci] apply automated fixes 2025-08-24 02:16:35 +00:00
Mauricio Siu
65203036f2 Merge branch 'canary' into feat/label-previews 2025-08-23 20:15:37 -06:00
Mauricio Siu
2ef5f967a9 refactor: clean up imports in show-preview-settings component 2025-08-23 20:14:41 -06:00
Mauricio Siu
b20c95ffbc Merge branch 'canary' into feat/label-previews 2025-08-23 20:14:16 -06:00
Mauricio Siu
09b2492585 Merge branch 'feat/label-previews' of github.com:PiquelChips/dokploy into feat/label-previews 2025-08-23 20:13:22 -06:00
Mauricio Siu
ca1fa7c4f7 feat: add support for preview labels in deployment process 2025-08-23 20:11:18 -06:00
autofix-ci[bot]
112b898d98 [autofix.ci] apply automated fixes 2025-08-24 02:01:00 +00:00
Mauricio Siu
8185482bcd Merge pull request #2370 from gentslava/fix/traefik_3
bump: Traefik 3.5.0
2025-08-23 19:53:47 -06:00
Mauricio Siu
dd8f5dba09 Merge branch 'canary' into fix/traefik_3 2025-08-23 19:53:40 -06:00
Mauricio Siu
e72a468c7e Merge pull request #2111 from Marukome0743/traefik
feat: bump Traefik v3.2.2 and add swarm network label
2025-08-23 19:50:50 -06:00
Mauricio Siu
02dd793dfb Merge pull request #2396 from alexevladgabriel/feat/self-env-refs
feat: Self reference env variables
2025-08-23 19:38:34 -06:00
Mauricio Siu
64ef033950 Merge pull request #2418 from periakteon/canary
fix(organization): integrate active organization refetching on update/create
2025-08-23 19:32:45 -06:00
Mauricio Siu
32f7bdf398 Merge pull request #2450 from Dokploy/2403-no-delete-volumes-option-when-deleting-in-bulk
feat(ui): add bulk deploy functionality for services in project dashb…
2025-08-23 16:59:03 -06:00
Mauricio Siu
8d73b77a19 Merge branch 'canary' into 2403-no-delete-volumes-option-when-deleting-in-bulk 2025-08-23 16:08:15 -06:00
Mauricio Siu
2e3d4f1021 feat(ui): implement bulk delete dialog for services in project dashboard 2025-08-23 16:06:25 -06:00
Mauricio Siu
ba1f4dbd3a feat(ui): add bulk deploy functionality for services in project dashboard 2025-08-23 16:04:13 -06:00
Mauricio Siu
653beac3d9 feat(ui): implement bulk delete dialog for services with volume deletion option 2025-08-23 15:55:56 -06:00
Vlad Vladov
37c34fdadc feat(volume): Add possibility to keep latest N backups for custom containers 2025-08-23 18:07:45 +03:00
Paul Sommer
d52fe5c050 fix: typo in ntfy provider 2025-08-21 15:57:20 +02:00
Paul Sommer
36281cd5d3 feat(notification): add ntfy notifications 2025-08-20 20:23:44 +02:00
Masum Gökyüz
69d676178f feat(organization): integrate active organization refetching on update/create 2025-08-20 09:33:01 +03:00
Vyacheslav Scherbinin
6612c92b4f chore: update ai providers 2025-08-20 13:16:04 +07:00
Vyacheslav Scherbinin
88c8fe4614 chore: update ollama ai provider 2025-08-20 00:58:39 +07:00
Vyacheslav Scherbinin
623fc26de5 fix(ai-ui): hide api key field for ollama 2025-08-19 23:56:54 +07:00
Vyacheslav Scherbinin
220576fd63 fix(ai-ui): empty models list text 2025-08-19 23:56:54 +07:00
Vyacheslav Scherbinin
07c23292da fix(ai): ollama fetch models 2025-08-19 23:56:54 +07:00
Vyacheslav Scherbinin
72fca80047 fix(ai-ui): disable AI key autocomplete 2025-08-19 23:56:54 +07:00
Vyacheslav Scherbinin
1e7f614bb6 fix(ai): ollama provider url-based detection 2025-08-19 23:56:53 +07:00
Vyacheslav Scherbinin
e2662a0ec5 fix(ai): ollama ai provider api url 2025-08-19 23:56:46 +07:00
ispareh
c96c25ca9f feat: add autofocus to two-factor authentication input 2025-08-19 14:40:04 +03:30
Marukome0743
4afd2d11fa feat: bump traefik to v3.2.2 2025-08-19 18:57:03 +09:00
Mauricio Siu
ff20bb2731 chore(package): bump version to v0.24.12 2025-08-19 00:31:53 -06:00
Mauricio Siu
8a802b0739 Merge pull request #2402 from gentslava/fix/scroll-gutters
fix(ui): scroll gutters stable
2025-08-19 00:21:19 -06:00
Mauricio Siu
e511173283 Merge pull request #2404 from gentslava/fix/modal-popover-handle
fix(ui): modal popover handle close
2025-08-19 00:19:44 -06:00
Mauricio Siu
763b1a344a Merge pull request #2407 from Dokploy/feat/prevent-delete-service-while-build-is-running
feat(ui): add alert blocks for running services in delete confirmatio…
2025-08-19 00:16:01 -06:00
Mauricio Siu
a4041185f1 feat(ui): add alert blocks for running services in delete confirmation dialogs 2025-08-19 00:14:50 -06:00
Vyacheslav Scherbinin
522dcd6c08 fix(ui): modal pointer events predefine 2025-08-18 23:52:30 +07:00
Vyacheslav Scherbinin
b4d5935875 fix(ui): modal popover handle close 2025-08-18 23:27:49 +07:00
Scai
8cc054389a feat: add self reference for env variables 2025-08-18 02:04:23 +03:00
Mauricio Siu
58b78e1ee3 fix(api): set deployment retries to 0 in Inngest function configuration 2025-08-17 13:44:09 -06:00
Mauricio Siu
5b0a8fde9c Merge pull request #2392 from Dokploy/2341-deployment-functionality-is-totally-broken-on-cloud-version
Integrate Inngest for deployment management in the API. Added Inngest…
2025-08-17 12:07:59 -06:00
Mauricio Siu
7e641c0ed5 Merge pull request #2394 from gentslava/fix/modal-content-overflow
fix(ui): modal double scroll
2025-08-17 12:03:59 -06:00
Mauricio Siu
83531ceacd Integrate Inngest for deployment management in the API. Added Inngest client initialization and updated deployment handling to send events to Inngest instead of using Redis. Updated package dependencies to include Inngest version 3.40.1. 2025-08-16 23:44:45 -06:00
Vyacheslav Scherbinin
6d9a1db8af fix(ui): scrollbar gutter stable 2025-08-17 12:36:40 +07:00
Vyacheslav Scherbinin
e3979d2c48 fix(ui): fixed viewport 2025-08-17 12:09:26 +07:00
Vyacheslav Scherbinin
5f39dfee3a fix(ui): fix double scroll 2025-08-17 11:58:10 +07:00
Mauricio Siu
774365c68e Refactor and update various components in the Dokploy application, enhancing functionality and fixing minor issues across multiple pages and features, including dashboard, settings, and API integrations. 2025-08-16 20:18:08 -06:00
Mauricio Siu
0cdacb5501 update(package): bump version to v0.24.11 2025-08-16 19:50:15 -06:00
Mauricio Siu
e266b1a620 Merge pull request #2361 from rennokki/fix/gitlab-url-basic-auth-support
fix: Added support for Basic Auth present in the GitLab URLs
2025-08-16 19:43:15 -06:00
autofix-ci[bot]
81ab71ba23 [autofix.ci] apply automated fixes 2025-08-17 01:33:47 +00:00
Mauricio Siu
ae92725554 Merge pull request #2373 from gentslava/fix/dialog-backdrop-logic
Fix Dialog backdrop
2025-08-16 16:15:32 -06:00
Mauricio Siu
974d1d8b26 Merge pull request #2363 from bobbymannino/keyboard-nav-on-more-pages
add keyboard nav for compose/database pages
2025-08-16 16:14:10 -06:00
Mauricio Siu
7367601e26 Merge pull request #2383 from haouarihk/trim-ip-address
Trim ip address
2025-08-16 16:12:35 -06:00
Mauricio Siu
861b390707 Merge pull request #2385 from cheetahbyte/fix/template-search
fix(template): duplicate key issue causing wrong formatting in template search
2025-08-16 16:12:00 -06:00
Leonhard Breuer
4e7378371d fix(template): make every key in map unique using index
FIXES #2382
2025-08-15 19:52:55 +02:00
Haouari haitam Kouider
b6cbf9127d trim ip address 2025-08-15 15:14:26 +00:00
Haouari haitam Kouider
661c517dfc trim the ip address 2025-08-15 15:13:24 +00:00
autofix-ci[bot]
f3ec01ec77 [autofix.ci] apply automated fixes 2025-08-13 06:46:05 +00:00
Vyacheslav Scherbinin
f4499463fe fix(dialog-ux): internal component state control 2025-08-13 12:54:58 +07:00
Vyacheslav Scherbinin
6e069154ef fix(dialog-ux): prevent default Radix double event onInteractOutside 2025-08-13 12:51:44 +07:00
Vyacheslav Scherbinin
66e6b56053 refactor: remove overflow hidden cause of useless 2025-08-13 10:07:08 +07:00
Vyacheslav Scherbinin
6248abd88e fix(ui): pointer events transparent modal overlay 2025-08-13 10:05:16 +07:00
autofix-ci[bot]
2c591cbd03 [autofix.ci] apply automated fixes 2025-08-13 01:25:30 +00:00
Vyacheslav Scherbinin
3864c50deb bump: Traefik v3.5.0 2025-08-13 08:23:30 +07:00
autofix-ci[bot]
83e8c82c4a [autofix.ci] apply automated fixes 2025-08-12 17:16:10 +00:00
Bob Mannino
a41137aacc reduce time waiting for second nav key to 1.5s 2025-08-12 18:15:35 +01:00
Bob Mannino
213acd6287 fix: do not navigate if typing in input/textarea/select
fixes #2367
2025-08-12 18:15:18 +01:00
autofix-ci[bot]
0781336b8f [autofix.ci] apply automated fixes 2025-08-11 18:33:47 +00:00
Bob Mannino
28811ca66d add mariadb/mongodb keyboard shortcuts 2025-08-11 19:33:25 +01:00
autofix-ci[bot]
ed53bdd0fa [autofix.ci] apply automated fixes 2025-08-11 18:28:50 +00:00
Bob Mannino
957d1b5966 add mysql keyboard shortcuts 2025-08-11 19:28:29 +01:00
Bob Mannino
ad359defae format 2025-08-11 19:15:54 +01:00
Bob Mannino
a4bbcea282 add keyboard shortcuts for compose/redis/postgres pages 2025-08-11 19:15:00 +01:00
PiquelChips
15e62961e8 fix: would only create previews if none of the labels were present 2025-08-11 14:09:02 +02:00
PiquelChips
429c1e4cd8 feat: better UI for submitting labels 2025-08-11 14:03:30 +02:00
Piquel
1904a3d1e9 Merge branch 'canary' into feat/label-previews 2025-08-11 13:29:04 +02:00
Alex Renoki
f0278f354b Added support for Basic Auth present in the GitLab URLs 2025-08-11 09:56:49 +03:00
Mauricio Siu
9763dce045 fix(swarm): adjust validation for containerId to allow empty array 2025-08-10 23:26:20 -06:00
Mauricio Siu
ef6dcaf363 chore(package): bump version to v0.24.10 2025-08-10 23:23:15 -06:00
Mauricio Siu
37b056cd4b Merge pull request #2314 from JamBalaya56562/strategy
ci(pull-request): use strategy matrix
2025-08-10 16:51:05 -06:00
Mauricio Siu
8bbef02e39 Merge pull request #2357 from Dokploy/1857-support-isolated-deployment-randomized-compose-for-compose-deployment-using-a-git-provider
1857 support isolated deployment randomized compose for compose deployment using a git provider
2025-08-10 16:44:28 -06:00
Mauricio Siu
231b8ed19d remove: eliminate Docker volumes from isolated deployment resources list 2025-08-10 16:43:03 -06:00
Mauricio Siu
cfa0135932 remove: delete IsolatedDeployment component from dashboard 2025-08-10 16:42:50 -06:00
Mauricio Siu
85bce827eb fix(keyboard-nav): ensure correct type for shortcut keys in navigation 2025-08-10 16:41:18 -06:00
Mauricio Siu
1fe12ba93e feat(isolation): add preview functionality for isolated deployment with loading state and dialog 2025-08-10 16:38:10 -06:00
Mauricio Siu
4b1146ab6b remove the "isWildcard" column from the "domain" table in the database schema 2025-08-10 15:58:15 -06:00
Mauricio Siu
fe2f6f842b Merge pull request #2332 from depado/fix-traefik-init-setup
fix(setup): properly handle dokploy-traefik container absence
2025-08-10 15:33:25 -06:00
Mauricio Siu
c3f29c2694 Merge pull request #2352 from Aeriit/fix-remote-traefik-env
fix(traefik): on setup support serverId as parameter and input
2025-08-10 15:04:26 -06:00
Mauricio Siu
d5307cb5d6 fix(traefik): streamline serverId handling in writeTraefikSetup function 2025-08-10 15:03:41 -06:00
Mauricio Siu
b99556b389 Merge pull request #2355 from bobbymannino/application-keyboard-navigation
feat: add keyboard shortcuts to application page
2025-08-10 15:01:04 -06:00
Bob Mannino
112a1dedec feat: add keyboard shortcuts to application page 2025-08-10 14:34:06 +01:00
Mauricio Siu
edbdc01a1e chore(package): bump version to v0.24.9 2025-08-10 06:12:28 -06:00
Aeriit
883e1d1bfe fix(traefik): on setup support serverId as parameter and input 2025-08-09 11:05:37 -04:00
Mauricio Siu
33d6c2073b Merge pull request #2337 from A-D-E/fix/gitlab-branches-pagination
fix: use configured GitLab URL instead of hardcoded gitlab.com
2025-08-09 00:23:43 -06:00
A-D-E
33873ce1e9 fix: use configured GitLab URL instead of hardcoded gitlab.com
The previous pagination implementation accidentally hardcoded the GitLab URL
to gitlab.com, breaking the integration for self-hosted GitLab instances.

Changes:
- Replace hardcoded 'https://gitlab.com' with gitlabProvider.gitlabUrl
- Maintains the pagination functionality added in previous commit

Fixes: GitLab branches API calls failing for self-hosted instances
2025-08-05 21:31:15 +02:00
depado
1d94c85c2b fix(setup): properly handle dokploy-traefik container absence 2025-08-05 14:53:35 +02:00
Mauricio Siu
1758655f66 feat(swarm): add OpenAPI metadata for drop-deployment endpoint in swarm router 2025-08-04 00:28:03 -06:00
Mauricio Siu
029eed7755 refactor(dashboard): improve layout and spacing in ShowConvertedCompose component 2025-08-03 18:10:19 -06:00
Mauricio Siu
f017536396 chore(package): bump version to v0.24.7 2025-08-03 18:04:24 -06:00
Mauricio Siu
ba5505cf81 feat(auth): add logger configuration to disable logging in production environment 2025-08-03 18:04:09 -06:00
Mauricio Siu
5ff5da9ff9 Merge pull request #2321 from Dokploy/1738-database-placement-constraints
feat(cluster-settings): Add swarm settings for databases
2025-08-03 17:41:08 -06:00
Mauricio Siu
e96a8ea4ad feat(databases): increment ForceUpdate in TaskTemplate for service updates across MariaDB, MongoDB, MySQL, Postgres, and Redis 2025-08-03 17:39:35 -06:00
Mauricio Siu
42864d2472 feat(docker): update generateConfigContainer to accept Partial<ApplicationNested> and enhance mount checks 2025-08-03 17:21:09 -06:00
Mauricio Siu
ae25ea265c feat(databases): enhance database service configuration by integrating health checks, restart policies, and additional settings across MariaDB, MongoDB, MySQL, Postgres, and Redis 2025-08-03 16:52:43 -06:00
Mauricio Siu
0755f28307 refactor(cluster-settings): update dialog content and improve layout in swarm settings component 2025-08-03 16:45:07 -06:00
Mauricio Siu
3d10d48425 fix(cluster-settings): ensure data validation for registryId in form defaults 2025-08-03 16:40:24 -06:00
Mauricio Siu
6e79183f6a feat(cluster-settings): refactor cluster settings components to support multiple database types and add new swarm configuration fields 2025-08-03 16:36:14 -06:00
Mauricio Siu
2318fb062a Merge pull request #2320 from Dokploy/2004-how-to-pause-log-output-in-doploy
feat(docker-logs): add pause/resume functionality for log streaming
2025-08-03 15:45:54 -06:00
Mauricio Siu
14b4bc9d85 feat(docker-logs): add pause/resume functionality for log streaming with message buffering 2025-08-03 15:43:53 -06:00
Mauricio Siu
4c72f1894c Merge pull request #2319 from Dokploy/1614-sort-project-alphabetically-and-by-other-criteria
feat(show-projects): implement project sorting and filtering function…
2025-08-03 15:25:52 -06:00
Mauricio Siu
ebd632df04 feat(show-projects): implement project sorting and filtering functionality 2025-08-03 15:24:56 -06:00
Mauricio Siu
4878ed2b6f Merge pull request #2318 from Dokploy/2223-local-deployment-doesnt-replace-old-container
feat(handle-ports): add publish mode warning for host mode limitations
2025-08-03 15:15:05 -06:00
Mauricio Siu
1d3ab2bafa feat(handle-ports): add publish mode warning for host mode limitations 2025-08-03 15:13:11 -06:00
Mauricio Siu
7cb7cfa2a8 feat(pr-template): add a pull request template to standardize submissions 2025-08-03 13:38:17 -06:00
Mauricio Siu
6009697710 Merge pull request #2312 from JamBalaya56562/create-pr
ci(create-pr): remove unused id
2025-08-03 13:30:29 -06:00
Mauricio Siu
6be86b49bb Merge pull request #2292 from JamBalaya56562/lint-shared
refactor: lint apps/components/shared files
2025-08-03 13:27:11 -06:00
Mauricio Siu
1e81244e0b docs(contributing): update pull request guidelines and clarify branch roles 2025-08-03 13:21:02 -06:00
Mauricio Siu
f659ea463d Merge pull request #2311 from JamBalaya56562/contributing
docs(contributing): use Alerts syntax of GitHub markdown
2025-08-03 13:17:16 -06:00
JamBalaya56562
22c7c6e6fb ci(pull-request): use strategy matrix 2025-08-03 18:40:37 +09:00
JamBalaya56562
caf57276a4 ci(create-pr): remove unused id 2025-08-03 18:09:33 +09:00
JamBalaya56562
15c6c7e657 docs(contributing): use Alerts syntax of GitHub markdown 2025-08-03 17:50:29 +09:00
JamBalaya56562
8be0db385a refactor: lint apps/components/shared files 2025-08-03 17:25:06 +09:00
Mauricio Siu
4259e2533e Merge pull request #2309 from Dokploy/1778-railpack-frontend-version-is-hardcoded
1778 railpack frontend version is hardcoded
2025-08-03 02:22:40 -06:00
Mauricio Siu
a138d12082 chore(tests): set railpackVersion to '0.2.2' in drop test configuration 2025-08-03 02:20:28 -06:00
Mauricio Siu
a2405ddd84 chore(build): add cleanup step to remove builder container after Railpack build completion 2025-08-03 02:14:59 -06:00
Mauricio Siu
e785ad5599 fix(build): set default railpackVersion to '0.2.2' and ensure cleanup in build process
- Updated the ShowBuildChooseForm component to default railpackVersion to '0.2.2' if not specified.
- Added cleanup step in the buildRailpack function to remove the builder container after execution.
- Refactored application router to include railpackVersion in the application schema.
2025-08-03 02:00:10 -06:00
Mauricio Siu
cc6445a8ec feat(application): add railpackVersion field to application schema and update related components
- Introduced a new column `railpackVersion` in the application table with a default value of '0.2.2'.
- Updated the application form to include a field for `railpackVersion` when the build type is set to railpack.
- Adjusted the build process to utilize the specified `railpackVersion` dynamically.
- Enhanced validation schema to accommodate the new field.
2025-08-03 01:54:07 -06:00
Mauricio Siu
b8f27d7b76 Merge pull request #2306 from Dokploy/2170-docker-compose-volume-mount-causes-oci-runtime-exec-failed-unless-container-is-force-recreated
refactor(docker): update docker exec command to set working directory…
2025-08-03 01:48:22 -06:00
Mauricio Siu
32f61b5e9b refactor(docker): update docker exec command to set working directory for terminal sessions 2025-08-03 01:47:31 -06:00
Mauricio Siu
e2d6b5eb8a Merge pull request #2305 from Dokploy/2249-traefik-doesnt-reload-when-installed-as-a-docker-service
refactor(traefik): update Traefik initialization to support standalon…
2025-08-03 01:21:45 -06:00
Mauricio Siu
7413c9484a refactor(settings): remove unused getTraefikPorts function to streamline settings router 2025-08-03 01:19:14 -06:00
Mauricio Siu
607c505c4b refactor(traefik): update Traefik initialization to support standalone and service modes, enhance port handling with protocol specification 2025-08-03 01:18:18 -06:00
Mauricio Siu
42629e83a1 Merge pull request #2304 from Dokploy/1681-application-automated-build-fails-due-connection-http-basic-access-denied
refactor(gitea, gitlab): remove unused parameters and fetch entities …
2025-08-02 21:24:51 -06:00
Mauricio Siu
b9f18cddf7 refactor(gitlab): reorder token refresh and provider fetching for improved clarity 2025-08-02 21:24:33 -06:00
Mauricio Siu
2790895642 refactor(gitea, gitlab): remove unused parameters and fetch entities by ID 2025-08-02 21:20:50 -06:00
Mauricio Siu
c21c88d89f chore(package): bump version from v0.24.5 to v0.24.6 2025-08-02 19:37:10 -06:00
Mauricio Siu
bf6b9c6893 Merge pull request #2302 from Dokploy/2281-url-rewrite-via-domain-routing-not-functioning
refactor(domain): enhance middleware handling for Traefik routers and…
2025-08-02 19:32:33 -06:00
Mauricio Siu
e08fe1dbea test(labels): add comprehensive tests for middleware handling in createDomainLabels function 2025-08-02 19:31:21 -06:00
Mauricio Siu
0b9eaac390 refactor(domain): enhance middleware handling for Traefik routers and improve path validation 2025-08-02 19:24:11 -06:00
Mauricio Siu
5ed49a5ca1 Merge pull request #2301 from Dokploy/2074-keep-latest-is-not-respected
fix(backups): change backup file extension from .dump.gz to .sql.gz f…
2025-08-02 18:41:11 -06:00
Mauricio Siu
1300a6242c fix(backups): change backup file extension from .dump.gz to .sql.gz for consistency 2025-08-02 18:40:40 -06:00
Mauricio Siu
201f07c084 fix(volumes): adjust layout for volume display and improve conditional rendering 2025-08-02 16:13:51 -06:00
Mauricio Siu
c5161f1612 Merge pull request #2300 from Dokploy/2259-file-mounts-not-updating
feat(mount): refactor updateMount logic and add updateFileMount funct…
2025-08-02 16:08:15 -06:00
Mauricio Siu
0755de03c2 feat(mount): refactor updateMount logic and add updateFileMount function for handling file mounts 2025-08-02 16:06:46 -06:00
Mauricio Siu
f376ea5fec Merge pull request #2297 from Dokploy/feat/add-custom-service-field-domains-compose
feat(dashboard): add manual input for service name in domains for docker compose
2025-08-02 13:21:01 -06:00
Mauricio Siu
346eb24926 feat(dashboard): add manual input option for service name selection in domain handling 2025-08-02 13:20:00 -06:00
Mauricio Siu
fe45c69939 Merge pull request #2296 from Dokploy/2291-mise-is-trying-to-verify-the-gpg-signature-of-the-nodejs-binary-for-node22180-but-it-cant-find-the-public-key-used-to-verify-the-signature
chore: update Railpack version to 0.2.2 in Dockerfile and related scr…
2025-08-02 13:14:58 -06:00
Mauricio Siu
39d46a51b3 chore: update Railpack version to 0.2.2 in Dockerfile and related scripts 2025-08-02 13:08:46 -06:00
Mauricio Siu
3e193590cc Merge pull request #2295 from JamBalaya56562/readme
docs: polish `README.md`
2025-08-02 12:50:26 -06:00
Mauricio Siu
c157a353f3 Merge pull request #2279 from A-D-E/fix/gitlab-branches-pagination
The getGitlabBranches function was only returning the first 20 branches
2025-08-02 12:48:32 -06:00
Mauricio Siu
2a14ae0c7f Merge branch 'canary' into fix/gitlab-branches-pagination 2025-08-02 12:44:14 -06:00
JamBalaya56562
144c74e7f7 docs: polish README.md 2025-08-02 20:38:28 +09:00
Mauricio Siu
1d4d766f3a Merge pull request #2229 from danielepintore/canary
feat(dashboard): generate user fallback avatar using user email and allow user to choose default avatar
2025-08-02 00:34:16 -06:00
Mauricio Siu
025d439f71 Merge branch 'canary' into feat/label-previews 2025-08-02 00:28:52 -06:00
Mauricio Siu
8532cba638 Merge pull request #2255 from Marukome0743/lint-layouts
refactor: lint apps/components/layouts files
2025-08-02 00:27:09 -06:00
Mauricio Siu
fdb4b176cb Merge pull request #2254 from Marukome0743/lint-test
refactor: lint apps/docker/__test__ files
2025-08-02 00:27:00 -06:00
Mauricio Siu
f2b214f8f0 Merge pull request #2266 from rainwashed/canary
fix: github app creation name conflicting with already existing Dokploy names
2025-08-02 00:23:15 -06:00
autofix-ci[bot]
0bcc59f90f [autofix.ci] apply automated fixes 2025-08-02 06:19:09 +00:00
Mauricio Siu
7ae4bf3215 Merge pull request #2290 from Dokploy/2277-two-copies-of-the-same-volume-backup-are-uploaded-to-s3
refactor(backup): consolidate utility imports and add local backup cl…
2025-08-01 01:28:17 -06:00
Mauricio Siu
0f5cf37757 refactor(backup): consolidate utility imports and add local backup cleanup after S3 upload 2025-08-01 01:27:35 -06:00
Mauricio Siu
a7bde655da Merge pull request #2289 from Dokploy/2282-custom-compose-path-not-being-used-when-manually-restarting-service
refactor(compose): reorganize imports and simplify command execution …
2025-08-01 01:16:33 -06:00
Mauricio Siu
295b6df5e1 refactor(compose): reorganize imports and simplify command execution for starting Docker Compose 2025-08-01 01:15:29 -06:00
Mauricio Siu
b5b63eae4f Merge pull request #2288 from Dokploy/git-fetch-origin-git-checkout-2263-swarm-containers-no-data-found
refactor(application): update application handling to support multipl…
2025-08-01 00:35:32 -06:00
Mauricio Siu
794e03460f refactor(application): update application handling to support multiple app names and improve data structure 2025-08-01 00:34:57 -06:00
Mauricio Siu
275d7ee586 refactor(billing): reorganize imports and adjust layout for better UI consistency 2025-07-31 03:37:09 -06:00
Mauricio Siu
29aae91959 feat(dashboard): implement form handling for server selection with Zod validation and enhance UI components 2025-07-31 03:35:48 -06:00
Mauricio Siu
ab6cb7349e feat(dashboard): refactor billing settings to use form handling with Zod validation and improve server selection UI 2025-07-31 03:17:45 -06:00
Mauricio Siu
e36c665e02 Merge branch 'canary' into feat/introduce-server-pay 2025-07-31 02:49:06 -06:00
A-D-E
e8f36f8ba5 The getGitlabBranches function was only returning the first 20 branches
due to GitLab's default API pagination limit. This prevented users from
accessing branches in repositories with more than 20 branches.

Changes:
- Add pagination loop to fetch all branches across multiple pages
- Set per_page to 100 (GitLab's maximum) for efficiency
- Add safety check using x-total header to prevent unnecessary requests
- Follow the same pagination pattern as validateGitlabProvider function

Fixes issue where branch selection was limited to first 20 branches
in repositories with many branches.
2025-07-30 15:17:14 +02:00
f9210d3165 lint: formatted changes using biome 2025-07-28 23:39:06 +02:00
rainwashed
9bc6411c98 fix: github app creation name conflicting with already existing Dokploy-Time names
appended a 5-char random string to the name creation as to prevent
conflicts with other existing Dokploy GitHub apps.
2025-07-28 17:18:30 -04:00
f8261b5364 feat(dashboard): use username instead of email for the generation of the
fallback avatar image
2025-07-28 19:20:05 +02:00
30c2c7afb0 feat(dashboard): generate user fallback avatar using user email. Allow
user to select the default avatar.
2025-07-28 16:17:52 +02:00
Marukome0743
f26c1c0da6 refactor: lint apps/docker/__test__ files 2025-07-28 20:32:08 +09:00
Marukome0743
d02976476a refactor: lint apps/components/layouts files 2025-07-28 19:56:44 +09:00
Mauricio Siu
17e9154887 Merge pull request #2257 from Dokploy/fix/send-build-error-on-remote-servers
Fix/send build error on remote servers
2025-07-28 01:52:57 -06:00
Mauricio Siu
2442494096 fix(application): simplify error message handling in deployment notifications 2025-07-28 01:51:21 -06:00
Mauricio Siu
bac2afb423 refactor(application): exclude appName from updateApplication data to streamline database updates 2025-07-28 01:50:58 -06:00
Mauricio Siu
4e9630e976 Merge pull request #2256 from Dokploy/feat/enhancements-cloud-version-ui
feat(dashboard): enhance application and database forms with tooltips…
2025-07-28 01:50:26 -06:00
Mauricio Siu
558f6aecae fix(application): improve error handling and notification messages during deployment 2025-07-28 01:48:33 -06:00
autofix-ci[bot]
9baafb83ff [autofix.ci] apply automated fixes 2025-07-28 07:38:28 +00:00
Mauricio Siu
c3e2b0d0f1 feat(dashboard): enhance application and database forms with tooltips for better user guidance 2025-07-28 01:12:43 -06:00
Mauricio Siu
11d584316a chore(package): bump version to v0.24.5 2025-07-28 00:57:44 -06:00
Mauricio Siu
f78dc555b2 Merge pull request #2244 from jhon2c/feat/improve-server-ux
feat(ux): Improve UX Based on Community Feedback
2025-07-27 23:21:24 -06:00
Mauricio Siu
5812b12a59 Merge pull request #2236 from masesisaac/canary
fix(dashboard): Update app security view to hide password
2025-07-27 23:16:07 -06:00
Mauricio Siu
7301d15e8f Merge pull request #2230 from amustapha/patch-1
fix: wrap user prompt in ai modal to prevent text stretch
2025-07-27 23:15:01 -06:00
Mauricio Siu
f79796a6c8 Merge pull request #2188 from Marukome0743/vscode
chore: add biome settings for vscode editor
2025-07-27 23:14:33 -06:00
Mauricio Siu
4122b37abd Merge pull request #2250 from Dokploy/feat/add-name-field-to-profile
feat(profile): add optional name field to user profile form and schema
2025-07-27 23:13:26 -06:00
Mauricio Siu
79e9593663 feat(profile): add optional name field to user profile form and schema 2025-07-27 23:13:06 -06:00
masesisaac
def3fa0030 fix(security): change password input type to 'password' 2025-07-28 04:58:43 +03:00
autofix-ci[bot]
d561068bcd [autofix.ci] apply automated fixes 2025-07-26 17:26:20 +00:00
Jhon
212c1b2d5f feat(dashboard): show "Action Required" badge for incomplete Git provider setup 2025-07-26 14:18:26 -03:00
Jhon
d3a54172b5 feat(ux): add conditional server selection functionality to application forms 2025-07-26 13:53:28 -03:00
PiquelChips
1f9ef473f1 format some files 2025-07-24 19:45:43 +02:00
PiquelChips
a0bbf7be23 add check for presence of labels 2025-07-24 19:35:33 +02:00
PiquelChips
a5bc384d77 run database migration 2025-07-24 19:02:50 +02:00
masesisaac
cda33eb291 refactor(dashboard): reorder imports in show-security.tsx for consistency 2025-07-24 17:45:26 +03:00
masesisaac
c178234e53 fix(dashboard): hide basic auth password by default 2025-07-24 17:41:51 +03:00
PiquelChips
f2ae39aa86 feat: preview deployments for pull requests with specific labels 2025-07-23 21:39:54 +02:00
Abdulhakeem Adetunji Mustapha
329db1fd1a fix: wrap user prompt in ai modal to prevent text stretch 2025-07-23 19:30:47 +01:00
Mauricio Siu
f3dc480b70 feat(api): integrate openapi-fetch for Hetzner and Hostinger services, enhancing API interaction and simplifying data fetching 2025-07-23 01:21:11 -06:00
Mauricio Siu
6758ef1542 refactor(services): convert fetch functions to arrow functions for consistency in Hetzner and Hostinger services 2025-07-23 00:43:32 -06:00
Mauricio Siu
bd4ff2dbf2 refactor(billing): remove unused functions and streamline Hostinger server data handling 2025-07-23 00:35:47 -06:00
Marukome0743
6efbf030a7 chore: add biome settings for vscode editor 2025-07-23 08:49:59 +09:00
Mauricio Siu
579a2262bf feat(billing): add support for Hetzner and Hostinger server providers with updated pricing and specifications 2025-07-21 00:23:51 -06:00
Mauricio Siu
b95dfed8fc chore(package): bump version to v0.24.4 2025-07-20 20:06:47 -06:00
Mauricio Siu
7fe3418d55 Merge pull request #2218 from Dokploy/2179-reloading-traefik-on-the-remote-server-will-cause-traefik-on-the-instance-to-change-accordingly
fix(traefik): remove duplicate file write operation in writeTraefikCo…
2025-07-20 20:05:48 -06:00
Mauricio Siu
288d86c73b fix(traefik): remove duplicate file write operation in writeTraefikConfigInPath function 2025-07-20 20:05:30 -06:00
Mauricio Siu
ffd5ccd386 Merge pull request #2202 from gentslava/feat/traefik-config
feat(config): Traefik
2025-07-20 19:45:53 -06:00
Mauricio Siu
98ddd096e5 Update packages/server/src/setup/traefik-setup.ts 2025-07-20 19:45:41 -06:00
Mauricio Siu
da6cc9fe72 Merge pull request #2190 from Marukome0743/format
chore: version up format.yml actions
2025-07-20 19:44:20 -06:00
Mauricio Siu
22d0af269e Merge pull request #2200 from Marukome0743/server
refactor: lint and sort imports on dokploy/server
2025-07-20 19:42:15 -06:00
Mauricio Siu
f0fdc46de5 Merge pull request #2187 from Marukome0743/v2
chore: upgrade to Biome v2
2025-07-20 19:41:49 -06:00
Mauricio Siu
9aea24115d Merge pull request #2199 from Marukome0743/lint
refactor: lint and sort import on dokploy application
2025-07-20 19:41:02 -06:00
Mauricio Siu
a9ee6c2393 Merge pull request #2194 from Marukome0743/pnpm
chore(package): version up pnpm to v9.12.0
2025-07-20 19:40:09 -06:00
Mauricio Siu
349717044c Merge pull request #2196 from Marukome0743/dispatch
ci: remove custom branch and add workflow_dispatch event
2025-07-20 19:37:27 -06:00
Mauricio Siu
f94f32695f Merge pull request #2195 from Marukome0743/monitoring
chore: remove `apps/monitoring` from `pnpm-workspace.yaml`
2025-07-20 19:37:07 -06:00
Mauricio Siu
37b78ea09c Merge pull request #2217 from Dokploy/2201-daily-docker-cleanup-not-working-on-remote-server
fix(dashboard): update Docker cleanup toggle logic to prioritize serv…
2025-07-20 19:01:46 -06:00
Mauricio Siu
9b89b4631f fix(dashboard): update Docker cleanup toggle logic to prioritize server settings 2025-07-20 19:01:20 -06:00
Mauricio Siu
7100095f2b Merge pull request #2216 from Dokploy/2209-update-s3-destination-form-loses-its-state-when-current-tab-loses-its-focus
fix(dashboard): disable refetch on window focus for destination handling
2025-07-20 18:57:33 -06:00
Mauricio Siu
a36ab65aa6 fix(dashboard): disable refetch on window focus for destination handling 2025-07-20 18:56:35 -06:00
Mauricio Siu
bf81ba20ff Merge pull request #2215 from Dokploy/2197-git-provider-api-undefined_value-error
refactor(auth): simplify user session structure in validateRequest fu…
2025-07-20 18:55:16 -06:00
Mauricio Siu
658a4a9b99 refactor(auth): simplify user session structure in validateRequest function
- Changed user object in mockSession to only include userId, removing email and name for a more streamlined session representation.
2025-07-20 18:54:57 -06:00
Mauricio Siu
47cb096cf3 Merge pull request #2214 from Dokploy/2203-identical-webhook-redeploy-url-after-duplicating-project
feat(project): add refreshToken to application and compose data retri…
2025-07-20 18:45:39 -06:00
Mauricio Siu
f3856722da feat(project): add refreshToken to application and compose data retrieval
- Included refreshToken in the data returned from findApplicationById and findComposeById functions to enhance application state management.
2025-07-20 18:45:18 -06:00
Vyacheslav Scherbinin
a67c3eb979 feat(conf): accessLog filePath 2025-07-16 16:46:47 +07:00
Vyacheslav Scherbinin
aaa205f104 feat(conf): disable sendAnonymousUsage 2025-07-16 12:29:31 +07:00
Marukome0743
cadea7ff28 refactor: lint and sort imports on dokploy/server 2025-07-15 14:22:37 +09:00
Marukome0743
9ab937f726 refactor: lint dokploy application 2025-07-15 14:13:32 +09:00
Marukome0743
d0af517eb7 ci: remove custom branch and add workflow_dispatch event 2025-07-14 19:03:41 +09:00
Marukome0743
66bdf9bf0a chore: remove apps/monitoring from pnpm-workspace.yaml 2025-07-14 18:24:26 +09:00
Marukome0743
d4a3af475a chore(package): version up pnpm to v9.12.0 2025-07-14 15:58:20 +09:00
autofix-ci[bot]
e92a8d7c98 [autofix.ci] apply automated fixes 2025-07-14 15:30:24 +09:00
Marukome0743
c4fec8cee5 chore: upgrade to Biome v2 2025-07-14 15:30:23 +09:00
Marukome0743
55f75bce53 chore: version up format.yml actions 2025-07-14 15:30:06 +09:00
Mauricio Siu
fdc524d79d fix(ui): adjust layout in UpdateServer component
- Removed unnecessary padding from DialogContent for a cleaner appearance.
- Added margin-top to the button container for improved spacing.
2025-07-13 23:37:05 -06:00
Mauricio Siu
93d6662466 docs(preview): update collaborator permission description in preview settings 2025-07-13 23:26:41 -06:00
Mauricio Siu
1977235d31 Merge pull request #2192 from Dokploy/fix/preview-deployments-public-repos
feat(preview): add collaborator permission requirement for preview de…
2025-07-13 23:20:51 -06:00
Mauricio Siu
1dd713a1d1 fix(deploy): change preview deployment limit check to be exclusive 2025-07-13 23:20:23 -06:00
Mauricio Siu
18b65f28f2 chore(package): bump version to v0.24.3 and comment out unused trustedOrigins function in auth.ts 2025-07-13 23:19:31 -06:00
Mauricio Siu
666db23b8e test: add previewRequireCollaboratorPermissions field to drop and traefik test cases 2025-07-13 23:17:32 -06:00
Mauricio Siu
2ca5321fdc feat(preview): add collaborator permission requirement for preview deployments
- Introduced a new boolean field `previewRequireCollaboratorPermissions` in the application schema to enforce permission checks for preview deployments.
- Updated the UI to include a toggle for this setting in the preview deployment settings.
- Enhanced GitHub deployment handler to validate PR authors against the required permissions, blocking unauthorized deployments and providing security notifications.
- Added SQL migration to update the database schema accordingly.
2025-07-13 23:12:09 -06:00
Mauricio Siu
3f3ff9670b chore(package): bump version to v0.24.2 2025-07-13 20:45:33 -06:00
Mauricio Siu
7fb902551e Merge pull request #2189 from jhon2c/fix/logs-overflow
fix(logs): Restore overflow classnames in logs components
2025-07-13 20:44:34 -06:00
Jhon
a201b3f979 fix(ui): regression of overflow-y-auto class in non dialog related componentes 2025-07-13 21:28:50 -03:00
Jhon
01d78e50fc fix(logs): adds back overflow classnames 2025-07-13 21:09:12 -03:00
Mauricio Siu
6681ba7bbd Merge pull request #2185 from Dokploy/fix/make-monitoring-restart-automatically
feat(monitoring): add RestartPolicy configuration for server and web …
2025-07-13 13:18:09 -06:00
Mauricio Siu
0b71411c0e feat(monitoring): add RestartPolicy configuration for server and web monitoring setups 2025-07-13 13:17:48 -06:00
Mauricio Siu
19f7465910 chore(docker): activate pnpm 9.12.0 in all Dockerfiles 2025-07-13 13:11:19 -06:00
Mauricio Siu
f33dd37571 Merge pull request #2184 from Dokploy/refactor/update-docker-base-images
chore(docker): update Node.js version to 20.16.0 in all Dockerfiles
2025-07-13 12:54:32 -06:00
Mauricio Siu
a0031ed07f chore(docker): update Node.js version to 20.16.0 in all Dockerfiles 2025-07-13 12:03:01 -06:00
Mauricio Siu
2ca4e264c4 Merge pull request #2082 from Marukome0743/dependencies
chore: match dependencies with current ones in pnpm-lock.yaml
2025-07-13 12:01:12 -06:00
Mauricio Siu
fa81d04fb3 Merge pull request #2164 from croatialu/fix/gitlab-deployments
fix(gitlab): Support dynamically generating clone URLs based on protocols
2025-07-13 11:55:19 -06:00
Mauricio Siu
bd8745393b chore(package): bump version to v0.24.1 2025-07-13 11:55:04 -06:00
autofix-ci[bot]
691c83c256 [autofix.ci] apply automated fixes 2025-07-13 17:54:36 +00:00
Mauricio Siu
6bd85e9216 Merge pull request #2182 from jhon2c/fix/dialog-crash
fix(ui):  Fix Dialogs Infinite Render Loops and Command Component Conflicts
2025-07-13 11:53:11 -06:00
Jhon
79c29fa92d fix(typo): fixed typo on replace classname 2025-07-13 13:58:25 -03:00
autofix-ci[bot]
89f71fe889 [autofix.ci] apply automated fixes 2025-07-13 16:50:41 +00:00
Jhon
bddafe294d fix(classname): removes leading blank space on classnames 2025-07-13 13:47:27 -03:00
Jhon
94829daf15 fix(ui): code formatting and DialogHeader improvements
- Apply consistent code formatting across dialog components
- Add bottom padding to DialogHeader for better visual separation
- Clean up DialogHeader usage in swarm settings (remove duplicate padding)
- Improve schedule dialog layout and add proper description
- Fix indentation and formatting inconsistencies

Final cleanup of dialog component formatting and spacing.
2025-07-13 13:35:26 -03:00
Jhon
2209d44ea5 fix(ui): update remaining dialog components with improved layouts
- Fix application import dialog positioning
- Update organization management dialog styling
- Ensure consistent DialogFooter behavior across all components

Completes the dialog layout improvements for better spacing and positioning.
2025-07-13 13:03:24 -03:00
Jhon
b12c035527 fix(ui): improve DialogFooter layout in settings dialogs
- Update certificate management dialog footer styling
- Enhance destination settings dialog layout
- Improve notification settings dialog footer spacing
- Add responsive design improvements for server creation dialog

Ensures consistent footer behavior across settings panels.
2025-07-13 13:03:11 -03:00
Jhon
baadba542f fix(ui): update DialogFooter styling in cluster management dialogs
- Add responsive layout and proper spacing to swarm settings footer
- Update registry dialog footer with improved flex layout
- Ensure proper button alignment on mobile and desktop
- Add sticky positioning for better UX in long forms
2025-07-13 13:01:36 -03:00
Jhon
a8fc052cbf fix(ui): resolve dialog closing issues with Command components
- Replace custom overlay click handler with proper onInteractOutside
- Add detection for Command components to prevent unwanted closures
- Restore overlay visibility without click handler conflicts
- Separate DialogFooter from scrollable content for proper spacing
- Add border and padding to DialogFooter container for visual separation

Fixes dialogs closing unexpectedly when used inside Command menus.
2025-07-13 13:00:21 -03:00
Jhon
fa5994bd47 fix(ui): remove max-h-screen and overflow-y-auto from remaining dialogs
Clean up any remaining dialog components with problematic CSS classes.
Complete removal of classes that interfere with new scroll handling system.
2025-07-13 12:17:05 -03:00
Jhon
96d0810607 fix(ui): remove max-h-screen and overflow-y-auto from project and database dialogs
Remove problematic CSS classes from:
- Project creation and management dialogs
- Database backup and restore dialogs
- Compose service management dialogs
- Template and AI generator dialogs

Ensures stable dialog behavior.
2025-07-13 12:16:51 -03:00
Jhon
2d382ea1be fix(ui): remove max-h-screen and overflow-y-auto from settings dialogs
Remove problematic CSS classes from system settings:
- Git provider configurations
- User management dialogs
- API key management
- Certificate management
- Notification settings
- Server management dialogs
- Profile and 2FA settings

Fixes render loops in admin panels.
2025-07-13 12:16:35 -03:00
Jhon
d78974efc0 fix(ui): remove max-h-screen and overflow-y-auto from advanced settings dialogs
Remove problematic CSS classes from advanced application dialogs:
- Cluster and swarm settings
- Port configuration
- Security settings
- Traefik configuration
- Volume management
- Redirect configuration

Prevents tab hangs with overflow content.
2025-07-13 12:15:36 -03:00
Jhon
81040c899f fix(ui): remove max-h-screen and overflow-y-auto from application feature dialogs
Remove problematic CSS classes from:
- Domain management dialogs
- Preview deployment dialogs
- Schedule configuration dialogs
- Volume backup dialogs

Ensures proper scrolling without render loops.
2025-07-13 12:15:09 -03:00
Jhon
c7344190b4 fix(ui): remove max-h-screen and overflow-y-auto from deployment dialogs
Remove problematic CSS classes from:
- Application deployment modals
- Docker logs modals
- Swarm application dialogs

Fixes infinite render loops with tall content.
2025-07-13 12:14:49 -03:00
Jhon
257c0eb106 fix(ui): remove max-h-screen and overflow-y-auto from service update dialogs
Remove problematic CSS classes that cause infinite render loops in:
- Application update dialog
- Database update dialogs (Redis, MariaDB, MongoDB, PostgreSQL, MySQL)
- Compose update dialog

These classes are now handled internally by the DialogContent component.
2025-07-13 12:14:36 -03:00
Jhon
c03b9509c8 fix(ui): resolve dialog infinite render loops with tall content
- Force modal=false on all dialogs to prevent Radix UI render loops
- Add React context to share dialog state between components
- Implement custom overlay with proper click-to-close behavior
- Add body scroll lock tied to dialog open state (prevents stuck scroll)
- Create scrollable content wrapper with overscroll-contain
- Remove complex wheel event handlers that caused tab hangs
- Simplify dialog architecture for better maintainability
2025-07-13 11:36:10 -03:00
Mauricio Siu
d87205c4dc chore: update README.md by removing outdated sponsor links and adjusting community backers section 2025-07-13 01:56:17 -06:00
Mauricio Siu
48aef798e4 Merge pull request #2176 from gentslava/fix/git-providers-layout
fix(ui): git providers overflow
2025-07-13 01:23:48 -06:00
Vyacheslav Scherbinin
baa5cd5c58 fix(ui): available git providers layout 2025-07-12 14:05:44 +07:00
Vyacheslav Scherbinin
5aae36996e fix(ui): buttons grow 2025-07-12 13:52:53 +07:00
Vyacheslav Scherbinin
ec8fa9fefe fix(ui): buttons wrap 2025-07-12 13:50:43 +07:00
Vyacheslav Scherbinin
d959f59c2d fix(typo): double space 2025-07-12 13:36:28 +07:00
Mauricio Siu
a1169795e4 Merge pull request #2163 from croatialu/fix/gitlab-url
fix: Add gitlabUrl calculation logic and update link references
2025-07-12 00:15:12 -06:00
Mauricio Siu
10af7925db Merge pull request #2156 from gentslava/fix/overflow-scroll
fix(ui): tabs overflow and Tailwind config
2025-07-11 22:58:41 -06:00
Mauricio Siu
c64cdca2e8 Merge pull request #2174 from Dokploy/2147-container-name-exceeds-63-characters-when-cloning-multiple-projects
feat(project): update application name handling during duplication
2025-07-11 22:53:06 -06:00
Mauricio Siu
a5b95d8cf3 feat(project): update application name handling during duplication
- Extracted and modified the application name by removing the suffix after the last hyphen when duplicating various application types (Postgres, MariaDB, Mongo, MySQL, Redis, Compose).
- Ensured consistent naming for duplicated applications across different database types.
2025-07-11 22:52:47 -06:00
Mauricio Siu
78b60f7d8a Merge pull request #2167 from croatialu/fix/traefik-config-editor-mask
fix: Optimize the code editor component, adjust the style and structu…
2025-07-11 22:29:23 -06:00
autofix-ci[bot]
58e6a14cd6 [autofix.ci] apply automated fixes 2025-07-12 04:28:55 +00:00
croatialu
0aac6da554 fix: Optimize the code editor component, adjust the style and structure to ensure the overlay is correctly rendered in the disabled state. 2025-07-11 14:19:58 +08:00
croatialu
978c4d85c5 fix(gitlab): Support dynamically generating clone URLs based on protocols 2025-07-11 13:33:46 +08:00
croatialu
70e08c96eb fix: Add gitlabUrl calculation logic and update link references
- Use the useMemo hook to calculate gitlabUrl in the SaveGitlabProvider component.
- Update link references to use the dynamically generated gitlabUrl, ensuring links correctly point to the corresponding GitLab repositories.
2025-07-11 11:55:16 +08:00
Vyacheslav Scherbinin
027853a361 fix(ui): change gap 2025-07-09 18:20:07 +07:00
Vyacheslav Scherbinin
43ebe4dc7c fix(config): the min- and max- variants are not supported with a screens configuration containing mixed units 2025-07-09 18:17:32 +07:00
Vyacheslav Scherbinin
0113ebe7da fix(ui): compose provider tabs layout 2025-07-09 14:20:17 +07:00
Vyacheslav Scherbinin
c36b40aa29 fix(ui): application provider tabs layout 2025-07-09 14:20:07 +07:00
Vyacheslav Scherbinin
caea934f88 fix(typo): double space 2025-07-09 14:16:02 +07:00
autofix-ci[bot]
9b2ea1cade [autofix.ci] apply automated fixes 2025-07-09 07:07:04 +00:00
Vyacheslav Scherbinin
3a82c4b27b fix(ui): compose tabs overflow 2025-07-09 13:53:14 +07:00
Vyacheslav Scherbinin
22a26e9873 fix(ui): application tabs overflow 2025-07-09 13:53:05 +07:00
Marukome0743
226a287ce7 chore: update package.json 2025-07-09 15:33:37 +09:00
Mauricio Siu
320b927aac Merge pull request #2152 from nktnet1/fix-ui-compose-tablist
fix(ui): adjust tablist item width for compose services
2025-07-08 21:47:16 -06:00
Khiet Tam Nguyen
d799b460bd fix(ui): adjust tablist item width for compose services 2025-07-08 20:08:26 +10:00
Mauricio Siu
3ed9da147b Merge pull request #2144 from Marukome0743/sponser
docs: fix broken README.md sponsers images
2025-07-06 21:16:45 -06:00
Marukome0743
636dec4f09 docs: fix broken README.md sponsers images 2025-07-07 10:35:32 +09:00
Mauricio Siu
4dcf6cf4c3 refactor(volume-backups): comment out keepLatestCount field and related logic
- Commented out the keepLatestCount field in the form schema and its usage in the HandleVolumeBackups component.
- Updated related form field rendering to prevent rendering of the keepLatestCount input.
2025-07-06 18:58:26 -06:00
Mauricio Siu
7356d71626 Merge pull request #1866 from Dokploy/1853-external-volume-should-not-be-isolated
refactor: remove unused volume suffix function from collision utility
2025-07-06 18:50:47 -06:00
Mauricio Siu
76603f598c feat(database): add isolatedDeploymentsVolume column to compose table
- Introduced a new boolean column "isolatedDeploymentsVolume" to the "compose" table with a default value of false.
- Updated existing records to set "isolatedDeploymentsVolume" to true.
- Modified related functions to handle the new column for improved deployment isolation management.
2025-07-06 18:46:36 -06:00
Mauricio Siu
e050c218e2 Merge branch 'canary' into 1853-external-volume-should-not-be-isolated 2025-07-06 18:29:00 -06:00
Mauricio Siu
46e0b5df75 Update package.json 2025-07-06 17:57:22 -06:00
Mauricio Siu
5b36503a3f Merge pull request #2134 from andr3i1010/canary
fix: fix environment variable parsing for railpack
2025-07-06 17:09:04 -06:00
Mauricio Siu
b9afc551db Merge pull request #2142 from Dokploy/fix/rollbacks-dns-issue
fix(rollbacks): correct dns issue resolution
2025-07-06 16:44:14 -06:00
Mauricio Siu
078ca19578 feat(rollbacks): enhance rollback functionality with full context support
- Updated the rollbacks schema to include mounts, ports, and optional registry information in the full context.
- Refactored the rollback service to utilize the full context for improved rollback operations, ensuring all necessary configurations are applied.
- Exported the getAuthConfig function for better accessibility in the application context.
2025-07-06 16:43:44 -06:00
Mauricio Siu
b7dc7bbf0c Merge pull request #2141 from Dokploy/1992-gitlab-repository-selection
fix(gitlab): update repository selection to use URL instead of name
2025-07-06 13:57:13 -06:00
Mauricio Siu
b9ee81aa59 fix(gitlab): update repository selection to use URL instead of name
- Changed the repository selection logic in SaveGitlabProvider and SaveGitlabProviderCompose components to use the repository URL for better accuracy.
- Updated the condition for displaying the selected repository in the CheckIcon component to compare against the gitlabPathNamespace instead of the repository name.
- Refactored the getGitlabRepositories function to simplify the group name check logic.
2025-07-06 13:56:58 -06:00
Mauricio Siu
b2d01a2889 Merge pull request #2140 from Dokploy/1187-swarm-service-bind-mounts-not-working-unless-manually-created
feat(volumes): add alert block for bind mount validation in AddVolume…
2025-07-05 17:18:24 -06:00
Mauricio Siu
5ec3d63ab2 feat(volumes): add alert block for bind mount validation in AddVolumes component
- Introduced an AlertBlock to provide users with warnings about host path validity and potential deployment issues when using bind mounts in the AddVolumes component.
- This enhancement improves user experience by ensuring users are informed of important considerations when configuring volumes.
2025-07-05 17:17:51 -06:00
Mauricio Siu
f0ef06ed8c Merge pull request #2139 from Dokploy/1541-register-login-screen-fails-on-chrome
1541 register login screen fails on chrome
2025-07-05 17:07:51 -06:00
Mauricio Siu
75b2c34a13 feat(api): implement lazy WebSocket client for improved connection management
- Introduced a `createLazyWSClient` function to manage WebSocket connections more efficiently by delaying the creation of the client until it's needed.
- Updated the `wsClient` initialization to use the new lazy client, enhancing performance and resource management in the application.
2025-07-05 17:06:39 -06:00
Mauricio Siu
cd4533df9e Merge branch 'canary' into 1541-register-login-screen-fails-on-chrome 2025-07-05 17:03:01 -06:00
Mauricio Siu
65a3d8175a Merge pull request #2138 from Dokploy/2109-reload-results-in-temporary-downtime-despite-healthcheck-zero-downtime-configured
refactor(application): remove redundant service stop logic
2025-07-05 16:48:18 -06:00
Mauricio Siu
d3702d22f2 refactor(application): remove redundant service stop logic
- Eliminated the conditional logic for stopping services based on serverId, streamlining the application status update process.
- This change enhances code clarity and maintains focus on application state management.
2025-07-05 16:47:44 -06:00
Mauricio Siu
d4b74c54da Merge pull request #2116 from Dokploy/394-ability-to-backup-named-volume-to-s3
394 ability to backup named volume to s3
2025-07-05 16:05:49 -06:00
Mauricio Siu
80ede659fb feat(volume-backups): enhance volume backup display with restore functionality
- Wrapped the volume backup handling component with a fragment to include the restore functionality.
- Added a new div for better layout and organization of the volume backup and restore components, improving user experience.
2025-07-05 16:00:01 -06:00
Mauricio Siu
c59ea57814 feat(database): add volume_backup table and update deployment schema
- Introduced a new "volume_backup" table to manage volume backup configurations, including fields for various database IDs and backup settings.
- Updated the "deployment" table to include a foreign key reference to the new "volume_backup" table.
- Added foreign key constraints to ensure data integrity across related tables.
- Updated journal and snapshot files to reflect these changes, enhancing the database schema for better backup management.
2025-07-05 15:40:57 -06:00
Mauricio Siu
381186c9f1 Merge branch 'canary' into 394-ability-to-backup-named-volume-to-s3 2025-07-05 15:40:25 -06:00
Mauricio Siu
05e0031daf refactor(database): remove volume_backup table and associated metadata
- Deleted the "volume_backup" table and its related SQL definitions, including foreign key constraints in the "deployment" table.
- Removed corresponding entries from the journal and snapshot files to ensure consistency and maintain a clean database schema.
- This cleanup improves the organization and maintainability of the database structure.
2025-07-05 15:40:14 -06:00
Mauricio Siu
1bacd42bf5 Merge pull request #2053 from jhon2c/feat/internal-path-routing
feat: add internal path routing and path stripping for domains
2025-07-05 15:34:58 -06:00
Mauricio Siu
2bc12a20ba Merge pull request #2128 from DearTanker/canary
Style: Change Node Applications dialog width, more easy to read.
2025-07-05 14:44:45 -06:00
Mauricio Siu
1943a9e8fa Merge pull request #2137 from Dokploy/2055-bug-report-requests-tab-limited-to-500-entries
fix(settings): update readMonitoringConfig to async and improve log r…
2025-07-05 14:44:34 -06:00
Mauricio Siu
db9109a3be fix(settings): update readMonitoringConfig to async and improve log reading efficiency 2025-07-05 14:43:49 -06:00
Jhonatan Caldeira
2f6084ec8f fix(conflicts): removed conflicted migrations 2025-07-05 16:08:09 -03:00
Jhonatan Caldeira
a62c9f63e1 Merge branch 'canary' into feat/internal-path-routing 2025-07-05 15:50:04 -03:00
autofix-ci[bot]
ee2bbf5e37 [autofix.ci] apply automated fixes 2025-07-05 17:38:16 +00:00
andrei1010
d27dff4906 fix: fix environment variable parsing for railpack 2025-07-05 17:14:28 +02:00
DearTanker
7874445510 Style: Change Node Applications dialog width, more easy to read. 2025-07-05 17:24:11 +08:00
Mauricio Siu
5c73ced500 chore(license): update copyright year to 2025 and remove obsolete dokploy license file 2025-07-05 01:38:37 -06:00
Mauricio Siu
b1450d14ac chore(package): bump version to v0.23.7 2025-07-05 01:36:13 -06:00
Mauricio Siu
c5e3b00990 Merge pull request #2125 from Dokploy/fix/issues
Fix/issues
2025-07-05 01:35:22 -06:00
Mauricio Siu
cf3f44f686 feat(database): add volume_backup table and related foreign key constraints
- Introduced a new table "volume_backup" to manage volume backup configurations.
- Added foreign key constraints linking "volumeBackupId" in the "deployment" table to the new "volume_backup" table.
- Updated the journal and snapshot files to reflect these changes, ensuring proper versioning and tracking.
2025-07-05 00:06:07 -06:00
Mauricio Siu
119883e746 Merge branch 'canary' into 394-ability-to-backup-named-volume-to-s3 2025-07-05 00:05:47 -06:00
Mauricio Siu
2918868166 refactor: remove deprecated volume backup SQL files and snapshots
- Deleted SQL files related to the volume_backup table, including type definitions, constraints, and columns that are no longer in use.
- Removed associated snapshot files to maintain consistency and reduce clutter in the database schema.
- This cleanup enhances the overall organization and maintainability of the database structure.
2025-07-05 00:05:36 -06:00
Mauricio Siu
715e44116d Merge pull request #2030 from s1nyx/fix/traefik-setup-was-not-pulling-image
fix(traefik-setup): now pulling the traefik image to make it sure it's present locally
2025-07-05 00:03:50 -06:00
Mauricio Siu
c15ee721ff feat(setup): add async execution of docker pull for traefik image during setup 2025-07-05 00:01:41 -06:00
Mauricio Siu
71befc3a4b Merge pull request #2115 from zuohuadong/canary
feat: fix OpencloudOS setup
2025-07-04 23:50:24 -06:00
Mauricio Siu
bca32f077b Merge pull request #2084 from Marukome0743/ubuntu
docs: update docker installation method of Ubuntu
2025-07-04 23:45:44 -06:00
Mauricio Siu
1afcecaec0 Merge pull request #2124 from Dokploy/feat/add-ports-publish-mode
Feat/add ports publish mode
2025-07-04 23:44:18 -06:00
Mauricio Siu
80b72dc75e fix: handle potential null values for publishMode in ShowPorts component 2025-07-04 23:42:35 -06:00
Mauricio Siu
5973d7b9b8 Merge branch 'canary' into feat/add-ports-publish-mode 2025-07-04 23:38:37 -06:00
autofix-ci[bot]
ab3a1504cf [autofix.ci] apply automated fixes 2025-07-05 05:37:11 +00:00
Mauricio Siu
f51c51958f feat: add publishMode column to port schema
- Introduced a new ENUM type "publishModeType" with values 'ingress' and 'host'.
- Added "publishMode" column to the "port" table with a default value of 'host'.
- Updated related metadata files to reflect the changes.
2025-07-04 23:33:21 -06:00
Mauricio Siu
f3703e6f5e Merge pull request #2112 from Marukome0743/error
refactor: remove unused catch errors
2025-07-04 23:29:28 -06:00
Mauricio Siu
14cb6cecae Merge pull request #2107 from DearTanker/canary
Style: Make all code editors apply Tailwind CSS font-mono style.
2025-07-04 23:24:01 -06:00
Mauricio Siu
6885b140eb Merge pull request #2108 from Marukome0743/blue
docs: remove blue underlink from README.md
2025-07-04 23:22:26 -06:00
Mauricio Siu
8e8712e33d style: align text in file tree component for improved readability 2025-07-04 23:17:19 -06:00
FelipeVasquez350
56fcaa8ccd Update show-port.tsx 2025-07-04 18:15:43 +02:00
FelipeVasquez350
d229284e5e Update handle-ports.tsx 2025-07-04 18:08:23 +02:00
FelipeVasquez350
3561b5cae6 feat: add option for publishMode in an application port settings 2025-07-04 18:01:13 +02:00
DearTanker
a3192d6584 Merge branch 'Dokploy:canary' into canary 2025-07-03 10:48:52 +08:00
DearTanker
24ea8b7fbd Style: Unspecify the popup list width to make the name appear in full 2025-07-03 10:39:58 +08:00
Marukome0743
e12df7b32e refactor: remove unused catch errors 2025-07-03 08:42:04 +09:00
Marukome0743
8001c9cfc2 docs: remove blue underlink from README.md 2025-07-03 08:41:38 +09:00
Marukome0743
a762b4b4ae docs: update docker installation method of Ubuntu 2025-07-03 08:41:08 +09:00
Jhonatan Caldeira
9cfbd664c5 Merge branch 'Dokploy:canary' into feat/internal-path-routing 2025-07-02 10:54:18 -03:00
huadong zuo
f9972bee60 Merge branch 'Dokploy:canary' into canary 2025-07-02 14:52:42 +08:00
Mauricio Siu
3970cd452b refactor: update volume backup imports for improved organization
- Changed import paths for findVolumeBackupById and findComposeById to enhance clarity and maintainability.
- Updated import structure to align with the latest service organization in the @dokploy/server package.
2025-07-02 00:52:25 -06:00
zuohuadong
6fc51e02a7 Revert "feat(swap): On hosts with less than 2G of memory, increase swap space to prevent installation failure."
This reverts commit 207fe6f477.
2025-07-02 14:51:48 +08:00
zuohuadong
fa7db0dc75 Revert "chore(setup):Increase interactive options"
This reverts commit 0c861585ed.
2025-07-02 14:50:39 +08:00
Mauricio Siu
107cdcee49 feat: extend volume backup functionality with scheduling and management
- Added support for volume backup jobs in the scheduling and removal processes.
- Enhanced job management to include volume backups in the job queue.
- Updated schema to accommodate volume backup data structure.
- Implemented initialization of volume backup jobs based on server status, improving backup management.
2025-07-02 00:45:57 -06:00
Mauricio Siu
6521491e2f feat: enhance volume backup scheduling and management
- Added initVolumeBackupsCronJobs function to initialize scheduled volume backups on server startup.
- Updated volumeBackupsRouter to handle scheduling and removal of volume backup jobs based on user input.
- Improved create and update volume backup logic to include scheduling functionality for both cloud and local environments.
- Introduced utility functions for scheduling and removing volume backup jobs, enhancing overall backup management.
2025-07-02 00:36:46 -06:00
Mauricio Siu
c5311f2a9f feat: implement volume backup and restore functionalities
- Added backupVolume and restoreVolume functions to handle the backup and restoration of volume data.
- Introduced a new index file to streamline exports for volume backup utilities.
- Updated volume backup logic to include scheduling and improved user feedback during operations.
- Refactored existing volume backup utilities for better organization and clarity.
2025-07-02 00:23:27 -06:00
Mauricio Siu
7726c8db21 fix: refine volume backup logic and enhance user feedback
- Updated HandleVolumeBackups to conditionally enable mount retrieval based on volumeBackupType, improving accuracy in fetching mounts.
- Enhanced backupVolume function to provide user feedback upon starting the compose container, ensuring better clarity during operations.
2025-07-02 00:09:07 -06:00
Mauricio Siu
b272f01a18 fix: update volume backup components for improved functionality
- Refactored HandleVolumeBackups to use consistent naming for mount items.
- Added an AlertBlock to RestoreVolumeBackups to inform users about potential volume name conflicts.
- Updated mount retrieval logic in the mount router to enhance accuracy and efficiency in fetching volume mounts.
2025-07-01 23:48:19 -06:00
Mauricio Siu
bddb07898e Merge branch 'canary' into 394-ability-to-backup-named-volume-to-s3 2025-07-01 23:32:50 -06:00
Mauricio Siu
2fe7349889 chore: update version in package.json to v0.23.6 2025-07-01 23:18:44 -06:00
Mauricio Siu
5c1c969873 Merge pull request #2113 from Dokploy/fix/schedules-rm
fix: prevent removal of current directory in deployment logs
2025-07-01 23:18:15 -06:00
Mauricio Siu
2f6f1b19e7 fix: prevent removal of current directory in deployment logs
- Updated the removeLastTenDeployments function to check if logPath is not the current directory before executing the removal command.
- Enhanced the unlink operation to ensure it only attempts to delete valid log paths.
2025-07-01 23:17:27 -06:00
Mauricio Siu
934ec9b16a fix: improve error handling during volume restoration process
- Simplified error handling in the volume restoration logic by removing detailed error messages and stack traces.
- Updated user feedback to provide clearer instructions when a volume is in use, enhancing the user experience during restoration attempts.
- Ensured that the restoration process aborts gracefully with informative messages when prerequisites are not met.
2025-07-01 01:21:54 -06:00
Mauricio Siu
c6d760a904 fix: update RestoreVolumeBackups and ShowVolumeBackups components for improved functionality
- Refactored the RestoreVolumeBackups component to ensure the type prop is required and added serverId handling for better integration.
- Corrected variable naming for destinationId in the form handling to prevent potential issues.
- Enhanced the ShowVolumeBackups component to pass serverId to the RestoreVolumeBackups component, ensuring consistent data flow.
- Improved user interface elements for backup file selection, ensuring better usability and clarity.
2025-07-01 01:12:20 -06:00
Mauricio Siu
4f021a3f79 feat: add restore volume backups component and integrate into show volume backups
- Introduced a new RestoreVolumeBackups component to facilitate the restoration of volume backups from selected files and destinations.
- Integrated the RestoreVolumeBackups component into the ShowVolumeBackups component, enhancing user experience by providing direct access to restoration functionality.
- Updated the restore-backup schema to include validation for destination and backup file selection, ensuring robust user input handling.
2025-06-30 22:50:46 -06:00
zuohuadong
0c861585ed chore(setup):Increase interactive options 2025-07-01 12:19:39 +08:00
Mauricio Siu
d15ccfe505 feat: add runVolumeBackup functionality and update volume backup paths
- Implemented the runVolumeBackup function to facilitate manual execution of volume backups, enhancing user control over backup processes.
- Updated various components to utilize the new VOLUME_BACKUPS_PATH for improved organization and clarity in backup file management.
- Enhanced error handling in the runManually mutation to ensure robust execution and logging of backup operations.
2025-06-30 22:15:45 -06:00
huadong zuo
e158e05ad6 Merge branch 'Dokploy:canary' into canary 2025-07-01 09:40:36 +08:00
Mauricio Siu
e21605030a fix: adjust scaling command in backupVolume function
- Updated the backupVolume function to use the actual number of replicas when scaling services back up after a backup, improving accuracy in service management.
- Enhanced command generation for application service types to ensure proper restoration of service states.
2025-06-30 11:27:18 -06:00
Jhonatan Caldeira
f1c46f0d19 fix(conflicts): redo database migrations broken due to upstream branch conflict 2025-06-30 11:26:33 -03:00
Jhonatan Caldeira
fbf3776548 Merge branch 'canary' into feat/internal-path-routing 2025-06-30 10:56:19 -03:00
Mauricio Siu
46d84eaa71 feat: implement volume restoration functionality
- Added a new restoreVolume function to facilitate the restoration of Docker volumes from backups.
- Integrated service type handling for both application and compose, ensuring proper scaling and management of services during restoration.
- Enhanced command generation for restoring volumes, improving clarity and maintainability of the logic.
2025-06-30 01:38:39 -06:00
Mauricio Siu
2a2b947998 refactor: remove redundant ID assignment in backupVolume command
- Eliminated duplicate ID assignment in the backupVolume function to streamline Docker command generation.
- Improved clarity and maintainability of the command logic by reducing unnecessary lines of code.
2025-06-30 01:35:32 -06:00
Mauricio Siu
9974b2326f refactor: streamline volume backup command generation
- Consolidated Docker command construction for volume backups into a base command to reduce redundancy.
- Enhanced service type handling for application and compose, ensuring proper scaling and stopping of services during backup.
- Improved readability and maintainability of the backup command logic by using template literals and consistent formatting.
2025-06-30 01:33:12 -06:00
Mauricio Siu
c042c8c0c5 feat: implement service-based volume selection for backups
- Added a new query to load mounts by service name, enhancing the volume backup form's functionality.
- Updated the form to allow users to select a service and corresponding volume from a dropdown, improving user experience.
- Retained the option for manual input of volume names, ensuring flexibility in volume selection.
- Refactored the component to streamline the handling of service and volume selections.
2025-06-30 01:25:50 -06:00
Mauricio Siu
819a310d48 feat: add volume selection functionality to volume backup form
- Introduced a new query to fetch named mounts by application ID, enhancing the volume backup form.
- Updated the form to allow users to select a volume from a dropdown, improving user experience.
- Retained the option for manual input of volume names, ensuring flexibility in volume selection.
2025-06-29 23:24:44 -06:00
Mauricio Siu
12860a0736 feat: add appName field to volume_backup schema and enhance deployment volume backup functionality
- Introduced a new appName column in the volume_backup table to improve application identification.
- Updated the volume backup schema to ensure appName is a required field.
- Enhanced the deployment service to support volume backup creation, integrating appName into the deployment process.
- Added validation for volume backup creation to ensure proper handling of appName and related data.
2025-06-29 23:18:12 -06:00
Mauricio Siu
392e2d66ec fix: improve volume backup validation and refactor component props
- Added validation to ensure service name is required when service type is "compose" in the volume backup form schema.
- Refactored the ShowVolumeBackups component to use a more consistent prop name for volume backup type, enhancing clarity and maintainability.
- Updated related components to align with the new prop structure, ensuring seamless integration across the application.
2025-06-29 23:14:53 -06:00
autofix-ci[bot]
1f4ce2daf3 [autofix.ci] apply automated fixes 2025-06-30 05:13:57 +00:00
Mauricio Siu
49edf17463 feat: enhance volume backup functionality and schema
- Added support for volume backups in the deployment management interface by introducing a new volumeBackupId field in the deployment schema.
- Updated the volume backup schema to include relationships with deployments, allowing for better management and tracking of volume backups.
- Enhanced API routes to include application data when querying volume backups, improving the data returned for related entities.
- Updated UI components to reflect the new volume backup features and ensure seamless integration with existing functionalities.
2025-06-29 23:10:49 -06:00
Mauricio Siu
6eea02c098 fix: update default enabled state for volume backups
- Changed the default value of the enabled property in the volume backup handling component from true to false to ensure backups are disabled by default unless explicitly enabled.
2025-06-29 23:07:18 -06:00
Mauricio Siu
a5bba9a11b refactor: update volume backup schema and form handling
- Modified the volume backup schema to enforce non-null constraints on volumeName and added serviceName.
- Removed unnecessary fields (type, hostPath) from the schema and updated related API and form handling.
- Enhanced form validation to ensure required fields are properly checked.
- Updated the UI components to reflect changes in the volume backup management interface.
2025-06-29 23:05:36 -06:00
DearTanker
37c7507507 Style: Make all code editors apply Tailwind CSS font-mono style. 2025-06-30 13:04:47 +08:00
Mauricio Siu
ce88a0a5f2 feat: implement volume backup management functionality
- Added components for handling and displaying volume backups in the dashboard.
- Created API routes for managing volume backups, including create, update, delete, and list operations.
- Introduced database schema for volume backups, including necessary fields and relationships.
- Updated the application to integrate volume backup features into the service management interface.
2025-06-29 22:22:10 -06:00
Mauricio Siu
40f28705cb Merge branch 'canary' into 394-ability-to-backup-named-volume-to-s3 2025-06-29 21:17:05 -06:00
Mauricio Siu
03e04b7bce Merge pull request #2105 from Dokploy/fix/cancel-schedules
feat: add kill process functionality to schedules
2025-06-29 21:13:37 -06:00
Mauricio Siu
b920e7c0f1 fix: handle potential null data in PID extraction for runCommand function 2025-06-29 21:10:11 -06:00
Mauricio Siu
15fde820a3 Merge pull request #2104 from DearTanker/canary
Style: Make Node Applications more readable.
2025-06-29 21:09:29 -06:00
Mauricio Siu
64293fce79 feat: add kill process functionality to deployments
- Implemented a new mutation to kill a running deployment process by its PID.
- Updated the deployment schema to include a PID field.
- Enhanced the deployment service to handle process termination and status updates.
- Modified the deployment scripts to echo PID and schedule ID for better tracking.
- Added error handling for the kill process operation.
2025-06-29 21:08:51 -06:00
DearTanker
526f249d0e Style: Make Node Applications more readable 2025-06-30 10:54:45 +08:00
Mauricio Siu
17c5a42d8e Merge branch 'canary' into 394-ability-to-backup-named-volume-to-s3 2025-06-29 14:11:34 -06:00
autofix-ci[bot]
fac96b5db5 [autofix.ci] apply automated fixes 2025-06-29 20:11:18 +00:00
Mauricio Siu
4796b0cf4e chore: update version in package.json to v0.23.5 2025-06-29 14:09:31 -06:00
Mauricio Siu
159a055bc6 Merge pull request #2102 from Dokploy/2092-preview-link-without-protocol
fix: update preview deployment comment to include protocol in domain URL
2025-06-29 13:47:30 -06:00
Mauricio Siu
cfade317f1 fix: update preview deployment comment to include protocol in domain URL 2025-06-29 13:47:17 -06:00
Mauricio Siu
36ebefff16 Merge pull request #2083 from Marukome0743/models
chore: remove unknown `apps/models` from pnpm-workspace.yaml
2025-06-29 13:24:33 -06:00
Mauricio Siu
7cc0603078 Merge pull request #2101 from SashkaHavr/fix-docker-config-path
fix: change default DOCKER_CONFIG to a config directory instead of config.json file
2025-06-29 13:24:08 -06:00
Mauricio Siu
e0e42ac554 Merge pull request #2100 from DearTanker/canary
style: Remove the width restriction on the server name.
2025-06-29 12:44:12 -06:00
Oleksandr Havrylov
e004d8bd52 fix: change default DOCKER_CONFIG to a config directory instead of config.json file 2025-06-29 17:14:50 +02:00
DearTanker
0c0912f606 Style: Remove the width restriction on the server name so that it can be displayed in full. 2025-06-29 21:13:36 +08:00
Mauricio Siu
8d81440d9b Merge branch 'canary' into 394-ability-to-backup-named-volume-to-s3 2025-06-28 13:23:37 -06:00
Mauricio Siu
9ede3bd71b feat(rollbacks): update backup and restore instructions for N8N data
- Added detailed commands for backing up and restoring N8N data using Docker.
- Included steps for scaling services and managing permissions during the restore process.
- Enhanced clarity of backup commands and added comments for better understanding.
2025-06-28 13:17:34 -06:00
Jhonatan Caldeira
df6a72ea50 Merge branch 'Dokploy:canary' into feat/internal-path-routing 2025-06-28 12:24:01 -03:00
Mauricio Siu
e79f8c4b72 feat: add Tolgee sponsorship banner to README 2025-06-27 00:11:02 -06:00
Mauricio Siu
26e2a24f63 chore: update version in package.json to v0.23.4 2025-06-26 23:57:36 -06:00
Mauricio Siu
830feabd70 Merge pull request #2072 from dscamargo/feat/database-name-database-backup-notification
feat: add database name in database backup notification
2025-06-26 23:55:57 -06:00
Mauricio Siu
122a3d110d Merge pull request #2090 from Dokploy/fix/correct-database-type-on-compose-backups
fix(backups): enhance database type handling in compose backup process
2025-06-26 23:34:33 -06:00
Mauricio Siu
c05edb313f fix(backups): enhance database type handling in compose backup process
- Added a new function to determine the database type based on the backup configuration.
- Updated notifications to use the correct database type instead of a hardcoded value.
2025-06-26 23:32:18 -06:00
Mauricio Siu
1ec2853862 Merge pull request #2089 from Dokploy/2080-invalid-name-when-trying-to-deploy-an-app-with-dockerfile-to-ghcrio
fix(upload): refactor registry tag construction for image uploads
2025-06-26 23:02:36 -06:00
Mauricio Siu
5c2709248c fix(upload): refactor registry tag construction for image uploads
- Updated the logic for constructing the registry tag in the uploadImage and uploadImageRemoteCommand functions to ensure correct formatting.
- Removed unnecessary path imports and streamlined the code for better readability.
2025-06-26 23:00:51 -06:00
autofix-ci[bot]
bc79074441 [autofix.ci] apply automated fixes 2025-06-27 03:13:41 +00:00
Mauricio Siu
3b5428697b feat(rollbacks): add backup and restore instructions for license-named backups
- Introduced a new Backup file containing detailed steps for creating and restoring backups using Docker.
- Included commands for stopping services, removing volumes, and managing backup files.
2025-06-26 21:13:09 -06:00
Mauricio Siu
5ada451916 Merge pull request #2087 from Dokploy/feat/add-dokploy-cloud-endpoints
feat(settings): add query to retrieve Dokploy cloud IPs
2025-06-26 21:01:50 -06:00
Mauricio Siu
6b0d9240dd feat(settings): add query to retrieve Dokploy cloud IPs
- Implemented a new admin procedure to fetch cloud IPs from environment variables.
- Returns an empty array if not in cloud mode.
2025-06-26 21:00:51 -06:00
zuohuadong
475c452451 chore(*): use dnf 2025-06-26 16:05:56 +08:00
Marukome0743
1e31ebb9c2 chore: remove unknown apps/models from pnpm-workspace.yaml 2025-06-26 16:49:44 +09:00
zuohuadong
207fe6f477 feat(swap): On hosts with less than 2G of memory, increase swap space to prevent installation failure. 2025-06-26 10:32:23 +08:00
zuohuadong
0b34676336 chore (opencloud) fix docker install 2025-06-26 10:24:14 +08:00
Douglas Camargo
499022a328 feat: add database name in database backup notification 2025-06-23 22:35:40 -03:00
Mauricio Siu
fb5d2bd5b6 feat(docker-swarm): implement server authorization checks and input validation
- Added server authorization checks to ensure users can only access resources for their organization.
- Enhanced input validation for container and app names using regex to prevent invalid entries.
- Updated multiple query procedures in both docker and swarm routers to include these checks and validations.
2025-06-22 23:57:12 -06:00
Mauricio Siu
e42f6bc610 feat(user-validation): enhance path validation in Traefik config
- Added refined validation for the 'path' field to prevent directory traversal attacks and unauthorized access.
- Implemented checks for null bytes and ensured paths start with the MAIN_TRAEFIK_PATH constant.
2025-06-22 23:57:02 -06:00
Mauricio Siu
61cf426615 feat(user-access): implement access control for user information retrieval
- Added checks to deny access if the user is not found in the organization.
- Implemented authorization logic to allow access only for users requesting their own information or users with owner role in the same organization.
2025-06-22 23:56:13 -06:00
Jhonatan Caldeira
dde12e132a Merge branch 'Dokploy:canary' into feat/internal-path-routing 2025-06-22 17:35:53 -03:00
Jhonatan Caldeira
fd0f679d0f feat(domains): add internal path routing and
strip path functionality to compose

  - Add internalPath field to route requests
  to different paths internally
  - Add stripPath option to remove external
  path prefix before forwarding
  - Improves validation for stripPath (requires
  non-root path) and internalPath (must start
  with /)
2025-06-22 14:55:27 -03:00
Mauricio Siu
2a89be6efc Merge pull request #2069 from Dokploy/2065-rollback-feature-dns-issues
feat(rollbacks): enhance fullContext type and refactor createRollback…
2025-06-22 18:01:21 +02:00
autofix-ci[bot]
412bb9e874 [autofix.ci] apply automated fixes 2025-06-22 16:00:36 +00:00
Mauricio Siu
6290c217f1 feat(rollbacks): add alert for storage usage in rollback settings
- Introduced an AlertBlock component to inform users about increased storage usage when rollbacks are enabled.
- Added cautionary note regarding the potential deletion of rollback images during manual cache cleaning.
2025-06-22 10:00:14 -06:00
Mauricio Siu
4babdd45ea chore: update version in package.json to v0.23.3 2025-06-22 09:58:35 -06:00
Mauricio Siu
24bff96898 feat(rollbacks): enhance fullContext type and refactor createRollback logic
- Updated fullContext type in rollbacks schema to include Application and Project types.
- Refactored createRollback function to separate fullContext from input and handle it more efficiently.
- Integrated environment variable preparation into the rollback process.
2025-06-22 09:56:36 -06:00
Jhonatan Caldeira
df8f1252a0 Merge branch 'Dokploy:canary' into feat/internal-path-routing 2025-06-22 11:54:59 -03:00
Mauricio Siu
892f272108 Merge pull request #2066 from nikolajjsj/feat/reset-2fa-script
Feat/reset 2fa script
2025-06-22 16:40:47 +02:00
Mauricio Siu
fca537ee40 feat(esbuild): add entry point for reset-2fa script 2025-06-22 08:40:13 -06:00
Mauricio Siu
ae24aa8be5 Merge pull request #2067 from Dokploy/fix/envs-not-reset
fix: simplify useEffect condition in ShowEnvironment component
2025-06-22 16:32:54 +02:00
Mauricio Siu
b74d3995ee chore: update version in package.json to v0.23.2 2025-06-22 08:32:20 -06:00
Mauricio Siu
f7fd77f7e9 fix: simplify useEffect condition in ShowEnvironment component 2025-06-22 08:31:46 -06:00
nikolajjsj
db8a4e6edf feat(scripts): add command to run reset-2fa script 2025-06-22 15:11:12 +02:00
nikolajjsj
fa16cfec2a feat(scripts): add script to reset 2fa for admin
Similar style to existing reset-password script
2025-06-22 15:10:57 +02:00
Mauricio Siu
f35d084dd4 chore: update version in package.json to v0.23.1 2025-06-22 00:58:00 -06:00
Mauricio Siu
274daf52c0 Merge pull request #2062 from Dokploy/fix/migration-git-permissions
refactor(git_provider): update userId assignment to use owner_id from…
2025-06-22 08:57:10 +02:00
Mauricio Siu
da52d767eb refactor(git_provider): update userId assignment to use owner_id from organization table
- Changed the SQL update statement to directly select the owner_id from the organization table instead of joining with the account table, simplifying the query.
2025-06-22 00:52:45 -06:00
Mauricio Siu
45a178e705 chore: update version in package.json to v0.23.0 2025-06-21 23:58:27 -06:00
Mauricio Siu
ebf9db7cc0 Merge pull request #2037 from Marukome0743/sort
chore: alphabetize the package.json dependencies
2025-06-22 07:50:55 +02:00
autofix-ci[bot]
8599f519a4 [autofix.ci] apply automated fixes 2025-06-22 05:44:21 +00:00
Mauricio Siu
113e4ae4b5 fix(middleware): update domain type and improve middleware configuration
- Changed the type of the `domain` parameter in `createPathMiddlewares` from `any` to `Domain` for better type safety.
- Added missing commas in middleware configuration objects to ensure proper syntax.
2025-06-21 23:43:52 -06:00
Mauricio Siu
7f0bdc7e00 feat(domain): add internalPath and stripPath properties to domain configuration
- Updated test files to include new properties `internalPath` and `stripPath` in domain configurations.
- Removed deprecated `createMultiPathDomain` function from the domain service to streamline the codebase.
2025-06-21 23:42:18 -06:00
Mauricio Siu
b685a817fd feat(domain): add internalPath and stripPath columns to domain schema
- Introduced new columns `internalPath` (text) with a default value of '/' and `stripPath` (boolean) with a default value of false to the domain table.
- Updated journal metadata to reflect the addition of these columns.
2025-06-21 23:39:22 -06:00
Mauricio Siu
6061a443d1 Merge branch 'canary' into feat/internal-path-routing 2025-06-21 23:39:01 -06:00
Mauricio Siu
4c9835d1f3 refactor(domain): remove deprecated columns internalPath and stripPath from domain schema
- Deleted SQL statements for internalPath and stripPath columns in the domain table.
- Updated journal and snapshot metadata to reflect the removal of these columns.
2025-06-21 23:38:39 -06:00
Mauricio Siu
ec6c685a28 Merge pull request #2019 from zuohuadong/canary
chore(server-setup.ts) support opencloudos
2025-06-22 07:37:22 +02:00
Mauricio Siu
7b14e4c5d2 Merge pull request #1986 from Dokploy/319-ability-to-roll-back-service-depoyments
Ability to roll back service deployments
2025-06-22 07:35:36 +02:00
Mauricio Siu
316f592e09 refactor(rollback): clean up unused code in rollback router
- Removed commented-out code and unused imports from the rollback router file to streamline the codebase and improve readability.
2025-06-21 23:35:11 -06:00
Mauricio Siu
bd82199ae0 feat(rollback): implement rollback creation in deployment process
- Added logic to create a rollback entry if the application has an active rollback during the deployment process.
- Enhanced the rollback handling by determining the appropriate tag image based on the application's source type (docker or app name).
2025-06-21 23:24:53 -06:00
Mauricio Siu
89d573a2f5 refactor: remove ShowEnv component from rollbacks
- Deleted the ShowEnv component responsible for displaying environment variables in the rollback context, streamlining the codebase.
2025-06-21 23:18:06 -06:00
Mauricio Siu
3d285ca437 feat(rollback): add rollback constraints and snapshots
- Introduced two new SQL files for rollback constraints, updating foreign key relationships with different delete actions (set null and cascade).
- Updated the journal and snapshot files to include the new rollback schema changes for versions 0096 and 0097.
- Enhanced the application service to handle rollback image tagging based on source type.
- Implemented rollback removal logic in the deployment service to ensure proper cleanup of rollback entries.
2025-06-21 23:17:21 -06:00
Mauricio Siu
8c5e34c528 refactor: remove limitRollback property from rollback settings schema
- Eliminated the limitRollback property from the form schema in show-rollback-settings.tsx to simplify the rollback configuration.
2025-06-21 21:53:14 -06:00
Mauricio Siu
98199e65bf refactor: remove limitRollback property and add rollback table schema
- Removed the limitRollback property from the baseApp configuration in drop.test.test.ts and traefik.test.ts files.
- Introduced a new SQL file to create a rollback table with relevant fields and constraints.
- Updated the journal and snapshot files to reflect the new rollback schema changes.
2025-06-21 21:21:29 -06:00
Mauricio Siu
bf1026af7a Merge branch 'canary' into 319-ability-to-roll-back-service-depoyments 2025-06-21 21:18:05 -06:00
Mauricio Siu
7c9767d90f chore: remove rollback-related SQL files and snapshots
- Deleted SQL files for the "rollback" table and related schema changes, including the "funny_leper_queen", "true_marvel_zombies", and "sweet_venom" migrations.
- Removed corresponding snapshot files to clean up the database schema history.
2025-06-21 21:17:54 -06:00
Mauricio Siu
688f6478f1 Merge pull request #1981 from ayham291/canary
feat: Git Provider Permissions
2025-06-22 05:16:11 +02:00
Mauricio Siu
cad17e0f7f fix(certificates): improve ASN.1 time parsing and handle edge cases
- Added TypeScript ignore directive to suppress type checking in the utility file.
- Refactored the time parsing logic to use Number.parseInt for better clarity.
- Adjusted the flow to throw an error for invalid ASN.1 time formats, ensuring robustness in certificate expiration date extraction.
2025-06-21 21:08:49 -06:00
Mauricio Siu
d97461d820 refactor(git-provider): update UnauthorizedGitProvider to use service prop and enhance access handling
- Changed the prop name from 'application' to 'service' in the UnauthorizedGitProvider component for clarity.
- Updated the logic to check for unauthorized access to the git provider in the compose router, returning a new field 'hasGitProviderAccess'.
- Implemented a disconnect functionality for git providers in the ShowProviderFormCompose component, providing user feedback on success or failure.
2025-06-21 21:03:31 -06:00
Mauricio Siu
9686848090 feat(git-provider): add userId column to git_provider table and update relationships
- Introduced a new userId column in the git_provider table to associate git providers with users.
- Updated the foreign key reference for userId to point to the users_temp table instead of the account table.
- Modified the UnauthorizedGitProvider component to include a dialog action for disconnecting repositories, enhancing user experience.
- Added a migration script to update existing git providers with the new userId values based on the organization owner.
2025-06-21 20:50:07 -06:00
Mauricio Siu
a7b644e403 Merge branch 'canary' into ayham291/canary 2025-06-21 20:21:41 -06:00
Mauricio Siu
96b4c334da remove: delete migration script and associated journal entries for 0093_elite_warlock
This commit removes the migration script for adding a userId column to the git_provider table, along with its corresponding journal entries. The migration was deemed unnecessary following recent changes to the handling of existing git providers.
2025-06-21 20:21:24 -06:00
Mauricio Siu
1b99c3ac23 Merge pull request #2059 from tarikyalcinkaya/fix/valid-name-regex
fix: allow dot character in project name validation (#2042)
2025-06-22 04:18:40 +02:00
Mauricio Siu
a12b514525 Merge pull request #2060 from Dokploy/2043-running-manual-backup-on-service-does-not-remove-outdated-backups-over-keep-latest
feat(backup): implement keepLatestNBackups function to manage backup …
2025-06-22 04:16:51 +02:00
Mauricio Siu
ea91b01461 feat(backup): implement keepLatestNBackups function to manage backup retention
- Added keepLatestNBackups function calls after each backup operation for Postgres, MySQL, MariaDB, Compose, and MongoDB to ensure only the latest N backups are retained.
2025-06-21 20:16:27 -06:00
Tarık Yalçınkaya
149b8f70d8 fix: allow dot character in project name validation (#2042) 2025-06-22 04:09:21 +03:00
Mauricio Siu
6be4984649 Merge pull request #2050 from dsincl12/canary
Fix typo: Clonning → Cloning
2025-06-22 01:55:10 +02:00
Mauricio Siu
7ec68e688b Merge pull request #2025 from onurguzel/fix-cert-expiration-date
fix: parse pem certificates correctly
2025-06-22 01:54:52 +02:00
autofix-ci[bot]
b30f8944c4 [autofix.ci] apply automated fixes 2025-06-21 23:53:09 +00:00
Mauricio Siu
f0d242b9b9 Merge pull request #2058 from Dokploy/2016-compose-and-environnement-variable-tab-keeps-resetting-themself
fix: update form reset conditions in environment and compose file edi…
2025-06-22 00:29:49 +02:00
Mauricio Siu
b6d86b4732 fix: update form reset conditions in environment and compose file editors
- Modified the reset logic in ShowEnvironment to only reset when there are no changes.
- Adjusted the reset condition in ComposeFileEditor to check if composeFile is empty before resetting.
- Cleaned up the query in the compose service page by removing unnecessary refetchInterval.
2025-06-21 16:27:58 -06:00
Mauricio Siu
304134cdda Merge pull request #2056 from Dokploy/1834-user-invite-email-not-sending
feat(invitation): add email provider selection and notification handl…
2025-06-21 21:10:38 +02:00
Mauricio Siu
c84b271511 feat(invitation): add email provider selection and notification handling for user invitations
- Introduced a new optional field for notificationId in the invitation form.
- Implemented fetching of email providers based on the active organization.
- Enhanced invitation sending logic to include email notifications when applicable.
- Updated UI to conditionally display email provider selection based on cloud status.
2025-06-21 13:08:49 -06:00
Jhonatan Caldeira
f2671f9369 fix(domain): remove unused ApplicationNested type import 2025-06-20 17:51:05 -03:00
Jhonatan Caldeira
bb904bb011 feat: add internal path routing and path stripping for domains
- Add internalPath and stripPath fields to domain schema
- Implement UI controls for configuring internal path routing
- Create Traefik middleware for path manipulation (addPrefix/stripPrefix)
- Support different external and internal paths for applications
- Enable path stripping for cleaner URL forwarding

This allows applications to be accessed via external paths while maintaining
different internal routing structures, useful for microservices and legacy
applications that expect specific path prefixes.
2025-06-20 16:36:27 -03:00
David Sinclair
96dd8d37a5 Fix typo: Clonning → Cloning 2025-06-20 11:30:38 +02:00
Mauricio Siu
be91b53c86 Merge pull request #2049 from Dokploy/1977-volumes-cant-be-edited
fix: update FormItem styles for better layout in UpdateVolume component
2025-06-20 08:41:15 +02:00
Mauricio Siu
98c77d539e fix: update FormItem styles for better layout in UpdateVolume component 2025-06-20 00:40:56 -06:00
Mauricio Siu
67f5befa48 Merge pull request #2007 from victorboudet/canary
fix api: return compose informations when created from template
2025-06-20 08:16:02 +02:00
Mauricio Siu
5b2056101f Merge pull request #1984 from TorstenDittmann/fix-ip-validation-behind-bunny-fastly
fix[domains]: Add CDN provider detection with dynamic display names
2025-06-20 08:15:39 +02:00
Mauricio Siu
000b4ba49e Merge pull request #2048 from Dokploy/1970-deploy-crashes-when-opening-requests
feat(database): set default value for logCleanupCron and update exist…
2025-06-20 07:44:22 +02:00
Mauricio Siu
4efa56aae5 Merge pull request #2034 from Marukome0743/syntax
build: add syntax directive to Dockerfiles
2025-06-20 07:37:27 +02:00
Mauricio Siu
a788a73fa3 feat(database): set default value for logCleanupCron and update existing records
- Added SQL script to set default value for "logCleanupCron" in "user_temp" table.
- Updated existing records with NULL "logCleanupCron" to the new default value.
- Updated user schema to reflect the default value for "logCleanupCron".
- Enhanced log cleanup functionality with error handling and logging.
2025-06-19 23:32:49 -06:00
Marukome0743
319ca6944d chore: sort the package.json dependencies 2025-06-16 13:06:44 +09:00
Marukome0743
238736db8d build: add syntax directive to Dockerfiles 2025-06-13 11:11:48 +09:00
s1nyx
9fb6ca2b3b feat(traefik-setup): check for existing image before pulling to optimize image management 2025-06-11 08:12:00 +02:00
s1nyx
9f146d7d80 fix(traefik-setup): now pulling the traefik image to make it sure it's present locally 2025-06-11 08:06:13 +02:00
Onur Güzel
556a437251 fix: parse pem certificates correctly 2025-06-10 16:10:19 +02:00
huadong zuo
ef5e1d6818 chore(server-setup.ts) support opencloudos 2025-06-09 16:10:48 +08:00
Mauricio Siu
1089a8247d refactor(auth): remove logger configuration for production environment 2025-06-08 16:56:31 -06:00
Mauricio Siu
ef0cef99a1 refactor: remove limitRollback from application settings and related UI components
- Eliminated the "limitRollback" property from the application schema and the ShowRollbackSettings component, streamlining rollback configuration.
- Updated the database schema to drop the "limitRollback" column from the "application" table, ensuring consistency across the application.
2025-06-08 16:53:23 -06:00
Victor Boudet
8737dc86c9 fix api: return compose informations when created from template 2025-06-05 14:24:43 +00:00
Mauricio Siu
cf06e5369a fix: update docker system prune command to remove unnecessary 'all' flag
- Modified the command in the cleanUpSystemPrune function to remove the '--all' flag, streamlining the Docker system prune operation.
2025-06-03 00:13:00 -06:00
Mauricio Siu
973de2a610 feat: add rollback configuration to base application settings
- Introduced "limitRollback" and "rollbackActive" properties to the base application configuration in both drop and traefik test files.
- These additions enhance the rollback functionality by allowing configuration of rollback limits and activation status.
2025-06-02 21:04:45 -06:00
Mauricio Siu
f8baf6fe41 feat: add fullContext column to rollback table and update related functionality
- Introduced a new "fullContext" JSONB column in the "rollback" table to store additional context for rollbacks.
- Removed the "env" column from the "rollback" table to streamline data management.
- Updated the rollbacks service to handle the new "fullContext" field during rollback creation.
- Adjusted the application service to eliminate environment variable handling in rollback operations.
2025-06-02 21:02:17 -06:00
ayham291
3e05be4513 fix(migration): handle existing git providers by assigning to org owner
Previously the migration would fail in production when trying to add
a NOT NULL userId column to git_provider table with existing data.
Now existing providers are automatically assigned to their organization owner.
2025-06-02 15:42:56 +02:00
ayham291
b3b009761a fix: made an opsie.. check the organization as well as the user for getAll git providers 2025-06-02 14:45:10 +02:00
autofix-ci[bot]
a659594134 [autofix.ci] apply automated fixes 2025-06-02 10:07:40 +00:00
Torsten Dittmann
9a1f0b467d fix: domain validation message display logic
Check for both message and cdnProvider before showing CDN status to
prevent displaying "Behind undefined" when cdnProvider is missing.
2025-06-02 12:07:18 +02:00
Torsten Dittmann
e8b3abb7c9 fix: Add validation for CIDR format in isIPInCIDR function 2025-06-02 12:03:14 +02:00
ayham291
8215d2e79f feat: implement unauthorized Git provider handling and disconnect functionality
- Added UnauthorizedGitProvider component to display information for applications connected to unauthorized Git providers.
- Implemented disconnectGitProvider mutation to allow users to disconnect from their Git provider, with success and error notifications.
- Updated application query to include access checks for Git providers, ensuring users can only interact with their authorized repositories.
2025-06-02 11:32:43 +02:00
Mauricio Siu
9c19b1efa3 Create SECURITY.md 2025-06-02 01:09:48 -06:00
Mauricio Siu
4966bbeb73 refactor: update icon in ShowDeployments component
- Replaced the ArrowDownToLine icon with RefreshCcw in the rollback button for improved clarity.
- Cleaned up unused imports from the component to streamline the code.
2025-06-01 22:56:18 -06:00
Mauricio Siu
df97dc0179 refactor: update ShowDeployments component and remove ShowRollbacks
- Enhanced the ShowDeployments component to conditionally display rollback options based on deployment status and type.
- Removed the ShowRollbacks component and its references from the application, streamlining the UI and functionality.
2025-06-01 22:56:00 -06:00
Mauricio Siu
b14b9300c0 feat: enhance rollback functionality with UI updates and database schema changes
- Updated Tailwind configuration for responsive design.
- Modified the ShowDeployments component to include rollback settings and actions.
- Introduced a new "rollback" table in the database schema with foreign key relationships.
- Updated deployment and application schemas to support rollback features.
- Added rollback mutation to the API for initiating rollbacks.
2025-06-01 22:52:33 -06:00
Mauricio Siu
a7d1fabd81 feat: add rollback functionality with new table and application schema updates
- Created a new "rollback" table to manage rollback operations.
- Added "rollbackActive" and "limitRollback" columns to the "application" table to support rollback features.
- Established foreign key constraints between the "rollback" and "application" tables for data integrity.
2025-06-01 19:45:33 -06:00
Mauricio Siu
d171e3da91 Merge branch 'canary' into 319-ability-to-roll-back-service-depoyments 2025-06-01 19:44:02 -06:00
Mauricio Siu
2c77029dad chore: remove rollback-related SQL files and snapshots
- Deleted SQL files for rollback table and related schema changes.
- Removed corresponding snapshot files to clean up the database schema history.
2025-06-01 19:43:48 -06:00
autofix-ci[bot]
030e482fce [autofix.ci] apply automated fixes 2025-06-02 00:15:31 +00:00
Mauricio Siu
e53c67f0d9 Merge pull request #1983 from TorstenDittmann/fix-railpack-env-vars
fix[railpack]: env parsing and update railpack to v0.0.66
2025-06-01 18:13:11 -06:00
Mauricio Siu
0c12d967e2 Update Dockerfile 2025-06-01 18:12:57 -06:00
Mauricio Siu
98aabd7bd8 Merge pull request #1930 from nktnet1/fix-traefik-failing-silently
fix: throw error if traefik container creation fails for a reason other than port taken
2025-06-01 15:42:00 -06:00
Torsten Dittmann
88e862544b fix[domains]: Add CDN provider detection with dynamic display names
Implements generic CDN detection service supporting Cloudflare, Fastly,
and Bunny CDN. Replaces hardcoded "Behind Cloudflare" text with
dynamic provider names and adds IP range validation for comprehensive
CDN detection.
2025-06-01 23:03:00 +02:00
Torsten Dittmann
7f9c19bc11 fix[railpack]: environment variable validation for empty strings
Allow empty string values to be processed as valid environment
variables by checking for existence rather than non-empty length.
2025-06-01 22:22:16 +02:00
Torsten Dittmann
9535276fe6 fix[railpack]: env parsing and update railpack to v0.0.66
Improve environment variable parsing to handle values containing equals
signs by extracting a dedicated parseEnvironmentKeyValuePair function
and updating Railpack secret formatting.
2025-06-01 22:03:16 +02:00
ayham291
56d21aff60 fix: add authorization checks in GitHub router to include userId validation
- Updated conditional checks to ensure that the GitHub provider's userId matches the session userId, in addition to the organizationId, for improved security and access control.
2025-06-01 20:53:54 +02:00
ayham291
8436d364be refactor: linter fixes 2025-06-01 20:46:32 +02:00
ayham291
5d5e56d144 feat: GitHub and GitLab provider integration with user association
- Added userId to the GitHub and GitLab provider setup to associate providers with the user who created them.
- Updated redirect URL in GitHub provider to include userId for better tracking.
- Modified API handlers and service functions to accommodate userId in provider creation and validation.
2025-06-01 20:45:29 +02:00
ayham291
0627b6fd3a refactor: clean up conditional checks in Bitbucket and Gitea routers for improved readability 2025-05-31 01:52:24 +02:00
ayham291
39af44daef feat: add user property to git-providers (bitbucket, gitea)
- relate a provider to the user who created it.
- for now the provider is only visible to its user.
2025-05-31 01:21:46 +02:00
Mauricio Siu
2619cb49d1 refactor: restore commented-out test cases and imports in drop.test.test.ts for improved functionality 2025-05-28 02:44:06 -06:00
Mauricio Siu
46d12fa9d8 Merge pull request #1967 from Dokploy/feat/add-chatwoot
Feat/add chatwoot
2025-05-28 02:41:45 -06:00
Mauricio Siu
51ee46496c chore: update pnpm lockfile with dependency version upgrades for improved stability and compatibility 2025-05-28 02:39:18 -06:00
Mauricio Siu
a13e24dab0 refactor: simplify Chatwoot widget condition in dashboard layout for improved readability 2025-05-28 02:33:44 -06:00
Mauricio Siu
4aac3476b6 refactor: update Chatwoot widget settings and types to enhance configuration options 2025-05-28 02:33:14 -06:00
Mauricio Siu
037343a796 feat: integrate Chatwoot widget into dashboard layout and replace project layout with dashboard layout in various pages 2025-05-28 02:22:56 -06:00
Mauricio Siu
274d80ea7c refactor: comment out test cases and imports in drop.test.test.ts for cleanup 2025-05-28 00:51:20 -06:00
Mauricio Siu
629889f1a8 refactor: reorganize imports and enhance backup functionality across various components 2025-05-28 00:38:53 -06:00
Mauricio Siu
3e74ce05a7 Merge pull request #1960 from Lux1L/feature/gitlab-subgroup-filtering
feat(gitlab): support nested group filtering using namespace.full_pat…
2025-05-28 00:37:05 -06:00
Mauricio Siu
d05218e848 Merge pull request #1958 from IPdotSetAF/git-lfs-fix
fix: moved git lfs from build stage to dokploy stage in dockerfile
2025-05-28 00:36:12 -06:00
Mauricio Siu
0fbad4f75e docs: remove supported OS section from README.md 2025-05-28 00:34:47 -06:00
IPdotSetAF
c3cbaf2a57 fix: moved git lfs from build stage to dokploy stage in dockerfile 2025-05-27 22:16:46 +03:30
avalolu
560d493d56 feat(gitlab): support nested group filtering using namespace.full_path.startsWith 2025-05-26 18:00:03 -04:00
Mauricio Siu
27b2106630 chore: bump version to v0.22.7 in package.json 2025-05-26 03:11:23 -06:00
Mauricio Siu
609954c366 Merge pull request #1931 from nktnet1/nginx-static-spa-build
feat: added SPA option for static sites
2025-05-26 03:10:51 -06:00
Mauricio Siu
84faa9747e chore: update Node.js version to 20.16.0 in configuration files 2025-05-26 03:09:09 -06:00
Mauricio Siu
4b370ef43e chore: update otpauth version to 9.4.0 in pnpm-lock.yaml 2025-05-26 03:01:57 -06:00
Mauricio Siu
b94a6bff92 Merge branch 'canary' into nginx-static-spa-build 2025-05-26 02:59:03 -06:00
Mauricio Siu
276b754377 chore: downgrade docker/build-push-action to version 4 in deploy workflows 2025-05-26 02:27:41 -06:00
Mauricio Siu
f3b3798362 chore: update docker/build-push-action to version 6 in deploy workflows 2025-05-26 02:15:08 -06:00
Mauricio Siu
461acc354e Merge pull request #1955 from Dokploy/1923-v0226-git-lfs-is-not-working-at-all-despite-1872
chore: add git-lfs to Dockerfile for large file support
2025-05-26 02:00:50 -06:00
Mauricio Siu
dfc75a9116 chore: remove Dockerfile for dokploy as part of project restructuring 2025-05-26 01:53:24 -06:00
Mauricio Siu
e1580bad23 chore: add git-lfs to Dockerfile for large file support 2025-05-26 01:52:41 -06:00
Mauricio Siu
b567ec1d83 Merge pull request #1954 from Dokploy/1943-error-backing-up-mysql-to-cloudflare-r2
feat: add pino and pino-pretty for logging, implement logger utility
2025-05-26 01:48:35 -06:00
Mauricio Siu
9c73b8dc36 feat: add pino and pino-pretty for logging, implement logger utility 2025-05-26 01:45:14 -06:00
Mauricio Siu
7348526873 Merge pull request #1953 from Dokploy/1898-remote-server-with-ipv6
fix: update slugIp formatting to handle colons in server IP
2025-05-26 00:55:43 -06:00
Mauricio Siu
6fc83f2db3 fix: update slugIp formatting to handle colons in server IP 2025-05-26 00:55:22 -06:00
Khiet Tam Nguyen
43d22c2bd4 test: fix typescript error for isStaticSpa 2025-05-20 16:33:34 +10:00
autofix-ci[bot]
38a5313967 [autofix.ci] apply automated fixes 2025-05-20 06:18:00 +00:00
Khiet Tam Nguyen
ba3645933f feat: added SPA option for static sites 2025-05-20 16:11:48 +10:00
Khiet Tam Nguyen
2fa2e76e2e fix: throw error if traefik container creation fails for a reason other than port 2025-05-20 15:28:45 +10:00
Mauricio Siu
2ad8bf355b feat: implement rollback functionality with UI components and database schema updates
- Added ShowEnv and ShowRollbackSettings components for displaying and configuring rollback settings.
- Implemented ShowRollbacks component to list and manage rollbacks for applications.
- Created rollback database schema and updated application schema to include rollback settings.
- Added API routes for managing rollbacks, including fetching, creating, and deleting rollbacks.
- Integrated rollback functionality into the application deployment process.
2025-05-10 20:28:34 -06:00
Mauricio Siu
cad628d155 refactor: remove unused volume suffix function from collision utility 2025-05-10 02:58:31 -06:00
Mauricio Siu
cd8230b0e5 refactor(add-domain): remove debug log statement from AddDomain component 2025-04-06 11:14:43 -06:00
607 changed files with 176594 additions and 10595 deletions

18
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,18 @@
## What is this PR about?
Please describe in a short paragraph what this PR is about.
## Checklist
Before submitting this PR, please make sure that:
- [] You created a dedicated branch based on the `canary` branch.
- [] You have read the suggestions in the CONTRIBUTING.md file https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md#pull-request
- [] You have tested this PR in your local instance.
## Issues related (if applicable)
closes #123
## Screenshots (if applicable)

BIN
.github/sponsors/tuple.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

View File

@@ -19,17 +19,14 @@ jobs:
fetch-depth: 0
- name: Get version from package.json
id: package_version
run: echo "VERSION=$(jq -r .version ./apps/dokploy/package.json)" >> $GITHUB_ENV
- name: Get latest GitHub tag
id: latest_tag
run: |
LATEST_TAG=$(git ls-remote --tags origin | awk -F'/' '{print $3}' | sort -V | tail -n1)
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
echo $LATEST_TAG
- name: Compare versions
id: compare_versions
run: |
if [ "${{ env.VERSION }}" != "${{ env.LATEST_TAG }}" ]; then
VERSION_CHANGED="true"
@@ -42,7 +39,6 @@ jobs:
echo "Latest tag: ${{ env.LATEST_TAG }}"
echo "Version changed: $VERSION_CHANGED"
- name: Check if a PR already exists
id: check_pr
run: |
PR_EXISTS=$(gh pr list --state open --base main --head canary --json number --jq '. | length')
echo "PR_EXISTS=$PR_EXISTS" >> $GITHUB_ENV

View File

@@ -2,7 +2,8 @@ name: Build Docker images
on:
push:
branches: ["canary", "main", "feat/monitoring"]
branches: [main, canary]
workflow_dispatch:
jobs:
build-and-push-cloud-image:

View File

@@ -2,7 +2,8 @@ name: Dokploy Docker Build
on:
push:
branches: [main, canary, "1061-custom-docker-service-hostname"]
branches: [main, canary, "fix/re-apply-database-migration-fix"]
workflow_dispatch:
env:
IMAGE_NAME: dokploy/dokploy

View File

@@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup biomeJs
uses: biomejs/setup-biome@v2
- name: Run Biome formatter
run: biome format . --write
run: biome format --write
- uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27 # v1.3.2

View File

@@ -4,43 +4,22 @@ on:
pull_request:
branches: [main, canary]
permissions:
contents: read
jobs:
lint-and-typecheck:
pr-check:
runs-on: ubuntu-latest
strategy:
matrix:
job: [build, test, typecheck]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20.9.0
node-version: 20.16.0
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm run server:build
- run: pnpm typecheck
build-and-test:
needs: lint-and-typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20.9.0
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm run server:build
- run: pnpm build
parallel-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20.9.0
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm run server:build
- run: pnpm test
- run: pnpm server:build
- run: pnpm ${{ matrix.job }}

2
.nvmrc
View File

@@ -1 +1 @@
20.9.0
20.16.0

3
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"recommendations": ["biomejs.biome"]
}

8
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,8 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"source.fixAll.biome": "explicit",
"source.organizeImports.biome": "explicit"
}
}

View File

@@ -52,7 +52,7 @@ feat: add new feature
Before you start, please make the clone based on the `canary` branch, since the `main` branch is the source of truth and should always reflect the latest stable release, also the PRs will be merged to the `canary` branch.
We use Node v20.9.0 and recommend this specific version. If you have nvm installed, you can run `nvm install 20.9.0 && nvm use` in the root directory.
We use Node v20.16.0 and recommend this specific version. If you have nvm installed, you can run `nvm install 20.16.0 && nvm use` in the root directory.
```bash
git clone https://github.com/dokploy/dokploy.git
@@ -87,7 +87,8 @@ pnpm run dokploy:dev
Go to http://localhost:3000 to see the development server
Note: this project uses Biome. If your editor is configured to use another formatter such as Prettier, it's recommended to either change it to use Biome or turn it off.
> [!NOTE]
> This project uses Biome. If your editor is configured to use another formatter such as Prettier, it's recommended to either change it to use Biome or turn it off.
## Build
@@ -117,10 +118,10 @@ In the case you lost your password, you can reset it using the following command
pnpm run reset-password
```
If you want to test the webhooks on development mode using localtunnel, make sure to install `localtunnel`
If you want to test the webhooks on development mode using localtunnel, make sure to install [`localtunnel`](https://localtunnel.app/)
```bash
bunx lt --port 3000
pnpm dlx localtunnel --port 3000
```
If you run into permission issues of docker run the following command
@@ -152,7 +153,7 @@ curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.35.0/pack-v0.
## Pull Request
- The `main` branch is the source of truth and should always reflect the latest stable release.
- The `canary` branch is the source of truth and should always reflect the latest stable release.
- Create a new branch for each feature or bug fix.
- Make sure to add tests for your changes.
- Make sure to update the documentation for any changes Go to the [docs.dokploy.com](https://docs.dokploy.com) website to see the changes.
@@ -161,6 +162,12 @@ curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.35.0/pack-v0.
- If your pull request fixes an open issue, please reference the issue in the pull request description.
- Once your pull request is merged, you will be automatically added as a contributor to the project.
**Important Considerations for Pull Requests:**
- **Focus and Scope:** Each Pull Request should ideally address a single, well-defined problem or introduce one new feature. This greatly facilitates review and reduces the chances of introducing unintended side effects.
- **Avoid Unfocused Changes:** Please avoid submitting Pull Requests that contain only minor changes such as whitespace adjustments, IDE-generated formatting, or removal of unused variables, unless these are part of a larger, clearly defined refactor or a dedicated "cleanup" Pull Request that addresses a specific `good first issue` or maintenance task.
- **Issue Association:** For any significant change, it's highly recommended to open an issue first to discuss the proposed solution with the community and maintainers. This ensures alignment and avoids duplicated effort. If your PR resolves an existing issue, please link it in the description (e.g., `Fixes #123`, `Closes #456`).
Thank you for your contribution!
## Templates

View File

@@ -1,7 +1,9 @@
FROM node:20.9-slim AS base
# syntax=docker/dockerfile:1
FROM node:20.16.0-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN corepack prepare pnpm@9.12.0 --activate
FROM base AS build
COPY . /usr/src/app
@@ -29,7 +31,7 @@ WORKDIR /app
# Set production
ENV NODE_ENV=production
RUN apt-get update && apt-get install -y curl unzip zip apache2-utils iproute2 rsync && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y curl unzip zip apache2-utils iproute2 rsync git-lfs && git lfs install && rm -rf /var/lib/apt/lists/*
# Copy only the necessary files
COPY --from=build /prod/dokploy/.next ./.next
@@ -56,7 +58,7 @@ RUN curl -sSL https://nixpacks.com/install.sh -o install.sh \
&& pnpm install -g tsx
# Install Railpack
ARG RAILPACK_VERSION=0.0.64
ARG RAILPACK_VERSION=0.2.2
RUN curl -sSL https://railpack.com/install.sh | bash
# Install buildpacks

View File

@@ -1,7 +1,9 @@
FROM node:20.9-slim AS base
# syntax=docker/dockerfile:1
FROM node:20.16.0-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN corepack prepare pnpm@9.12.0 --activate
FROM base AS build
COPY . /usr/src/app

View File

@@ -1,3 +1,4 @@
# syntax=docker/dockerfile:1
# Build stage
FROM golang:1.21-alpine3.19 AS builder

View File

@@ -1,7 +1,9 @@
FROM node:20.9-slim AS base
# syntax=docker/dockerfile:1
FROM node:20.16.0-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN corepack prepare pnpm@9.12.0 --activate
FROM base AS build
COPY . /usr/src/app

View File

@@ -1,7 +1,9 @@
FROM node:20.9-slim AS base
# syntax=docker/dockerfile:1
FROM node:20.16.0-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN corepack prepare pnpm@9.12.0 --activate
FROM base AS build
COPY . /usr/src/app

View File

@@ -16,28 +16,29 @@ Here's how to install docker on different operating systems:
### Ubuntu
```bash
# Uninstall old versions
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
# Update package index
sudo apt-get update
# Install prerequisites
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
# Add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Set up stable repository
# Add the repository to Apt sources
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker Engine
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```
## Windows

View File

@@ -2,7 +2,7 @@
## Core License (Apache License 2.0)
Copyright 2024 Mauricio Siu.
Copyright 2025 Mauricio Siu.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

137
README.md
View File

@@ -1,23 +1,36 @@
<div align="center">
<div>
<a href="https://dokploy.com" target="_blank" rel="noopener">
<img style="object-fit: cover;" align="center" width="100%"src=".github/sponsors/logo.png" alt="Dokploy - Open Source Alternative to Vercel, Heroku and Netlify." />
</a>
</div>
</br>
<div align="center">
<div>Join us on Discord for help, feedback, and discussions!</div>
<a href="https://dokploy.com">
<img src=".github/sponsors/logo.png" alt="Dokploy - Open Source Alternative to Vercel, Heroku and Netlify." width="100%" />
</a>
</br>
</br>
<p>Join us on Discord for help, feedback, and discussions!</p>
<a href="https://discord.gg/2tBnJ3jDJc">
<img src="https://discordapp.com/api/guilds/1234073262418563112/widget.png?style=banner2" alt="Discord Shield"/>
</a>
</div>
</div>
<br />
<div align="center" markdown="1">
<sup>Special thanks to:</sup>
<br>
<br>
<a href="https://tuple.app/dokploy">
<img src=".github/sponsors/tuple.png" alt="Tuple's sponsorship image" width="400"/>
</a>
### [Tuple, the premier screen sharing app for developers](https://tuple.app/dokploy)
[Available for MacOS & Windows](https://tuple.app/dokploy)<br>
</div>
Dokploy is a free, self-hostable Platform as a Service (PaaS) that simplifies the deployment and management of applications and databases.
### Features
## ✨ Features
Dokploy includes multiple features to make your life easier.
@@ -47,7 +60,7 @@ curl -sSL https://dokploy.com/install.sh | sh
For detailed documentation, visit [docs.dokploy.com](https://docs.dokploy.com).
## Sponsors
## ♥️ Sponsors
🙏 We're deeply grateful to all our sponsors who make Dokploy possible! Your support helps cover the costs of hosting, testing, and developing new features.
@@ -61,76 +74,47 @@ For detailed documentation, visit [docs.dokploy.com](https://docs.dokploy.com).
### Hero Sponsors 🎖
<div style="display: flex; align-items: center; gap: 20px;">
<a href="https://www.hostinger.com/vps-hosting?ref=dokploy" target="_blank" style="display: inline-block; margin-right: 10px;">
<img src=".github/sponsors/hostinger.jpg" alt="Hostinger" height="50"/>
</a>
<a href="https://www.lxaer.com/?ref=dokploy" target="_blank" style="display: inline-block; margin-right: 10px;">
<img src=".github/sponsors/lxaer.png" alt="LX Aer" height="50"/>
</a>
<a href="https://mandarin3d.com/?ref=dokploy" target="_blank" style="display: inline-block;">
<img src=".github/sponsors/mandarin.png" alt="Mandarin" height="50"/>
</a>
<a href="https://lightnode.com/?ref=dokploy" target="_blank" style="display: inline-block;">
<img src=".github/sponsors/light-node.webp" alt="Lightnode" height="70"/>
</a>
<div>
<a href="https://www.hostinger.com/vps-hosting?ref=dokploy"><img src=".github/sponsors/hostinger.jpg" alt="Hostinger" width="300"/></a>
<a href="https://www.lxaer.com/?ref=dokploy"><img src=".github/sponsors/lxaer.png" alt="LX Aer" width="100"/></a>
</div>
<!-- Premium Supporters 🥇 -->
<!-- Add Premium Supporters here -->
### Premium Supporters 🥇
<div style="display: flex; align-items: center; gap: 20px;">
<a href="https://supafort.com/?ref=dokploy" target="_blank" style="display: inline-block; margin-right: 20px;">
<img src="https://supafort.com/build/q-4Ht4rBZR.webp" alt="Supafort.com" height="50"/>
</a>
<a href="https://agentdock.ai/?ref=dokploy" target="_blank" style="display: inline-block; margin-right: 50px;">
<img src=".github/sponsors/agentdock.png" alt="agentdock.ai" height="70"/>
</a>
<div>
<a href="https://supafort.com/?ref=dokploy"><img src="https://supafort.com/build/q-4Ht4rBZR.webp" alt="Supafort.com" width="300"/></a>
<a href="https://agentdock.ai/?ref=dokploy"><img src=".github/sponsors/agentdock.png" alt="agentdock.ai" width="100"/></a>
</div>
### Elite Contributors 🥈
<div style="display: flex; align-items: center; gap: 20px;">
<a href="https://americancloud.com/?ref=dokploy" target="_blank" style="display: inline-block; padding: 10px; border-radius: 10px;">
<img src=".github/sponsors/american-cloud.png" alt="AmericanCloud" height="70"/>
</a>
</div>
<!-- Elite Contributors 🥈 -->
<!-- Add Elite Contributors here -->
### Supporting Members 🥉
<div style="display: flex; gap: 30px; flex-wrap: wrap;">
<a href="https://lightspeed.run/?ref=dokploy"><img src="https://github.com/lightspeedrun.png" width="60px" alt="Lightspeed.run"/></a>
<a href="https://cloudblast.io/?ref=dokploy "><img src="https://cloudblast.io/img/logo-icon.193cf13e.svg" width="250px" alt="Cloudblast.io"/></a>
<a href="https://startupfa.me/?ref=dokploy "><img src=".github/sponsors/startupfame.png" width="65px" alt="Startupfame"/></a>
<a href="https://itsdb-center.com?ref=dokploy "><img src=".github/sponsors/its.png" width="65px" alt="Itsdb-center"/></a>
<a href="https://openalternative.co/?ref=dokploy "><img src=".github/sponsors/openalternative.png" width="65px" alt="Openalternative"/></a>
<a href="https://synexa.ai/?ref=dokploy"><img src=".github/sponsors/synexa.png" width="65px" alt="Synexa"/></a>
### Elite Contributors 🥈
<div>
<a href="https://americancloud.com/?ref=dokploy"><img src=".github/sponsors/american-cloud.png" alt="AmericanCloud" width="300"/></a>
<a href="https://tolgee.io/?utm_source=github_dokploy&utm_medium=banner&utm_campaign=dokploy"><img src="https://dokploy.com/tolgee-logo.png" alt="Tolgee" width="100"/></a>
</div>
### Supporting Members 🥉
<div>
<a href="https://cloudblast.io/?ref=dokploy"><img src="https://cloudblast.io/img/logo-icon.193cf13e.svg" width="250px" alt="Cloudblast.io"/></a>
<a href="https://synexa.ai/?ref=dokploy"><img src=".github/sponsors/synexa.png" width="65px" alt="Synexa"/></a>
</div>
### Community Backers 🤝
<div style="display: flex; gap: 30px; flex-wrap: wrap;">
<a href="https://steamsets.com/?ref=dokploy"><img src="https://avatars.githubusercontent.com/u/111978405?s=200&v=4" width="60px" alt="Steamsets.com"/></a>
<a href="https://rivo.gg/?ref=dokploy"><img src="https://avatars.githubusercontent.com/u/126797452?s=200&v=4" width="60px" alt="Rivo.gg"/></a>
<a href="https://photoquest.wedding/?ref=dokploy"><img src="https://photoquest.wedding/favicon/android-chrome-512x512.png" width="60px" alt="Rivo.gg"/></a>
</div>
#### Organizations:
[![Sponsors on Open Collective](https://opencollective.com/dokploy/organizations.svg?width=890)](https://opencollective.com/dokploy)
[Sponsors on Open Collective](https://opencollective.com/dokploy)
#### Individuals:
@@ -139,28 +123,15 @@ For detailed documentation, visit [docs.dokploy.com](https://docs.dokploy.com).
### Contributors 🤝
<a href="https://github.com/dokploy/dokploy/graphs/contributors">
<img src="https://contrib.rocks/image?repo=dokploy/dokploy" />
</a>
## Video Tutorial
<a href="https://youtu.be/mznYKPvhcfw">
<img src="https://dokploy.com/banner.png" alt="Watch the video" width="400" style="border-radius:20px;"/>
<img src="https://contrib.rocks/image?repo=dokploy/dokploy" alt="Contributors" />
</a>
<!-- ## Supported OS
## 📺 Video Tutorial
- Ubuntu 24.04 LTS
- Ubuntu 23.10
- Ubuntu 22.04 LTS
- Ubuntu 20.04 LTS
- Ubuntu 18.04 LTS
- Debian 12
- Debian 11
- Fedora 40
- Centos 9
- Centos 8 -->
<a href="https://youtu.be/mznYKPvhcfw">
<img src="https://dokploy.com/banner.png" alt="Watch the video" width="400"/>
</a>
## Contributing
## 🤝 Contributing
Check out the [Contributing Guide](CONTRIBUTING.md) for more information.

28
SECURITY.md Normal file
View File

@@ -0,0 +1,28 @@
# Dokploy Security Policy
At Dokploy, security is a top priority. We appreciate the help of security researchers and the community in identifying and reporting vulnerabilities.
## How to Report a Vulnerability
If you have discovered a security vulnerability in Dokploy, we ask that you report it responsibly by following these guidelines:
1. **Contact us:** Send an email to [contact@dokploy.com](mailto:contact@dokploy.com).
2. **Provide clear details:** Include as much information as possible to help us understand and reproduce the vulnerability. This should include:
* A clear description of the vulnerability.
* Steps to reproduce the vulnerability.
* Any sample code, screenshots, or videos that might be helpful.
* The potential impact of the vulnerability.
3. **Do not make the vulnerability public:** Please refrain from publicly disclosing the vulnerability until we have had the opportunity to investigate and address it. This is crucial for protecting our users.
4. **Allow us time:** We will endeavor to acknowledge receipt of your report as soon as possible and keep you informed of our progress. The time to resolve the vulnerability may vary depending on its complexity and severity.
## What We Expect From You
* Do not access user data or systems beyond what is necessary to demonstrate the vulnerability.
* Do not perform denial-of-service (DoS) attacks, spamming, or social engineering.
* Do not modify or destroy data that does not belong to you.
## Our Commitment
We are committed to working with you quickly and responsibly to address any legitimate security vulnerability.
Thank you for helping us keep Dokploy secure for everyone.

View File

@@ -9,25 +9,30 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"inngest": "3.40.1",
"@dokploy/server": "workspace:*",
"@hono/node-server": "^1.14.3",
"@hono/zod-validator": "0.3.0",
"@nerimity/mimiqueue": "1.2.3",
"dotenv": "^16.4.5",
"hono": "^4.7.10",
"pino": "9.4.0",
"pino-pretty": "11.2.2",
"@hono/zod-validator": "0.3.0",
"zod": "^3.23.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"@dokploy/server": "workspace:*",
"@hono/node-server": "^1.12.1",
"hono": "^4.5.8",
"dotenv": "^16.3.1",
"redis": "4.7.0",
"@nerimity/mimiqueue": "1.2.3"
"zod": "^3.25.32"
},
"devDependencies": {
"typescript": "^5.4.2",
"@types/node": "^20.17.51",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@types/node": "^20.11.17",
"tsx": "^4.7.1"
"tsx": "^4.16.2",
"typescript": "^5.8.3"
},
"packageManager": "pnpm@9.5.0"
"packageManager": "pnpm@9.12.0",
"engines": {
"node": "^20.16.0",
"pnpm": ">=9.12.0"
}
}

View File

@@ -2,21 +2,90 @@ import { serve } from "@hono/node-server";
import { Hono } from "hono";
import "dotenv/config";
import { zValidator } from "@hono/zod-validator";
import { Queue } from "@nerimity/mimiqueue";
import { createClient } from "redis";
import { Inngest } from "inngest";
import { serve as serveInngest } from "inngest/hono";
import { logger } from "./logger.js";
import { type DeployJob, deployJobSchema } from "./schema.js";
import {
cancelDeploymentSchema,
type DeployJob,
deployJobSchema,
} from "./schema.js";
import { deploy } from "./utils.js";
const app = new Hono();
const redisClient = createClient({
url: process.env.REDIS_URL,
// Initialize Inngest client
export const inngest = new Inngest({
id: "dokploy-deployments",
name: "Dokploy Deployment Service",
});
export const deploymentFunction = inngest.createFunction(
{
id: "deploy-application",
name: "Deploy Application",
concurrency: [
{
key: "event.data.serverId",
limit: 1,
},
],
retries: 0,
cancelOn: [
{
event: "deployment/cancelled",
if: "async.data.applicationId == event.data.applicationId || async.data.composeId == event.data.composeId",
timeout: "1h", // Allow cancellation for up to 1 hour
},
],
},
{ event: "deployment/requested" },
async ({ event, step }) => {
const jobData = event.data as DeployJob;
return await step.run("execute-deployment", async () => {
logger.info("Deploying started");
try {
const result = await deploy(jobData);
logger.info("Deployment finished", result);
// Send success event
await inngest.send({
name: "deployment/completed",
data: {
...jobData,
result,
status: "success",
},
});
return result;
} catch (error) {
logger.error("Deployment failed", { jobData, error });
// Send failure event
await inngest.send({
name: "deployment/failed",
data: {
...jobData,
error: error instanceof Error ? error.message : String(error),
status: "failed",
},
});
throw error;
}
});
},
);
app.use(async (c, next) => {
if (c.req.path === "/health") {
if (c.req.path === "/health" || c.req.path === "/api/inngest") {
return next();
}
const authHeader = c.req.header("X-API-Key");
if (process.env.API_KEY !== authHeader) {
@@ -26,36 +95,97 @@ app.use(async (c, next) => {
return next();
});
app.post("/deploy", zValidator("json", deployJobSchema), (c) => {
app.post("/deploy", zValidator("json", deployJobSchema), async (c) => {
const data = c.req.valid("json");
queue.add(data, { groupName: data.serverId });
return c.json(
{
message: "Deployment Added",
},
200,
);
logger.info("Received deployment request", data);
try {
// Send event to Inngest instead of adding to Redis queue
await inngest.send({
name: "deployment/requested",
data,
});
logger.info("Deployment event sent to Inngest", {
serverId: data.serverId,
});
return c.json(
{
message: "Deployment Added to Inngest Queue",
serverId: data.serverId,
},
200,
);
} catch (error) {
console.log("error", error);
logger.error("Failed to send deployment event", error);
return c.json(
{
message: "Failed to queue deployment",
error: error instanceof Error ? error.message : String(error),
},
500,
);
}
});
app.post(
"/cancel-deployment",
zValidator("json", cancelDeploymentSchema),
async (c) => {
const data = c.req.valid("json");
logger.info("Received cancel deployment request", data);
try {
// Send cancellation event to Inngest
await inngest.send({
name: "deployment/cancelled",
data,
});
const identifier =
data.applicationType === "application"
? `applicationId: ${data.applicationId}`
: `composeId: ${data.composeId}`;
logger.info("Deployment cancellation event sent", {
...data,
identifier,
});
return c.json({
message: "Deployment cancellation requested",
applicationType: data.applicationType,
});
} catch (error) {
logger.error("Failed to send deployment cancellation event", error);
return c.json(
{
message: "Failed to cancel deployment",
error: error instanceof Error ? error.message : String(error),
},
500,
);
}
},
);
app.get("/health", async (c) => {
return c.json({ status: "ok" });
});
const queue = new Queue({
name: "deployments",
process: async (job: DeployJob) => {
logger.info("Deploying job", job);
return await deploy(job);
},
redisClient,
});
(async () => {
await redisClient.connect();
await redisClient.flushAll();
logger.info("Redis Cleaned");
})();
// Serve Inngest functions endpoint
app.on(
["GET", "POST", "PUT"],
"/api/inngest",
serveInngest({
client: inngest,
functions: [deploymentFunction],
}),
);
const port = Number.parseInt(process.env.PORT || "3000");
logger.info("Starting Deployments Server ✅", port);
logger.info("Starting Deployments Server with Inngest ✅", port);
serve({ fetch: app.fetch, port });

View File

@@ -3,8 +3,8 @@ import { z } from "zod";
export const deployJobSchema = z.discriminatedUnion("applicationType", [
z.object({
applicationId: z.string(),
titleLog: z.string(),
descriptionLog: z.string(),
titleLog: z.string().optional(),
descriptionLog: z.string().optional(),
server: z.boolean().optional(),
type: z.enum(["deploy", "redeploy"]),
applicationType: z.literal("application"),
@@ -12,8 +12,8 @@ export const deployJobSchema = z.discriminatedUnion("applicationType", [
}),
z.object({
composeId: z.string(),
titleLog: z.string(),
descriptionLog: z.string(),
titleLog: z.string().optional(),
descriptionLog: z.string().optional(),
server: z.boolean().optional(),
type: z.enum(["deploy", "redeploy"]),
applicationType: z.literal("compose"),
@@ -22,8 +22,8 @@ export const deployJobSchema = z.discriminatedUnion("applicationType", [
z.object({
applicationId: z.string(),
previewDeploymentId: z.string(),
titleLog: z.string(),
descriptionLog: z.string(),
titleLog: z.string().optional(),
descriptionLog: z.string().optional(),
server: z.boolean().optional(),
type: z.enum(["deploy"]),
applicationType: z.literal("application-preview"),
@@ -32,3 +32,16 @@ export const deployJobSchema = z.discriminatedUnion("applicationType", [
]);
export type DeployJob = z.infer<typeof deployJobSchema>;
export const cancelDeploymentSchema = z.discriminatedUnion("applicationType", [
z.object({
applicationId: z.string(),
applicationType: z.literal("application"),
}),
z.object({
composeId: z.string(),
applicationType: z.literal("compose"),
}),
]);
export type CancelDeploymentJob = z.infer<typeof cancelDeploymentSchema>;

View File

@@ -18,14 +18,14 @@ export const deploy = async (job: DeployJob) => {
if (job.type === "redeploy") {
await rebuildRemoteApplication({
applicationId: job.applicationId,
titleLog: job.titleLog,
descriptionLog: job.descriptionLog,
titleLog: job.titleLog || "Rebuild deployment",
descriptionLog: job.descriptionLog || "",
});
} else if (job.type === "deploy") {
await deployRemoteApplication({
applicationId: job.applicationId,
titleLog: job.titleLog,
descriptionLog: job.descriptionLog,
titleLog: job.titleLog || "Manual deployment",
descriptionLog: job.descriptionLog || "",
});
}
}
@@ -38,14 +38,14 @@ export const deploy = async (job: DeployJob) => {
if (job.type === "redeploy") {
await rebuildRemoteCompose({
composeId: job.composeId,
titleLog: job.titleLog,
descriptionLog: job.descriptionLog,
titleLog: job.titleLog || "Rebuild deployment",
descriptionLog: job.descriptionLog || "",
});
} else if (job.type === "deploy") {
await deployRemoteCompose({
composeId: job.composeId,
titleLog: job.titleLog,
descriptionLog: job.descriptionLog,
titleLog: job.titleLog || "Manual deployment",
descriptionLog: job.descriptionLog || "",
});
}
}
@@ -57,14 +57,14 @@ export const deploy = async (job: DeployJob) => {
if (job.type === "deploy") {
await deployRemotePreviewApplication({
applicationId: job.applicationId,
titleLog: job.titleLog,
descriptionLog: job.descriptionLog,
titleLog: job.titleLog || "Preview Deployment",
descriptionLog: job.descriptionLog || "",
previewDeploymentId: job.previewDeploymentId,
});
}
}
}
} catch (_) {
} catch (e) {
if (job.applicationType === "application") {
await updateApplicationStatus(job.applicationId, "error");
} else if (job.applicationType === "compose") {
@@ -76,6 +76,8 @@ export const deploy = async (job: DeployJob) => {
previewStatus: "error",
});
}
throw e;
}
return true;

View File

@@ -1 +1 @@
20.9.0
20.16.0

View File

@@ -1,26 +0,0 @@
FROM node:18-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
FROM base AS build
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y python3 make g++ git git-lfs && git lfs install && rm -rf /var/lib/apt/lists/*
# Install dependencies
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
# Build only the dokploy app
RUN pnpm run dokploy:build
# Deploy only the dokploy app
RUN pnpm deploy --filter=dokploy --prod /prod/dokploy
FROM base AS dokploy
COPY --from=build /prod/dokploy /prod/dokploy
WORKDIR /prod/dokploy
EXPOSE 3000
CMD [ "pnpm", "start" ]

View File

@@ -1,26 +0,0 @@
# License
## Core License (Apache License 2.0)
Copyright 2024 Mauricio Siu.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
## Additional Terms for Specific Features
The following additional terms apply to the multi-node support, Docker Compose file, Preview Deployments and Multi Server features of Dokploy. In the event of a conflict, these provisions shall take precedence over those in the Apache License:
- **Self-Hosted Version Free**: All features of Dokploy, including multi-node support, Docker Compose file support, Preview Deployments and Multi Server, will always be free to use in the self-hosted version.
- **Restriction on Resale**: The multi-node support, Docker Compose file support, Preview Deployments and Multi Server features cannot be sold or offered as a service by any party other than the copyright holder without prior written consent.
- **Modification Distribution**: Any modifications to the multi-node support, Docker Compose file support, Preview Deployments and Multi Server features must be distributed freely and cannot be sold or offered as a service.
For further inquiries or permissions, please contact us directly.

View File

@@ -1,5 +1,5 @@
import { addSuffixToAllProperties } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { addSuffixToAllProperties } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,5 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToConfigsRoot } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { addSuffixToConfigsRoot, generateRandomHash } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,8 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToConfigsInServices } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import {
addSuffixToConfigsInServices,
generateRandomHash,
} from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,5 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToAllConfigs } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { addSuffixToAllConfigs, generateRandomHash } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -19,6 +19,8 @@ describe("createDomainLabels", () => {
path: "/",
createdAt: "",
previewDeploymentId: "",
internalPath: "/",
stripPath: false,
};
it("should create basic labels for web entrypoint", async () => {
@@ -106,4 +108,136 @@ describe("createDomainLabels", () => {
"traefik.http.services.test-app-1-web.loadbalancer.server.port=3000",
);
});
it("should add stripPath middleware when stripPath is enabled", async () => {
const stripPathDomain = {
...baseDomain,
path: "/api",
stripPath: true,
};
const labels = await createDomainLabels(appName, stripPathDomain, "web");
expect(labels).toContain(
"traefik.http.middlewares.stripprefix-test-app-1.stripprefix.prefixes=/api",
);
expect(labels).toContain(
"traefik.http.routers.test-app-1-web.middlewares=stripprefix-test-app-1",
);
});
it("should add internalPath middleware when internalPath is set", async () => {
const internalPathDomain = {
...baseDomain,
internalPath: "/hello",
};
const webLabels = await createDomainLabels(
appName,
internalPathDomain,
"web",
);
const websecureLabels = await createDomainLabels(
appName,
internalPathDomain,
"websecure",
);
// Middleware definition should only appear in web entrypoint
expect(webLabels).toContain(
"traefik.http.middlewares.addprefix-test-app-1.addprefix.prefix=/hello",
);
expect(websecureLabels).not.toContain(
"traefik.http.middlewares.addprefix-test-app-1.addprefix.prefix=/hello",
);
// Both routers should reference the middleware
expect(webLabels).toContain(
"traefik.http.routers.test-app-1-web.middlewares=addprefix-test-app-1",
);
expect(websecureLabels).toContain(
"traefik.http.routers.test-app-1-websecure.middlewares=addprefix-test-app-1",
);
});
it("should combine HTTPS redirect with internalPath middleware in correct order", async () => {
const combinedDomain = {
...baseDomain,
https: true,
internalPath: "/hello",
};
const webLabels = await createDomainLabels(appName, combinedDomain, "web");
const websecureLabels = await createDomainLabels(
appName,
combinedDomain,
"websecure",
);
// Web entrypoint should have both middlewares with redirect first
expect(webLabels).toContain(
"traefik.http.routers.test-app-1-web.middlewares=redirect-to-https@file,addprefix-test-app-1",
);
// Websecure should only have the addprefix middleware
expect(websecureLabels).toContain(
"traefik.http.routers.test-app-1-websecure.middlewares=addprefix-test-app-1",
);
// Middleware definition should only appear once (in web)
expect(webLabels).toContain(
"traefik.http.middlewares.addprefix-test-app-1.addprefix.prefix=/hello",
);
expect(websecureLabels).not.toContain(
"traefik.http.middlewares.addprefix-test-app-1.addprefix.prefix=/hello",
);
});
it("should combine all middlewares in correct order", async () => {
const fullDomain = {
...baseDomain,
https: true,
path: "/api",
stripPath: true,
internalPath: "/hello",
};
const webLabels = await createDomainLabels(appName, fullDomain, "web");
// Should have all middleware definitions (only in web)
expect(webLabels).toContain(
"traefik.http.middlewares.stripprefix-test-app-1.stripprefix.prefixes=/api",
);
expect(webLabels).toContain(
"traefik.http.middlewares.addprefix-test-app-1.addprefix.prefix=/hello",
);
// Should have middlewares in correct order: redirect, stripprefix, addprefix
expect(webLabels).toContain(
"traefik.http.routers.test-app-1-web.middlewares=redirect-to-https@file,stripprefix-test-app-1,addprefix-test-app-1",
);
});
it("should not add middleware definitions for websecure entrypoint", async () => {
const internalPathDomain = {
...baseDomain,
path: "/api",
stripPath: true,
internalPath: "/hello",
};
const websecureLabels = await createDomainLabels(
appName,
internalPathDomain,
"websecure",
);
// Should not contain any middleware definitions
expect(websecureLabels).not.toContain(
"traefik.http.middlewares.stripprefix-test-app-1.stripprefix.prefixes=/api",
);
expect(websecureLabels).not.toContain(
"traefik.http.middlewares.addprefix-test-app-1.addprefix.prefix=/hello",
);
// But should reference the middlewares
expect(websecureLabels).toContain(
"traefik.http.routers.test-app-1-websecure.middlewares=stripprefix-test-app-1,addprefix-test-app-1",
);
});
});

View File

@@ -1,6 +1,5 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToNetworksRoot } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { addSuffixToNetworksRoot, generateRandomHash } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,8 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToServiceNetworks } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import {
addSuffixToServiceNetworks,
generateRandomHash,
} from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,10 +1,10 @@
import { generateRandomHash } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import {
addSuffixToAllNetworks,
addSuffixToNetworksRoot,
addSuffixToServiceNetworks,
generateRandomHash,
} from "@dokploy/server";
import { addSuffixToNetworksRoot } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,5 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToSecretsRoot } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { addSuffixToSecretsRoot, generateRandomHash } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,8 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToSecretsInServices } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import {
addSuffixToSecretsInServices,
generateRandomHash,
} from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,5 +1,5 @@
import { addSuffixToAllSecrets } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { addSuffixToAllSecrets } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,5 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToServiceNames } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { addSuffixToServiceNames, generateRandomHash } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,5 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToServiceNames } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { addSuffixToServiceNames, generateRandomHash } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,5 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToServiceNames } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { addSuffixToServiceNames, generateRandomHash } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,5 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToServiceNames } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { addSuffixToServiceNames, generateRandomHash } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,5 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToServiceNames } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { addSuffixToServiceNames, generateRandomHash } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,8 +1,8 @@
import type { ComposeSpecification } from "@dokploy/server";
import {
addSuffixToAllServiceNames,
addSuffixToServiceNames,
} from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,5 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToServiceNames } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { addSuffixToServiceNames, generateRandomHash } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,9 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToAllVolumes, addSuffixToVolumesRoot } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import {
addSuffixToAllVolumes,
addSuffixToVolumesRoot,
generateRandomHash,
} from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,5 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToVolumesRoot } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { addSuffixToVolumesRoot, generateRandomHash } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,6 +1,8 @@
import { generateRandomHash } from "@dokploy/server";
import { addSuffixToVolumesInServices } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import {
addSuffixToVolumesInServices,
generateRandomHash,
} from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,5 +1,5 @@
import { addSuffixToAllVolumes } from "@dokploy/server";
import type { ComposeSpecification } from "@dokploy/server";
import { addSuffixToAllVolumes } from "@dokploy/server";
import { load } from "js-yaml";
import { expect, test } from "vitest";

View File

@@ -1,5 +1,5 @@
import { extractCommitMessage } from "@/pages/api/deploy/[refreshToken]";
import { describe, expect, it } from "vitest";
import { extractCommitMessage } from "@/pages/api/deploy/[refreshToken]";
describe("GitHub Webhook Skip CI", () => {
const mockGithubHeaders = {

View File

@@ -1,12 +1,12 @@
import fs from "node:fs/promises";
import path from "node:path";
import { paths } from "@dokploy/server/constants";
const { APPLICATIONS_PATH } = paths();
import type { ApplicationNested } from "@dokploy/server";
import { unzipDrop } from "@dokploy/server";
import { paths } from "@dokploy/server/constants";
import AdmZip from "adm-zip";
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
const { APPLICATIONS_PATH } = paths();
vi.mock("@dokploy/server/constants", async (importOriginal) => {
const actual = await importOriginal();
return {
@@ -25,10 +25,13 @@ if (typeof window === "undefined") {
}
const baseApp: ApplicationNested = {
railpackVersion: "0.2.2",
applicationId: "",
previewLabels: [],
herokuVersion: "",
giteaBranch: "",
giteaBuildPath: "",
previewRequireCollaboratorPermissions: false,
giteaId: "",
giteaOwner: "",
giteaRepository: "",
@@ -53,13 +56,21 @@ const baseApp: ApplicationNested = {
previewPort: 3000,
previewLimit: 0,
previewWildcard: "",
project: {
environment: {
env: "",
organizationId: "",
environmentId: "",
name: "",
description: "",
createdAt: "",
description: "",
projectId: "",
project: {
env: "",
organizationId: "",
name: "",
description: "",
createdAt: "",
projectId: "",
},
},
buildArgs: null,
buildPath: "/",
@@ -89,6 +100,7 @@ const baseApp: ApplicationNested = {
dockerfile: null,
dockerImage: null,
dropBuildPath: null,
environmentId: "",
enabled: null,
env: null,
healthCheckSwarm: null,
@@ -103,8 +115,8 @@ const baseApp: ApplicationNested = {
password: null,
placementSwarm: null,
ports: [],
projectId: "",
publishDirectory: null,
isStaticSpa: null,
redirects: [],
refreshToken: "",
registry: null,
@@ -120,6 +132,7 @@ const baseApp: ApplicationNested = {
updateConfigSwarm: null,
username: null,
dockerContextPath: null,
rollbackActive: false,
};
describe("unzipDrop using real zip files", () => {
@@ -139,7 +152,7 @@ describe("unzipDrop using real zip files", () => {
const outputPath = path.join(APPLICATIONS_PATH, baseApp.appName, "code");
const zip = new AdmZip("./__test__/drop/zips/single-file.zip");
console.log(`Output Path: ${outputPath}`);
const zipBuffer = zip.toBuffer();
const zipBuffer = zip.toBuffer() as Buffer<ArrayBuffer>;
const file = new File([zipBuffer], "single.zip");
await unzipDrop(file, baseApp);
const files = await fs.readdir(outputPath, { withFileTypes: true });
@@ -149,67 +162,68 @@ describe("unzipDrop using real zip files", () => {
} finally {
}
});
it("should correctly extract a zip with a single root folder and a subfolder", async () => {
baseApp.appName = "folderwithfile";
// const appName = "folderwithfile";
const outputPath = path.join(APPLICATIONS_PATH, baseApp.appName, "code");
const zip = new AdmZip("./__test__/drop/zips/folder-with-file.zip");
const zipBuffer = zip.toBuffer();
const file = new File([zipBuffer], "single.zip");
await unzipDrop(file, baseApp);
const files = await fs.readdir(outputPath, { withFileTypes: true });
expect(files.some((f) => f.name === "folder1.txt")).toBe(true);
});
it("should correctly extract a zip with multiple root folders", async () => {
baseApp.appName = "two-folders";
// const appName = "two-folders";
const outputPath = path.join(APPLICATIONS_PATH, baseApp.appName, "code");
const zip = new AdmZip("./__test__/drop/zips/two-folders.zip");
const zipBuffer = zip.toBuffer();
const file = new File([zipBuffer], "single.zip");
await unzipDrop(file, baseApp);
const files = await fs.readdir(outputPath, { withFileTypes: true });
expect(files.some((f) => f.name === "folder1")).toBe(true);
expect(files.some((f) => f.name === "folder2")).toBe(true);
});
it("should correctly extract a zip with a single root with a file", async () => {
baseApp.appName = "nested";
// const appName = "nested";
const outputPath = path.join(APPLICATIONS_PATH, baseApp.appName, "code");
const zip = new AdmZip("./__test__/drop/zips/nested.zip");
const zipBuffer = zip.toBuffer();
const file = new File([zipBuffer], "single.zip");
await unzipDrop(file, baseApp);
const files = await fs.readdir(outputPath, { withFileTypes: true });
expect(files.some((f) => f.name === "folder1")).toBe(true);
expect(files.some((f) => f.name === "folder2")).toBe(true);
expect(files.some((f) => f.name === "folder3")).toBe(true);
});
it("should correctly extract a zip with a single root with a folder", async () => {
baseApp.appName = "folder-with-sibling-file";
// const appName = "folder-with-sibling-file";
const outputPath = path.join(APPLICATIONS_PATH, baseApp.appName, "code");
const zip = new AdmZip("./__test__/drop/zips/folder-with-sibling-file.zip");
const zipBuffer = zip.toBuffer();
const file = new File([zipBuffer], "single.zip");
await unzipDrop(file, baseApp);
const files = await fs.readdir(outputPath, { withFileTypes: true });
expect(files.some((f) => f.name === "folder1")).toBe(true);
expect(files.some((f) => f.name === "test.txt")).toBe(true);
});
});
// it("should correctly extract a zip with a single root folder and a subfolder", async () => {
// baseApp.appName = "folderwithfile";
// // const appName = "folderwithfile";
// const outputPath = path.join(APPLICATIONS_PATH, baseApp.appName, "code");
// const zip = new AdmZip("./__test__/drop/zips/folder-with-file.zip");
// const zipBuffer = zip.toBuffer();
// const file = new File([zipBuffer], "single.zip");
// await unzipDrop(file, baseApp);
// const files = await fs.readdir(outputPath, { withFileTypes: true });
// expect(files.some((f) => f.name === "folder1.txt")).toBe(true);
// });
// it("should correctly extract a zip with multiple root folders", async () => {
// baseApp.appName = "two-folders";
// // const appName = "two-folders";
// const outputPath = path.join(APPLICATIONS_PATH, baseApp.appName, "code");
// const zip = new AdmZip("./__test__/drop/zips/two-folders.zip");
// const zipBuffer = zip.toBuffer();
// const file = new File([zipBuffer], "single.zip");
// await unzipDrop(file, baseApp);
// const files = await fs.readdir(outputPath, { withFileTypes: true });
// expect(files.some((f) => f.name === "folder1")).toBe(true);
// expect(files.some((f) => f.name === "folder2")).toBe(true);
// });
// it("should correctly extract a zip with a single root with a file", async () => {
// baseApp.appName = "nested";
// // const appName = "nested";
// const outputPath = path.join(APPLICATIONS_PATH, baseApp.appName, "code");
// const zip = new AdmZip("./__test__/drop/zips/nested.zip");
// const zipBuffer = zip.toBuffer();
// const file = new File([zipBuffer], "single.zip");
// await unzipDrop(file, baseApp);
// const files = await fs.readdir(outputPath, { withFileTypes: true });
// expect(files.some((f) => f.name === "folder1")).toBe(true);
// expect(files.some((f) => f.name === "folder2")).toBe(true);
// expect(files.some((f) => f.name === "folder3")).toBe(true);
// });
// it("should correctly extract a zip with a single root with a folder", async () => {
// baseApp.appName = "folder-with-sibling-file";
// // const appName = "folder-with-sibling-file";
// const outputPath = path.join(APPLICATIONS_PATH, baseApp.appName, "code");
// const zip = new AdmZip("./__test__/drop/zips/folder-with-sibling-file.zip");
// const zipBuffer = zip.toBuffer();
// const file = new File([zipBuffer], "single.zip");
// await unzipDrop(file, baseApp);
// const files = await fs.readdir(outputPath, { withFileTypes: true });
// expect(files.some((f) => f.name === "folder1")).toBe(true);
// expect(files.some((f) => f.name === "test.txt")).toBe(true);
// });
// });

View File

@@ -0,0 +1,335 @@
import { prepareEnvironmentVariables } from "@dokploy/server/index";
import { describe, expect, it } from "vitest";
const projectEnv = `
ENVIRONMENT=staging
DATABASE_URL=postgres://postgres:postgres@localhost:5432/project_db
PORT=3000
`;
const environmentEnv = `
NODE_ENV=development
API_URL=https://api.dev.example.com
REDIS_URL=redis://localhost:6379
DATABASE_NAME=dev_database
SECRET_KEY=env-secret-123
`;
describe("prepareEnvironmentVariables (environment variables)", () => {
it("resolves environment variables correctly", () => {
const serviceWithEnvVars = `
NODE_ENV=\${{environment.NODE_ENV}}
API_URL=\${{environment.API_URL}}
SERVICE_PORT=4000
`;
const resolved = prepareEnvironmentVariables(
serviceWithEnvVars,
"",
environmentEnv,
);
expect(resolved).toEqual([
"NODE_ENV=development",
"API_URL=https://api.dev.example.com",
"SERVICE_PORT=4000",
]);
});
it("resolves both project and environment variables", () => {
const serviceWithBoth = `
ENVIRONMENT=\${{project.ENVIRONMENT}}
NODE_ENV=\${{environment.NODE_ENV}}
API_URL=\${{environment.API_URL}}
DATABASE_URL=\${{project.DATABASE_URL}}
SERVICE_PORT=4000
`;
const resolved = prepareEnvironmentVariables(
serviceWithBoth,
projectEnv,
environmentEnv,
);
expect(resolved).toEqual([
"ENVIRONMENT=staging",
"NODE_ENV=development",
"API_URL=https://api.dev.example.com",
"DATABASE_URL=postgres://postgres:postgres@localhost:5432/project_db",
"SERVICE_PORT=4000",
]);
});
it("handles undefined environment variables", () => {
const serviceWithUndefined = `
UNDEFINED_VAR=\${{environment.UNDEFINED_VAR}}
`;
expect(() =>
prepareEnvironmentVariables(serviceWithUndefined, "", environmentEnv),
).toThrow("Invalid environment variable: environment.UNDEFINED_VAR");
});
it("allows service variables to override environment variables", () => {
const serviceOverrideEnv = `
NODE_ENV=production
API_URL=\${{environment.API_URL}}
`;
const resolved = prepareEnvironmentVariables(
serviceOverrideEnv,
"",
environmentEnv,
);
expect(resolved).toEqual([
"NODE_ENV=production", // Overrides environment variable
"API_URL=https://api.dev.example.com",
]);
});
it("resolves complex references with project, environment, and service variables", () => {
const complexServiceEnv = `
FULL_DATABASE_URL=\${{project.DATABASE_URL}}/\${{environment.DATABASE_NAME}}
API_ENDPOINT=\${{environment.API_URL}}/\${{project.ENVIRONMENT}}/api
SERVICE_NAME=my-service
COMPLEX_VAR=\${{SERVICE_NAME}}-\${{environment.NODE_ENV}}-\${{project.ENVIRONMENT}}
`;
const resolved = prepareEnvironmentVariables(
complexServiceEnv,
projectEnv,
environmentEnv,
);
expect(resolved).toEqual([
"FULL_DATABASE_URL=postgres://postgres:postgres@localhost:5432/project_db/dev_database",
"API_ENDPOINT=https://api.dev.example.com/staging/api",
"SERVICE_NAME=my-service",
"COMPLEX_VAR=my-service-development-staging",
]);
});
it("handles environment variables with special characters", () => {
const specialEnvVars = `
SPECIAL_URL=https://special.com
COMPLEX_KEY="key-with-@#$%^&*()"
JWT_SECRET="secret-with-spaces and symbols!@#"
`;
const serviceWithSpecial = `
FULL_URL=\${{environment.SPECIAL_URL}}/path?key=\${{environment.COMPLEX_KEY}}
AUTH_SECRET=\${{environment.JWT_SECRET}}
`;
const resolved = prepareEnvironmentVariables(
serviceWithSpecial,
"",
specialEnvVars,
);
expect(resolved).toEqual([
"FULL_URL=https://special.com/path?key=key-with-@#$%^&*()",
"AUTH_SECRET=secret-with-spaces and symbols!@#",
]);
});
it("maintains precedence: service > environment > project", () => {
const conflictingProjectEnv = `
NODE_ENV=production-project
API_URL=https://project.api.com
DATABASE_NAME=project_db
`;
const conflictingEnvironmentEnv = `
NODE_ENV=development-environment
API_URL=https://environment.api.com
DATABASE_NAME=env_db
`;
const serviceWithConflicts = `
NODE_ENV=service-override
PROJECT_ENV=\${{project.NODE_ENV}}
ENV_VAR=\${{environment.API_URL}}
DB_NAME=\${{environment.DATABASE_NAME}}
`;
const resolved = prepareEnvironmentVariables(
serviceWithConflicts,
conflictingProjectEnv,
conflictingEnvironmentEnv,
);
expect(resolved).toEqual([
"NODE_ENV=service-override", // Service wins
"PROJECT_ENV=production-project", // Project reference
"ENV_VAR=https://environment.api.com", // Environment reference
"DB_NAME=env_db", // Environment reference
]);
});
it("handles empty environment variables", () => {
const serviceWithEmpty = `
SERVICE_VAR=test
PROJECT_VAR=\${{project.ENVIRONMENT}}
`;
const resolved = prepareEnvironmentVariables(
serviceWithEmpty,
projectEnv,
"",
);
expect(resolved).toEqual(["SERVICE_VAR=test", "PROJECT_VAR=staging"]);
});
it("handles mixed quotes and environment variables", () => {
const envWithQuotes = `
QUOTED_VAR="development"
SINGLE_QUOTED='https://api.dev.example.com'
MIXED_VAR="value with 'single' quotes"
`;
const serviceWithQuotes = `
NODE_ENV=\${{environment.QUOTED_VAR}}
API_URL=\${{environment.SINGLE_QUOTED}}
COMPLEX="Prefix-\${{environment.MIXED_VAR}}-Suffix"
`;
const resolved = prepareEnvironmentVariables(
serviceWithQuotes,
"",
envWithQuotes,
);
expect(resolved).toEqual([
"NODE_ENV=development",
"API_URL=https://api.dev.example.com",
"COMPLEX=Prefix-value with 'single' quotes-Suffix",
]);
});
it("resolves multiple environment references in single value", () => {
const multiRefEnv = `
HOST=localhost
PORT=5432
USERNAME=postgres
PASSWORD=secret123
`;
const serviceWithMultiRefs = `
DATABASE_URL=postgresql://\${{environment.USERNAME}}:\${{environment.PASSWORD}}@\${{environment.HOST}}:\${{environment.PORT}}/mydb
CONNECTION_STRING=\${{environment.HOST}}:\${{environment.PORT}}
`;
const resolved = prepareEnvironmentVariables(
serviceWithMultiRefs,
"",
multiRefEnv,
);
expect(resolved).toEqual([
"DATABASE_URL=postgresql://postgres:secret123@localhost:5432/mydb",
"CONNECTION_STRING=localhost:5432",
]);
});
it("handles nested references with environment and project variables", () => {
const nestedProjectEnv = `
BASE_DOMAIN=example.com
PROTOCOL=https
`;
const nestedEnvironmentEnv = `
SUBDOMAIN=api.dev
PATH_PREFIX=/v1
`;
const serviceWithNested = `
FULL_URL=\${{project.PROTOCOL}}://\${{environment.SUBDOMAIN}}.\${{project.BASE_DOMAIN}}\${{environment.PATH_PREFIX}}/endpoint
API_BASE=\${{project.PROTOCOL}}://\${{environment.SUBDOMAIN}}.\${{project.BASE_DOMAIN}}
`;
const resolved = prepareEnvironmentVariables(
serviceWithNested,
nestedProjectEnv,
nestedEnvironmentEnv,
);
expect(resolved).toEqual([
"FULL_URL=https://api.dev.example.com/v1/endpoint",
"API_BASE=https://api.dev.example.com",
]);
});
it("throws error for malformed environment variable references", () => {
const serviceWithMalformed = `
MALFORMED1=\${{environment.}}
MALFORMED2=\${{environment}}
VALID=\${{environment.NODE_ENV}}
`;
// Should throw error for empty variable name after environment.
expect(() =>
prepareEnvironmentVariables(serviceWithMalformed, "", environmentEnv),
).toThrow("Invalid environment variable: environment.");
});
it("handles environment variables with numeric values", () => {
const numericEnv = `
PORT=8080
TIMEOUT=30
RETRY_COUNT=3
PERCENTAGE=99.5
`;
const serviceWithNumeric = `
SERVER_PORT=\${{environment.PORT}}
REQUEST_TIMEOUT=\${{environment.TIMEOUT}}
MAX_RETRIES=\${{environment.RETRY_COUNT}}
SUCCESS_RATE=\${{environment.PERCENTAGE}}
`;
const resolved = prepareEnvironmentVariables(
serviceWithNumeric,
"",
numericEnv,
);
expect(resolved).toEqual([
"SERVER_PORT=8080",
"REQUEST_TIMEOUT=30",
"MAX_RETRIES=3",
"SUCCESS_RATE=99.5",
]);
});
it("handles boolean-like environment variables", () => {
const booleanEnv = `
DEBUG=true
ENABLED=false
PRODUCTION=1
DEVELOPMENT=0
`;
const serviceWithBoolean = `
DEBUG_MODE=\${{environment.DEBUG}}
FEATURE_ENABLED=\${{environment.ENABLED}}
IS_PROD=\${{environment.PRODUCTION}}
IS_DEV=\${{environment.DEVELOPMENT}}
`;
const resolved = prepareEnvironmentVariables(
serviceWithBoolean,
"",
booleanEnv,
);
expect(resolved).toEqual([
"DEBUG_MODE=true",
"FEATURE_ENABLED=false",
"IS_PROD=1",
"IS_DEV=0",
]);
});
});

View File

@@ -177,3 +177,77 @@ COMPLEX_VAR="'Prefix \"DoubleQuoted\" and \${{project.APP_NAME}}'"
]);
});
});
describe("prepareEnvironmentVariables (self references)", () => {
it("resolves self references correctly", () => {
const serviceEnv = `
ENVIRONMENT=staging
DATABASE_URL=postgres://postgres:postgres@localhost:5432/project_db
SELF_REF=\${{ENVIRONMENT}}
`;
const resolved = prepareEnvironmentVariables(serviceEnv, "");
expect(resolved).toEqual([
"ENVIRONMENT=staging",
"DATABASE_URL=postgres://postgres:postgres@localhost:5432/project_db",
"SELF_REF=staging",
]);
});
it("throws on undefined self references", () => {
const serviceEnv = `
MISSING_VAR=\${{UNDEFINED_VAR}}
`;
expect(() => prepareEnvironmentVariables(serviceEnv, "")).toThrow(
"Invalid service environment variable: UNDEFINED_VAR",
);
});
it("allows overriding and still resolving from self", () => {
const serviceEnv = `
ENVIRONMENT=production
OVERRIDE_ENV=\${{ENVIRONMENT}}
`;
const resolved = prepareEnvironmentVariables(serviceEnv, "");
expect(resolved).toEqual([
"ENVIRONMENT=production",
"OVERRIDE_ENV=production",
]);
});
it("resolves multiple self references inside one value", () => {
const serviceEnv = `
ENVIRONMENT=staging
APP_NAME=MyApp
COMPLEX=\${{APP_NAME}}-\${{ENVIRONMENT}}-\${{APP_NAME}}
`;
const resolved = prepareEnvironmentVariables(serviceEnv, "");
expect(resolved).toEqual([
"ENVIRONMENT=staging",
"APP_NAME=MyApp",
"COMPLEX=MyApp-staging-MyApp",
]);
});
it("handles quotes with self references", () => {
const serviceEnv = `
ENVIRONMENT=production
QUOTED="'\${{ENVIRONMENT}}'"
MIXED="\"Double \${{ENVIRONMENT}}\""
`;
const resolved = prepareEnvironmentVariables(serviceEnv, "");
expect(resolved).toEqual([
"ENVIRONMENT=production",
"QUOTED='production'",
'MIXED="Double production"',
]);
});
});

View File

@@ -1,5 +1,6 @@
import { parseRawConfig, processLogs } from "@dokploy/server";
import { describe, expect, it } from "vitest";
const sampleLogEntry = `{"ClientAddr":"172.19.0.1:56732","ClientHost":"172.19.0.1","ClientPort":"56732","ClientUsername":"-","DownstreamContentSize":0,"DownstreamStatus":304,"Duration":14729375,"OriginContentSize":0,"OriginDuration":14051833,"OriginStatus":304,"Overhead":677542,"RequestAddr":"s222-umami-c381af.traefik.me","RequestContentSize":0,"RequestCount":122,"RequestHost":"s222-umami-c381af.traefik.me","RequestMethod":"GET","RequestPath":"/dashboard?_rsc=1rugv","RequestPort":"-","RequestProtocol":"HTTP/1.1","RequestScheme":"http","RetryAttempts":0,"RouterName":"s222-umami-60e104-47-web@docker","ServiceAddr":"10.0.1.15:3000","ServiceName":"s222-umami-60e104-47-web@docker","ServiceURL":{"Scheme":"http","Opaque":"","User":null,"Host":"10.0.1.15:3000","Path":"","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"StartLocal":"2024-08-25T04:34:37.306691884Z","StartUTC":"2024-08-25T04:34:37.306691884Z","entryPointName":"web","level":"info","msg":"","time":"2024-08-25T04:34:37Z"}`;
describe("processLogs", () => {

View File

@@ -1,11 +1,12 @@
import type { Domain } from "@dokploy/server";
import type { Redirect } from "@dokploy/server";
import type { ApplicationNested } from "@dokploy/server";
import type { ApplicationNested, Domain, Redirect } from "@dokploy/server";
import { createRouterConfig } from "@dokploy/server";
import { expect, test } from "vitest";
const baseApp: ApplicationNested = {
railpackVersion: "0.2.2",
rollbackActive: false,
applicationId: "",
previewLabels: [],
herokuVersion: "",
giteaRepository: "",
giteaOwner: "",
@@ -17,6 +18,7 @@ const baseApp: ApplicationNested = {
appName: "",
autoDeploy: true,
enableSubmodules: false,
previewRequireCollaboratorPermissions: false,
serverId: "",
branch: null,
dockerBuildStage: "",
@@ -34,13 +36,22 @@ const baseApp: ApplicationNested = {
previewLimit: 0,
previewCustomCertResolver: null,
previewWildcard: "",
project: {
environmentId: "",
environment: {
env: "",
organizationId: "",
environmentId: "",
name: "",
description: "",
createdAt: "",
description: "",
projectId: "",
project: {
env: "",
organizationId: "",
name: "",
description: "",
createdAt: "",
projectId: "",
},
},
buildPath: "/",
gitlabPathNamespace: "",
@@ -83,8 +94,8 @@ const baseApp: ApplicationNested = {
password: null,
placementSwarm: null,
ports: [],
projectId: "",
publishDirectory: null,
isStaticSpa: null,
redirects: [],
refreshToken: "",
registry: null,
@@ -117,6 +128,8 @@ const baseDomain: Domain = {
domainType: "application",
uniqueConfigKey: 1,
previewDeploymentId: "",
internalPath: "/",
stripPath: false,
};
const baseRedirect: Redirect = {

View File

@@ -1,5 +1,5 @@
import { describe, expect, test } from "vitest";
import { normalizeS3Path } from "@dokploy/server/utils/backups/utils";
import { describe, expect, test } from "vitest";
describe("normalizeS3Path", () => {
test("should handle empty and whitespace-only prefix", () => {

View File

@@ -1,3 +1,9 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { HelpCircle, Settings } from "lucide-react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { CodeEditor } from "@/components/shared/code-editor";
import { Button } from "@/components/ui/button";
@@ -26,12 +32,6 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { HelpCircle, Settings } from "lucide-react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const HealthCheckSwarmSchema = z
.object({
@@ -130,7 +130,7 @@ const createStringToJSONSchema = (schema: z.ZodTypeAny) => {
}
try {
return JSON.parse(str);
} catch (_e) {
} catch {
ctx.addIssue({ code: "custom", message: "Invalid JSON format" });
return z.NEVER;
}
@@ -181,21 +181,38 @@ const addSwarmSettings = z.object({
type AddSwarmSettings = z.infer<typeof addSwarmSettings>;
interface Props {
applicationId: string;
id: string;
type: "postgres" | "mariadb" | "mongo" | "mysql" | "redis" | "application";
}
export const AddSwarmSettings = ({ applicationId }: Props) => {
const { data, refetch } = api.application.one.useQuery(
{
applicationId,
},
{
enabled: !!applicationId,
},
);
export const AddSwarmSettings = ({ id, type }: Props) => {
const queryMap = {
postgres: () =>
api.postgres.one.useQuery({ postgresId: id }, { enabled: !!id }),
redis: () => api.redis.one.useQuery({ redisId: id }, { enabled: !!id }),
mysql: () => api.mysql.one.useQuery({ mysqlId: id }, { enabled: !!id }),
mariadb: () =>
api.mariadb.one.useQuery({ mariadbId: id }, { enabled: !!id }),
application: () =>
api.application.one.useQuery({ applicationId: id }, { enabled: !!id }),
mongo: () => api.mongo.one.useQuery({ mongoId: id }, { enabled: !!id }),
};
const { data, refetch } = queryMap[type]
? queryMap[type]()
: api.mongo.one.useQuery({ mongoId: id }, { enabled: !!id });
const { mutateAsync, isError, error, isLoading } =
api.application.update.useMutation();
const mutationMap = {
postgres: () => api.postgres.update.useMutation(),
redis: () => api.redis.update.useMutation(),
mysql: () => api.mysql.update.useMutation(),
mariadb: () => api.mariadb.update.useMutation(),
application: () => api.application.update.useMutation(),
mongo: () => api.mongo.update.useMutation(),
};
const { mutateAsync, isError, error, isLoading } = mutationMap[type]
? mutationMap[type]()
: api.mongo.update.useMutation();
const form = useForm<AddSwarmSettings>({
defaultValues: {
@@ -244,7 +261,12 @@ export const AddSwarmSettings = ({ applicationId }: Props) => {
const onSubmit = async (data: AddSwarmSettings) => {
await mutateAsync({
applicationId,
applicationId: id || "",
postgresId: id || "",
redisId: id || "",
mysqlId: id || "",
mariadbId: id || "",
mongoId: id || "",
healthCheckSwarm: data.healthCheckSwarm,
restartPolicySwarm: data.restartPolicySwarm,
placementSwarm: data.placementSwarm,
@@ -270,18 +292,18 @@ export const AddSwarmSettings = ({ applicationId }: Props) => {
Swarm Settings
</Button>
</DialogTrigger>
<DialogContent className="max-h-[85vh] overflow-y-auto sm:max-w-5xl p-0">
<DialogHeader className="p-6">
<DialogContent className="sm:max-w-5xl">
<DialogHeader>
<DialogTitle>Swarm Settings</DialogTitle>
<DialogDescription>
Update certain settings using a json object.
</DialogDescription>
</DialogHeader>
{isError && <AlertBlock type="error">{error?.message}</AlertBlock>}
<div className="px-4">
<div>
<AlertBlock type="info">
Changing settings such as placements may cause the logs/monitoring
to be unavailable.
Changing settings such as placements may cause the logs/monitoring,
backups and other features to be unavailable.
</AlertBlock>
</div>
@@ -289,13 +311,13 @@ export const AddSwarmSettings = ({ applicationId }: Props) => {
<form
id="hook-form-add-permissions"
onSubmit={form.handleSubmit(onSubmit)}
className="grid grid-cols-1 md:grid-cols-2 w-full gap-4 relative"
className="grid grid-cols-1 md:grid-cols-2 w-full gap-4 relative mt-4"
>
<FormField
control={form.control}
name="healthCheckSwarm"
render={({ field }) => (
<FormItem className="relative max-lg:px-4 lg:pl-6 ">
<FormItem className="relative ">
<FormLabel>Health Check</FormLabel>
<TooltipProvider delayDuration={0}>
<Tooltip>
@@ -351,7 +373,7 @@ export const AddSwarmSettings = ({ applicationId }: Props) => {
control={form.control}
name="restartPolicySwarm"
render={({ field }) => (
<FormItem className="relative max-lg:px-4 lg:pr-6 ">
<FormItem className="relative ">
<FormLabel>Restart Policy</FormLabel>
<TooltipProvider delayDuration={0}>
<Tooltip>
@@ -405,7 +427,7 @@ export const AddSwarmSettings = ({ applicationId }: Props) => {
control={form.control}
name="placementSwarm"
render={({ field }) => (
<FormItem className="relative max-lg:px-4 lg:pl-6 ">
<FormItem className="relative ">
<FormLabel>Placement</FormLabel>
<TooltipProvider delayDuration={0}>
<Tooltip>
@@ -471,7 +493,7 @@ export const AddSwarmSettings = ({ applicationId }: Props) => {
control={form.control}
name="updateConfigSwarm"
render={({ field }) => (
<FormItem className="relative max-lg:px-4 lg:pr-6 ">
<FormItem className="relative ">
<FormLabel>Update Config</FormLabel>
<TooltipProvider delayDuration={0}>
<Tooltip>
@@ -529,7 +551,7 @@ export const AddSwarmSettings = ({ applicationId }: Props) => {
control={form.control}
name="rollbackConfigSwarm"
render={({ field }) => (
<FormItem className="relative max-lg:px-4 lg:pl-6 ">
<FormItem className="relative ">
<FormLabel>Rollback Config</FormLabel>
<TooltipProvider delayDuration={0}>
<Tooltip>
@@ -587,7 +609,7 @@ export const AddSwarmSettings = ({ applicationId }: Props) => {
control={form.control}
name="modeSwarm"
render={({ field }) => (
<FormItem className="relative max-lg:px-4 lg:pr-6 ">
<FormItem className="relative ">
<FormLabel>Mode</FormLabel>
<TooltipProvider delayDuration={0}>
<Tooltip>
@@ -650,7 +672,7 @@ export const AddSwarmSettings = ({ applicationId }: Props) => {
control={form.control}
name="networkSwarm"
render={({ field }) => (
<FormItem className="relative max-lg:px-4 lg:pl-6 ">
<FormItem className="relative ">
<FormLabel>Network</FormLabel>
<TooltipProvider delayDuration={0}>
<Tooltip>
@@ -709,7 +731,7 @@ export const AddSwarmSettings = ({ applicationId }: Props) => {
control={form.control}
name="labelsSwarm"
render={({ field }) => (
<FormItem className="relative max-lg:px-4 lg:pr-6 ">
<FormItem className="relative ">
<FormLabel>Labels</FormLabel>
<TooltipProvider delayDuration={0}>
<Tooltip>
@@ -753,7 +775,7 @@ export const AddSwarmSettings = ({ applicationId }: Props) => {
)}
/>
<DialogFooter className="flex w-full flex-row justify-end md:col-span-2 m-0 sticky bottom-0 right-0 bg-muted border p-2 ">
<DialogFooter className="flex w-full flex-row justify-end md:col-span-2 m-0 sticky bottom-0 right-0 bg-muted border">
<Button
isLoading={isLoading}
form="hook-form-add-permissions"

View File

@@ -1,3 +1,10 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { Server } from "lucide-react";
import Link from "next/link";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
@@ -26,43 +33,57 @@ import {
SelectValue,
} from "@/components/ui/select";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { Server } from "lucide-react";
import Link from "next/link";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { AddSwarmSettings } from "./modify-swarm-settings";
interface Props {
applicationId: string;
id: string;
type: "postgres" | "mariadb" | "mongo" | "mysql" | "redis" | "application";
}
const AddRedirectchema = z.object({
replicas: z.number().min(1, "Replicas must be at least 1"),
registryId: z.string(),
registryId: z.string().optional(),
});
type AddCommand = z.infer<typeof AddRedirectchema>;
export const ShowClusterSettings = ({ applicationId }: Props) => {
const { data } = api.application.one.useQuery(
{
applicationId,
},
{ enabled: !!applicationId },
);
export const ShowClusterSettings = ({ id, type }: Props) => {
const queryMap = {
postgres: () =>
api.postgres.one.useQuery({ postgresId: id }, { enabled: !!id }),
redis: () => api.redis.one.useQuery({ redisId: id }, { enabled: !!id }),
mysql: () => api.mysql.one.useQuery({ mysqlId: id }, { enabled: !!id }),
mariadb: () =>
api.mariadb.one.useQuery({ mariadbId: id }, { enabled: !!id }),
application: () =>
api.application.one.useQuery({ applicationId: id }, { enabled: !!id }),
mongo: () => api.mongo.one.useQuery({ mongoId: id }, { enabled: !!id }),
};
const { data, refetch } = queryMap[type]
? queryMap[type]()
: api.mongo.one.useQuery({ mongoId: id }, { enabled: !!id });
const { data: registries } = api.registry.all.useQuery();
const utils = api.useUtils();
const mutationMap = {
postgres: () => api.postgres.update.useMutation(),
redis: () => api.redis.update.useMutation(),
mysql: () => api.mysql.update.useMutation(),
mariadb: () => api.mariadb.update.useMutation(),
application: () => api.application.update.useMutation(),
mongo: () => api.mongo.update.useMutation(),
};
const { mutateAsync, isLoading } = api.application.update.useMutation();
const { mutateAsync, isLoading } = mutationMap[type]
? mutationMap[type]()
: api.mongo.update.useMutation();
const form = useForm<AddCommand>({
defaultValues: {
registryId: data?.registryId || "",
...(type === "application" && data && "registryId" in data
? {
registryId: data?.registryId || "",
}
: {}),
replicas: data?.replicas || 1,
},
resolver: zodResolver(AddRedirectchema),
@@ -71,7 +92,11 @@ export const ShowClusterSettings = ({ applicationId }: Props) => {
useEffect(() => {
if (data?.command) {
form.reset({
registryId: data?.registryId || "",
...(type === "application" && data && "registryId" in data
? {
registryId: data?.registryId || "",
}
: {}),
replicas: data?.replicas || 1,
});
}
@@ -79,18 +104,25 @@ export const ShowClusterSettings = ({ applicationId }: Props) => {
const onSubmit = async (data: AddCommand) => {
await mutateAsync({
applicationId,
registryId:
data?.registryId === "none" || !data?.registryId
? null
: data?.registryId,
applicationId: id || "",
postgresId: id || "",
redisId: id || "",
mysqlId: id || "",
mariadbId: id || "",
mongoId: id || "",
...(type === "application"
? {
registryId:
data?.registryId === "none" || !data?.registryId
? null
: data?.registryId,
}
: {}),
replicas: data?.replicas,
})
.then(async () => {
toast.success("Command Updated");
await utils.application.one.invalidate({
applicationId,
});
await refetch();
})
.catch(() => {
toast.error("Error updating the command");
@@ -103,10 +135,10 @@ export const ShowClusterSettings = ({ applicationId }: Props) => {
<div>
<CardTitle className="text-xl">Cluster Settings</CardTitle>
<CardDescription>
Add the registry and the replicas of the application
Modify swarm settings for the service.
</CardDescription>
</div>
<AddSwarmSettings applicationId={applicationId} />
<AddSwarmSettings id={id} type={type} />
</CardHeader>
<CardContent className="flex flex-col gap-4">
<AlertBlock type="info">
@@ -144,58 +176,62 @@ export const ShowClusterSettings = ({ applicationId }: Props) => {
/>
</div>
{registries && registries?.length === 0 ? (
<div className="pt-10">
<div className="flex flex-col items-center gap-3">
<Server className="size-8 text-muted-foreground" />
<span className="text-base text-muted-foreground">
To use a cluster feature, you need to configure at least a
registry first. Please, go to{" "}
<Link
href="/dashboard/settings/cluster"
className="text-foreground"
>
Settings
</Link>{" "}
to do so.
</span>
</div>
</div>
) : (
{type === "application" && (
<>
<FormField
control={form.control}
name="registryId"
render={({ field }) => (
<FormItem>
<FormLabel>Select a registry</FormLabel>
<Select
onValueChange={field.onChange}
defaultValue={field.value}
>
<SelectTrigger>
<SelectValue placeholder="Select a registry" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
{registries?.map((registry) => (
<SelectItem
key={registry.registryId}
value={registry.registryId}
>
{registry.registryName}
</SelectItem>
))}
<SelectItem value={"none"}>None</SelectItem>
<SelectLabel>
Registries ({registries?.length})
</SelectLabel>
</SelectGroup>
</SelectContent>
</Select>
</FormItem>
)}
/>
{registries && registries?.length === 0 ? (
<div className="pt-10">
<div className="flex flex-col items-center gap-3">
<Server className="size-8 text-muted-foreground" />
<span className="text-base text-muted-foreground">
To use a cluster feature, you need to configure at least
a registry first. Please, go to{" "}
<Link
href="/dashboard/settings/cluster"
className="text-foreground"
>
Settings
</Link>{" "}
to do so.
</span>
</div>
</div>
) : (
<>
<FormField
control={form.control}
name="registryId"
render={({ field }) => (
<FormItem>
<FormLabel>Select a registry</FormLabel>
<Select
onValueChange={field.onChange}
defaultValue={field.value}
>
<SelectTrigger>
<SelectValue placeholder="Select a registry" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
{registries?.map((registry) => (
<SelectItem
key={registry.registryId}
value={registry.registryId}
>
{registry.registryName}
</SelectItem>
))}
<SelectItem value={"none"}>None</SelectItem>
<SelectLabel>
Registries ({registries?.length})
</SelectLabel>
</SelectGroup>
</SelectContent>
</Select>
</FormItem>
)}
/>
</>
)}
</>
)}

View File

@@ -1,3 +1,8 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { Button } from "@/components/ui/button";
import {
Card,
@@ -16,11 +21,7 @@ import {
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
interface Props {
applicationId: string;
}

View File

@@ -1,3 +1,9 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { Code2, Globe2, HardDrive } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { CodeEditor } from "@/components/shared/code-editor";
import { Button } from "@/components/ui/button";
@@ -27,12 +33,6 @@ import { ScrollArea } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
import { Textarea } from "@/components/ui/textarea";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { Code2, Globe2, HardDrive } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const ImportSchema = z.object({
base64: z.string(),
@@ -107,7 +107,7 @@ export const ShowImport = ({ composeId }: Props) => {
composeId,
});
setShowModal(false);
} catch (_error) {
} catch {
toast.error("Error importing template");
}
};
@@ -126,7 +126,7 @@ export const ShowImport = ({ composeId }: Props) => {
});
setTemplateInfo(result);
setShowModal(true);
} catch (_error) {
} catch {
toast.error("Error processing template");
}
};
@@ -185,7 +185,7 @@ export const ShowImport = ({ composeId }: Props) => {
</Button>
</div>
<Dialog open={showModal} onOpenChange={setShowModal}>
<DialogContent className="max-h-[80vh] max-w-[50vw] overflow-y-auto">
<DialogContent className="max-w-[50vw]">
<DialogHeader>
<DialogTitle className="text-2xl font-bold">
Template Information

View File

@@ -1,3 +1,9 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { PenBoxIcon, PlusIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm, useWatch } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
@@ -26,15 +32,12 @@ import {
SelectValue,
} from "@/components/ui/select";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { PenBoxIcon, PlusIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const AddPortSchema = z.object({
publishedPort: z.number().int().min(1).max(65535),
publishMode: z.enum(["ingress", "host"], {
required_error: "Publish mode is required",
}),
targetPort: z.number().int().min(1).max(65535),
protocol: z.enum(["tcp", "udp"], {
required_error: "Protocol is required",
@@ -77,9 +80,15 @@ export const HandlePorts = ({
resolver: zodResolver(AddPortSchema),
});
const publishMode = useWatch({
control: form.control,
name: "publishMode",
});
useEffect(() => {
form.reset({
publishedPort: data?.publishedPort ?? 0,
publishMode: data?.publishMode ?? "ingress",
targetPort: data?.targetPort ?? 0,
protocol: data?.protocol ?? "tcp",
});
@@ -120,7 +129,7 @@ export const HandlePorts = ({
<Button>{children}</Button>
)}
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">
<DialogContent className="sm:max-w-lg">
<DialogHeader>
<DialogTitle>Ports</DialogTitle>
<DialogDescription>
@@ -165,6 +174,32 @@ export const HandlePorts = ({
</FormItem>
)}
/>
<FormField
control={form.control}
name="publishMode"
render={({ field }) => {
return (
<FormItem className="md:col-span-2">
<FormLabel>Published Port Mode</FormLabel>
<Select
onValueChange={field.onChange}
value={field.value}
>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a publish mode for the port" />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value={"ingress"}>Ingress</SelectItem>
<SelectItem value={"host"}>Host</SelectItem>
</SelectContent>
</Select>
<FormMessage />
</FormItem>
);
}}
/>
<FormField
control={form.control}
name="targetPort"
@@ -223,6 +258,16 @@ export const HandlePorts = ({
</div>
</form>
{publishMode === "host" && (
<AlertBlock type="warning" className="mt-4">
<strong>Host Mode Limitation:</strong> When using Host publish
mode, Docker Swarm has limitations that prevent proper container
updates during deployments. Old containers may not be replaced
automatically. Consider using Ingress mode instead, or be prepared
to manually stop/start the application after deployments.
</AlertBlock>
)}
<DialogFooter>
<Button
isLoading={isLoading}

View File

@@ -1,3 +1,5 @@
import { Rss, Trash2 } from "lucide-react";
import { toast } from "sonner";
import { AlertBlock } from "@/components/shared/alert-block";
import { DialogAction } from "@/components/shared/dialog-action";
import { Button } from "@/components/ui/button";
@@ -9,9 +11,8 @@ import {
CardTitle,
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { Rss, Trash2 } from "lucide-react";
import { toast } from "sonner";
import { HandlePorts } from "./handle-ports";
interface Props {
applicationId: string;
}
@@ -60,7 +61,7 @@ export const ShowPorts = ({ applicationId }: Props) => {
{data?.ports.map((port) => (
<div key={port.portId}>
<div className="flex w-full flex-col sm:flex-row sm:items-center justify-between gap-4 sm:gap-10 border rounded-lg p-4">
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 flex-col gap-4 sm:gap-8">
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 flex-col gap-4 sm:gap-8">
<div className="flex flex-col gap-1">
<span className="font-medium">Published Port</span>
<span className="text-sm text-muted-foreground">
@@ -68,7 +69,13 @@ export const ShowPorts = ({ applicationId }: Props) => {
</span>
</div>
<div className="flex flex-col gap-1">
<span className="font-medium"> Target Port</span>
<span className="font-medium">Published Port Mode</span>
<span className="text-sm text-muted-foreground">
{port?.publishMode?.toUpperCase()}
</span>
</div>
<div className="flex flex-col gap-1">
<span className="font-medium">Target Port</span>
<span className="text-sm text-muted-foreground">
{port.targetPort}
</span>

View File

@@ -1,3 +1,9 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { PenBoxIcon, PlusIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
@@ -30,12 +36,6 @@ import {
import { Separator } from "@/components/ui/separator";
import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { PenBoxIcon, PlusIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const AddRedirectchema = z.object({
regex: z.string().min(1, "Regex required"),
@@ -179,7 +179,7 @@ export const HandleRedirect = ({
<Button>{children}</Button>
)}
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">
<DialogContent className="sm:max-w-lg">
<DialogHeader>
<DialogTitle>Redirects</DialogTitle>
<DialogDescription>

View File

@@ -1,3 +1,5 @@
import { Split, Trash2 } from "lucide-react";
import { toast } from "sonner";
import { DialogAction } from "@/components/shared/dialog-action";
import { Button } from "@/components/ui/button";
import {
@@ -8,8 +10,6 @@ import {
CardTitle,
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { Split, Trash2 } from "lucide-react";
import { toast } from "sonner";
import { HandleRedirect } from "./handle-redirect";
interface Props {

View File

@@ -1,3 +1,9 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { PenBoxIcon, PlusIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
@@ -19,12 +25,6 @@ import {
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { PenBoxIcon, PlusIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const AddSecuritychema = z.object({
username: z.string().min(1, "Username is required"),
@@ -114,7 +114,7 @@ export const HandleSecurity = ({
<Button>{children}</Button>
)}
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-lg">
<DialogContent className="sm:max-w-lg">
<DialogHeader>
<DialogTitle>Security</DialogTitle>
<DialogDescription>
@@ -151,7 +151,7 @@ export const HandleSecurity = ({
<FormItem>
<FormLabel>Password</FormLabel>
<FormControl>
<Input placeholder="test" {...field} />
<Input placeholder="test" type="password" {...field} />
</FormControl>
<FormMessage />

View File

@@ -1,4 +1,7 @@
import { LockKeyhole, Trash2 } from "lucide-react";
import { toast } from "sonner";
import { DialogAction } from "@/components/shared/dialog-action";
import { ToggleVisibilityInput } from "@/components/shared/toggle-visibility-input";
import { Button } from "@/components/ui/button";
import {
Card,
@@ -7,9 +10,9 @@ import {
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { api } from "@/utils/api";
import { LockKeyhole, Trash2 } from "lucide-react";
import { toast } from "sonner";
import { HandleSecurity } from "./handle-security";
interface Props {
@@ -58,19 +61,18 @@ export const ShowSecurity = ({ applicationId }: Props) => {
<div className="flex flex-col gap-6 ">
{data?.security.map((security) => (
<div key={security.securityId}>
<div className="flex w-full flex-col sm:flex-row justify-between sm:items-center gap-4 sm:gap-10 border rounded-lg p-4">
<div className="grid grid-cols-1 sm:grid-cols-2 flex-col gap-4 sm:gap-8">
<div className="flex flex-col gap-1">
<span className="font-medium">Username</span>
<span className="text-sm text-muted-foreground">
{security.username}
</span>
<div className="flex w-full flex-col md:flex-row justify-between md:items-center gap-4 md:gap-10 border rounded-lg p-4">
<div className="grid grid-cols-1 md:grid-cols-2 flex-col gap-4 md:gap-8">
<div className="flex flex-col gap-2">
<Label>Username</Label>
<Input disabled value={security.username} />
</div>
<div className="flex flex-col gap-1">
<span className="font-medium">Password</span>
<span className="text-sm text-muted-foreground">
{security.password}
</span>
<div className="flex flex-col gap-2">
<Label>Password</Label>
<ToggleVisibilityInput
value={security.password}
disabled
/>
</div>
</div>
<div className="flex flex-row gap-2">

View File

@@ -1,3 +1,9 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { InfoIcon } from "lucide-react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
@@ -23,12 +29,6 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { InfoIcon } from "lucide-react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const addResourcesSchema = z.object({
memoryReservation: z.string().optional(),

View File

@@ -1,3 +1,4 @@
import { File, Loader2 } from "lucide-react";
import { CodeEditor } from "@/components/shared/code-editor";
import {
Card,
@@ -7,8 +8,8 @@ import {
CardTitle,
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { File, Loader2 } from "lucide-react";
import { UpdateTraefikConfig } from "./update-traefik-config";
interface Props {
applicationId: string;
}

View File

@@ -1,3 +1,9 @@
import { zodResolver } from "@hookform/resolvers/zod";
import jsyaml from "js-yaml";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { CodeEditor } from "@/components/shared/code-editor";
import { Button } from "@/components/ui/button";
@@ -19,12 +25,6 @@ import {
FormMessage,
} from "@/components/ui/form";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import jsyaml from "js-yaml";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const UpdateTraefikConfigSchema = z.object({
traefikConfig: z.string(),
@@ -122,7 +122,7 @@ export const UpdateTraefikConfig = ({ applicationId }: Props) => {
<DialogTrigger asChild>
<Button isLoading={isLoading}>Modify</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-4xl">
<DialogContent className="sm:max-w-4xl">
<DialogHeader>
<DialogTitle>Update traefik config</DialogTitle>
<DialogDescription>Update the traefik config</DialogDescription>

View File

@@ -1,3 +1,11 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { PlusIcon } from "lucide-react";
import type React from "react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { CodeEditor } from "@/components/shared/code-editor";
import { Button } from "@/components/ui/button";
import {
@@ -21,13 +29,7 @@ import { Label } from "@/components/ui/label";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
import { cn } from "@/lib/utils";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { PlusIcon } from "lucide-react";
import type React from "react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
interface Props {
serviceId: string;
serviceType:
@@ -150,7 +152,7 @@ export const AddVolumes = ({
<DialogTrigger className="" asChild>
<Button>{children}</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-3xl">
<DialogContent className="sm:max-w-3xl">
<DialogHeader>
<DialogTitle>Volumes / Mounts</DialogTitle>
</DialogHeader>
@@ -169,6 +171,23 @@ export const AddVolumes = ({
onSubmit={form.handleSubmit(onSubmit)}
className="grid w-full gap-8 "
>
{type === "bind" && (
<AlertBlock>
<div className="space-y-2">
<p>
Make sure the host path is a valid path and exists in the
host machine.
</p>
<p className="text-sm text-muted-foreground">
<strong>Cluster Warning:</strong> If you're using cluster
features, bind mounts may cause deployment failures since
the path must exist on all worker/manager nodes. Consider
using external tools to distribute the folder across nodes
or use named volumes instead.
</p>
</div>
</AlertBlock>
)}
<FormField
control={form.control}
defaultValue={form.control._defaultValues.type}

View File

@@ -1,3 +1,5 @@
import { Package, Trash2 } from "lucide-react";
import { toast } from "sonner";
import { AlertBlock } from "@/components/shared/alert-block";
import { DialogAction } from "@/components/shared/dialog-action";
import { Button } from "@/components/ui/button";
@@ -9,11 +11,10 @@ import {
CardTitle,
} from "@/components/ui/card";
import { api } from "@/utils/api";
import { Package, Trash2 } from "lucide-react";
import { toast } from "sonner";
import type { ServiceType } from "../show-resources";
import { AddVolumes } from "./add-volumes";
import { UpdateVolume } from "./update-volume";
interface Props {
id: string;
type: ServiceType | "compose";
@@ -80,7 +81,7 @@ export const ShowVolumes = ({ id, type }: Props) => {
className="flex w-full flex-col sm:flex-row sm:items-center justify-between gap-4 sm:gap-10 border rounded-lg p-4"
>
{/* <Package className="size-8 self-center text-muted-foreground" /> */}
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 flex-col gap-4 sm:gap-8">
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 flex-col gap-4 sm:gap-8">
<div className="flex flex-col gap-1">
<span className="font-medium">Mount Type</span>
<span className="text-sm text-muted-foreground">
@@ -112,21 +113,21 @@ export const ShowVolumes = ({ id, type }: Props) => {
</span>
</div>
)}
{mount.type === "file" ? (
{mount.type === "file" && (
<div className="flex flex-col gap-1">
<span className="font-medium">File Path</span>
<span className="text-sm text-muted-foreground">
{mount.filePath}
</span>
</div>
) : (
<div className="flex flex-col gap-1">
<span className="font-medium">Mount Path</span>
<span className="text-sm text-muted-foreground">
{mount.mountPath}
</span>
</div>
)}
<div className="flex flex-col gap-1">
<span className="font-medium">Mount Path</span>
<span className="text-sm text-muted-foreground">
{mount.mountPath}
</span>
</div>
</div>
<div className="flex flex-row gap-1">
<UpdateVolume

View File

@@ -1,3 +1,9 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { PenBoxIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { CodeEditor } from "@/components/shared/code-editor";
import { Button } from "@/components/ui/button";
@@ -20,12 +26,6 @@ import {
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { PenBoxIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const mountSchema = z.object({
mountPath: z.string().min(1, "Mount path required"),
@@ -186,7 +186,7 @@ export const UpdateVolume = ({
<PenBoxIcon className="size-3.5 text-primary group-hover:text-blue-500" />
</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-3xl">
<DialogContent className="sm:max-w-3xl">
<DialogHeader>
<DialogTitle>Update</DialogTitle>
<DialogDescription>Update the mount</DialogDescription>
@@ -247,7 +247,7 @@ export const UpdateVolume = ({
control={form.control}
name="content"
render={({ field }) => (
<FormItem>
<FormItem className="max-w-full max-w-[45rem]">
<FormLabel>Content</FormLabel>
<FormControl>
<FormControl>
@@ -256,7 +256,7 @@ export const UpdateVolume = ({
placeholder={`NODE_ENV=production
PORT=3000
`}
className="h-96 font-mono"
className="h-96 font-mono w-full"
{...field}
/>
</FormControl>

View File

@@ -1,7 +1,14 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { Cog } from "lucide-react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Checkbox } from "@/components/ui/checkbox";
import {
Form,
FormControl,
@@ -14,12 +21,6 @@ import {
import { Input } from "@/components/ui/input";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { Cog } from "lucide-react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
export enum BuildType {
dockerfile = "dockerfile",
@@ -63,10 +64,12 @@ const mySchema = z.discriminatedUnion("buildType", [
publishDirectory: z.string().optional(),
}),
z.object({
buildType: z.literal(BuildType.static),
buildType: z.literal(BuildType.railpack),
railpackVersion: z.string().nullable().default("0.2.2"),
}),
z.object({
buildType: z.literal(BuildType.railpack),
buildType: z.literal(BuildType.static),
isStaticSpa: z.boolean().default(false),
}),
]);
@@ -83,6 +86,8 @@ interface ApplicationData {
dockerBuildStage?: string | null;
herokuVersion?: string | null;
publishDirectory?: string | null;
isStaticSpa?: boolean | null;
railpackVersion?: string | null | undefined;
}
function isValidBuildType(value: string): value is BuildType {
@@ -115,16 +120,19 @@ const resetData = (data: ApplicationData): AddTemplate => {
case BuildType.static:
return {
buildType: BuildType.static,
isStaticSpa: data.isStaticSpa ?? false,
};
case BuildType.railpack:
return {
buildType: BuildType.railpack,
railpackVersion: data.railpackVersion || null,
};
default:
default: {
const buildType = data.buildType as BuildType;
return {
buildType,
} as AddTemplate;
}
}
};
@@ -174,6 +182,12 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => {
data.buildType === BuildType.heroku_buildpacks
? data.herokuVersion
: null,
isStaticSpa:
data.buildType === BuildType.static ? data.isStaticSpa : null,
railpackVersion:
data.buildType === BuildType.railpack
? data.railpackVersion || "0.2.2"
: null,
})
.then(async () => {
toast.success("Build type saved");
@@ -364,6 +378,49 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => {
)}
/>
)}
{buildType === BuildType.static && (
<FormField
control={form.control}
name="isStaticSpa"
render={({ field }) => (
<FormItem>
<FormControl>
<div className="flex items-center gap-x-2 p-2">
<Checkbox
id="checkboxIsStaticSpa"
value={String(field.value)}
checked={field.value}
onCheckedChange={field.onChange}
/>
<FormLabel htmlFor="checkboxIsStaticSpa">
Single Page Application (SPA)
</FormLabel>
</div>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
)}
{buildType === BuildType.railpack && (
<FormField
control={form.control}
name="railpackVersion"
render={({ field }) => (
<FormItem>
<FormLabel>Railpack Version</FormLabel>
<FormControl>
<Input
placeholder="Railpack Version"
{...field}
value={field.value ?? ""}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
)}
<div className="flex w-full justify-end">
<Button isLoading={isLoading} type="submit">
Save

View File

@@ -1,3 +1,5 @@
import { Paintbrush } from "lucide-react";
import { toast } from "sonner";
import {
AlertDialog,
AlertDialogAction,
@@ -11,8 +13,6 @@ import {
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { api } from "@/utils/api";
import { Paintbrush } from "lucide-react";
import { toast } from "sonner";
interface Props {
id: string;

View File

@@ -1,3 +1,5 @@
import { RefreshCcw } from "lucide-react";
import { toast } from "sonner";
import {
AlertDialog,
AlertDialogAction,
@@ -10,8 +12,6 @@ import {
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { api } from "@/utils/api";
import { RefreshCcw } from "lucide-react";
import { toast } from "sonner";
interface Props {
id: string;

View File

@@ -1,3 +1,5 @@
import { Loader2 } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import { Badge } from "@/components/ui/badge";
import { Checkbox } from "@/components/ui/checkbox";
import {
@@ -7,8 +9,6 @@ import {
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog";
import { Loader2 } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import { TerminalLine } from "../../docker/logs/terminal-line";
import { type LogLine, parseLogs } from "../../docker/logs/utils";
@@ -124,7 +124,7 @@ export const ShowDeployment = ({
}
}}
>
<DialogContent className={"sm:max-w-5xl overflow-y-auto max-h-screen"}>
<DialogContent className={"sm:max-w-5xl"}>
<DialogHeader>
<DialogTitle>Deployment</DialogTitle>
<DialogDescription className="flex items-center gap-2">

View File

@@ -1,8 +1,7 @@
import { useState } from "react";
import { Button } from "@/components/ui/button";
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
import type { RouterOutputs } from "@/utils/api";
import { useState } from "react";
import { ShowDeployment } from "../deployments/show-deployment";
import { ShowDeployments } from "./show-deployments";
@@ -14,7 +13,8 @@ interface Props {
| "schedule"
| "server"
| "backup"
| "previewDeployment";
| "previewDeployment"
| "volumeBackup";
serverId?: string;
refreshToken?: string;
children?: React.ReactNode;
@@ -49,7 +49,7 @@ export const ShowDeploymentsModal = ({
</Button>
)}
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-5xl p-0">
<DialogContent className="sm:max-w-5xl p-0">
<ShowDeployments
id={id}
type={type}

View File

@@ -1,5 +1,11 @@
import { Clock, Loader2, RefreshCcw, RocketIcon, Settings } from "lucide-react";
import React, { useEffect, useMemo, useState } from "react";
import { toast } from "sonner";
import { AlertBlock } from "@/components/shared/alert-block";
import { DateTooltip } from "@/components/shared/date-tooltip";
import { DialogAction } from "@/components/shared/dialog-action";
import { StatusTooltip } from "@/components/shared/status-tooltip";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
Card,
@@ -8,13 +14,11 @@ import {
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { type RouterOutputs, api } from "@/utils/api";
import { RocketIcon, Clock, Loader2 } from "lucide-react";
import React, { useEffect, useState } from "react";
import { api, type RouterOutputs } from "@/utils/api";
import { ShowRollbackSettings } from "../rollbacks/show-rollback-settings";
import { CancelQueues } from "./cancel-queues";
import { RefreshToken } from "./refresh-token";
import { ShowDeployment } from "./show-deployment";
import { Badge } from "@/components/ui/badge";
interface Props {
id: string;
@@ -24,7 +28,8 @@ interface Props {
| "schedule"
| "server"
| "backup"
| "previewDeployment";
| "previewDeployment"
| "volumeBackup";
refreshToken?: string;
serverId?: string;
}
@@ -57,7 +62,48 @@ export const ShowDeployments = ({
},
);
const { data: isCloud } = api.settings.isCloud.useQuery();
const { mutateAsync: rollback, isLoading: isRollingBack } =
api.rollback.rollback.useMutation();
const { mutateAsync: killProcess, isLoading: isKillingProcess } =
api.deployment.killProcess.useMutation();
// Cancel deployment mutations
const {
mutateAsync: cancelApplicationDeployment,
isLoading: isCancellingApp,
} = api.application.cancelDeployment.useMutation();
const {
mutateAsync: cancelComposeDeployment,
isLoading: isCancellingCompose,
} = api.compose.cancelDeployment.useMutation();
const [url, setUrl] = React.useState("");
// Check for stuck deployment (more than 9 minutes) - only for the most recent deployment
const stuckDeployment = useMemo(() => {
if (!isCloud || !deployments || deployments.length === 0) return null;
const now = Date.now();
const NINE_MINUTES = 10 * 60 * 1000; // 9 minutes in milliseconds
// Get the most recent deployment (first in the list since they're sorted by date)
const mostRecentDeployment = deployments[0];
if (
!mostRecentDeployment ||
mostRecentDeployment.status !== "running" ||
!mostRecentDeployment.startedAt
) {
return null;
}
const startTime = new Date(mostRecentDeployment.startedAt).getTime();
const elapsed = now - startTime;
return elapsed > NINE_MINUTES ? mostRecentDeployment : null;
}, [isCloud, deployments]);
useEffect(() => {
setUrl(document.location.origin);
}, []);
@@ -68,14 +114,71 @@ export const ShowDeployments = ({
<div className="flex flex-col gap-2">
<CardTitle className="text-xl">Deployments</CardTitle>
<CardDescription>
See all the 10 last deployments for this {type}
See the last 10 deployments for this {type}
</CardDescription>
</div>
{(type === "application" || type === "compose") && (
<CancelQueues id={id} type={type} />
)}
<div className="flex flex-row items-center gap-2">
{(type === "application" || type === "compose") && (
<CancelQueues id={id} type={type} />
)}
{type === "application" && (
<ShowRollbackSettings applicationId={id}>
<Button variant="outline">
Configure Rollbacks <Settings className="size-4" />
</Button>
</ShowRollbackSettings>
)}
</div>
</CardHeader>
<CardContent className="flex flex-col gap-4">
{stuckDeployment && (type === "application" || type === "compose") && (
<AlertBlock
type="warning"
className="flex-col items-start w-full p-4"
>
<div className="flex flex-col gap-3">
<div>
<div className="font-medium text-sm mb-1">
Build appears to be stuck
</div>
<p className="text-sm">
Hey! Looks like the build has been running for more than 10
minutes. Would you like to cancel this deployment?
</p>
</div>
<Button
variant="destructive"
size="sm"
className="w-fit"
isLoading={
type === "application" ? isCancellingApp : isCancellingCompose
}
onClick={async () => {
try {
if (type === "application") {
await cancelApplicationDeployment({
applicationId: id,
});
} else if (type === "compose") {
await cancelComposeDeployment({
composeId: id,
});
}
toast.success("Deployment cancellation requested");
} catch (error) {
toast.error(
error instanceof Error
? error.message
: "Failed to cancel deployment",
);
}
}}
>
Cancel Deployment
</Button>
</div>
</AlertBlock>
)}
{refreshToken && (
<div className="flex flex-col gap-2 text-sm">
<span>
@@ -86,7 +189,9 @@ export const ShowDeployments = ({
<span>Webhook URL: </span>
<div className="flex flex-row items-center gap-2">
<span className="break-all text-muted-foreground">
{`${url}/api/deploy${type === "compose" ? "/compose" : ""}/${refreshToken}`}
{`${url}/api/deploy${
type === "compose" ? "/compose" : ""
}/${refreshToken}`}
</span>
{(type === "application" || type === "compose") && (
<RefreshToken id={id} type={type} />
@@ -154,13 +259,73 @@ export const ShowDeployments = ({
)}
</div>
<Button
onClick={() => {
setActiveLog(deployment);
}}
>
View
</Button>
<div className="flex flex-row items-center gap-2">
{deployment.pid && deployment.status === "running" && (
<DialogAction
title="Kill Process"
description="Are you sure you want to kill the process?"
type="default"
onClick={async () => {
await killProcess({
deploymentId: deployment.deploymentId,
})
.then(() => {
toast.success("Process killed successfully");
})
.catch(() => {
toast.error("Error killing process");
});
}}
>
<Button
variant="destructive"
size="sm"
isLoading={isKillingProcess}
>
Kill Process
</Button>
</DialogAction>
)}
<Button
onClick={() => {
setActiveLog(deployment);
}}
>
View
</Button>
{deployment?.rollback &&
deployment.status === "done" &&
type === "application" && (
<DialogAction
title="Rollback to this deployment"
description="Are you sure you want to rollback to this deployment?"
type="default"
onClick={async () => {
await rollback({
rollbackId: deployment.rollback.rollbackId,
})
.then(() => {
toast.success(
"Rollback initiated successfully",
);
})
.catch(() => {
toast.error("Error initiating rollback");
});
}}
>
<Button
variant="secondary"
size="sm"
isLoading={isRollingBack}
>
<RefreshCcw className="size-4 text-primary group-hover:text-red-500" />
Rollback
</Button>
</DialogAction>
)}
</div>
</div>
</div>
))}

View File

@@ -1,3 +1,7 @@
import { Copy, HelpCircle, Server } from "lucide-react";
import { toast } from "sonner";
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
Dialog,
DialogContent,
@@ -6,10 +10,6 @@ import {
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import { Button } from "@/components/ui/button";
import { AlertBlock } from "@/components/shared/alert-block";
import { Copy, HelpCircle, Server } from "lucide-react";
import { toast } from "sonner";
interface Props {
domain: {
@@ -33,7 +33,7 @@ export const DnsHelperModal = ({ domain, serverIp }: Props) => {
<HelpCircle className="size-4" />
</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-2xl">
<DialogContent className="sm:max-w-2xl">
<DialogHeader>
<DialogTitle className="flex items-center gap-2">
<Server className="size-5" />

View File

@@ -1,3 +1,10 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { DatabaseZap, Dices, RefreshCw } from "lucide-react";
import Link from "next/link";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import z from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
@@ -34,14 +41,6 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";
import { api } from "@/utils/api";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { zodResolver } from "@hookform/resolvers/zod";
import { DatabaseZap, Dices, RefreshCw } from "lucide-react";
import Link from "next/link";
import z from "zod";
export type CacheType = "fetch" | "cache";
@@ -49,6 +48,8 @@ export const domain = z
.object({
host: z.string().min(1, { message: "Add a hostname" }),
path: z.string().min(1).optional(),
internalPath: z.string().optional(),
stripPath: z.boolean().optional(),
port: z
.number()
.min(1, { message: "Port must be at least 1" })
@@ -84,6 +85,29 @@ export const domain = z
message: "Required",
});
}
// Validate stripPath requires a valid path
if (input.stripPath && (!input.path || input.path === "/")) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
path: ["stripPath"],
message:
"Strip path can only be enabled when a path other than '/' is specified",
});
}
// Validate internalPath starts with /
if (
input.internalPath &&
input.internalPath !== "/" &&
!input.internalPath.startsWith("/")
) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
path: ["internalPath"],
message: "Internal path must start with '/'",
});
}
});
type Domain = z.infer<typeof domain>;
@@ -98,6 +122,7 @@ interface Props {
export const AddDomain = ({ id, type, domainId = "", children }: Props) => {
const [isOpen, setIsOpen] = useState(false);
const [cacheType, setCacheType] = useState<CacheType>("cache");
const [isManualInput, setIsManualInput] = useState(false);
const utils = api.useUtils();
const { data, refetch } = api.domain.one.useQuery(
@@ -162,6 +187,8 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => {
defaultValues: {
host: "",
path: undefined,
internalPath: undefined,
stripPath: false,
port: undefined,
https: false,
certificateType: undefined,
@@ -182,6 +209,8 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => {
...data,
/* Convert null to undefined */
path: data?.path || undefined,
internalPath: data?.internalPath || undefined,
stripPath: data?.stripPath || false,
port: data?.port || undefined,
certificateType: data?.certificateType || undefined,
customCertResolver: data?.customCertResolver || undefined,
@@ -194,6 +223,8 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => {
form.reset({
host: "",
path: undefined,
internalPath: undefined,
stripPath: false,
port: undefined,
https: false,
certificateType: undefined,
@@ -261,7 +292,7 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => {
<DialogTrigger className="" asChild>
{children}
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-2xl">
<DialogContent className="sm:max-w-2xl">
<DialogHeader>
<DialogTitle>Domain</DialogTitle>
<DialogDescription>{dictionary.dialogDescription}</DialogDescription>
@@ -294,46 +325,126 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => {
<FormItem className="w-full">
<FormLabel>Service Name</FormLabel>
<div className="flex gap-2">
<Select
onValueChange={field.onChange}
defaultValue={field.value || ""}
>
{isManualInput ? (
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a service name" />
</SelectTrigger>
<Input
placeholder="Enter service name manually"
{...field}
className="w-full"
/>
</FormControl>
) : (
<Select
onValueChange={field.onChange}
defaultValue={field.value || ""}
>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a service name" />
</SelectTrigger>
</FormControl>
<SelectContent>
{services?.map((service, index) => (
<SelectItem
value={service}
key={`${service}-${index}`}
>
{service}
<SelectContent>
{services?.map((service, index) => (
<SelectItem
value={service}
key={`${service}-${index}`}
>
{service}
</SelectItem>
))}
<SelectItem value="none" disabled>
Empty
</SelectItem>
))}
<SelectItem value="none" disabled>
Empty
</SelectItem>
</SelectContent>
</Select>
</SelectContent>
</Select>
)}
{!isManualInput && (
<>
<TooltipProvider delayDuration={0}>
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="secondary"
type="button"
isLoading={isLoadingServices}
onClick={() => {
if (cacheType === "fetch") {
refetchServices();
} else {
setCacheType("fetch");
}
}}
>
<RefreshCw className="size-4 text-muted-foreground" />
</Button>
</TooltipTrigger>
<TooltipContent
side="left"
sideOffset={5}
className="max-w-[10rem]"
>
<p>
Fetch: Will clone the repository and
load the services
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<TooltipProvider delayDuration={0}>
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="secondary"
type="button"
isLoading={isLoadingServices}
onClick={() => {
if (cacheType === "cache") {
refetchServices();
} else {
setCacheType("cache");
}
}}
>
<DatabaseZap className="size-4 text-muted-foreground" />
</Button>
</TooltipTrigger>
<TooltipContent
side="left"
sideOffset={5}
className="max-w-[10rem]"
>
<p>
Cache: If you previously deployed this
compose, it will read the services
from the last deployment/fetch from
the repository
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</>
)}
<TooltipProvider delayDuration={0}>
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="secondary"
type="button"
isLoading={isLoadingServices}
onClick={() => {
if (cacheType === "fetch") {
refetchServices();
} else {
setCacheType("fetch");
setIsManualInput(!isManualInput);
if (!isManualInput) {
field.onChange("");
}
}}
>
<RefreshCw className="size-4 text-muted-foreground" />
{isManualInput ? (
<RefreshCw className="size-4 text-muted-foreground" />
) : (
<span className="text-xs text-muted-foreground">
Manual
</span>
)}
</Button>
</TooltipTrigger>
<TooltipContent
@@ -342,40 +453,9 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => {
className="max-w-[10rem]"
>
<p>
Fetch: Will clone the repository and load
the services
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<TooltipProvider delayDuration={0}>
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="secondary"
type="button"
isLoading={isLoadingServices}
onClick={() => {
if (cacheType === "cache") {
refetchServices();
} else {
setCacheType("cache");
}
}}
>
<DatabaseZap className="size-4 text-muted-foreground" />
</Button>
</TooltipTrigger>
<TooltipContent
side="left"
sideOffset={5}
className="max-w-[10rem]"
>
<p>
Cache: If you previously deployed this
compose, it will read the services from
the last deployment/fetch from the
repository
{isManualInput
? "Switch to service selection"
: "Enter service name manually"}
</p>
</TooltipContent>
</Tooltip>
@@ -469,6 +549,49 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => {
}}
/>
<FormField
control={form.control}
name="internalPath"
render={({ field }) => {
return (
<FormItem>
<FormLabel>Internal Path</FormLabel>
<FormDescription>
The path where your application expects to receive
requests internally (defaults to "/")
</FormDescription>
<FormControl>
<Input placeholder={"/"} {...field} />
</FormControl>
<FormMessage />
</FormItem>
);
}}
/>
<FormField
control={form.control}
name="stripPath"
render={({ field }) => (
<FormItem className="flex flex-row items-center justify-between p-3 border rounded-lg shadow-sm">
<div className="space-y-0.5">
<FormLabel>Strip Path</FormLabel>
<FormDescription>
Remove the external path from the request before
forwarding to the application
</FormDescription>
<FormMessage />
</div>
<FormControl>
<Switch
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormControl>
</FormItem>
)}
/>
<FormField
control={form.control}
name="port"

View File

@@ -1,13 +1,3 @@
import { DialogAction } from "@/components/shared/dialog-action";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { api } from "@/utils/api";
import {
CheckCircle2,
ExternalLink,
@@ -21,17 +11,27 @@ import {
XCircle,
} from "lucide-react";
import Link from "next/link";
import { toast } from "sonner";
import { AddDomain } from "./handle-domain";
import { useState } from "react";
import { toast } from "sonner";
import { DialogAction } from "@/components/shared/dialog-action";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";
import { api } from "@/utils/api";
import { DnsHelperModal } from "./dns-helper-modal";
import { Badge } from "@/components/ui/badge";
import { AddDomain } from "./handle-domain";
export type ValidationState = {
isLoading: boolean;
@@ -39,6 +39,7 @@ export type ValidationState = {
error?: string;
resolvedIp?: string;
message?: string;
cdnProvider?: string;
};
export type ValidationStates = Record<string, ValidationState>;
@@ -119,6 +120,7 @@ export const ShowDomains = ({ id, type }: Props) => {
isValid: result.isValid,
error: result.error,
resolvedIp: result.resolvedIp,
cdnProvider: result.cdnProvider,
message: result.error && result.isValid ? result.error : undefined,
},
}));
@@ -354,8 +356,9 @@ export const ShowDomains = ({ id, type }: Props) => {
) : validationState?.isValid ? (
<>
<CheckCircle2 className="size-3 mr-1" />
{validationState.message
? "Behind Cloudflare"
{validationState.message &&
validationState.cdnProvider
? `Behind ${validationState.cdnProvider}`
: "DNS Valid"}
</>
) : validationState?.error ? (

View File

@@ -1,3 +1,9 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { EyeIcon, EyeOffIcon } from "lucide-react";
import { type CSSProperties, useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { CodeEditor } from "@/components/shared/code-editor";
import { Button } from "@/components/ui/button";
import {
@@ -16,12 +22,6 @@ import {
} from "@/components/ui/form";
import { Toggle } from "@/components/ui/toggle";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { EyeIcon, EyeOffIcon } from "lucide-react";
import { type CSSProperties, useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import type { ServiceType } from "../advanced/show-resources";
const addEnvironmentSchema = z.object({

View File

@@ -1,13 +1,13 @@
import { Button } from "@/components/ui/button";
import { Card } from "@/components/ui/card";
import { Form } from "@/components/ui/form";
import { Secrets } from "@/components/ui/secrets";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { Button } from "@/components/ui/button";
import { Card } from "@/components/ui/card";
import { Form } from "@/components/ui/form";
import { Secrets } from "@/components/ui/secrets";
import { api } from "@/utils/api";
const addEnvironmentSchema = z.object({
env: z.string(),

View File

@@ -1,3 +1,10 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { CheckIcon, ChevronsUpDown, X } from "lucide-react";
import Link from "next/link";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { BitbucketIcon } from "@/components/icons/data-tools-icons";
import { AlertBlock } from "@/components/shared/alert-block";
import { Badge } from "@/components/ui/badge";
@@ -40,13 +47,6 @@ import {
} from "@/components/ui/tooltip";
import { cn } from "@/lib/utils";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { CheckIcon, ChevronsUpDown, X } from "lucide-react";
import Link from "next/link";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const BitbucketProviderSchema = z.object({
buildPath: z.string().min(1, "Path is required").default("/"),

View File

@@ -1,3 +1,8 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { Button } from "@/components/ui/button";
import {
Form,
@@ -9,11 +14,6 @@ import {
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const DockerProviderSchema = z.object({
dockerImage: z.string().min(1, {

View File

@@ -1,3 +1,8 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { TrashIcon } from "lucide-react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { Button } from "@/components/ui/button";
import { Dropzone } from "@/components/ui/dropzone";
import {
@@ -11,11 +16,6 @@ import {
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { type UploadFile, uploadFileSchema } from "@/utils/schema";
import { zodResolver } from "@hookform/resolvers/zod";
import { TrashIcon } from "lucide-react";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
interface Props {
applicationId: string;

View File

@@ -1,3 +1,13 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { KeyRoundIcon, LockIcon, X } from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/router";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { GitIcon } from "@/components/icons/data-tools-icons";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
Form,
@@ -17,25 +27,14 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Switch } from "@/components/ui/switch";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";
import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { KeyRoundIcon, LockIcon, X } from "lucide-react";
import Link from "next/link";
import { useRouter } from "next/router";
import { GitIcon } from "@/components/icons/data-tools-icons";
import { Badge } from "@/components/ui/badge";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const GitProviderSchema = z.object({
buildPath: z.string().min(1, "Path is required").default("/"),

View File

@@ -1,3 +1,10 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { CheckIcon, ChevronsUpDown, HelpCircle, Plus, X } from "lucide-react";
import Link from "next/link";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { GiteaIcon } from "@/components/icons/data-tools-icons";
import { AlertBlock } from "@/components/shared/alert-block";
import { Badge } from "@/components/ui/badge";
@@ -40,13 +47,6 @@ import {
} from "@/components/ui/tooltip";
import { cn } from "@/lib/utils";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { CheckIcon, ChevronsUpDown, HelpCircle, Plus, X } from "lucide-react";
import Link from "next/link";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
interface GiteaRepository {
name: string;

View File

@@ -1,3 +1,10 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { CheckIcon, ChevronsUpDown, HelpCircle, Plus, X } from "lucide-react";
import Link from "next/link";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { GithubIcon } from "@/components/icons/data-tools-icons";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
@@ -39,13 +46,6 @@ import {
} from "@/components/ui/tooltip";
import { cn } from "@/lib/utils";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { CheckIcon, ChevronsUpDown, HelpCircle, Plus, X } from "lucide-react";
import Link from "next/link";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const GithubProviderSchema = z.object({
buildPath: z.string().min(1, "Path is required").default("/"),

View File

@@ -1,3 +1,10 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { CheckIcon, ChevronsUpDown, HelpCircle, Plus, X } from "lucide-react";
import Link from "next/link";
import { useEffect, useMemo } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { GitlabIcon } from "@/components/icons/data-tools-icons";
import { AlertBlock } from "@/components/shared/alert-block";
import { Badge } from "@/components/ui/badge";
@@ -40,13 +47,6 @@ import {
} from "@/components/ui/tooltip";
import { cn } from "@/lib/utils";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { CheckIcon, ChevronsUpDown, HelpCircle, Plus, X } from "lucide-react";
import Link from "next/link";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const GitlabProviderSchema = z.object({
buildPath: z.string().min(1, "Path is required").default("/"),
@@ -96,6 +96,16 @@ export const SaveGitlabProvider = ({ applicationId }: Props) => {
const repository = form.watch("repository");
const gitlabId = form.watch("gitlabId");
const gitlabUrl = useMemo(() => {
const url = gitlabProviders?.find(
(provider) => provider.gitlabId === gitlabId,
)?.gitlabUrl;
const gitlabUrl = url?.replace(/\/$/, "");
return gitlabUrl || "https://gitlab.com";
}, [gitlabId, gitlabProviders]);
const {
data: repositories,
isLoading: isLoadingRepositories,
@@ -224,7 +234,7 @@ export const SaveGitlabProvider = ({ applicationId }: Props) => {
<FormLabel>Repository</FormLabel>
{field.value.owner && field.value.repo && (
<Link
href={`https://gitlab.com/${field.value.owner}/${field.value.repo}`}
href={`${gitlabUrl}/${field.value.owner}/${field.value.repo}`}
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-1 text-sm text-muted-foreground hover:text-primary"
@@ -278,7 +288,7 @@ export const SaveGitlabProvider = ({ applicationId }: Props) => {
{repositories?.map((repo) => {
return (
<CommandItem
value={repo.name}
value={repo.url}
key={repo.url}
onSelect={() => {
form.setValue("repository", {
@@ -299,7 +309,8 @@ export const SaveGitlabProvider = ({ applicationId }: Props) => {
<CheckIcon
className={cn(
"ml-auto h-4 w-4",
repo.name === field.value.repo
repo.url ===
field.value.gitlabPathNamespace
? "opacity-100"
: "opacity-0",
)}

View File

@@ -1,3 +1,7 @@
import { GitBranch, Loader2, UploadCloud } from "lucide-react";
import Link from "next/link";
import { useState } from "react";
import { toast } from "sonner";
import { SaveDockerProvider } from "@/components/dashboard/application/general/generic/save-docker-provider";
import { SaveGitProvider } from "@/components/dashboard/application/general/generic/save-git-provider";
import { SaveGiteaProvider } from "@/components/dashboard/application/general/generic/save-gitea-provider";
@@ -5,20 +9,18 @@ import { SaveGithubProvider } from "@/components/dashboard/application/general/g
import {
BitbucketIcon,
DockerIcon,
GitIcon,
GiteaIcon,
GithubIcon,
GitIcon,
GitlabIcon,
} from "@/components/icons/data-tools-icons";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { api } from "@/utils/api";
import { GitBranch, Loader2, UploadCloud } from "lucide-react";
import Link from "next/link";
import { useState } from "react";
import { SaveBitbucketProvider } from "./save-bitbucket-provider";
import { SaveDragNDrop } from "./save-drag-n-drop";
import { SaveGitlabProvider } from "./save-gitlab-provider";
import { UnauthorizedGitProvider } from "./unauthorized-git-provider";
type TabState =
| "github"
@@ -43,12 +45,31 @@ export const ShowProviderForm = ({ applicationId }: Props) => {
const { data: giteaProviders, isLoading: isLoadingGitea } =
api.gitea.giteaProviders.useQuery();
const { data: application } = api.application.one.useQuery({ applicationId });
const { data: application, refetch } = api.application.one.useQuery({
applicationId,
});
const { mutateAsync: disconnectGitProvider } =
api.application.disconnectGitProvider.useMutation();
const [tab, setSab] = useState<TabState>(application?.sourceType || "github");
const isLoading =
isLoadingGithub || isLoadingGitlab || isLoadingBitbucket || isLoadingGitea;
const handleDisconnect = async () => {
try {
await disconnectGitProvider({ applicationId });
toast.success("Repository disconnected successfully");
await refetch();
} catch (error) {
toast.error(
`Failed to disconnect repository: ${
error instanceof Error ? error.message : "Unknown error"
}`,
);
}
};
if (isLoading) {
return (
<Card className="group relative w-full bg-transparent">
@@ -77,6 +98,38 @@ export const ShowProviderForm = ({ applicationId }: Props) => {
);
}
// Check if user doesn't have access to the current git provider
if (
application &&
!application.hasGitProviderAccess &&
application.sourceType !== "docker" &&
application.sourceType !== "drop"
) {
return (
<Card className="group relative w-full bg-transparent">
<CardHeader>
<CardTitle className="flex items-start justify-between">
<div className="flex flex-col gap-2">
<span className="flex flex-col space-y-0.5">Provider</span>
<p className="flex items-center text-sm font-normal text-muted-foreground">
Repository connection through unauthorized provider
</p>
</div>
<div className="hidden space-y-1 text-sm font-normal md:block">
<GitBranch className="size-6 text-muted-foreground" />
</div>
</CardTitle>
</CardHeader>
<CardContent>
<UnauthorizedGitProvider
service={application}
onDisconnect={handleDisconnect}
/>
</CardContent>
</Card>
);
}
return (
<Card className="group relative w-full bg-transparent">
<CardHeader>
@@ -100,8 +153,8 @@ export const ShowProviderForm = ({ applicationId }: Props) => {
setSab(e as TabState);
}}
>
<div className="flex flex-row items-center justify-between w-full gap-4">
<TabsList className="md:grid md:w-fit md:grid-cols-7 max-md:overflow-x-scroll justify-start bg-transparent overflow-y-hidden">
<div className="flex flex-row items-center justify-between w-full overflow-auto">
<TabsList className="flex gap-4 justify-start bg-transparent">
<TabsTrigger
value="github"
className="rounded-none border-b-2 gap-2 border-b-transparent data-[state=active]:border-b-2 data-[state=active]:border-b-border"

View File

@@ -0,0 +1,149 @@
import { AlertCircle, GitBranch, Unlink } from "lucide-react";
import {
BitbucketIcon,
GiteaIcon,
GithubIcon,
GitIcon,
GitlabIcon,
} from "@/components/icons/data-tools-icons";
import { DialogAction } from "@/components/shared/dialog-action";
import { Alert, AlertDescription } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import type { RouterOutputs } from "@/utils/api";
interface Props {
service:
| RouterOutputs["application"]["one"]
| RouterOutputs["compose"]["one"];
onDisconnect: () => void;
}
export const UnauthorizedGitProvider = ({ service, onDisconnect }: Props) => {
const getProviderIcon = (sourceType: string) => {
switch (sourceType) {
case "github":
return <GithubIcon className="size-5 text-muted-foreground" />;
case "gitlab":
return <GitlabIcon className="size-5 text-muted-foreground" />;
case "bitbucket":
return <BitbucketIcon className="size-5 text-muted-foreground" />;
case "gitea":
return <GiteaIcon className="size-5 text-muted-foreground" />;
case "git":
return <GitIcon className="size-5 text-muted-foreground" />;
default:
return <GitBranch className="size-5 text-muted-foreground" />;
}
};
const getRepositoryInfo = () => {
switch (service.sourceType) {
case "github":
return {
repo: service.repository,
branch: service.branch,
owner: service.owner,
};
case "gitlab":
return {
repo: service.gitlabRepository,
branch: service.gitlabBranch,
owner: service.gitlabOwner,
};
case "bitbucket":
return {
repo: service.bitbucketRepository,
branch: service.bitbucketBranch,
owner: service.bitbucketOwner,
};
case "gitea":
return {
repo: service.giteaRepository,
branch: service.giteaBranch,
owner: service.giteaOwner,
};
case "git":
return {
repo: service.customGitUrl,
branch: service.customGitBranch,
owner: null,
};
default:
return { repo: null, branch: null, owner: null };
}
};
const { repo, branch, owner } = getRepositoryInfo();
return (
<div className="space-y-4">
<Alert>
<AlertCircle className="h-4 w-4" />
<AlertDescription>
This application is connected to a {service.sourceType} repository
through a git provider that you don't have access to. You can see
basic repository information below, but cannot modify the
configuration.
</AlertDescription>
</Alert>
<Card className="border-dashed border-2 border-muted-foreground/20 bg-transparent">
<CardHeader>
<CardTitle className="flex items-center gap-2">
{getProviderIcon(service.sourceType)}
<span className="capitalize text-sm font-medium">
{service.sourceType} Repository
</span>
</CardTitle>
</CardHeader>
<CardContent className="space-y-3">
{owner && (
<div>
<span className="text-sm font-medium text-muted-foreground">
Owner:
</span>
<p className="text-sm">{owner}</p>
</div>
)}
{repo && (
<div>
<span className="text-sm font-medium text-muted-foreground">
Repository:
</span>
<p className="text-sm">{repo}</p>
</div>
)}
{branch && (
<div>
<span className="text-sm font-medium text-muted-foreground">
Branch:
</span>
<p className="text-sm">{branch}</p>
</div>
)}
<div className="pt-4 border-t">
<DialogAction
title="Disconnect Repository"
description="Are you sure you want to disconnect this repository?"
type="default"
onClick={async () => {
onDisconnect();
}}
>
<Button variant="secondary" className="w-full">
<Unlink className="size-4 mr-2" />
Disconnect Repository
</Button>
</DialogAction>
<p className="text-xs text-muted-foreground mt-2">
Disconnecting will allow you to configure a new repository with
your own git providers.
</p>
</div>
</CardContent>
</Card>
</div>
);
};

View File

@@ -1,3 +1,14 @@
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
import {
Ban,
CheckCircle2,
Hammer,
RefreshCcw,
Rocket,
Terminal,
} from "lucide-react";
import { useRouter } from "next/router";
import { toast } from "sonner";
import { ShowBuildChooseForm } from "@/components/dashboard/application/build/show";
import { ShowProviderForm } from "@/components/dashboard/application/general/generic/show";
import { DialogAction } from "@/components/shared/dialog-action";
@@ -11,18 +22,8 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";
import { api } from "@/utils/api";
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
import {
Ban,
CheckCircle2,
Hammer,
RefreshCcw,
Rocket,
Terminal,
} from "lucide-react";
import { useRouter } from "next/router";
import { toast } from "sonner";
import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal";
interface Props {
applicationId: string;
}
@@ -68,7 +69,7 @@ export const ShowGeneralApplication = ({ applicationId }: Props) => {
toast.success("Application deployed successfully");
refetch();
router.push(
`/dashboard/project/${data?.projectId}/services/application/${applicationId}?tab=deployments`,
`/dashboard/project/${data?.environment.projectId}/environment/${data?.environmentId}/services/application/${applicationId}?tab=deployments`,
);
})
.catch(() => {

View File

@@ -1,3 +1,6 @@
import { Loader2 } from "lucide-react";
import dynamic from "next/dynamic";
import { useEffect, useState } from "react";
import { Badge } from "@/components/ui/badge";
import {
Card,
@@ -18,9 +21,6 @@ import {
} from "@/components/ui/select";
import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
import { Loader2 } from "lucide-react";
import dynamic from "next/dynamic";
import { useEffect, useState } from "react";
export const DockerLogs = dynamic(
() =>
import("@/components/dashboard/docker/logs/docker-logs-id").then(

View File

@@ -1,3 +1,9 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { Dices } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import type z from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
@@ -33,15 +39,8 @@ import {
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";
import { api } from "@/utils/api";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { domain } from "@/server/db/validations/domain";
import { zodResolver } from "@hookform/resolvers/zod";
import { Dices } from "lucide-react";
import type z from "zod";
import { api } from "@/utils/api";
type Domain = z.infer<typeof domain>;
@@ -138,7 +137,7 @@ export const AddPreviewDomain = ({
<DialogTrigger className="" asChild>
{children}
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-2xl">
<DialogContent className="sm:max-w-2xl">
<DialogHeader>
<DialogTitle>Domain</DialogTitle>
<DialogDescription>{dictionary.dialogDescription}</DialogDescription>

View File

@@ -1,3 +1,13 @@
import {
ExternalLink,
FileText,
GitPullRequest,
Loader2,
PenSquare,
RocketIcon,
Trash2,
} from "lucide-react";
import { toast } from "sonner";
import { GithubIcon } from "@/components/icons/data-tools-icons";
import { DateTooltip } from "@/components/shared/date-tooltip";
import { DialogAction } from "@/components/shared/dialog-action";
@@ -13,20 +23,10 @@ import {
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import {
ExternalLink,
FileText,
GitPullRequest,
Loader2,
PenSquare,
RocketIcon,
Trash2,
} from "lucide-react";
import { toast } from "sonner";
import { ShowModalLogs } from "../../settings/web-server/show-modal-logs";
import { ShowDeploymentsModal } from "../deployments/show-deployments-modal";
import { AddPreviewDomain } from "./add-preview-domain";
import { ShowPreviewSettings } from "./show-preview-settings";
import { ShowDeploymentsModal } from "../deployments/show-deployments-modal";
interface Props {
applicationId: string;

View File

@@ -1,3 +1,10 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { HelpCircle, Plus, Settings2, X } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
Dialog,
@@ -27,13 +34,13 @@ import {
SelectValue,
} from "@/components/ui/select";
import { Switch } from "@/components/ui/switch";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { Settings2 } from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
const schema = z
.object({
@@ -42,10 +49,12 @@ const schema = z
wildcardDomain: z.string(),
port: z.number(),
previewLimit: z.number(),
previewLabels: z.array(z.string()).optional(),
previewHttps: z.boolean(),
previewPath: z.string(),
previewCertificateType: z.enum(["letsencrypt", "none", "custom"]),
previewCustomCertResolver: z.string().optional(),
previewRequireCollaboratorPermissions: z.boolean(),
})
.superRefine((input, ctx) => {
if (
@@ -80,9 +89,11 @@ export const ShowPreviewSettings = ({ applicationId }: Props) => {
wildcardDomain: "*.traefik.me",
port: 3000,
previewLimit: 3,
previewLabels: [],
previewHttps: false,
previewPath: "/",
previewCertificateType: "none",
previewRequireCollaboratorPermissions: true,
},
resolver: zodResolver(schema),
});
@@ -100,11 +111,14 @@ export const ShowPreviewSettings = ({ applicationId }: Props) => {
buildArgs: data.previewBuildArgs || "",
wildcardDomain: data.previewWildcard || "*.traefik.me",
port: data.previewPort || 3000,
previewLabels: data.previewLabels || [],
previewLimit: data.previewLimit || 3,
previewHttps: data.previewHttps || false,
previewPath: data.previewPath || "/",
previewCertificateType: data.previewCertificateType || "none",
previewCustomCertResolver: data.previewCustomCertResolver || "",
previewRequireCollaboratorPermissions:
data.previewRequireCollaboratorPermissions || true,
});
}
}, [data]);
@@ -115,12 +129,15 @@ export const ShowPreviewSettings = ({ applicationId }: Props) => {
previewBuildArgs: formData.buildArgs,
previewWildcard: formData.wildcardDomain,
previewPort: formData.port,
previewLabels: formData.previewLabels,
applicationId,
previewLimit: formData.previewLimit,
previewHttps: formData.previewHttps,
previewPath: formData.previewPath,
previewCertificateType: formData.previewCertificateType,
previewCustomCertResolver: formData.previewCustomCertResolver,
previewRequireCollaboratorPermissions:
formData.previewRequireCollaboratorPermissions,
})
.then(() => {
toast.success("Preview Deployments settings updated");
@@ -138,7 +155,7 @@ export const ShowPreviewSettings = ({ applicationId }: Props) => {
Configure
</Button>
</DialogTrigger>
<DialogContent className="max-h-screen overflow-y-auto sm:max-w-5xl w-full">
<DialogContent className="sm:max-w-5xl w-full">
<DialogHeader>
<DialogTitle>Preview Deployment Settings</DialogTitle>
<DialogDescription>
@@ -194,6 +211,90 @@ export const ShowPreviewSettings = ({ applicationId }: Props) => {
</FormItem>
)}
/>
<FormField
control={form.control}
name="previewLabels"
render={({ field }) => (
<FormItem className="md:col-span-2">
<div className="flex items-center gap-2">
<FormLabel>Preview Labels</FormLabel>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<HelpCircle className="size-4 text-muted-foreground hover:text-foreground transition-colors cursor-pointer" />
</TooltipTrigger>
<TooltipContent>
<p>
Add a labels that will trigger a preview
deployment for a pull request. If no labels
are specified, all pull requests will trigger
a preview deployment.
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
<div className="flex flex-wrap gap-2 mb-2">
{field.value?.map((label, index) => (
<Badge
key={index}
variant="secondary"
className="flex items-center gap-1"
>
{label}
<X
className="size-3 cursor-pointer hover:text-destructive"
onClick={() => {
const newLabels = [...(field.value || [])];
newLabels.splice(index, 1);
field.onChange(newLabels);
}}
/>
</Badge>
))}
</div>
<div className="flex gap-2">
<FormControl>
<Input
placeholder="Enter a label (e.g. enhancements, needs-review)"
onKeyDown={(e) => {
if (e.key === "Enter") {
e.preventDefault();
const input = e.currentTarget;
const label = input.value.trim();
if (label) {
field.onChange([
...(field.value || []),
label,
]);
input.value = "";
}
}
}}
/>
</FormControl>
<Button
type="button"
variant="outline"
size="icon"
onClick={() => {
const input = document.querySelector(
'input[placeholder*="Enter a label"]',
) as HTMLInputElement;
const label = input.value.trim();
if (label) {
field.onChange([...(field.value || []), label]);
input.value = "";
}
}}
>
<Plus className="size-4" />
</Button>
</div>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="previewLimit"
@@ -312,6 +413,37 @@ export const ShowPreviewSettings = ({ applicationId }: Props) => {
</div>
</div>
<div className="grid gap-4 lg:grid-cols-2">
<FormField
control={form.control}
name="previewRequireCollaboratorPermissions"
render={({ field }) => (
<FormItem className="flex flex-row items-center justify-between p-3 mt-4 border rounded-lg shadow-sm col-span-2">
<div className="space-y-0.5">
<FormLabel>
Require Collaborator Permissions
</FormLabel>
<FormDescription>
Require collaborator permissions to preview
deployments, valid roles are:
<ul>
<li>Admin</li>
<li>Maintain</li>
<li>Write</li>
</ul>
</FormDescription>
</div>
<FormControl>
<Switch
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormControl>
</FormItem>
)}
/>
</div>
<FormField
control={form.control}
name="env"

View File

@@ -0,0 +1,108 @@
Backup
# license-namedbackups-abxelc
1. docker ps --filter "label=com.docker.swarm.service.name=license-namedbackups-abxelc" --format "{{.Names}}"
2. docker run --rm \
--volumes-from "license-namedbackups-abxelc.1.m3cxy78ocj3w0zu42kmgamc5y" \
-v $(pwd):/backup \
ubuntu \
tar cvf /backup/backup.tar /var/lib/postgresql/data
# Official Command Backup
1. Backup
docker run --rm \
-v license-namedbackups-abxelc-data:/volume_data \
-v $(pwd):/backup \
ubuntu \
bash -c "cd /volume_data && tar cvf /backup/generic_backup.tar ."
2. Restore
docker service scale license-namedbackups-abxelc=0
docker volume rm license-namedbackups-abxelc-data
2. docker run --rm \
-v license-namedbackups-abxelc-data:/volume_data \
-v $(pwd):/backup \
ubuntu \
bash -c "cd /volume_data && tar xvf /backup/generic_backup.tar ."
docker service scale license-namedbackups-abxelc=1
root@srv594061:~# docker volume inspect n8n_data-data
[
{
"CreatedAt": "2025-06-28T18:07:44Z",
"Driver": "local",
"Labels": null,
"Mountpoint": "/var/lib/docker/volumes/n8n_data-data/_data",
"Name": "n8n_data-data",
"Options": null,
"Scope": "local"
}
]
Archivos funcuionando creados por N8N
# root@srv594061:~# cd /var/lib/docker/volumes/n8n_data-data/_data
# root@srv594061:/var/lib/docker/volumes/n8n_data-data/_data# ls
# binaryData config crash.journal database.sqlite git n8nEventLog.log ssh
Luego que intente hacer el backup con el comando de backup
root@srv594061:~# docker run --rm -v n8n_data-data:/volume_data -v $(pwd):/backup ubuntu bash -c "cd /volume_data && tar cvf /backup/generic_backup6.tar ."
./
./config
./crash.journal
./binaryData/
./git/
./database.sqlite
./ssh/
./n8nEventLog.log
root@srv594061:~#
# Paramos la aplicacion
docker service scale n8n=0
# Haciendo el restore
root@srv594061:~# docker volume rm n8n_data-data
n8n_data-data
root@srv594061:~# docker run --rm -v n8n_data-data:/volume_data -v $(pwd):/backup ubuntu bash -c "cd /volume_data && tar xvf /backup/generic_backup6.tar && chown -R 999:999 ."
./
./config
./crash.journal
./binaryData/
./git/
./database.sqlite
./ssh/
./n8nEventLog.log
# Tenemos los archivos en el volumen
root@srv594061:~# ls /var/lib/docker/volumes/n8n_data-data/_data
binaryData config crash.journal database.sqlite git n8nEventLog.log ssh
root@srv594061:~#
docker service scale n8n=1
# Luego en N8N Cuando se que el volumen tiene la data
Permissions 0644 for n8n settings file /home/node/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.
User settings loaded from: /home/node/.n8n/config
Last session crashed
Error: EACCES: permission denied, open '/home/node/.n8n/crash.journal'
at open (node:internal/fs/promises:639:25)
at touchFile (/usr/local/lib/node_modules/n8n/dist/crash-journal.js:18:20)
at Object.init (/usr/local/lib/node_modules/n8n/dist/crash-journal.js:32:5)
at Start.initCrashJournal (/usr/local/lib/node_modules/n8n/dist/commands/base-command.js:113:9)
at Start.init (/usr/local/lib/node_modules/n8n/dist/commands/start.js:141:9)
at Start._run (/usr/local/lib/node_modules/n8n/node_modules/@oclif/core/lib/command.js:301:13)
at Config.runCommand (/usr/local/lib/node_modules/n8n/node_modules/@oclif/core/lib/config/config.js:424:25)
at run (/usr/local/lib/node_modules/n8n/node_modules/@oclif/core/lib/main.js:94:16)
at /usr/local/lib/node_modules/n8n/bin/n8n:71:2
TypeError: Cannot read properties of undefined (reading 'error')

View File

@@ -0,0 +1,123 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { Button } from "@/components/ui/button";
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
} from "@/components/ui/form";
import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
const formSchema = z.object({
rollbackActive: z.boolean(),
});
type FormValues = z.infer<typeof formSchema>;
interface Props {
applicationId: string;
children?: React.ReactNode;
}
export const ShowRollbackSettings = ({ applicationId, children }: Props) => {
const [isOpen, setIsOpen] = useState(false);
const { data: application, refetch } = api.application.one.useQuery(
{
applicationId,
},
{
enabled: !!applicationId,
},
);
const { mutateAsync: updateApplication, isLoading } =
api.application.update.useMutation();
const form = useForm<FormValues>({
resolver: zodResolver(formSchema),
defaultValues: {
rollbackActive: application?.rollbackActive ?? false,
},
});
const onSubmit = async (data: FormValues) => {
await updateApplication({
applicationId,
rollbackActive: data.rollbackActive,
})
.then(() => {
toast.success("Rollback settings updated");
setIsOpen(false);
refetch();
})
.catch(() => {
toast.error("Failed to update rollback settings");
});
};
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>{children}</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Rollback Settings</DialogTitle>
<DialogDescription>
Configure how rollbacks work for this application
</DialogDescription>
<AlertBlock>
Having rollbacks enabled increases storage usage. Be careful with
this option. Note that manually cleaning the cache may delete
rollback images, making them unavailable for future rollbacks.
</AlertBlock>
</DialogHeader>
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6">
<FormField
control={form.control}
name="rollbackActive"
render={({ field }) => (
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-4">
<div className="space-y-0.5">
<FormLabel className="text-base">
Enable Rollbacks
</FormLabel>
<FormDescription>
Allow rolling back to previous deployments
</FormDescription>
</div>
<FormControl>
<Switch
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormControl>
</FormItem>
)}
/>
<Button type="submit" className="w-full" isLoading={isLoading}>
Save Settings
</Button>
</form>
</Form>
</DialogContent>
</Dialog>
);
};

View File

@@ -1,25 +1,36 @@
import { zodResolver } from "@hookform/resolvers/zod";
import {
DatabaseZap,
Info,
PenBoxIcon,
PlusCircle,
RefreshCw,
} from "lucide-react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
import { z } from "zod";
import { AlertBlock } from "@/components/shared/alert-block";
import { CodeEditor } from "@/components/shared/code-editor";
import { Button } from "@/components/ui/button";
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
FormMessage,
FormDescription,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
import { z } from "zod";
import {
Info,
PlusCircle,
PenBoxIcon,
RefreshCw,
DatabaseZap,
} from "lucide-react";
import {
Select,
SelectContent,
@@ -27,25 +38,15 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Switch } from "@/components/ui/switch";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";
import { Switch } from "@/components/ui/switch";
import { useEffect, useState } from "react";
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import { toast } from "sonner";
import { AlertBlock } from "@/components/shared/alert-block";
import { CodeEditor } from "@/components/shared/code-editor";
import { cn } from "@/lib/utils";
import { api } from "@/utils/api";
import type { CacheType } from "../domains/handle-domain";
export const commonCronExpressions = [
@@ -232,14 +233,17 @@ export const HandleSchedules = ({ id, scheduleId, scheduleType }: Props) => {
</DialogTrigger>
<DialogContent
className={cn(
"max-h-screen overflow-y-auto",
scheduleTypeForm === "dokploy-server" || scheduleTypeForm === "server"
? "max-h-[95vh] sm:max-w-2xl"
: " sm:max-w-lg",
? "sm:max-w-2xl"
: "sm:max-w-lg",
)}
>
<DialogHeader>
<DialogTitle>{scheduleId ? "Edit" : "Create"} Schedule</DialogTitle>
<DialogDescription>
{scheduleId ? "Manage" : "Create"} a schedule to run a task at a
specific time or interval.
</DialogDescription>
</DialogHeader>
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6">

Some files were not shown because too many files have changed in this diff Show More