Add the option roothttp
[src/app-framework-binder.git] / src / afb-config.h
1 /*
2  * Copyright (C) 2015, 2016 "IoT.bzh"
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *   http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef LOCAL_DEF_H
17 #define LOCAL_DEF_H
18
19 #pragma once
20
21 /* other definitions --------------------------------------------------- */
22
23 // Note: because of a bug in libmagic MAGIC_DB NULL should not be used for default
24 #define MAX_ALIAS 10           // max number of aliases
25
26 #define DEFLT_CNTX_TIMEOUT  3600   // default Client Connection Timeout
27 #define DEFLT_API_TIMEOUT   20     // default Plugin API Timeout [0=NoLimit for Debug Only]
28 #define DEFLT_CACHE_TIMEOUT 100000 // default Static File Chache [Client Side Cache 100000~=1day]
29 #define DEFLT_AUTH_TOKEN    NULL   // expect for debug should == NULL
30 #define DEFLT_HTTP_TIMEOUT  15     // Max MibMicroHttp timeout
31
32 #define CTX_NBCLIENTS   10   // allow a default of 10 authenticated clients
33
34 struct afb_config_item
35 {
36         struct afb_config_item *previous;
37         int kind;
38         char *value;
39 };
40
41 // main config structure
42 struct afb_config
43 {
44   char *console;           // console device name (can be a file or a tty)
45   int   httpdPort;
46   char *ldpaths;           // list of plugins directories
47   char *rootdir;           // base dir for files
48   char *roothttp;          // directory for http files
49   char *rootbase;          // Angular HTML5 base URL
50   char *rootapi;           // Base URL for REST APIs
51   char *sessiondir;        // where to store mixer session files
52   char *token;             // initial authentication token [default NULL no session]
53   int  background;        // run in backround mode
54   int  readyfd;           // a #fd to signal when ready to serve
55   int  cacheTimeout;
56   int  apiTimeout;
57   int  cntxTimeout;        // Client Session Context timeout
58   int  nbSessionMax;    // max count of sessions
59   int mode;           // mode of listening
60   int aliascount;
61   struct afb_config_item *items;
62   struct {
63          char  *url;
64          char  *path;
65        } aliasdir[MAX_ALIAS];  // alias mapping for icons,apps,...
66 };
67
68 #endif /* LOCAL_DEF_H */