]> WPIA git - cassiopeia.git/blob - src/apps/signer.cpp
chg: Build two binaries for the signer
[cassiopeia.git] / src / apps / signer.cpp
1 #include <iostream>
2 #include <fstream>
3 #include <streambuf>
4
5 #include "database.h"
6 #include "mysql.h"
7 #include "simpleOpensslSigner.h"
8 #include "util.h"
9 #include "bios.h"
10 #include "slipBio.h"
11 #include "remoteSigner.h"
12 #include "sslUtil.h"
13 #include "config.h"
14 #include "recordHandler.h"
15
16 #ifdef NO_DAEMON
17 #define DAEMON false
18 #else
19 #define DAEMON true
20 #endif
21
22 int handlermain( int argc, const char* argv[] );
23
24 int main( int argc, const char* argv[] ) {
25     ( void ) argc;
26     ( void ) argv;
27
28     std::string path;
29
30     if( DAEMON ) {
31         path = "/etc/cacert/cassiopeia/cassiopeia.conf";
32     } else {
33         path = "config.txt";
34     }
35
36
37     if( parseConfig( path ) != 0 ) {
38         return -1;
39     }
40
41     return handlermain( argc, argv );
42 }