87691af0f9f69003a471b08f489798932b2cfa6f
[src/app-framework-binder.git] / src / afb-config.h
1 /*
2    local-def.h -- provide a REST/HTTP interface
3
4    Copyright (C) 2015, Fulup Ar Foll
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 */
21 #ifndef LOCAL_DEF_H
22 #define LOCAL_DEF_H
23
24 #pragma once
25
26 /* other definitions --------------------------------------------------- */
27
28 // Note: because of a bug in libmagic MAGIC_DB NULL should not be used for default
29 #define MAX_ALIAS 10           // max number of aliases
30
31 #define DEFLT_CNTX_TIMEOUT  3600   // default Client Connection Timeout
32 #define DEFLT_API_TIMEOUT   0      // default Plugin API Timeout [0=NoLimit for Debug Only]
33 #define DEFLT_CACHE_TIMEOUT 100000 // default Static File Chache [Client Side Cache 100000~=1day]
34 #define DEFLT_AUTH_TOKEN    NULL   // expect for debug should == NULL
35 #define DEFLT_HTTP_TIMEOUT  15     // Max MibMicroHttp timeout
36
37 #define CTX_NBCLIENTS   10   // allow a default of 10 authenticated clients
38
39 // main config structure
40 struct afb_config
41 {
42   char *console;           // console device name (can be a file or a tty)
43   int   httpdPort;
44   char *ldpaths;           // list of plugins directories
45   char *rootdir;           // base dir for httpd file download
46   char *rootbase;          // Angular HTML5 base URL
47   char *rootapi;           // Base URL for REST APIs
48   char *sessiondir;        // where to store mixer session files
49   char *token;             // initial authentication token [default NULL no session]
50   int  background;        // run in backround mode
51   int  readyfd;           // a #fd to signal when ready to serve
52   int  cacheTimeout;
53   int  apiTimeout;
54   int  cntxTimeout;        // Client Session Context timeout
55   int mode;           // mode of listening
56   int aliascount;
57   struct {
58          char  *url;
59          char  *path;
60        } aliasdir[MAX_ALIAS];  // alias mapping for icons,apps,...
61 };
62
63 #endif /* LOCAL_DEF_H */