X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Fconfig.cpp;h=a4d32848ecb7de4e3e4609adc5a83e997d927d47;hb=6121035a7d8ea738bc89c2de8e6602fb1099b0e2;hp=acdaafbe8faea60a58b97ccb8d6b8178edd817eb;hpb=709700dfbbeb5bf8aee1f5a1966f0192d783ae03;p=cassiopeia.git diff --git a/src/config.cpp b/src/config.cpp index acdaafb..a4d3284 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -13,6 +13,8 @@ std::unordered_map profiles; std::unordered_map> CAs; std::string sqlHost, sqlUser, sqlPass, sqlDB; std::string serialPath; +std::string crlPrefix; +std::string crtPrefix; std::shared_ptr> parseConf( std::string path ) { auto map = std::make_shared>(); @@ -21,7 +23,7 @@ std::shared_ptr> parseConf( std::st if( !config.is_open() ) { logger::notef( "Where is \"%s\"?", path ); - throw "Config missing"; + throw std::runtime_error( "Config missing" ); } std::string line1; @@ -115,7 +117,7 @@ int parseProfiles() { closedir( dir ); } else { - throw "Directory with CAConfigs not found"; + throw std::runtime_error( "Directory with CAConfigs not found" ); } profiles.emplace( profileName, prof ); @@ -138,6 +140,8 @@ int parseConfig( std::string path ) { sqlPass = masterConf->at( "sql.password" ); sqlDB = masterConf->at( "sql.database" ); serialPath = masterConf->at( "serialPath" ); + crlPrefix = masterConf->at( "crlPrefix" ); + crtPrefix = masterConf->at( "crtPrefix" ); if( keyDir == "" ) { logger::error( "Missing config property key.directory" );