Open
Conversation
84a6ec6 to
387a6b8
Compare
- Add ECR registry type, AWS credentials, and Drizzle migrations - Enhance ECR integration, login handling, and rollbacks - Refactor ECR into a dedicated Docker provider tab - Sync Drizzle metadata with trunk
387a6b8 to
1bcb5ca
Compare
3 tasks
apps/dokploy/components/dashboard/settings/cluster/registry/handle-registry.tsx
Show resolved
Hide resolved
- Omit awsSecretAccessKey from payload when empty to prevent overwriting during edits. - Add validation for username and password in the registry schema to ensure they are provided. - Improve ECR authentication token parsing for better error handling. - Update Docker login command to use a safe registry login command for enhanced security.
Author
|
How to retrigger the auto CR after fixes? |
- Update validation to ensure awsSecretAccessKey is only required when not in editing mode, preventing unnecessary validation errors during edits.
Author
|
can you check the pr again? all issues have beed addressed @greptileai |
Author
|
okay seems like someone with permissions is required for re trigger greptile. those were nice catches NGL |
- Introduced getSafeRegistryLoginCommand to encapsulate Docker login command construction for improved security and readability. - Updated login logic to utilize the new command structure, enhancing code maintainability.
…s-ecr-registry-support
Author
|
can you check the pr again? all issues have beed addressed @greptileai |
Author
|
@greptileai please review the pr again |
Author
|
@Siumauricio When u get a chance re trigger |
Author
|
AHA 5/5 let's gooo @Siumauricio |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend changes:
Frontend changes:
This enables users to connect to AWS ECR repositories using their AWS credentials while maintaining backward compatibility with existing Docker registries.
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:
canarybranch.Issues related (if applicable)
closes #2040
Screenshots (if applicable)
Greptile Summary
This PR adds AWS ECR as a supported registry type in Dokploy, enabling users to authenticate with ECR repositories using AWS IAM credentials instead of username/password. The implementation uses the AWS SDK (
@aws-sdk/client-ecr) for token acquisition, shells out todocker login --password-stdinfor safe credential passing, adds conditional Zod validation on both the frontend and backend, and extends the database schema with three new nullable ECR-specific columns.Key changes and highlights:
getECRAuthToken/loginDockerToECRinpackages/server/src/utils/aws/ecr.tshandle AWS SDK token fetching and Docker login with correctprintf %s ... | docker login --password-stdinpiping.getSafeRegistryLoginCommand/getSafeDockerLoginCommandin the registry schema centralize safe shell command generation, and have been correctly applied intestRegistry,testRegistryById,createRegistry,updateRegistry, andgetRegistryCommands.apiCreateRegistryandapiTestRegistryusesuperRefineto enforce field-specific validation for ECR vs. non-ECR registries.awsSecretAccessKeyfrom update payloads when the field is left blank, preventing accidental credential erasure.password,awsSecretAccessKey) are excluded fromfindRegistryByIdandfindAllRegistryByOrganizationIdresults, protecting credentials from being leaked through API responses.pullImagepath indocker/utils.tsstill passes passwords via the-pflag (process-list visibility) rather than--password-stdin, inconsistent with the PR's stated security goal; (2) the ECRauthconfigforwarded to dockerode'sremoteDocker.pullis in the wrong format — it works in practice only because thedocker logincall caches credentials on the daemon first.Confidence Score: 5/5
This PR is safe to merge; all remaining findings are P2 style or best-practice issues that do not block correctness in normal usage.
All previously raised P0/P1 concerns (ECR token split, unescaped credentials, missing validation, secret key overwrite on edit) have been resolved in the current code. The two remaining findings are P2: the pullImage path still uses -p (password in process list, not an injection vector), and the dockerode authconfig format for ECR is wrong but works in practice thanks to cached daemon credentials. Neither blocks the primary ECR registration and deploy flow.
packages/server/src/utils/docker/utils.ts — pullImage still uses -p and pullRemoteImage passes a malformed authconfig to dockerode for ECR pulls.
Comments Outside Diff (1)
packages/server/src/utils/providers/docker.ts, line 48-52 (link)The PR introduces
getSafeDockerLoginCommandandgetSafeRegistryLoginCommandfor proper shell escaping, but the pre-existing non-ECR branch here still interpolatespassword,username, andregistryUrldirectly into a shell command string without any escaping. A credential containing",$, or a backtick can break the command or enable injection. The new helpergetSafeDockerLoginCommand(added inpackages/server/src/db/schema/registry.ts) should be used here instead of the raw template literal, consistent with how all other login paths in this PR are now handled.Reviews (3): Last reviewed commit: "re add my drizzle" | Re-trigger Greptile