mirror of
https://github.com/leon-ai/leon.git
synced 2024-12-25 01:31:47 +03:00
feat: sanitize current OS profile session name for better privacy
This commit is contained in:
parent
075f4458a0
commit
fe580cfb92
@ -43,34 +43,6 @@ dotenv.config()
|
||||
const skillsResolversNlpModelPath =
|
||||
'core/data/models/leon-skills-resolvers-model.nlp'
|
||||
const mainNlpModelPath = 'core/data/models/leon-main-model.nlp'
|
||||
const pastebinData = {
|
||||
leonVersion: null,
|
||||
environment: {
|
||||
osDetails: null,
|
||||
nodeVersion: null,
|
||||
npmVersion: null
|
||||
},
|
||||
nlpModels: {
|
||||
globalResolversModelState: null,
|
||||
skillsResolversModelState: null,
|
||||
mainModelState: null
|
||||
},
|
||||
pythonBridge: {
|
||||
version: null,
|
||||
executionTime: null,
|
||||
command: null,
|
||||
output: null,
|
||||
error: null
|
||||
},
|
||||
tcpServer: {
|
||||
version: null,
|
||||
startTime: null,
|
||||
command: null,
|
||||
output: null,
|
||||
error: null
|
||||
},
|
||||
report: null
|
||||
}
|
||||
const report = {
|
||||
can_run: { title: 'Run', type: 'error', v: true },
|
||||
can_run_skill: { title: 'Run skills', type: 'error', v: true },
|
||||
@ -116,6 +88,34 @@ dotenv.config()
|
||||
v: true
|
||||
}
|
||||
}
|
||||
let pastebinData = {
|
||||
leonVersion: null,
|
||||
environment: {
|
||||
osDetails: null,
|
||||
nodeVersion: null,
|
||||
npmVersion: null
|
||||
},
|
||||
nlpModels: {
|
||||
globalResolversModelState: null,
|
||||
skillsResolversModelState: null,
|
||||
mainModelState: null
|
||||
},
|
||||
pythonBridge: {
|
||||
version: null,
|
||||
executionTime: null,
|
||||
command: null,
|
||||
output: null,
|
||||
error: null
|
||||
},
|
||||
tcpServer: {
|
||||
version: null,
|
||||
startTime: null,
|
||||
command: null,
|
||||
output: null,
|
||||
error: null
|
||||
},
|
||||
report: null
|
||||
}
|
||||
|
||||
LogHelper.title('Checking')
|
||||
|
||||
@ -527,6 +527,10 @@ dotenv.config()
|
||||
|
||||
pastebinData.report = report
|
||||
|
||||
pastebinData = JSON.parse(
|
||||
SystemHelper.sanitizeUsername(JSON.stringify(pastebinData))
|
||||
)
|
||||
|
||||
LogHelper.title('REPORT URL')
|
||||
|
||||
LogHelper.info('Sending report...')
|
||||
|
@ -137,4 +137,14 @@ export class SystemHelper {
|
||||
'0.0.0'
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace all current session profile name occurrences with {username} placeholder
|
||||
* @example sanitizeUsername('/home/louis') // '/home/{username}'
|
||||
*/
|
||||
public static sanitizeUsername(str: string): string {
|
||||
const { username } = os.userInfo()
|
||||
|
||||
return str.replace(new RegExp(username, 'g'), '{username}')
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user