Title: feat: Allow injecting ca cert in project · Issue #1210 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: feat: Allow injecting ca cert in project · Issue #1210 · triggerdotdev/trigger.dev
X Title: feat: Allow injecting ca cert in project · Issue #1210 · triggerdotdev/trigger.dev
Description: Is your feature request related to a problem? Please describe. I was playing with the self-hosted deployment in an isolated environment with a private registry. Found out that it fails to even build due to private certification authority...
Open Graph Description: Is your feature request related to a problem? Please describe. I was playing with the self-hosted deployment in an isolated environment with a private registry. Found out that it fails to even buil...
X Description: Is your feature request related to a problem? Please describe. I was playing with the self-hosted deployment in an isolated environment with a private registry. Found out that it fails to even buil...
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/issues/1210
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat: Allow injecting ca cert in project","articleBody":"### Is your feature request related to a problem? Please describe.\r\n\r\nI was playing with the self-hosted deployment in an isolated environment with a private registry. Found out that it fails to even build due to private certification authority. \r\n\r\nBuild works without problem but can not be run as the entrypoint tries to connect to self hosted trigger.dev api which is secured by self signed/private cert chain.\r\n\r\nAllowing to inject private root cert which will allow securely interacting with the internal services would be helpful.\r\n\r\n### Describe the solution you'd like to see\r\n\r\nA config option to include a ca file which would then be added to `NODE_EXTRA_CA_CERTS=/app/ca.crt` environment variable during docker build and worker initialization.\r\n\r\n### Describe alternate solutions\r\n\r\nAllow replacing `Containerfile.prod` along with build/runtime variable using config instead of through the project setting. project settings can not even be fetched in this scenario\r\n\r\n### Additional information\r\n\r\nFor others who want to be able to do this in current scenario (tested beta-48), do this\r\n\r\n1. install `trigger.dev@beta` as dev dependency instead of running from npx, \r\n\r\n2. add `ca.crt` file in your project and update config `additionalFiles: [\"./ca.crt\"]` to copy this.\r\n\r\n3. in file `node_modules\\trigger.dev\\dist\\Containerfile.prod` update the section for ENV with following\r\n```yaml\r\nENV TRIGGER_PROJECT_ID=${TRIGGER_PROJECT_ID} \\\r\n # ... ....\r\n NODE_ENV=production \\\r\n NODE_EXTRA_CA_CERTS=/app/lib/ca.crt # this line\r\n```\r\n\r\n4. Update `node_modules\\trigger.dev\\dist\\workers\\prod\\entry-point.js`, update function `gatherProcessEnv` at the very end of file like this\r\n```js\r\nfunction gatherProcessEnv() {\r\n const env = {\r\n\r\n NODE_ENV: process.env.NODE_ENV ?? \"production\",\r\n// ... other config\r\n NODE_EXTRA_CA_CERTS: process.env.NODE_EXTRA_CA_CERTS, //// THIS LINE\r\n };\r\n return Object.fromEntries(Object.entries(env).filter(([key, value]) => value !== void 0));\r\n}\r\n```\r\n\r\nstep 3 and 4 needs to be done inside `node_modules`, this can be patched with `patch-packages` or `yarn patch`. caveat is that as of writing this issue, the library is getting updated almost every day.\r\n\r\nI can definitely create a pull request over next few days which should fix this if acceptable.","author":{"url":"https://github.com/gautamsi","@type":"Person","name":"gautamsi"},"datePublished":"2024-07-09T22:21:49Z","url":"https://github.com/triggerdotdev/trigger.dev/issues/1210"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c0f730e6-1451-d056-3bdb-9330a45c4c53 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 917A:1C3CF5:3A8E6E:575EE1:6AFAE238 |
| html-safe-nonce | d9ece33b33d7d28486ed7db4be7161952b1e1f8f377ae01481e063b3cb6dccfc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTdBOjFDM0NGNTozQThFNkU6NTc1RUUxOjZBRkFFMjM4IiwidmlzaXRvcl9pZCI6IjM3NTY4NzcyMzI1MzE2MjU1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d57cbd32035c93ea70ab7acf918ddae33eae2ee5e7b8785561eeab0151057612 |
| hovercard-subject-tag | issue:2399325954 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/triggerdotdev/trigger.dev/1210/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3d0f91d8a76823de459379ae39a386c2a36118d2bcc2e1bd89377eb85e079a3c/triggerdotdev/trigger.dev/issues/1210 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3d0f91d8a76823de459379ae39a386c2a36118d2bcc2e1bd89377eb85e079a3c/triggerdotdev/trigger.dev/issues/1210 |
| og:image:alt | Is your feature request related to a problem? Please describe. I was playing with the self-hosted deployment in an isolated environment with a private registry. Found out that it fails to even buil... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gautamsi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d9bd51a568909a83d1abb9d6f74d68f0c87ca85fe3a56d3f5d70d8b89add9f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git |
| octolytics-dimension-user_id | 95297378 |
| octolytics-dimension-user_login | triggerdotdev |
| octolytics-dimension-repository_id | 572570113 |
| octolytics-dimension-repository_nwo | triggerdotdev/trigger.dev |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572570113 |
| octolytics-dimension-repository_network_root_nwo | triggerdotdev/trigger.dev |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a7ae932999cc6d511008dbf980ff9efad2a31f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width