Skip to content

Commit

Permalink
fix(ls): don't allow dots in process name
Browse files Browse the repository at this point in the history
closes TryGhost#184
- tighten up pname validation regex
- replace dots with dashes in default pname
  • Loading branch information
acburdine committed May 5, 2017
1 parent 1052a4c commit dad87b5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/commands/config/advanced.js
Expand Up @@ -31,10 +31,10 @@ module.exports = [{
}, {
name: 'pname',
description: 'Name of the Ghost instance',
validate: value => !!value.match(/[A-Za-z0-9:\.\-_]+/) ||
'Invalid process name. Process name can contain alphanumeric characters,' +
'and the special characters \'.\', \'-\', and \'_\'',
default: config => url.parse(config.get('url')).hostname
validate: value => !!value.match(/^[A-Za-z0-9\-_]+$/) ||
'Invalid process name. Process name can contain alphanumeric characters ' +
'and the special characters \'-\' and \'_\'',
default: config => url.parse(config.get('url')).hostname.replace(/\./g, '-')
}, {
name: 'port',
description: 'Port ghost should listen on',
Expand Down

0 comments on commit dad87b5

Please sign in to comment.