hackmdio / hackmdio/codimd

Bug: Docker Secrets lead to uncaughtException

Open
#1,949 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
10.1k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

As soon as you use docker secrets, you will get the following exception:

```
error: uncaughtException: Cannot freeze array buffer views with elements 15:29:21 [7/7167]TypeError: Cannot freeze array buffer views with elements at Function.freeze () at deepFreeze (/home/hackmd/app/node_modules/deep-freeze/index.js:2:10) at /home/hackmd/app/node_modules/deep-freeze/index.js:9:7 at Array.forEach () at deepFreeze (/home/hackmd/app/node_modules/deep-freeze/index.js:4:33) at /home/hackmd/app/node_modules/deep-freeze/index.js:9:7 at Array.forEach ()
at deepFreeze (/home/hackmd/app/node_modules/deep-freeze/index.js:4:33)
at Object. (/home/hackmd/app/lib/config/index.js:214:10)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at Module.load (node:internal/modules/cjs/loader:1076:32)
at Function.Module._load (node:internal/modules/cjs/loader:911:12)
at Module.require (node:internal/modules/cjs/loader:1100:19)
at require (node:internal/modules/cjs/helpers:119:18)
at Object. (/home/hackmd/app/app.js:23:14)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
```

If you use random secrets, that are not used by https://github.com/hackmdio/codimd/blob/develop/lib/config/dockerSecret.js, there is no exception. If you used a named secret (e.g. `imgur_clientid`), like in the following example, you get the exception.

```
codimd:
image: hackmdio/hackmd:2.6.1
container_name: codimd
[... other container settings ...]
secrets:
- source: codimd_imgur_secret
target: imgur_clientid # when target = "abcef" no exception, but the secret is not used of course
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.