@flowfuse/device-agent
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -0,1 +1,8 @@ | ||
#### 3.0.2: Release | ||
- Apply custom message in login dialog on direct access (#332) @knolleary | ||
- Bump docker/setup-buildx-action from 3.7.1 to 3.8.0 (#331) @app/dependabot | ||
- Send nr version (#327) @hardillb | ||
- Bump docker/build-push-action from 6.9.0 to 6.10.0 (#330) @app/dependabot | ||
#### 3.0.1: Release | ||
@@ -2,0 +9,0 @@ |
@@ -5,5 +5,7 @@ const { IntervalJitter } = require('./IntervalJitter') | ||
const fs = require('fs/promises') | ||
const { readFileSync } = require('fs') | ||
const path = require('path') | ||
const httpClient = require('./http') | ||
const mqttClient = require('./mqtt') | ||
const semver = require('semver') | ||
const Launcher = require('./launcher.js') | ||
@@ -226,3 +228,3 @@ const { info, warn, debug } = require('./logging/log') | ||
if (this.launcher) { | ||
return await this.launcher.readPackage() | ||
return this.launcher.readPackage() | ||
} | ||
@@ -266,2 +268,17 @@ return null | ||
} | ||
if (this.launcher?.readPackage) { | ||
const { modules } = this.launcher.readPackage() | ||
if (semver.valid(modules['node-red']) !== null) { | ||
state.nodeRedVersion = modules['node-red'] | ||
} else { | ||
try { | ||
const nrPackPath = path.join(this.launcher.projectDir, 'node_modules/node-red/package.json') | ||
const content = readFileSync(nrPackPath) | ||
const packJSON = JSON.parse(content) | ||
state.nodeRedVersion = packJSON.version | ||
} catch (err) { | ||
// Bad node-red install | ||
} | ||
} | ||
} | ||
if (this.currentMode === 'developer' && this.editorToken && this.editorAffinity) { | ||
@@ -440,3 +457,3 @@ state.affinity = this.editorAffinity | ||
try { | ||
const modules = (await _launcher.readPackage())?.modules | ||
const modules = (_launcher.readPackage())?.modules | ||
const flows = await _launcher.readFlow() | ||
@@ -443,0 +460,0 @@ diskSnapshot = { flows, modules } |
const childProcess = require('child_process') | ||
const { existsSync } = require('fs') | ||
const fs = require('fs/promises') | ||
const { readFileSync } = require('fs') | ||
const path = require('path') | ||
@@ -92,3 +93,3 @@ const { log, info, debug, warn, NRlog } = require('./logging/log') | ||
async readPackage () { | ||
readPackage () { | ||
debug(`Reading package.json: ${this.files.packageJSON}`) | ||
@@ -102,3 +103,3 @@ const data = { | ||
try { | ||
const packageJSON = await fs.readFile(this.files.packageJSON) | ||
const packageJSON = readFileSync(this.files.packageJSON) | ||
const packageData = JSON.parse(packageJSON) | ||
@@ -351,3 +352,3 @@ data.modules = packageData.dependencies | ||
if (userDefinedNRVersion && options?.updateSettings && this.agent?.currentOwnerType === 'application') { | ||
const pkg = await this.readPackage() | ||
const pkg = this.readPackage() | ||
const pkgNRVersion = pkg.modules?.['node-red'] || 'latest' | ||
@@ -354,0 +355,0 @@ const snapshotNRVersion = this.snapshot?.modules?.['node-red'] |
@@ -45,3 +45,2 @@ const settings = require('./settings.json') | ||
const auth = { | ||
type: 'credentials', // the type of the auth | ||
tokenHeader: 'x-access-token', // the header where node-red expects to find the token | ||
@@ -98,8 +97,2 @@ tokens: async function (token) { | ||
} | ||
}, | ||
users: async function (username) { | ||
return null | ||
}, | ||
authenticate: async function (username, password) { | ||
return null | ||
} | ||
@@ -174,2 +167,11 @@ } | ||
} | ||
runtimeSettings.editorTheme.login = { | ||
message: 'Access the editor through the FlowFuse platform' | ||
} | ||
if (themeSettings.projectURL) { | ||
runtimeSettings.editorTheme.login.button = { | ||
url: themeSettings.projectURL, | ||
label: 'Open FlowFuse Dashboard' | ||
} | ||
} | ||
@@ -176,0 +178,0 @@ if (settings.flowforge.auditLogger?.bin && settings.flowforge.auditLogger?.url) { |
{ | ||
"name": "@flowfuse/device-agent", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "An Edge Agent for running Node-RED instances deployed from the FlowFuse Platform", | ||
@@ -5,0 +5,0 @@ "exports": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
304051
4767
42