Skip to content

Added extraCACerts config #1214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 17, 2024
Merged

Added extraCACerts config #1214

merged 5 commits into from
Jul 17, 2024

Conversation

gautamsi
Copy link
Contributor

@gautamsi gautamsi commented Jul 13, 2024

Closes #1210

✅ Checklist

  • I have followed every step in the contributing guide
  • The PR title follows the convention.
  • I ran and tested the code works

Testing

  1. Generate a self signed cert and use this to protect trigger.dev deployment
  2. create a task which tries to access a self hosted api with self signed certificate
  3. try to deploy the project to self-hosted instance, see it fail
  4. create a ca.crt file containing signing certificate public key in pem format
  5. copy this file to project dir
  6. add extraCACerts config ./ca.crt
  7. deploy the task to self-hosted instance, this time it should deploy and run successfully

Changelog


Added config option extraCACerts to ProjectConfig type. This copies the ca file along with additionalFiles and sets NODE_EXTRA_CA_CERTS environment variable in built image as well as running the task.

Screenshots

[Screenshots]

💯

Copy link

changeset-bot bot commented Jul 13, 2024

⚠️ No Changeset found

Latest commit: 9611fa8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Collaborator

@nicktrn nicktrn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @gautamsi!

Good call with resolveConfig(). I think it will be a lot cleaner doing everything in there, that is:

  1. Add the raw extraCACerts path to additionalFiles
  2. Tranform it so resolvedConfig.extraCACerts now points at the deployed destination path -> /app/...

Re the last point: We could even just strip .. and keep the path relative to /app if NODE_EXTRA_CA_CERTS works fine with relative paths. /app is the work dir in the resulting image so that should be fine.

@gautamsi
Copy link
Contributor Author

I will update this soon

@nicktrn
Copy link
Collaborator

nicktrn commented Jul 17, 2024

Thanks for the changes! Will get this merged and tested. Should be in the next release.

@nicktrn nicktrn merged commit e417aca into triggerdotdev:main Jul 17, 2024
2 checks passed
@gautamsi gautamsi deleted the fixes-#1210 branch July 17, 2024 11:02
@gautamsi
Copy link
Contributor Author

verified beta-49 works with this feature :)

@nicktrn
Copy link
Collaborator

nicktrn commented Jul 18, 2024

I did test this locally briefly and relative paths work as well 👍

@gautamsi gautamsi mentioned this pull request Sep 21, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Allow injecting ca cert in project
2 participants