[Config] Reworked the services' configuration
This commit is contained in:
+31
-68
@@ -23,89 +23,52 @@
|
||||
|
||||
namespace {
|
||||
|
||||
void splitStrings(const std::string& source, std::vector<std::string>& res)
|
||||
{
|
||||
std::istringstream oss(source);
|
||||
|
||||
std::string str;
|
||||
while(oss >> str)
|
||||
res.push_back(str);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ConfigReader::ConfigReader(boost::filesystem::path p)
|
||||
ConfigReader::ConfigReader()
|
||||
: _config (nullptr)
|
||||
{
|
||||
_config.readFile(p.string().c_str());
|
||||
}
|
||||
|
||||
ConfigReader&
|
||||
ConfigReader::instance()
|
||||
{
|
||||
static ConfigReader instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
void
|
||||
ConfigReader::getLoggerConfig(Logger::Config& config)
|
||||
ConfigReader::setFile(boost::filesystem::path p)
|
||||
{
|
||||
config.enableFileLogging = _config.lookupValue("main.logger.file", config.logPath);
|
||||
config.enableConsoleLogging = _config.lookup("main.logger.console");
|
||||
config.minSeverity = static_cast<Severity>((int)_config.lookup("main.logger.level"));
|
||||
if (_config != nullptr)
|
||||
delete _config;
|
||||
|
||||
_config = new libconfig::Config();
|
||||
|
||||
_config->readFile(p.string().c_str());
|
||||
}
|
||||
|
||||
void
|
||||
ConfigReader::getCoverGrabberConfig(CoverArt::Grabber::Config& config)
|
||||
std::string
|
||||
ConfigReader::getString(std::string setting)
|
||||
{
|
||||
std::string extensions = _config.lookup("main.cover.file_extensions");
|
||||
config.maxFileSize = static_cast<unsigned int>(_config.lookup("main.cover.file_max_size"));
|
||||
std::string filenames = _config.lookup("main.cover.file_preferred_names");
|
||||
|
||||
splitStrings(extensions, config.fileExtensions);
|
||||
splitStrings(filenames, config.preferredFileNames);
|
||||
return _config->lookup(setting);
|
||||
}
|
||||
|
||||
void
|
||||
ConfigReader::getUserInterfaceConfig(Service::UserInterfaceService::Config& config)
|
||||
unsigned long
|
||||
ConfigReader::getULong(std::string setting)
|
||||
{
|
||||
|
||||
config.enable = _config.lookup("ui.enable");
|
||||
if (!config.enable)
|
||||
return;
|
||||
|
||||
config.docRootPath = _config.lookup("ui.resources.docroot");
|
||||
config.appRootPath = _config.lookup("ui.resources.approot");
|
||||
config.httpsPort = static_cast<unsigned int>(_config.lookup("ui.listen-endpoint.port"));
|
||||
config.httpsAddress = boost::asio::ip::address::from_string((const char*)_config.lookup("ui.listen-endpoint.addr"));
|
||||
config.sslCertificatePath = _config.lookup("ui.ssl-crypto.cert");
|
||||
config.sslPrivateKeyPath = _config.lookup("ui.ssl-crypto.key");
|
||||
config.sslTempDhPath = _config.lookup("ui.ssl-crypto.dh");
|
||||
|
||||
config.dbPath = _config.lookup("main.database.path");
|
||||
return static_cast<unsigned int>(_config->lookup(setting));
|
||||
}
|
||||
|
||||
#if defined HAVE_LMSAPI
|
||||
void
|
||||
ConfigReader::getLmsAPIConfig(Service::LmsAPIService::Config& config)
|
||||
long
|
||||
ConfigReader::getLong(std::string setting)
|
||||
{
|
||||
config.enable = _config.lookup("remote.enable");
|
||||
if (!config.enable)
|
||||
return;
|
||||
|
||||
config.port = static_cast<unsigned int>(_config.lookup("remote.listen-endpoint.port"));
|
||||
config.address = boost::asio::ip::address::from_string((const char*)_config.lookup("remote.listen-endpoint.addr"));
|
||||
config.sslCertificatePath = _config.lookup("remote.ssl-crypto.cert");
|
||||
config.sslPrivateKeyPath = _config.lookup("remote.ssl-crypto.key");
|
||||
config.sslTempDhPath = _config.lookup("remote.ssl-crypto.dh");
|
||||
|
||||
config.dbPath = _config.lookup("main.database.path");
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
ConfigReader::getDatabaseUpdateConfig(Service::DatabaseUpdateService::Config& config)
|
||||
{
|
||||
config.enable = true;
|
||||
|
||||
config.dbPath = _config.lookup("main.database.path");
|
||||
|
||||
std::string audioExtensions = _config.lookup("main.database.audio_extensions");
|
||||
std::string videoExtensions = _config.lookup("main.database.video_extensions");
|
||||
|
||||
splitStrings(audioExtensions, config.audioExtensions);
|
||||
splitStrings(videoExtensions, config.videoExtensions);
|
||||
return _config->lookup(setting);
|
||||
}
|
||||
|
||||
bool
|
||||
ConfigReader::getBool(std::string setting)
|
||||
{
|
||||
return _config->lookup(setting);
|
||||
}
|
||||
|
||||
|
||||
+11
-24
@@ -23,40 +23,27 @@
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <libconfig.h++>
|
||||
|
||||
#include "config/config.h"
|
||||
|
||||
#include "cover/CoverArtGrabber.hpp"
|
||||
#include "logger/Logger.hpp"
|
||||
|
||||
#include "service/UserInterfaceService.hpp"
|
||||
#include "service/DatabaseUpdateService.hpp"
|
||||
#if defined HAVE_LMSAPI
|
||||
#include "service/LmsAPIServerService.hpp"
|
||||
#endif
|
||||
|
||||
class ConfigReader
|
||||
{
|
||||
public:
|
||||
|
||||
ConfigReader(boost::filesystem::path p);
|
||||
ConfigReader(const ConfigReader&) = delete;
|
||||
ConfigReader& operator=(const ConfigReader&) = delete;
|
||||
|
||||
// Logger configuration
|
||||
void getLoggerConfig(Logger::Config& config);
|
||||
static ConfigReader& instance();
|
||||
|
||||
// Covers
|
||||
void getCoverGrabberConfig(CoverArt::Grabber::Config& config);
|
||||
void setFile(boost::filesystem::path p);
|
||||
|
||||
// Service configurations
|
||||
void getUserInterfaceConfig(Service::UserInterfaceService::Config& config);
|
||||
void getDatabaseUpdateConfig(Service::DatabaseUpdateService::Config& config);
|
||||
|
||||
#if defined HAVE_LMSAPI
|
||||
void getLmsAPIConfig(Service::LmsAPIService::Config& config);
|
||||
#endif
|
||||
std::string getString(std::string setting);
|
||||
unsigned long getULong(std::string setting);
|
||||
long getLong(std::string setting);
|
||||
bool getBool(std::string setting);
|
||||
|
||||
private:
|
||||
|
||||
libconfig::Config _config;
|
||||
ConfigReader();
|
||||
|
||||
libconfig::Config *_config;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,10 +17,8 @@
|
||||
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
#include "logger/Logger.hpp"
|
||||
#include "config/ConfigReader.hpp"
|
||||
#include "av/InputFormatContext.hpp"
|
||||
|
||||
#include "CoverArtGrabber.hpp"
|
||||
@@ -28,6 +26,18 @@
|
||||
|
||||
namespace {
|
||||
|
||||
std::vector<std::string> splitStrings(const std::string& source)
|
||||
{
|
||||
std::vector<std::string> res;
|
||||
std::istringstream oss(source);
|
||||
|
||||
std::string str;
|
||||
while(oss >> str)
|
||||
res.push_back(str);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
bool
|
||||
isFileSupported(const boost::filesystem::path& file, const std::vector<boost::filesystem::path> extensions)
|
||||
{
|
||||
@@ -58,12 +68,12 @@ Grabber::instance()
|
||||
}
|
||||
|
||||
void
|
||||
Grabber::init(const Config& config)
|
||||
Grabber::init()
|
||||
{
|
||||
for (auto extension : config.fileExtensions)
|
||||
for (const std::string& extension : splitStrings( ConfigReader::instance().getString("main.cover.file_extensions")))
|
||||
_fileExtensions.push_back("." + extension);
|
||||
|
||||
_maxFileSize = config.maxFileSize;
|
||||
_maxFileSize = ConfigReader::instance().getULong("main.cover.file_max_size");
|
||||
}
|
||||
|
||||
std::vector<CoverArt>
|
||||
@@ -75,7 +85,7 @@ Grabber::getFromInputFormatContext(const Av::InputFormatContext& input, std::siz
|
||||
{
|
||||
std::vector<Av::Picture> pictures = input.getPictures(nbMaxCovers);
|
||||
|
||||
BOOST_FOREACH(const Av::Picture& picture, pictures)
|
||||
for (Av::Picture& picture : pictures)
|
||||
res.push_back( CoverArt(picture.mimeType, picture.data) );
|
||||
|
||||
}
|
||||
|
||||
@@ -38,14 +38,7 @@ class Grabber
|
||||
|
||||
static Grabber& instance();
|
||||
|
||||
struct Config
|
||||
{
|
||||
std::vector<std::string> fileExtensions;
|
||||
std::size_t maxFileSize;
|
||||
std::vector<std::string> preferredFileNames;
|
||||
};
|
||||
|
||||
void init(const Config& config);
|
||||
void init();
|
||||
|
||||
std::vector<boost::filesystem::path> getCoverPaths(const boost::filesystem::path& directoryPath, std::size_t nbMaxCovers = 1) const;
|
||||
std::vector<CoverArt> getFromDirectory(const boost::filesystem::path& path, std::size_t nbMaxCovers = 1) const;
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
#include <boost/log/core.hpp>
|
||||
#include <boost/log/trivial.hpp>
|
||||
#include <boost/log/expressions.hpp>
|
||||
@@ -37,6 +35,8 @@
|
||||
|
||||
#include <boost/date_time/posix_time/ptime.hpp>
|
||||
|
||||
#include "config/ConfigReader.hpp"
|
||||
|
||||
|
||||
#include "Logger.hpp"
|
||||
|
||||
@@ -64,7 +64,7 @@ Logger::Logger()
|
||||
MOD_UI,
|
||||
};
|
||||
|
||||
BOOST_FOREACH(Module module, modules)
|
||||
for(Module module : modules)
|
||||
_loggers[module].add_attribute("Module", boost::log::attributes::constant< Module >(module));
|
||||
}
|
||||
|
||||
@@ -74,19 +74,18 @@ Logger::get(Module module)
|
||||
return _loggers[module];
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Logger::init(const Config& config)
|
||||
Logger::init()
|
||||
{
|
||||
boost::log::add_common_attributes();
|
||||
|
||||
boost::log::register_simple_formatter_factory< Severity, char >("Severity");
|
||||
|
||||
if (config.enableFileLogging)
|
||||
if (ConfigReader::instance().getBool("main.logger.file.enable"))
|
||||
{
|
||||
boost::log::add_file_log
|
||||
(
|
||||
boost::log::keywords::file_name = config.logPath + std::string(".%N"),
|
||||
boost::log::keywords::file_name = ConfigReader::instance().getString("main.logger.file.path") + std::string(".%N"),
|
||||
boost::log::keywords::rotation_size = 10 * 1024 * 1024,
|
||||
boost::log::keywords::open_mode = std::ios_base::app,
|
||||
boost::log::keywords::auto_flush = true,
|
||||
@@ -100,7 +99,7 @@ Logger::init(const Config& config)
|
||||
);
|
||||
}
|
||||
|
||||
if (config.enableConsoleLogging)
|
||||
if (ConfigReader::instance().getBool("main.logger.console.enable"))
|
||||
{
|
||||
boost::log::add_console_log(std::cout,
|
||||
boost::log::keywords::format = (
|
||||
@@ -115,7 +114,7 @@ Logger::init(const Config& config)
|
||||
|
||||
boost::log::core::get()->set_filter
|
||||
(
|
||||
boost::log::expressions::attr<Severity>("Severity") <= config.minSeverity
|
||||
boost::log::expressions::attr<Severity>("Severity") <= ConfigReader::instance().getULong("main.logger.level")
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -65,15 +65,8 @@ class Logger
|
||||
|
||||
static Logger& instance();
|
||||
|
||||
struct Config {
|
||||
bool enableFileLogging;
|
||||
bool enableConsoleLogging;
|
||||
std::string logPath;
|
||||
Severity minSeverity;
|
||||
};
|
||||
|
||||
//[ example_tutorial_file_advanced
|
||||
void init(const Config& config);
|
||||
void init();
|
||||
|
||||
boost::log::sources::severity_logger< Severity >&
|
||||
get(Module module);
|
||||
|
||||
+8
-34
@@ -20,11 +20,11 @@
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#include "config/config.h"
|
||||
#include "logger/Logger.hpp"
|
||||
|
||||
#include "config/ConfigReader.hpp"
|
||||
#include "transcode/AvConvTranscoder.hpp"
|
||||
#include "av/Common.hpp"
|
||||
#include "logger/Logger.hpp"
|
||||
#include "cover/CoverArtGrabber.hpp"
|
||||
|
||||
#include "service/ServiceManager.hpp"
|
||||
#include "service/DatabaseUpdateService.hpp"
|
||||
@@ -61,28 +61,10 @@ int main(int argc, char* argv[])
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
ConfigReader configReader(configFile);
|
||||
ConfigReader::instance().setFile(configFile);
|
||||
|
||||
// Initializa logging facility
|
||||
{
|
||||
Logger::Config loggerConfig;
|
||||
configReader.getLoggerConfig(loggerConfig);
|
||||
Logger::instance().init(loggerConfig);
|
||||
}
|
||||
|
||||
{
|
||||
CoverArt::Grabber::Config config;
|
||||
configReader.getCoverGrabberConfig(config);
|
||||
CoverArt::Grabber::instance().init(config);
|
||||
}
|
||||
|
||||
LMS_LOG(MOD_MAIN, SEV_INFO) << "Reading service configurations...";
|
||||
|
||||
Service::DatabaseUpdateService::Config dbUpdateConfig;
|
||||
configReader.getDatabaseUpdateConfig(dbUpdateConfig);
|
||||
|
||||
Service::UserInterfaceService::Config uiConfig;
|
||||
configReader.getUserInterfaceConfig(uiConfig);
|
||||
Logger::instance().init();
|
||||
CoverArt::Grabber::instance().init();
|
||||
|
||||
Service::ServiceManager& serviceManager = Service::ServiceManager::instance();
|
||||
|
||||
@@ -93,20 +75,12 @@ int main(int argc, char* argv[])
|
||||
|
||||
LMS_LOG(MOD_MAIN, SEV_INFO) << "Starting services...";
|
||||
|
||||
if (dbUpdateConfig.enable)
|
||||
serviceManager.startService( std::make_shared<Service::DatabaseUpdateService>( dbUpdateConfig ) );
|
||||
|
||||
serviceManager.startService( std::make_shared<Service::DatabaseUpdateService>() );
|
||||
serviceManager.startService( std::make_shared<Service::UserInterfaceService>(boost::filesystem::path(argv[0])));
|
||||
#if defined HAVE_LMSAPI
|
||||
Service::LmsAPIService::Config lmsAPIConfig;
|
||||
configReader.getLmsAPIConfig(lmsAPIConfig);
|
||||
|
||||
if (lmsAPIConfig.enable)
|
||||
serviceManager.startService( std::make_shared<Service::LmsAPIService>( lmsAPIConfig ));
|
||||
serviceManager.startService( std::make_shared<Service::LmsAPIService>( ));
|
||||
#endif
|
||||
|
||||
if (uiConfig.enable)
|
||||
serviceManager.startService( std::make_shared<Service::UserInterfaceService>(boost::filesystem::path(argv[0]), uiConfig));
|
||||
|
||||
LMS_LOG(MOD_MAIN, SEV_NOTICE) << "Now running...";
|
||||
|
||||
serviceManager.run();
|
||||
|
||||
@@ -19,18 +19,32 @@
|
||||
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
#include "config/ConfigReader.hpp"
|
||||
#include "logger/Logger.hpp"
|
||||
|
||||
#include "DatabaseUpdateService.hpp"
|
||||
|
||||
static std::vector<std::string> splitStrings(const std::string& source)
|
||||
{
|
||||
std::vector<std::string> res;
|
||||
std::istringstream oss(source);
|
||||
|
||||
std::string str;
|
||||
while(oss >> str)
|
||||
res.push_back(str);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
namespace Service {
|
||||
|
||||
DatabaseUpdateService::DatabaseUpdateService(const Config& config)
|
||||
DatabaseUpdateService::DatabaseUpdateService()
|
||||
: _metadataParser(),
|
||||
_databaseUpdater( config.dbPath, _metadataParser)
|
||||
_databaseUpdater( ConfigReader::instance().getString("main.database.path"),
|
||||
_metadataParser)
|
||||
{
|
||||
_databaseUpdater.setAudioExtensions(config.audioExtensions);
|
||||
_databaseUpdater.setVideoExtensions(config.videoExtensions);
|
||||
_databaseUpdater.setAudioExtensions(splitStrings(ConfigReader::instance().getString("main.database.audio_extensions")));
|
||||
_databaseUpdater.setVideoExtensions(splitStrings(ConfigReader::instance().getString("main.database.video_extensions")));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -36,14 +36,7 @@ class DatabaseUpdateService : public Service
|
||||
|
||||
typedef std::shared_ptr<DatabaseUpdateService> pointer;
|
||||
|
||||
struct Config {
|
||||
bool enable;
|
||||
boost::filesystem::path dbPath;
|
||||
std::vector<std::string> audioExtensions;
|
||||
std::vector<std::string> videoExtensions;
|
||||
};
|
||||
|
||||
DatabaseUpdateService(const Config& config);
|
||||
DatabaseUpdateService();
|
||||
|
||||
// Service interface
|
||||
void start(void);
|
||||
|
||||
@@ -17,18 +17,24 @@
|
||||
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <boost/asio/ip/address.hpp>
|
||||
|
||||
#include "config/ConfigReader.hpp"
|
||||
#include "logger/Logger.hpp"
|
||||
|
||||
#include "LmsAPIServerService.hpp"
|
||||
|
||||
namespace Service {
|
||||
|
||||
LmsAPIService::LmsAPIService(const Config& config)
|
||||
: _server(boost::asio::ip::tcp::endpoint(config.address, config.port),
|
||||
config.sslCertificatePath,
|
||||
config.sslPrivateKeyPath,
|
||||
config.sslTempDhPath,
|
||||
config.dbPath)
|
||||
LmsAPIService::LmsAPIService()
|
||||
: _server(
|
||||
boost::asio::ip::tcp::endpoint(
|
||||
boost::asio::ip::address::from_string(ConfigReader::instance().getString("remote.listen-endpoint.addr")),
|
||||
ConfigReader::instance().getULong("remote.listen-endpoint.port")),
|
||||
ConfigReader::instance().getString("remote.ssl-crypto.cert"),
|
||||
ConfigReader::instance().getString("remote.ssl-crypto.key"),
|
||||
ConfigReader::instance().getString("remote.ssl-crypto.dh"),
|
||||
ConfigReader::instance().getString("main.database.path"))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#define REMOTE_SERVER_SERVICE_HPP
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/asio/ip/address.hpp>
|
||||
|
||||
#include "config/config.h"
|
||||
|
||||
@@ -35,17 +34,7 @@ class LmsAPIService : public Service
|
||||
{
|
||||
public:
|
||||
|
||||
struct Config {
|
||||
bool enable;
|
||||
boost::asio::ip::address address;
|
||||
unsigned short port;
|
||||
boost::filesystem::path sslCertificatePath;
|
||||
boost::filesystem::path sslPrivateKeyPath;
|
||||
boost::filesystem::path sslTempDhPath;
|
||||
boost::filesystem::path dbPath;
|
||||
};
|
||||
|
||||
LmsAPIService(const Config& config);
|
||||
LmsAPIService();
|
||||
|
||||
void start(void);
|
||||
void stop(void);
|
||||
|
||||
@@ -22,24 +22,23 @@
|
||||
#include "UserInterfaceService.hpp"
|
||||
#include "ui/LmsApplication.hpp"
|
||||
|
||||
#include "config/ConfigReader.hpp"
|
||||
|
||||
namespace Service {
|
||||
|
||||
UserInterfaceService::UserInterfaceService( boost::filesystem::path runAppPath, const Config& config)
|
||||
UserInterfaceService::UserInterfaceService( boost::filesystem::path runAppPath)
|
||||
: _server(runAppPath.string())
|
||||
{
|
||||
std::vector<std::string> args;
|
||||
|
||||
args.push_back(runAppPath.string());
|
||||
args.push_back("--docroot=" + config.docRootPath.string());
|
||||
args.push_back("--approot=" + config.appRootPath.string());
|
||||
{
|
||||
std::ostringstream oss; oss << config.httpsPort;
|
||||
args.push_back("--https-port=" + oss.str());
|
||||
}
|
||||
args.push_back("--https-address=" + config.httpsAddress.to_string());
|
||||
args.push_back("--ssl-certificate=" + config.sslCertificatePath.string());
|
||||
args.push_back("--ssl-private-key=" + config.sslPrivateKeyPath.string());
|
||||
args.push_back("--ssl-tmp-dh=" + config.sslTempDhPath.string());
|
||||
args.push_back("--docroot=" + ConfigReader::instance().getString("ui.resources.docroot"));
|
||||
args.push_back("--approot=" + ConfigReader::instance().getString("ui.resources.approot"));
|
||||
args.push_back("--https-port=" + std::to_string( ConfigReader::instance().getULong("ui.listen-endpoint.port")));
|
||||
args.push_back("--https-address=" + ConfigReader::instance().getString("ui.listen-endpoint.addr"));
|
||||
args.push_back("--ssl-certificate=" + ConfigReader::instance().getString("ui.ssl-crypto.cert"));
|
||||
args.push_back("--ssl-private-key=" + ConfigReader::instance().getString("ui.ssl-crypto.key"));
|
||||
args.push_back("--ssl-tmp-dh=" + ConfigReader::instance().getString("ui.ssl-crypto.dh"));
|
||||
|
||||
// Construct argc/argv
|
||||
int argc = args.size();
|
||||
@@ -55,7 +54,7 @@ UserInterfaceService::UserInterfaceService( boost::filesystem::path runAppPath,
|
||||
_server.setServerConfiguration (argc, const_cast<char**>(argv));
|
||||
|
||||
// bind entry point
|
||||
_server.addEntryPoint(Wt::Application, boost::bind(UserInterface::LmsApplication::create, _1, config.dbPath));
|
||||
_server.addEntryPoint(Wt::Application, boost::bind(UserInterface::LmsApplication::create, _1, ConfigReader::instance().getString("main.database.path")));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#define WEB_SERVER_SERVICE_HPP
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/asio/ip/address.hpp>
|
||||
|
||||
#include <Wt/WServer>
|
||||
|
||||
@@ -33,20 +32,7 @@ class UserInterfaceService : public Service
|
||||
{
|
||||
public:
|
||||
|
||||
struct Config {
|
||||
bool enable;
|
||||
boost::filesystem::path docRootPath;
|
||||
boost::filesystem::path appRootPath;
|
||||
unsigned short httpsPort;
|
||||
boost::asio::ip::address httpsAddress;
|
||||
boost::filesystem::path sslCertificatePath;
|
||||
boost::filesystem::path sslPrivateKeyPath;
|
||||
boost::filesystem::path sslTempDhPath;
|
||||
boost::filesystem::path dbPath;
|
||||
};
|
||||
|
||||
UserInterfaceService(boost::filesystem::path runAppPath,
|
||||
const Config& config);
|
||||
UserInterfaceService(boost::filesystem::path runAppPath);
|
||||
|
||||
void start(void);
|
||||
void stop(void);
|
||||
|
||||
Reference in New Issue
Block a user