Skip to content
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

Add log passthrough support #82

Merged
merged 5 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading