@flowfuse/file-server 2.24.6-fcb4d71-202512151818.0 → 2.25.1-0064109-202601051157.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +3 -3
- package/eslint.config.mjs +56 -0
- package/forge/auth.js +1 -2
- package/forge/config.js +1 -3
- package/forge/driver.js +2 -3
- package/forge/fileServer.js +3 -1
- package/forge/routes/context.js +7 -4
- package/forge/routes/files.js +2 -4
- package/forge/routes/index.js +1 -2
- package/forge/routes/quota.js +1 -3
- package/package.json +14 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
#### 2.25.0: Release
|
|
2
|
+
|
|
3
|
+
- Bump flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml (#193)
|
|
4
|
+
- Bump flowfuse/github-actions-workflows/.github/workflows/build_node_package.yml from 0.43.0 to 0.44.0 (#192) @app/dependabot
|
|
5
|
+
|
|
1
6
|
#### 2.24.5: Release
|
|
2
7
|
|
|
3
8
|
- Bump actions/setup-node from 6.0.0 to 6.1.0 (#190) @app/dependabot
|
package/README.md
CHANGED
|
@@ -165,7 +165,7 @@ options.
|
|
|
165
165
|
|
|
166
166
|
### Context Storage
|
|
167
167
|
|
|
168
|
-
####
|
|
168
|
+
#### Database
|
|
169
169
|
|
|
170
170
|
This driver can use either PostgreSQL or SQLite to hold context values.
|
|
171
171
|
|
|
@@ -173,7 +173,7 @@ To use with PostgreSQL configure as follows:
|
|
|
173
173
|
|
|
174
174
|
```yaml
|
|
175
175
|
context:
|
|
176
|
-
type:
|
|
176
|
+
type: db
|
|
177
177
|
options:
|
|
178
178
|
type: postgres
|
|
179
179
|
host: 127.0.0.1
|
|
@@ -188,7 +188,7 @@ To use with SQLite configure as follows:
|
|
|
188
188
|
|
|
189
189
|
```yaml
|
|
190
190
|
context:
|
|
191
|
-
type:
|
|
191
|
+
type: db
|
|
192
192
|
options:
|
|
193
193
|
type: sqlite
|
|
194
194
|
storage: ff-context.db
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import globals from 'globals'
|
|
2
|
+
import js from '@eslint/js'
|
|
3
|
+
import neostandard, { resolveIgnoresFromGitignore } from 'neostandard'
|
|
4
|
+
import stylistic from '@stylistic/eslint-plugin'
|
|
5
|
+
import noOnlyTests from 'eslint-plugin-no-only-tests'
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
{
|
|
9
|
+
files: ['**/*.js'],
|
|
10
|
+
languageOptions: {
|
|
11
|
+
globals: {
|
|
12
|
+
...globals.browser
|
|
13
|
+
},
|
|
14
|
+
sourceType: 'script'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
files: ['test/**/*.js'],
|
|
19
|
+
languageOptions: {
|
|
20
|
+
globals: {
|
|
21
|
+
...globals.browser,
|
|
22
|
+
...globals.mocha
|
|
23
|
+
},
|
|
24
|
+
sourceType: 'script'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
ignores: [
|
|
29
|
+
...resolveIgnoresFromGitignore()
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
js.configs.recommended,
|
|
33
|
+
...neostandard(),
|
|
34
|
+
{
|
|
35
|
+
plugins: {
|
|
36
|
+
'@stylistic': stylistic,
|
|
37
|
+
'no-only-tests': noOnlyTests
|
|
38
|
+
},
|
|
39
|
+
rules: {
|
|
40
|
+
// built-in
|
|
41
|
+
eqeqeq: 'error',
|
|
42
|
+
'object-shorthand': ['error'],
|
|
43
|
+
'no-console': ['error', { allow: ['debug', 'info', 'warn', 'error'] }],
|
|
44
|
+
quotes: ['off', 'error', 'single', { avoidEscape: true }],
|
|
45
|
+
|
|
46
|
+
// plugin:stylistic
|
|
47
|
+
'@stylistic/indent': ['warn', 4], // https://eslint.style/rules/indent#options
|
|
48
|
+
'@stylistic/spaced-comment': ['error', 'always'], // https://eslint.style/rules/spaced-comment
|
|
49
|
+
'@stylistic/no-multi-spaces': 'error', // https://eslint.style/rules/no-multi-spaces#no-multi-spaces
|
|
50
|
+
'@stylistic/comma-dangle': ['error', 'never'], // https://eslint.style/rules/comma-dangle#comma-dangle
|
|
51
|
+
|
|
52
|
+
// plugin:no-only-tests
|
|
53
|
+
'no-only-tests/no-only-tests': 'error'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
]
|
package/forge/auth.js
CHANGED
|
@@ -4,7 +4,7 @@ const got = require('got')
|
|
|
4
4
|
const authCache = {}
|
|
5
5
|
const ttl = 90 * 1000
|
|
6
6
|
|
|
7
|
-
module.exports = fp(async function (app, opts
|
|
7
|
+
module.exports = fp(async function (app, opts) {
|
|
8
8
|
const client = got.extend({
|
|
9
9
|
prefixUrl: `${app.config.base_url}/account/check/project`,
|
|
10
10
|
headers: {
|
|
@@ -102,5 +102,4 @@ module.exports = fp(async function (app, opts, done) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
app.decorate('checkAuth', checkAuth)
|
|
105
|
-
done()
|
|
106
105
|
})
|
package/forge/config.js
CHANGED
|
@@ -74,7 +74,7 @@ module.exports = {
|
|
|
74
74
|
|
|
75
75
|
return config
|
|
76
76
|
},
|
|
77
|
-
attach: fp(async function (app, opts
|
|
77
|
+
attach: fp(async function (app, opts) {
|
|
78
78
|
Object.freeze(config)
|
|
79
79
|
app.decorate('config', config)
|
|
80
80
|
|
|
@@ -87,7 +87,5 @@ module.exports = {
|
|
|
87
87
|
if (!opts.config) {
|
|
88
88
|
app.log.info(`Config File: ${config.configFile}`)
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
next()
|
|
92
90
|
})
|
|
93
91
|
}
|
package/forge/driver.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const fp = require('fastify-plugin')
|
|
2
2
|
const getDriver = require('./drivers/vfs.js')
|
|
3
3
|
|
|
4
|
-
module.exports = fp(async function (app, opts
|
|
4
|
+
module.exports = fp(async function (app, opts) {
|
|
5
5
|
const Driver = require('./drivers/' + app.config.driver.type)
|
|
6
6
|
try {
|
|
7
7
|
app.decorate('_driver', new Driver(app))
|
|
@@ -13,7 +13,6 @@ module.exports = fp(async function (app, opts, done) {
|
|
|
13
13
|
done()
|
|
14
14
|
})
|
|
15
15
|
} catch (err) {
|
|
16
|
-
console.
|
|
16
|
+
console.error(err)
|
|
17
17
|
}
|
|
18
|
-
done()
|
|
19
18
|
})
|
package/forge/fileServer.js
CHANGED
package/forge/routes/context.js
CHANGED
|
@@ -9,8 +9,13 @@
|
|
|
9
9
|
/** @typedef {import('fastify').FastifyReply} FastifyReply */
|
|
10
10
|
/** @typedef {import('fastify').FastifyRequest} FastifyRequest */
|
|
11
11
|
|
|
12
|
-
module.exports = async function (app, opts
|
|
13
|
-
|
|
12
|
+
module.exports = async function (app, opts) {
|
|
13
|
+
let driver
|
|
14
|
+
if (app.config.context.type === 'db') {
|
|
15
|
+
driver = require('../context-driver/sequelize')
|
|
16
|
+
} else {
|
|
17
|
+
driver = require(`../context-driver/${app.config.context.type}`)
|
|
18
|
+
}
|
|
14
19
|
|
|
15
20
|
await driver.init(app)
|
|
16
21
|
|
|
@@ -181,6 +186,4 @@ module.exports = async function (app, opts, done) {
|
|
|
181
186
|
await driver.clean(request.params.projectId, request.body)
|
|
182
187
|
reply.send()
|
|
183
188
|
})
|
|
184
|
-
|
|
185
|
-
done()
|
|
186
189
|
}
|
package/forge/routes/files.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
/** @typedef {import('fastify').FastifyReply} FastifyReply */
|
|
10
10
|
/** @typedef {import('fastify').FastifyRequest} FastifyRequest */
|
|
11
11
|
|
|
12
|
-
module.exports = async function (app, opts
|
|
12
|
+
module.exports = async function (app, opts) {
|
|
13
13
|
app.addContentTypeParser('application/octet-stream', { parseAs: 'buffer' }, function (request, payload, done) {
|
|
14
14
|
done(null, payload)
|
|
15
15
|
})
|
|
@@ -66,7 +66,7 @@ module.exports = async function (app, opts, done) {
|
|
|
66
66
|
}
|
|
67
67
|
reply.code(200).send()
|
|
68
68
|
} catch (err) {
|
|
69
|
-
console.
|
|
69
|
+
console.error(err)
|
|
70
70
|
reply.code(400).send(err)
|
|
71
71
|
}
|
|
72
72
|
})
|
|
@@ -125,6 +125,4 @@ module.exports = async function (app, opts, done) {
|
|
|
125
125
|
reply.code(err.statusCode || 400).send(err)
|
|
126
126
|
}
|
|
127
127
|
})
|
|
128
|
-
|
|
129
|
-
done()
|
|
130
128
|
}
|
package/forge/routes/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const fp = require('fastify-plugin')
|
|
2
2
|
|
|
3
|
-
module.exports = fp(async function (app, opts
|
|
3
|
+
module.exports = fp(async function (app, opts) {
|
|
4
4
|
app.addHook('preHandler', app.checkAuth)
|
|
5
5
|
await app.register(require('./files'), { prefix: '/v1/files', logLevel: app.config.logging.http })
|
|
6
6
|
await app.register(require('./quota'), { prefix: '/v1/quota', logLevel: app.config.logging.http })
|
|
@@ -14,5 +14,4 @@ module.exports = fp(async function (app, opts, done) {
|
|
|
14
14
|
}
|
|
15
15
|
return result
|
|
16
16
|
})
|
|
17
|
-
done()
|
|
18
17
|
})
|
package/forge/routes/quota.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
module.exports = async function (app, opts
|
|
1
|
+
module.exports = async function (app, opts) {
|
|
2
2
|
app.get('/:teamId/:projectId', async (request, reply) => {
|
|
3
3
|
reply.send({
|
|
4
4
|
used: await request.vfs.quota(request.params.teamId, request.params.projectId)
|
|
5
5
|
})
|
|
6
6
|
})
|
|
7
|
-
|
|
8
|
-
done()
|
|
9
7
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowfuse/file-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.1-0064109-202601051157.0",
|
|
4
4
|
"description": "A basic Object Storage backend",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "node index.js",
|
|
8
8
|
"serve": "cross-env NODE_ENV=development nodemon -w forge index.js",
|
|
9
|
-
"lint": "eslint -c .
|
|
10
|
-
"lint:fix": "eslint -c .
|
|
9
|
+
"lint": "eslint -c eslint.config.mjs",
|
|
10
|
+
"lint:fix": "eslint -c eslint.config.mjs --fix",
|
|
11
11
|
"test": "mocha test/unit/**/*_spec.js --timeout 5000",
|
|
12
12
|
"test:nopg": "cross-env TEST_POSTGRES=false mocha test/unit/**/*_spec.js --timeout 5000"
|
|
13
13
|
},
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"homepage": "https://github.com/FlowFuse/file-server#readme",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@aws-sdk/client-s3": "^3.388.0",
|
|
35
|
-
"@fastify/helmet": "^
|
|
35
|
+
"@fastify/helmet": "^13.0.2",
|
|
36
36
|
"@node-red/util": "^3.1.0",
|
|
37
|
-
"fastify": "^
|
|
38
|
-
"fastify-
|
|
39
|
-
"fastify-
|
|
40
|
-
"fastify-
|
|
37
|
+
"fastify": "^5.6.2",
|
|
38
|
+
"fastify-healthcheck": "^5.1.0",
|
|
39
|
+
"fastify-metrics": "^12.1.0",
|
|
40
|
+
"fastify-plugin": "^5.1.0",
|
|
41
41
|
"got": "^11.8.6",
|
|
42
42
|
"pg": "^8.11.2",
|
|
43
43
|
"pino": "^8.15.1",
|
|
@@ -48,17 +48,18 @@
|
|
|
48
48
|
"yaml": "^2.1.3"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
+
"@eslint/js": "^9.39.2",
|
|
51
52
|
"cross-env": "^7.0.3",
|
|
52
|
-
"eslint": "^
|
|
53
|
-
"eslint-
|
|
54
|
-
"
|
|
55
|
-
"eslint-plugin-promise": "^6.1.1",
|
|
53
|
+
"eslint": "^9.39.2",
|
|
54
|
+
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
55
|
+
"globals": "^16.5.0",
|
|
56
56
|
"mocha": "^10.1.0",
|
|
57
57
|
"mocha-cli": "^1.0.1",
|
|
58
|
+
"neostandard": "^0.12.2",
|
|
58
59
|
"nodemon": "^3.0.1",
|
|
59
60
|
"should": "^13.2.3"
|
|
60
61
|
},
|
|
61
62
|
"engines": {
|
|
62
|
-
"node": ">=
|
|
63
|
+
"node": ">=20.x"
|
|
63
64
|
}
|
|
64
65
|
}
|