Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@flowfuse/nr-launcher

Package Overview
Dependencies
Maintainers
0
Versions
217
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flowfuse/nr-launcher - npm Package Compare versions

Comparing version 2.7.1-eb9c703-202408140935.0 to 2.8.1-4e03127-202408290944.0

lib/files/index.js

7

CHANGELOG.md

@@ -0,1 +1,8 @@

#### 2.8.0: Release
- Update Project Nodes and File nodes (#279) @hardillb
- First pass at file api (#275) @hardillb
- Fix HealthCheck errors when editor disabled (#277) @hardillb
- Fix flushInterval in context module (#272) @knolleary
#### 2.7.0: Release

@@ -2,0 +9,0 @@

2

index.js

@@ -14,2 +14,3 @@ #!/usr/bin/env node

const { AdminInterface } = require('./lib/admin')
const { filesInterface } = require('./lib/files')

@@ -115,2 +116,3 @@ const cmdLineOptions = [

filesInterface(adminInterface.app, launcher.settings)
// const wss = new ws.Server({ clientTracking: false, noServer: true })

@@ -117,0 +119,0 @@ //

@@ -16,2 +16,3 @@ const http = require('http')

const app = express()
this.app = app
this.server = http.createServer(app)

@@ -18,0 +19,0 @@

@@ -134,2 +134,4 @@ const fs = require('fs')

this.settings.storageDir = path.normalize(path.join(this.settings.rootDir, this.settings.userDir, 'storage'))
// setup nodeDir to include the path to additional nodes and plugins

@@ -371,3 +373,3 @@ const nodesDir = []

stdio: ['ignore', 'pipe', 'pipe'],
cwd: path.join(this.settings.rootDir, this.settings.userDir, 'storage')
cwd: this.settings.storageDir
}

@@ -429,2 +431,5 @@

}
if (this.settings.settings.disableEditor) {
opts.throwHttpErrors = false
}
// Use a HEAD request to minimise data transfer

@@ -431,0 +436,0 @@ const res = await got.head(pollUrl, opts)

15

lib/resources/sample.js

@@ -9,5 +9,4 @@ const got = require('got')

}
})();
})()
let lastCPUTime = 0

@@ -18,3 +17,3 @@

try {
const res = await got.get(url, {
const res = await got.get(url, {
headers: {

@@ -38,8 +37,8 @@ pragma: 'no-cache',

} else if (metric.name === 'process_resident_memory_bytes') {
response.ps = parseInt(metric.metrics[0].value)/(1024*1024)
response.ps = parseInt(metric.metrics[0].value) / (1024 * 1024)
} else if (metric.name === 'process_cpu_seconds_total') {
cpuTime = parseFloat(metric.metrics[0].value)
if (lastCPUTime != 0) {
const cpuTime = parseFloat(metric.metrics[0].value)
if (lastCPUTime !== 0) {
const delta = cpuTime - lastCPUTime
response.cpu = (delta/time) * 100
response.cpu = (delta / time) * 100
}

@@ -60,2 +59,2 @@ lastCPUTime = cpuTime

module.exports = sampleResources
module.exports = sampleResources

@@ -1,5 +0,1 @@

const os = require('node:os')
const crypto = require('crypto')
const instanceId = crypto.createHash('md5').update(os.hostname()).digest('hex').substring(0, 4)
class SampleBuffer {

@@ -20,3 +16,3 @@ constructor (size = 1000) {

this.buffer[this.head++] = sample
if (this.head == this.size) {
if (this.head === this.size) {
this.head = 0

@@ -37,5 +33,5 @@ this.wrapped = true

return this.buffer.slice(0, this.head)
} else {
} else {
const result = this.buffer.slice(this.head, this.size)
result.push(...this.buffer.slice(0,this.head))
result.push(...this.buffer.slice(0, this.head))
return result

@@ -61,3 +57,3 @@ }

avgLastX (x) {
const samples = this.lastX(x)
const samples = this.lastX(x)
const result = {}

@@ -74,3 +70,3 @@ let skipped = 0

}
}
}
}

@@ -82,3 +78,3 @@ } else {

for (const [key, value] of Object.entries(result)) {
result[key] = value/(samples.length-skipped)
result[key] = value / (samples.length - skipped)
}

@@ -90,2 +86,2 @@ result.count = samples.length

module.exports = SampleBuffer
module.exports = SampleBuffer

@@ -162,6 +162,22 @@ const path = require('path')

if (settings.rootDir) {
const uibRoot = path.join(settings.rootDir, settings.userDir, 'storage', 'uibuilder').split(path.sep).join(path.posix.sep)
const uibRoot = path.join(settings.storageDir, 'uibuilder').split(path.sep).join(path.posix.sep)
projectSettings.uibuilder = { uibRoot }
}
if (settings.settings?.httpStatic) {
// This is an array of httpStatic properties - however their path setting
// will currently be relative to cwd. For safety, map them to absolute paths
// and validate they are not traversing out of the storageDir
const httpStatic = []
settings.settings.httpStatic.forEach(staticSetting => {
staticSetting.path = path.normalize(path.join(settings.storageDir, staticSetting.path))
if (staticSetting.path.startsWith(settings.storageDir)) {
httpStatic.push(staticSetting)
}
})
if (httpStatic.length > 0) {
projectSettings.httpStatic = httpStatic
}
}
let contextStorage = ''

@@ -362,3 +378,4 @@ if (settings.fileStore?.url) {

httpAdminCookieOptions: ${JSON.stringify(httpAdminCookieOptions)},
${projectSettings.uibuilder ? 'uibuilder: ' + JSON.stringify(projectSettings.uibuilder) : ''}
${projectSettings.uibuilder ? 'uibuilder: ' + JSON.stringify(projectSettings.uibuilder) + ',' : ''}
${projectSettings.httpStatic ? 'httpStatic: ' + JSON.stringify(projectSettings.httpStatic) : ''}
}

@@ -365,0 +382,0 @@ `

{
"name": "@flowfuse/nr-launcher",
"version": "2.7.1-eb9c703-202408140935.0",
"version": "2.8.1-4e03127-202408290944.0",
"description": "FlowFuse Launcher for running Node-RED",

@@ -23,3 +23,3 @@ "exports": {

"test": "mocha 'test/unit/**/*_spec.js'",
"lint": "eslint -c .eslintrc *.js lib/*.js test/**/*.js",
"lint": "eslint -c .eslintrc *.js lib/**/*.js test/**/*.js",
"lint:fix": "eslint -c .eslintrc *.js lib/*.js test/**/*.js --fix",

@@ -59,2 +59,3 @@ "build-theme": "node lib/theme/scripts/build.js "

"memorystore": "^1.6.7",
"multer": "^1.4.5-lts.1",
"oauth": "^0.9.15",

@@ -61,0 +62,0 @@ "parse-prometheus-text-format": "^1.1.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc