Skip to content

Commit

Permalink
Merge pull request #82 from FlowFuse/log-passthrough
Browse files Browse the repository at this point in the history
Add log passthrough support
  • Loading branch information
hardillb authored Feb 12, 2024
2 parents 9aeecf2 + 2d9b506 commit f46502f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ driver:
socket: /var/run/docker.sock
registry: containers.flowforge.com
privateCA: /full/path/to/chain.pem
logPassthrough: true
```
- `registry` is the Docker Registry to load Stack Containers from (default: Docker Hub)
- `socket` is the path to the docker unix domain socket (default: /var/run/docker.sock)
- privateCA: is the fully qualified path to a pem file containing trusted CA cert chain (default: not set)
- `privateCA`: is the fully qualified path to a pem file containing trusted CA cert chain (default: not set)
- `logPassthrough` Have Node-RED logs printed in JSON format to container stdout (default: false)

### Configuration via environment variables

Expand Down
6 changes: 5 additions & 1 deletion docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ const createContainer = async (project, domain) => {
contOptions.Env.push(`FORGE_NR_SECRET=${credentialSecret}`)
}

if (this._app.config.driver.options.privateCA && fs.existsSync(this._app.config.driver.options.privateCA)) {
if (this._options?.logPassthrough) {
contOptions.Env.push('FORGE_LOG_PASSTHROUGH=true')
}

if (this._app.config.driver.options?.privateCA && fs.existsSync(this._app.config.driver.options?.privateCA)) {
contOptions.Binds = [
`${this._app.config.driver.options.privateCA}:/usr/local/ssl-certs/chain.pem`
]
Expand Down

0 comments on commit f46502f

Please sign in to comment.