mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-28 10:10:20 +02:00
6c546b2098
I know it is proposed to deprecate them in favor of a more generic one (`-c port=80`), but in the meantime the existing ones should work properly.
41 lines
1 KiB
JavaScript
41 lines
1 KiB
JavaScript
"use strict";
|
|
|
|
var ClientManager = new require("../clientManager");
|
|
var program = require("commander");
|
|
var colors = require("colors/safe");
|
|
var server = require("../server");
|
|
var Helper = require("../helper");
|
|
|
|
program
|
|
.command("start")
|
|
.option("-H, --host <ip>", "host")
|
|
.option("-P, --port <port>", "port")
|
|
.option("-B, --bind <ip>", "bind")
|
|
.option(" --public", "mode")
|
|
.option(" --private", "mode")
|
|
.description("Start the server")
|
|
.action(function(options) {
|
|
var users = new ClientManager().getUsers();
|
|
|
|
var mode = Helper.config.public;
|
|
if (options.public) {
|
|
mode = true;
|
|
} else if (options.private) {
|
|
mode = false;
|
|
}
|
|
|
|
if (!mode && !users.length && !Helper.config.ldap.enable) {
|
|
log.warn("No users found.");
|
|
log.info(`Create a new user with ${colors.bold("lounge add <name>")}.`);
|
|
|
|
return;
|
|
}
|
|
|
|
Helper.config.host = options.host || Helper.config.host;
|
|
Helper.config.port = options.port || Helper.config.port;
|
|
Helper.config.bind = options.bind || Helper.config.bind;
|
|
Helper.config.public = mode;
|
|
|
|
server();
|
|
});
|