Skip to content

Commit dad87b5

Browse files
committed
fix(ls): don't allow dots in process name
closes TryGhost#184 - tighten up pname validation regex - replace dots with dashes in default pname
1 parent 1052a4c commit dad87b5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/commands/config/advanced.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ module.exports = [{
3131
}, {
3232
name: 'pname',
3333
description: 'Name of the Ghost instance',
34-
validate: value => !!value.match(/[A-Za-z0-9:\.\-_]+/) ||
35-
'Invalid process name. Process name can contain alphanumeric characters,' +
36-
'and the special characters \'.\', \'-\', and \'_\'',
37-
default: config => url.parse(config.get('url')).hostname
34+
validate: value => !!value.match(/^[A-Za-z0-9\-_]+$/) ||
35+
'Invalid process name. Process name can contain alphanumeric characters ' +
36+
'and the special characters \'-\' and \'_\'',
37+
default: config => url.parse(config.get('url')).hostname.replace(/\./g, '-')
3838
}, {
3939
name: 'port',
4040
description: 'Port ghost should listen on',

0 commit comments

Comments
 (0)