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