-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathwebserver.config.xml
executable file
·160 lines (158 loc) · 7.76 KB
/
webserver.config.xml
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?xml version="1.0" encoding="utf-8"?>
<!-- web server configuration file: this node can be child node, thus embedded in shared xml -->
<WebServer>
<!--which HTTP ip and port this server listens to. -->
<servers>
<!--
@param host, port: which ip port to listen to. if * it means all.
-->
<server host="*" port="8080">
<defaultHost rules_id="simple_rule"></defaultHost>
<virtualhosts>
<!-- force "http://127.0.0.1/" to match to iternal npl_code_wiki site for debugging -->
<host name="127.0.0.1:8099" rules_id="npl_code_wiki" allow='{"127.0.0.1"}'></host>
</virtualhosts>
</server>
</servers>
<!--rules used when starting a web server. Multiple rules with different id can be defined. -->
<rules id="simple_rule">
<!--URI map everything without extension to index.page-->
<rule match='{"^[^%./]*/$", "^[^%.]+$", "robots.txt"}' with="WebServer.redirecthandler" params='{"/index.page"}'></rule>
<!--npl server page example-->
<rule match="%.page$" with="WebServer.npl_page_handler" params='%CD%'></rule>
<!--filehandler example, base dir is where the root file directory is.
@param %CD%: means current file's directory,
@param nocache: when to add no cache headers on client side, turn this on only on dev server
-->
<rule match="^/?wp%-" with="WebServer.filehandler" params='{baseDir = "script/apps/WebServer/admin/", }'></rule>
<rule match="." with="WebServer.filehandler" params='{baseDir = "%CD%", }'></rule>
</rules>
<!--global NPL runtime config-->
<config>
<!--log level: FATAL, ERROR, WARN, INFO, DEBUG, TRACE -->
<string name='log_level'>DEBUG</string>
<string name='AccessLog'>log/access.log</string>
<number name='max_log_lines'>1000000</number>
<!--The default duration in seconds to cache a static document when no expiry date is specified.-->
<number name='CacheDefaultExpire'>240000</number>
<!--number of libcurl http thread count. For server who needs to send many http request, use a higher value like 10. -->
<number name='ServerCurlThreadCount'>20</number>
<!--queue size of the libcurl http request. default to 500. One can set to a smaller value, if one does not want to cache too many requests in the queue.
if request queue is full, System.os.GetUrl() will be ignored.
-->
<number name='ServerCurlThreadQueueSize'>50</number>
<!--HTTP server related-->
<table name='NPLRuntime'>
<!--whether to use compression for incoming connections. This must be true in order for CompressionLevel and CompressionThreshold to take effect-->
<bool name='compress_incoming'>true</bool>
<!---1, 0-9: Set the zlib compression level to use in case compresssion is enabled.
Compression level is an integer in the range of -1 to 9.
Lower compression levels result in faster execution, but less compression. Higher levels result in greater compression,
but slower execution. The zlib constant -1, provides a good compromise between compression and speed and is equivalent to level 6.-->
<number name='CompressionLevel'>-1</number>
<!--when the NPL message size is bigger than this number of bytes, we will use m_nCompressionLevel for compression.
For message smaller than the threshold, we will not compress even m_nCompressionLevel is not 0.-->
<number name='CompressionThreshold'>204800</number>
<!--if plain text http content is requested, we will compress it with gzip when its size is over this number of bytes.-->
<number name='HTTPCompressionThreshold'>12000</number>
<!--the default npl queue size for each npl thread. defaults to 500. may set to something like 5000 for busy servers-->
<number name='npl_queue_size'>20000</number>
<!--whether socket's SO_KEEPALIVE is enabled.-->
<bool name='TCPKeepAlive'>true</bool>
<!--enable application level keep alive. we will use a global idle timer to detect if a connection has been inactive for IdleTimeoutPeriod-->
<bool name='KeepAlive'>false</bool>
<!--Enable idle timeout. This is the application level timeout setting.-->
<bool name='IdleTimeout'>false</bool>
<!--how many milliseconds of inactivity to assume this connection should be timed out. if 0 it is never timed out.-->
<number name='IdleTimeoutPeriod'>1200000</number>
<!--queue size of pending socket acceptor-->
<number name='MaxPendingConnections'>1000</number>
<!--default to 1, set to 0 to silence some connection verbose log. -->
<number name='LogLevel'>0</number>
</table>
<!--garbage collection interval for memory. No need to change-->
<table name='gc'>
<number name='gc_interval'>20000</number>
<string name='gc_opt'>none</string>
<bool name='print_gc_info'>false</bool>
<!--automatic garbage collection parameters-->
<number name='gc_setpause'>90</number>
<number name='gc_setstepmul'>500</number>
</table>
</config>
<config>
<table name='default'>
<table name='wiki'>
<table name='secrets'>
<!--token secret for this website-->
<string name='TOKEN_SECRET'>ask_admin</string>
<!--OAuth 2.0-->
<string name='GITHUB_SECRET'>ask admin or webserver.config.xml.secret</string>
</table>
<table name='clientid'>
<string name='GITHUB_CLIENTID'>44ed8acc9b71e36f47d8</string>
</table>
<!--how many seconds to expire user token-->
<number name='token_expire'>3600000</number>
</table>
<table name="email">
<!--email server url-->
<string name='url'>smtp.exmail.qq.com</string>
<!--email username-->
<string name='username'>noreply@keepwork.com</string>
<!--email password-->
<string name='password'>ask_admin</string>
<!--email from-->
<string name='from'>noreply@keepwork.com</string>
</table>
<table name='data_source'>
<table name='inner_gitlab'>
<string name='token'>ask admin or webserver.config.xml.secret</string>
<string name='host'>git.keepwork.com</string>
</table>
</table>
</table>
<table name='qiankunew.com'>
<table name='wiki'>
<table name='secrets'>
<!--token secret for this website-->
<string name='TOKEN_SECRET'>ask admin or webserver.config.xml.secret</string>
<!--OAuth 2.0-->
<string name='GITHUB_SECRET'>ask admin or webserver.config.xml.secret</string>
</table>
<table name='clientid'>
<string name='GITHUB_CLIENTID'>60516ce6357ada9725df</string>
</table>
<!--how many seconds to expire user token-->
<number name='token_expire'>360000</number>
</table>
<table name='data_source'>
<table name='inner_gitlab'>
<string name='token'>ask admin or webserver.config.xml.secret</string>
<string name='host'>git.keepwork.com</string>
</table>
</table>
</table>
<table name='keepwork.com'>
<table name='wiki'>
<table name='secrets'>
<!--token secret for this website-->
<string name='TOKEN_SECRET'>ask_admin</string>
<!--OAuth 2.0-->
<string name='GITHUB_SECRET'>ask admin or webserver.config.xml.secret</string>
</table>
<table name='clientid'>
<string name='GITHUB_CLIENTID'>2219fe9cb6d105dd30fb</string>
</table>
<!--how many seconds to expire user token-->
<number name='token_expire'>360000</number>
</table>
<table name='data_source'>
<table name='inner_gitlab'>
<string name='token'>ask admin or webserver.config.xml.secret</string>
<string name='host'>git.keepwork.com</string>
</table>
</table>
</table>
</config>
</WebServer>