diff --git a/bin/sinopia b/bin/sinopia index e5e6a77ea..8ff0ad0dd 100755 --- a/bin/sinopia +++ b/bin/sinopia @@ -9,7 +9,7 @@ var crypto = require('crypto'); var pkg = require(pkg_file); commander - .option('-l, --listen <[host:]port>', 'host:port number to listen on (default: localhost:4873)', '4873') + .option('-l, --listen <[host:]port>', 'host:port number to listen on (default: localhost:4873)') .option('-c, --config ', 'use this configuration file (default: ./config.yaml)') .version(pkg.version) .parse(process.argv); @@ -33,7 +33,8 @@ if (commander.config) { if (!config.user_agent) config.user_agent = 'Sinopia/'+pkg.version; if (!config.self_path) config.self_path = config_path; -var hostport = commander.listen.split(':'); +var hostport = commander.listen || config.listen || '4873'; +hostport = hostport.split(':'); if (hostport.length < 2) { hostport = [undefined, hostport[0]]; } diff --git a/lib/config_def.yaml b/lib/config_def.yaml index 808430338..5211ccbb9 100644 --- a/lib/config_def.yaml +++ b/lib/config_def.yaml @@ -40,3 +40,6 @@ packages: # if you use nginx with custom path, use this to override links #url_prefix: https://dev.company.local/sinopia/ +# you can specify listen address (or simply a port) +#listen: localhost:4873 +