-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
Makes it easier to modify a command Each command exports an object: { directive: string or array of commands that call this handler handler: function to process the command syntax: string of how to call the command description: human readable explaination of command flags: optional object of flags }
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
"ftp", | ||
"ftp-server", | ||
"ftp-srv", | ||
"ftp-svr", | ||
"ftpd", | ||
"server" | ||
], | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
directive: 'ALLO', | ||
handler: function () { | ||
return this.reply(202); | ||
}, | ||
syntax: '{{cmd}}', | ||
description: 'Allocate sufficient disk space to receive a file', | ||
flags: { | ||
obsolete: true | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const stor = require('./stor').handler; | ||
|
||
module.exports = { | ||
directive: 'APPE', | ||
handler: function (args) { | ||
return stor.call(this, args); | ||
}, | ||
syntax: '{{cmd}} [path]', | ||
description: 'Append to a file' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const _ = require('lodash'); | ||
|
||
module.exports = { | ||
directive: 'AUTH', | ||
handler: function ({command} = {}) { | ||
const method = _.upperCase(command._[1]); | ||
|
||
switch (method) { | ||
case 'TLS': return handleTLS.call(this); | ||
case 'SSL': return handleSSL.call(this); | ||
default: return this.reply(504); | ||
} | ||
}, | ||
syntax: '{{cmd}} [type]', | ||
description: 'Set authentication mechanism', | ||
flags: { | ||
no_auth: true | ||
} | ||
} | ||
|
||
function handleTLS() { | ||
return this.reply(504); | ||
} | ||
|
||
function handleSSL() { | ||
return this.reply(504); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const cwd = require('./cwd').handler; | ||
|
||
module.exports = { | ||
directive: ['CDUP', 'XCUP'], | ||
handler: function(args) { | ||
args.command._ = [args.command._[0], '..']; | ||
return cwd.call(this, args); | ||
}, | ||
syntax: '{{cmd}}', | ||
description: 'Change to Parent Directory' | ||
} |