-
Notifications
You must be signed in to change notification settings - Fork 4
/
Settings.h
101 lines (91 loc) · 2.46 KB
/
Settings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include "libUseful/libUseful.h"
#ifndef ALAYA_SETTINGS_H
#define ALAYA_SETTINGS_H
//Flag values for Settings->Flags
#define FLAG_NODEMON 1
#define FLAG_CHROOT 2
#define FLAG_CHHOME 4
#define FLAG_CHSHARE 8
#define FLAG_SSL 16
#define FLAG_SSL_PFS 32
#define FLAG_PFS_GENERATE 64
#define FLAG_COMPRESS 256
#define FLAG_PARTIAL_COMPRESS 512
#define FLAG_USE_UNSHARE 1024
#define FLAG_USE_REUSEPORT 2048
#define FLAG_CHECK_SCRIPTS 4096
#define FLAG_LOGOUT_AVAILABLE 8192
#define FLAG_LOOKUP_CLIENT 16384
#define FLAG_KEEPALIVES 32768
#define FLAG_SIGHUP_RECV 65536
#define FLAG_LOG_VERBOSE 131072
#define FLAG_LOG_MORE_VERBOSE 262144
#define FLAG_USE_FASTOPEN 524288
#define FLAG_USE_HTTPS_FASTOPEN 1048576
//Flag values for Settings->AuthFlags and Session->AuthFlags
#define FLAG_AUTH_REQUIRED 1
#define FLAG_AUTH_PRESENT 2
#define FLAG_AUTH_BASIC 4
#define FLAG_AUTH_DIGEST 8
#define FLAG_AUTH_ACCESS_TOKEN 16
#define FLAG_AUTH_COOKIE 32
#define FLAG_AUTH_HASCOOKIE 64
#define FLAG_AUTH_CERT_ASK 128
#define FLAG_AUTH_CERT_SUFFICIENT 256
#define FLAG_AUTH_CERT_REQUIRED 512
#define FLAG_AUTH_ADMIN 1024
typedef struct
{
int Flags;
int Port;
int ListenQueueLen;
char *DefaultUser;
char *DefaultGroup;
gid_t DefaultGroupID;
char *DefaultDir;
char *AdminUser;
int DirListFlags;
char *AllowUsers;
char *DenyUsers;
int AuthFlags;
char *AuthMethods;
char *AuthPath;
char *AuthRealm;
char *ConfigPath;
char *ScriptHashFile;
char *BindAddress;
char *HttpMethods;
char *IndexFiles;
char *M3UFileTypes;
char *AccessTokenKey;
char *ForbiddenURLStrings;
char *Timezone;
char *AddressSpace;
char *StackSize;
int DisplayNameLen;
unsigned long DocumentCacheTime;
ListNode *SSLKeys;
ListNode *VPaths;
ListNode *ScriptHandlers;
ListNode *LoginEntries;
ListNode *SanitizeArgumentsAllowedTags;
ListNode *CustomHeaders;
ListNode *HostConnections;
ListNode *UserAgents;
ListNode *Events;
ListNode *ProxyConfig;
char *PackFormats;
char *LogPath;
char *PidFilePath;
int MaxLogSize;
int MaxLogRotate;
int ActivityTimeout;
} TSettings;
extern TSettings Settings;
void InitSettings();
void PostProcessSettings(TSettings *Settings);
void ReadConfigFile(const char *Path);
void ParseConfigItem(const char *ConfigLine);
void ParseConfigItemList(const char *Settings);
void SettingsParseCommandLine(int argc, char *argv[], TSettings *Settings);
#endif