-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.php
More file actions
395 lines (353 loc) · 14.6 KB
/
config.php
File metadata and controls
395 lines (353 loc) · 14.6 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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
<?php
declare(strict_types=1);
return [
/*
|--------------------------------------------------------------------------
| Servers
|--------------------------------------------------------------------------
|
| The available Expose servers that your client can connect to.
| When sharing sites or TCP ports, you can specify the server
| that should be used using the `--server=` option.
|
*/
'servers' => [
'main' => [
'host' => env('SERVER_HOST', 'sharedwithexpose.com'),
'port' => env('SERVER_PORT', 443),
],
],
/*
|--------------------------------------------------------------------------
| Server Endpoint
|--------------------------------------------------------------------------
|
| When you specify a server that does not exist in above static array,
| Expose will perform a GET request to this URL and tries to retrieve
| a JSON payload that looks like the configurations servers array.
|
| Expose then tries to load the configuration for the given server
| if available.
|
*/
'server_endpoint' => env('SERVERS_ENDPOINT', 'https://expose.dev/api/servers'),
/*
|--------------------------------------------------------------------------
| Default Server
|--------------------------------------------------------------------------
|
| The default server from the servers array,
| or the servers endpoint above.
|
*/
'default_server' => 'main',
/*
|--------------------------------------------------------------------------
| DNS
|--------------------------------------------------------------------------
|
| The DNS server to use when resolving the shared URLs.
| When Expose is running from within Docker containers, you should set this to
| `true` to fall-back to the system default DNS servers.
|
*/
'dns' => env('DNS_SERVER', true) ?: true,
/*
|--------------------------------------------------------------------------
| Auth Token
|--------------------------------------------------------------------------
|
| The global authentication token to use for the expose server that you
| are connecting to. You can let expose automatically update this value
| for you by running
|
| > expose token YOUR-AUTH-TOKEN
|
*/
'auth_token' => env('AUTH_TOKEN', ''),
/*
|--------------------------------------------------------------------------
| Default Domain
|--------------------------------------------------------------------------
|
| The custom domain to use when sharing sites with Expose.
| You can register your own custom domain using Expose Pro
| Learn more at: https://expose.dev/get-pro
|
| > expose default-domain YOUR-CUSTOM-WHITELABEL-DOMAIN
|
*/
'default_domain' => env('DEFAULT_DOMAIN'),
/*
|--------------------------------------------------------------------------
| Default TLD
|--------------------------------------------------------------------------
|
| The default TLD to use when sharing your local sites. Expose will try
| to look up the TLD if you are using Laravel Valet automatically.
| Otherwise you can specify it here manually.
|
*/
'default_tld' => 'test',
/*
|--------------------------------------------------------------------------
| Default HTTPS
|--------------------------------------------------------------------------
|
| Whether to use HTTPS as a default when sharing your local sites. Expose
| will try to look up the protocol if you are using Laravel Valet
| automatically. Otherwise you can specify it here manually.
|
*/
'default_https' => false,
/*
|--------------------------------------------------------------------------
| Maximum Logged Requests
|--------------------------------------------------------------------------
|
| The maximum number if requests to keep in memory when inspecting your
| requests and responses in the local dashboard.
|
*/
'max_logged_requests' => 25,
/*
|--------------------------------------------------------------------------
| Maximum Allowed Memory
|--------------------------------------------------------------------------
|
| The maximum memory allocated to the expose process.
|
*/
'memory_limit' => env('MEMORY_LIMIT', '128M'),
/*
|--------------------------------------------------------------------------
| Skip Response Logging
|--------------------------------------------------------------------------
|
| Sometimes, some responses don't need to be logged. Some are too big,
| some can't be read (like compiled assets). This configuration allows you
| to be as granular as you wish when logging the responses.
|
| If you run constantly out of memory, you probably need to set some of these up.
|
| Keep in mind, by default, BINARY requests/responses are not logged.
| You do not need to add video/mp4 for example to this list.
|
*/
'skip_body_log' => [
/**
* | Skip response logging by HTTP response code. Format: 4*, 5*.
*/
'status' => [
// "4*"
],
/**
* | Skip response logging by HTTP response content type. Ex: "text/css".
*/
'content_type' => [
//
],
/**
* | Skip response logging by file extension. Ex: ".js.map", ".min.js", ".min.css".
*/
'extension' => [
'.js.map',
'.css.map',
],
/**
* | Skip response logging if response size is greater than configured value.
* | Valid suffixes are: B, KB, MB, GB.
* | Ex: 500B, 1KB, 2MB, 3GB.
*/
'size' => '1MB',
],
'admin' => [
/*
|--------------------------------------------------------------------------
| Database
|--------------------------------------------------------------------------
|
| The SQLite database that your expose server should use. This database
| will hold all users that are able to authenticate with your server,
| if you enable authentication token validation.
|
*/
'database' => implode(DIRECTORY_SEPARATOR, [
$_SERVER['HOME'] ?? __DIR__,
'.expose',
'expose.db',
]),
/*
|--------------------------------------------------------------------------
| Validate auth tokens
|--------------------------------------------------------------------------
|
| By default, once you start an expose server, anyone is able to connect to
| it, given that they know the server host. If you want to only allow the
| connection from users that have valid authentication tokens, set this
| setting to true. You can also modify this at runtime in the server
| admin interface.
|
*/
'validate_auth_tokens' => false,
/*
|--------------------------------------------------------------------------
| TCP Port Sharing
|--------------------------------------------------------------------------
|
| Control if you want to allow users to share TCP ports with your Expose
| server. You can add fine-grained control per authentication token,
| but if you want to disable TCP port sharing in general, set this
| value to false.
|
*/
'allow_tcp_port_sharing' => true,
/*
|--------------------------------------------------------------------------
| TCP Port Range
|--------------------------------------------------------------------------
|
| Expose allows you to also share TCP ports, for example when sharing your
| local SSH server with the public. This setting allows you to define the
| port range that Expose will use to assign new ports to the users.
|
| Note: Do not use port ranges below 1024, as it might require root
| privileges to assign these ports.
|
*/
'tcp_port_range' => [
'from' => 50000,
'to' => 60000,
],
/*
|--------------------------------------------------------------------------
| Maximum connection length
|--------------------------------------------------------------------------
|
| If you want to limit the amount of time that a single connection can
| stay connected to the expose server, you can specify the maximum
| connection length in minutes here. A maximum length of 0 means that
| clients can stay connected as long as they want.
|
*/
'maximum_connection_length' => 0,
/*
|--------------------------------------------------------------------------
| Maximum number of open connections
|--------------------------------------------------------------------------
|
| You can limit the amount of connections that one client/user can have
| open. A maximum connection count of 0 means that clients can open
| as many connections as they want.
|
| When creating users with the API/admin interface, you can
| override this setting per user.
|
*/
'maximum_open_connections_per_user' => 0,
/*
|--------------------------------------------------------------------------
| Subdomain
|--------------------------------------------------------------------------
|
| This is the subdomain that your expose admin dashboard will be available at.
| The given subdomain will be reserved, so no other tunnel connection can
| request this subdomain for their own connection.
|
*/
'subdomain' => env('SUBDOMAIN', 'expose'),
/*
|--------------------------------------------------------------------------
| Reserved Subdomain
|--------------------------------------------------------------------------
|
| Specify any subdomains that you don't want to be able to register
| on your expose server.
|
*/
'reserved_subdomains' => [],
/*
|--------------------------------------------------------------------------
| Subdomain Generator
|--------------------------------------------------------------------------
|
| This is the subdomain generator that will be used, when no specific
| subdomain was provided. The default implementation simply generates
| a random string for you. Feel free to change this.
|
*/
'subdomain_generator' => \App\Server\SubdomainGenerator\RandomSubdomainGenerator::class,
/*
|--------------------------------------------------------------------------
| Connection Callback
|--------------------------------------------------------------------------
|
| This is a callback method that will be called when a new connection is
| established.
| The \App\Client\Callbacks\WebHookConnectionCallback::class is included out of the box.
|
*/
'connection_callback' => null,
'connection_callbacks' => [
'webhook' => [
'url' => null,
'secret' => null,
],
],
/*
|--------------------------------------------------------------------------
| Users
|--------------------------------------------------------------------------
|
| The admin dashboard of expose is protected via HTTP basic authentication
| Here you may add the user/password combinations that you want to
| accept as valid logins for the dashboard.
|
*/
'users' => [
'username' => 'password',
],
/*
|--------------------------------------------------------------------------
| User Repository
|--------------------------------------------------------------------------
|
| This is the user repository, which by default loads and saves all authorized
| users in a SQLite database. You can implement your own user repository
| if you want to store your users in a different store (Redis, MySQL, etc.)
|
*/
'user_repository' => \App\Server\UserRepository\DatabaseUserRepository::class,
'subdomain_repository' => \App\Server\SubdomainRepository\DatabaseSubdomainRepository::class,
'logger_repository' => \App\Server\LoggerRepository\NullLogger::class,
/*
|--------------------------------------------------------------------------
| Messages
|--------------------------------------------------------------------------
|
| The default messages that the expose server will send the clients.
| These settings can also be changed at runtime in the expose admin
| interface.
|
*/
'messages' => [
'resolve_connection_message' => function ($connectionInfo, $user) {
return config('expose.admin.messages.message_of_the_day');
},
'message_of_the_day' => 'Thank you for using expose.',
'invalid_auth_token' => 'Authentication failed. Please check your authentication token and try again.',
'subdomain_taken' => 'The chosen subdomain :subdomain is already taken. Please choose a different subdomain.',
'subdomain_reserved' => 'The chosen subdomain :subdomain is not available. Please choose a different subdomain.',
'custom_subdomain_unauthorized' => 'You are not allowed to specify custom subdomains. Please upgrade to Expose Pro. Assigning a random subdomain instead.',
'custom_domain_unauthorized' => 'You are not allowed to use this custom domain.',
'tcp_port_sharing_unauthorized' => 'You are not allowed to share TCP ports. Please upgrade to Expose Pro.',
'no_free_tcp_port_available' => 'There are no free TCP ports available on this server. Please try again later.',
'tcp_port_sharing_disabled' => 'TCP port sharing is not available on this Expose server.',
],
'statistics' => [
'enable_statistics' => true,
'interval_in_seconds' => 3600,
'repository' => \App\Server\StatisticsRepository\DatabaseStatisticsRepository::class,
],
],
];