remote-file: add --remote-root option for security
This commit is contained in:
parent
09d41cae5b
commit
2ab2614853
4 changed files with 9 additions and 1 deletions
|
|
@ -380,6 +380,9 @@ module.exports = {
|
|||
|
||||
if (data.path) p = path.resolve(...data.path)
|
||||
|
||||
var root = settings.read('remoteRoot')
|
||||
if (root && !p.includes(root)) p = root
|
||||
|
||||
fs.readdir(p, (err, files)=>{
|
||||
if (err) {
|
||||
ipc.send('notify', {class: 'error', message: err.message}, clientId)
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ module.exports = {
|
|||
return msg
|
||||
}
|
||||
},
|
||||
'remote-root':{type:'string', describe:'set remote file browsing root folder', file:{folder: true}},
|
||||
'instance-name':{type:'string',describe:'used to differenciate multiple instances in a zeroconf network'},
|
||||
'fullscreen':{type:'boolean', describe:'launch in fullscreen mode (only affects the default gui, F11 to exit)'},
|
||||
'inspect':{type:'boolean', describe:'enable node/electron inspector', launcher: false}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ var makeDefaultConfig = function(argv){
|
|||
noGpu: argv['disable-gpu'] || false,
|
||||
readOnly: argv['read-only'] || false,
|
||||
remoteSaving: argv['remote-saving'] ? RegExp(argv['remote-saving']) : false,
|
||||
remoteRoot: argv['remote-root'] || false,
|
||||
midi: argv['midi'],
|
||||
stateFile: (function(){
|
||||
if (!argv['state']) return false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue