Changeset - 35c13f038f69
[Not reviewed]
0 4 0
Jan Kaluza - 13 years ago 2012-08-29 15:33:43
hanzz.k@gmail.com
Hidden password, allow seeting port
4 files changed with 6 insertions and 5 deletions:
0 comments (0 inline, 0 general)
spectrum_manager/src/main.cpp
Show inline comments
 
@@ -139,7 +139,7 @@ int main(int argc, char **argv)
 
	}
 
	else if (command[0] == "server") {
 
		Server server(&config);
 
		server.start(8080);
 
		server.start();
 
		while (1) { sleep(10); }
 
	}
 
	else {
spectrum_manager/src/managerconfig.cpp
Show inline comments
 
@@ -31,6 +31,7 @@ bool ManagerConfig::load(const std::string &configfile, boost::program_options::
 
	opts.add_options()
 
		("service.admin_username", value<std::string>()->default_value(""), "Administrator username.")
 
		("service.admin_password", value<std::string>()->default_value(""), "Administrator password.")
 
		("service.port", value<int>()->default_value(8081), "Web interface port.")
 
		("service.config_directory", value<std::string>()->default_value("/etc/spectrum2/transports/"), "Directory with spectrum2 configuration files. One .cfg file per one instance")
 
		("servers.server", value<std::vector<std::string> >()->multitoken(), "Server.")
 
	;
spectrum_manager/src/server.cpp
Show inline comments
 
@@ -158,9 +158,9 @@ static void *_event_handler(enum mg_event event, struct mg_connection *conn) {
 
	return static_cast<Server *>(request_info->user_data)->event_handler(event, conn);
 
}
 

	
 
bool Server::start(int port) {
 
bool Server::start() {
 
	const char *options[] = {
 
		"listening_ports", boost::lexical_cast<std::string>(port).c_str(),
 
		"listening_ports", boost::lexical_cast<std::string>(CONFIG_INT(m_config, "service.port")).c_str(),
 
		"num_threads", "1",
 
		NULL
 
	};
 
@@ -296,7 +296,7 @@ void Server::serve_login(struct mg_connection *conn, const struct mg_request_inf
 
      <br/>\
 
      <form action=\"/authorize\">\
 
        Username: <input type=\"text\" name=\"user\"></input><br/>\
 
        Password: <input type=\"text\" name=\"password\"></input><br/>\
 
        Password: <input type=\"password\" name=\"password\"></input><br/>\
 
        <input type=\"submit\" value=\"Login\"></input>\
 
      </form>\
 
    </center>\
spectrum_manager/src/server.h
Show inline comments
 
@@ -46,7 +46,7 @@ class Server {
 
		/// Destructor
 
		virtual ~Server();
 

	
 
		bool start(int port);
 
		bool start();
 

	
 
		void *event_handler(enum mg_event event, struct mg_connection *conn);
 

	
0 comments (0 inline, 0 general)