-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathsource.apacheconf.js
More file actions
334 lines (332 loc) · 14.5 KB
/
source.apacheconf.js
File metadata and controls
334 lines (332 loc) · 14.5 KB
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/mrmlnc/vscode-apache>
// and licensed `mit`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: ['.apacheconf', '.vhost'],
names: ['apacheconf', 'aconf', 'apache'],
patterns: [
{
captures: {1: {name: 'punctuation.definition.comment.apacheconf'}},
match: '^(\\s)*(#).*$\\n?',
name: 'comment.line.hash.ini'
},
{
captures: {
1: {name: 'punctuation.definition.tag.apacheconf'},
2: {name: 'entity.tag.apacheconf'},
4: {name: 'string.value.apacheconf'},
5: {name: 'punctuation.definition.tag.apacheconf'}
},
match:
'(<)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost|Macro|If|Else|ElseIf)(\\s(.+?))?(>)'
},
{
captures: {
1: {name: 'punctuation.definition.tag.apacheconf'},
2: {name: 'entity.tag.apacheconf'},
3: {name: 'punctuation.definition.tag.apacheconf'}
},
match:
'(</)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost|Macro|If|Else|ElseIf)(>)'
},
{
captures: {
3: {name: 'string.regexp.apacheconf'},
4: {name: 'string.replacement.apacheconf'}
},
match: '(?<=(Rewrite(Rule|Cond)))\\s+(.+?)\\s+(.+?)($|\\s)'
},
{
captures: {
2: {name: 'entity.status.apacheconf'},
3: {name: 'string.regexp.apacheconf'},
5: {name: 'string.path.apacheconf'}
},
match:
'(?<=RedirectMatch)(\\s+(\\d\\d\\d|permanent|temp|seeother|gone))?\\s+(.+?)\\s+((.+?)($|\\s))?'
},
{
captures: {
2: {name: 'entity.status.apacheconf'},
3: {name: 'string.path.apacheconf'},
5: {name: 'string.path.apacheconf'}
},
match:
'(?<=Redirect)(\\s+(\\d\\d\\d|permanent|temp|seeother|gone))?\\s+(.+?)\\s+((.+?)($|\\s))?'
},
{
captures: {
1: {name: 'string.regexp.apacheconf'},
3: {name: 'string.path.apacheconf'}
},
match: '(?<=ScriptAliasMatch|AliasMatch)\\s+(.+?)\\s+((.+?)\\s)?'
},
{
captures: {
1: {name: 'string.path.apacheconf'},
3: {name: 'string.path.apacheconf'}
},
match:
'(?<=RedirectPermanent|RedirectTemp|ScriptAlias|Alias)\\s+(.+?)\\s+((.+?)($|\\s))?'
},
{
captures: {1: {name: 'keyword.core.apacheconf'}},
match:
'\\b(AcceptPathInfo|AccessFileName|AddDefaultCharset|AddOutputFilterByType|AllowEncodedSlashes|AllowOverride|AuthName|AuthType|CGIMapExtension|ContentDigest|DefaultType|Define|DocumentRoot|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|FileETag|ForceType|HostnameLookups|IdentityCheck|Include(Optional)?|KeepAlive|KeepAliveTimeout|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|LogLevel|MaxKeepAliveRequests|Mutex|NameVirtualHost|Options|Require|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScriptInterpreterSource|ServerAdmin|ServerAlias|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetHandler|SetInputFilter|SetOutputFilter|Time(O|o)ut|TraceEnable|UseCanonicalName|Use|ErrorLogFormat|GlobalLog|PHPIniDir|SSLHonorCipherOrder|SSLCompression|SSLUseStapling|SSLStapling\\w+|SSLCARevocationCheck|SSLSRPVerifierFile|SSLSessionTickets|RequestReadTimeout|ProxyHTML\\w+|MaxRanges)\\b'
},
{
captures: {1: {name: 'keyword.mpm.apacheconf'}},
match:
'\\b(AcceptMutex|AssignUserID|BS2000Account|ChildPerUserID|CoreDumpDirectory|EnableExceptionHook|Group|Listen|ListenBacklog|LockFile|MaxClients|MaxConnectionsPerChild|MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxRequestWorkers|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MinSpareServers|MinSpareThreads|NumServers|PidFile|ReceiveBufferSize|ScoreBoardFile|SendBufferSize|ServerLimit|StartServers|StartThreads|ThreadLimit|ThreadsPerChild|ThreadStackSize|User|Win32DisableAcceptEx)\\b'
},
{
captures: {1: {name: 'keyword.access.apacheconf'}},
match: '\\b(Allow|Deny|Order)\\b'
},
{
captures: {1: {name: 'keyword.actions.apacheconf'}},
match: '\\b(Action|Script)\\b'
},
{
captures: {1: {name: 'keyword.alias.apacheconf'}},
match:
'\\b(Alias|AliasMatch|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ScriptAlias|ScriptAliasMatch)\\b'
},
{
captures: {1: {name: 'keyword.auth.apacheconf'}},
match:
'\\b(AuthAuthoritative|AuthGroupFile|AuthUserFile|AuthBasicProvider|AuthBasicFake|AuthBasicAuthoritative|AuthBasicUseDigestAlgorithm)\\b'
},
{
captures: {1: {name: 'keyword.auth_anon.apacheconf'}},
match:
'\\b(Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail)\\b'
},
{
captures: {1: {name: 'keyword.auth_dbm.apacheconf'}},
match:
'\\b(AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile)\\b'
},
{
captures: {1: {name: 'keyword.auth_digest.apacheconf'}},
match:
'\\b(AuthDigestAlgorithm|AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize|AuthDigestProvider)\\b'
},
{
captures: {1: {name: 'keyword.auth_ldap.apacheconf'}},
match:
'\\b(AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl)\\b'
},
{
captures: {1: {name: 'keyword.autoindex.apacheconf'}},
match:
'\\b(AddAlt|AddAltByEncoding|AddAltByType|AddDescription|AddIcon|AddIconByEncoding|AddIconByType|DefaultIcon|HeaderName|IndexIgnore|IndexOptions|IndexOrderDefault|ReadmeName)\\b'
},
{
captures: {1: {name: 'keyword.filter.apacheconf'}},
match:
'\\b(BalancerMember|BalancerGrowth|BalancerPersist|BalancerInherit)\\b'
},
{
captures: {1: {name: 'keyword.cache.apacheconf'}},
match:
'\\b(CacheDefaultExpire|CacheDisable|CacheEnable|CacheForceCompletion|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire)\\b'
},
{
captures: {1: {name: 'keyword.cern_meta.apacheconf'}},
match: '\\b(MetaDir|MetaFiles|MetaSuffix)\\b'
},
{
captures: {1: {name: 'keyword.cgi.apacheconf'}},
match: '\\b(ScriptLog|ScriptLogBuffer|ScriptLogLength)\\b'
},
{
captures: {1: {name: 'keyword.cgid.apacheconf'}},
match: '\\b(ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock)\\b'
},
{
captures: {1: {name: 'keyword.charset_lite.apacheconf'}},
match: '\\b(CharsetDefault|CharsetOptions|CharsetSourceEnc)\\b'
},
{
captures: {1: {name: 'keyword.dav.apacheconf'}},
match: '\\b(Dav|DavDepthInfinity|DavMinTimeout|DavLockDB)\\b'
},
{
captures: {1: {name: 'keyword.deflate.apacheconf'}},
match:
'\\b(DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize)\\b'
},
{
captures: {1: {name: 'keyword.dir.apacheconf'}},
match: '\\b(DirectoryIndex|DirectorySlash|FallbackResource)\\b'
},
{
captures: {1: {name: 'keyword.disk_cache.apacheconf'}},
match:
'\\b(CacheDirLength|CacheDirLevels|CacheExpiryCheck|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheMaxFileSize|CacheMinFileSize|CacheRoot|CacheSize|CacheTimeMargin)\\b'
},
{
captures: {1: {name: 'keyword.dumpio.apacheconf'}},
match: '\\b(DumpIOInput|DumpIOOutput)\\b'
},
{
captures: {1: {name: 'keyword.env.apacheconf'}},
match: '\\b(PassEnv|SetEnv|UnsetEnv)\\b'
},
{
captures: {1: {name: 'keyword.expires.apacheconf'}},
match: '\\b(ExpiresActive|ExpiresByType|ExpiresDefault)\\b'
},
{
captures: {1: {name: 'keyword.ext_filter.apacheconf'}},
match: '\\b(ExtFilterDefine|ExtFilterOptions)\\b'
},
{
captures: {1: {name: 'keyword.file_cache.apacheconf'}},
match: '\\b(CacheFile|MMapFile)\\b'
},
{
captures: {1: {name: 'keyword.filter.apacheconf'}},
match:
'\\b(AddOutputFilterByType|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace)\\b'
},
{
captures: {1: {name: 'keyword.headers.apacheconf'}},
match: '\\b(Header|RequestHeader)\\b'
},
{
captures: {1: {name: 'keyword.imap.apacheconf'}},
match: '\\b(ImapBase|ImapDefault|ImapMenu)\\b'
},
{
captures: {1: {name: 'keyword.include.apacheconf'}},
match:
'\\b(SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|XBitHack)\\b'
},
{
captures: {1: {name: 'keyword.isapi.apacheconf'}},
match:
'\\b(ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer)\\b'
},
{
captures: {1: {name: 'keyword.ldap.apacheconf'}},
match:
'\\b(LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTrustedCA|LDAPTrustedCAType)\\b'
},
{
captures: {1: {name: 'keyword.log.apacheconf'}},
match:
'\\b(BufferedLogs|CookieLog|CustomLog|LogFormat|TransferLog|ForensicLog)\\b'
},
{
captures: {1: {name: 'keyword.mem_cache.apacheconf'}},
match:
'\\b(MCacheMaxObjectCount|MCacheMaxObjectSize|MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize)\\b'
},
{
captures: {1: {name: 'keyword.mime.apacheconf'}},
match:
'\\b(AddCharset|AddEncoding|AddHandler|AddInputFilter|AddLanguage|AddOutputFilter|AddType|DefaultLanguage|ModMimeUsePathInfo|MultiviewsMatch|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|TypesConfig)\\b'
},
{
captures: {1: {name: 'keyword.misc.apacheconf'}},
match:
'\\b(ProtocolEcho|Example|AddModuleInfo|MimeMagicFile|CheckSpelling|ExtendedStatus|SuexecUserGroup|UserDir)\\b'
},
{
captures: {1: {name: 'keyword.negotiation.apacheconf'}},
match:
'\\b(CacheNegotiatedDocs|ForceLanguagePriority|LanguagePriority)\\b'
},
{
captures: {1: {name: 'keyword.nw_ssl.apacheconf'}},
match: '\\b(NWSSLTrustedCerts|NWSSLUpgradeable|SecureListen)\\b'
},
{
captures: {1: {name: 'keyword.proxy.apacheconf'}},
match:
'\\b(AllowCONNECT|NoProxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyFtpDirCharset|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassMatch|ProxyPassReverse|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia)\\b'
},
{
captures: {1: {name: 'keyword.rewrite.apacheconf'}},
match:
'\\b(RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule)\\b'
},
{
captures: {1: {name: 'keyword.setenvif.apacheconf'}},
match: '\\b(BrowserMatch|BrowserMatchNoCase|SetEnvIf|SetEnvIfNoCase)\\b'
},
{
captures: {1: {name: 'keyword.so.apacheconf'}},
match: '\\b(LoadFile|LoadModule)\\b'
},
{
captures: {1: {name: 'keyword.ssl.apacheconf'}},
match:
'\\b(SSLCACertificateFile|SSLCACertificatePath|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth|SSLInsecureRenegotiation|SSLOpenSSLConfCmd)\\b'
},
{
captures: {1: {name: 'keyword.substitute.apacheconf'}},
match:
'\\b(Substitute|SubstituteInheritBefore|SubstituteMaxLineLength)\\b'
},
{
captures: {1: {name: 'keyword.usertrack.apacheconf'}},
match:
'\\b(CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking)\\b'
},
{
captures: {1: {name: 'keyword.vhost_alias.apacheconf'}},
match:
'\\b(VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP)\\b'
},
{
captures: {
1: {name: 'keyword.php.apacheconf'},
3: {name: 'entity.property.apacheconf'},
5: {name: 'string.value.apacheconf'}
},
match:
'\\b(php_value|php_flag|php_admin_value|php_admin_flag)\\b(\\s+(.+?)(\\s+(".+?"|.+?))?)?\\s'
},
{
captures: {
1: {name: 'punctuation.variable.apacheconf'},
3: {name: 'variable.env.apacheconf'},
4: {name: 'variable.misc.apacheconf'},
5: {name: 'punctuation.variable.apacheconf'}
},
match:
'(%\\{)((HTTP_USER_AGENT|HTTP_REFERER|HTTP_COOKIE|HTTP_FORWARDED|HTTP_HOST|HTTP_PROXY_CONNECTION|HTTP_ACCEPT|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|REMOTE_USER|REMOTE_IDENT|REQUEST_METHOD|SCRIPT_FILENAME|PATH_INFO|QUERY_STRING|AUTH_TYPE|DOCUMENT_ROOT|SERVER_ADMIN|SERVER_NAME|SERVER_ADDR|SERVER_PORT|SERVER_PROTOCOL|SERVER_SOFTWARE|TIME_YEAR|TIME_MON|TIME_DAY|TIME_HOUR|TIME_MIN|TIME_SEC|TIME_WDAY|TIME|API_VERSION|THE_REQUEST|REQUEST_URI|REQUEST_FILENAME|IS_SUBREQ|HTTPS)|(.*?))(\\})'
},
{
captures: {1: {name: 'entity.mime-type.apacheconf'}},
match: '\\b((text|image|application|video|audio)/.+?)\\s'
},
{
captures: {1: {name: 'entity.helper.apacheconf'}},
match: '\\b(?i)(export|from|unset|set|on|off)\\b'
},
{
captures: {1: {name: 'constant.integer.apacheconf'}},
match: '\\b(\\d+)\\b'
},
{
captures: {
1: {name: 'punctuation.definition.flag.apacheconf'},
2: {name: 'string.flag.apacheconf'},
3: {name: 'punctuation.definition.flag.apacheconf'}
},
match: '\\s(\\[)(.*?)(\\])\\s'
}
],
scopeName: 'source.apacheconf'
}
export default grammar