Repository navigation
Expand file tree
/
Copy pathconfig.dist.php
More file actions
171 lines (167 loc) · 10.6 KB
/
Copy pathconfig.dist.php
File metadata and controls
171 lines (167 loc) · 10.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
<?php // @formatter:off
/**
* This file is part of the phpCacheAdmin.
* Copyright (c) Róbert Kelčák (https://kelcak.com/)
*/
declare(strict_types=1);
/*
* Do not edit this file but copy it to config.php.
*/
return [
/**
* Enabled dashboards and their order. The first item is the default dashboard.
*/
'dashboards' => [
RobiNN\Pca\Dashboards\Server\ServerDashboard::class,
RobiNN\Pca\Dashboards\Redis\RedisDashboard::class,
RobiNN\Pca\Dashboards\Memcached\MemcachedDashboard::class,
RobiNN\Pca\Dashboards\OPCache\OPCacheDashboard::class,
RobiNN\Pca\Dashboards\APCu\APCuDashboard::class,
RobiNN\Pca\Dashboards\Realpath\RealpathDashboard::class,
],
'redisoptions' => [
//'client' => 'predis', // redis or predis. Auto-detected when not set.
//'blockedcommands' => ['CONFIG SET', 'CONFIG REWRITE', 'REPLICAOF', 'SLAVEOF', 'MIGRATE', 'RESTORE', 'SAVE'], // Extra commands to refuse in the console.
'pubsubrefresh' => 5, // In seconds, refresh interval for the Pub/Sub active channels list - default 5
'pubsubwindow' => 5, // In seconds, how long one Pub/Sub monitor request captures messages (1-10) - default 5
'scanthreshold' => 100_000, // Use SCAN automatically instead of KEYS when the database has more keys than this, 1000 keys are retrieved - default 100_000
//'scansize' => 1000, // Always use SCAN and retrieve at most this many keys, regardless of 'scanthreshold' (optional).
],
'redis' => [
[
'name' => 'Localhost', // The server name (optional).
'host' => '127.0.0.1', // Optional when a path or nodes is specified.
/*'nodes' => [
// List of cluster nodes.
'127.0.0.1:7000',
'127.0.0.1:7001',
'127.0.0.1:7002',
],*/
'port' => 6379, // Optional when the default port is used.
/*'sentinels' => [
// List of Sentinels. The current master is looked up on every request, so failover is picked up on the next page load.
'127.0.0.1:26379',
'127.0.0.1:26380',
'127.0.0.1:26381',
],*/
//'sentinelmaster' => 'mymaster', // Name of the monitored master (optional). Default mymaster.
//'sentinelpassword' => '', // Password of the Sentinels themselves, not of the master (optional).
//'scheme' => 'tls', // Connection scheme (optional).
/*'ssl' => [
// SSL options for TLS https://www.php.net/manual/en/context.ssl.php - requires Redis >= 6.0 (optional).
'cafile' => 'private.pem',
'verify_peer' => true,
],*/
//'database' => 0, // Default database (optional).
//'username' => '', // ACL - requires Redis >= 6.0 (optional).
//'password' => '', // Optional.
//'authfile' => '/run/secrets/file_name', // File with a password, e.g., Docker secrets (optional).
//'path' => '/var/run/redis/redis-server.sock', // Unix domain socket (optional).
//'databases' => 16, // Number of databases, use this if the CONFIG command is disabled (optional).
//'separator' => ':', // Separator for tree view (optional).
//'readonly' => true, // Block all destructive actions only on this server (optional).
//'color' => 'red', // Mark the server, e.g. production: red, orange, amber, green, teal, blue, violet, pink, gray or a #hex code (optional).
],
],
'memcachedoptions' => [
//'blockedcommands' => ['flush_all', 'stats reset'], // Extra commands to refuse in the console, the case does not matter.
],
'memcached' => [
[
'name' => 'Localhost', // The server name, optional.
'host' => '127.0.0.1', // Optional when a path is specified.
'port' => 11211, // Optional when the default port is used.
//'path' => '/var/run/memcached/memcached.sock', // Unix domain socket (optional).
//'separator' => ':', // Separator for tree view (optional).
//'extension' => true, // Enable Memcached extension only for get and set operations (optional).
//'readonly' => true, // Block all destructive actions only on this server (optional).
//'color' => 'red', // Mark the server, e.g. production: red, orange, amber, green, teal, blue, violet, pink, gray or a #hex code (optional).
],
],
'apcu' => [
'separator' => ':', // Separator for tree view (optional).
],
'opcache' => [
//'warmuppaths' => ['/var/www'], // Directories the warmup may compile from. Defaults to the document root.
],
'remoteservers' => [
// Other PHP servers whose OPcache, APCu and Realpath cache to monitor (read-only), each one runs pca-remote.php.
/*[
'name' => 'Web 2', // The server name (optional).
'url' => 'https://web2.example.com/pca-remote.php',
'token' => '', // The same token as in pca-remote.php on that server.
//'timeout' => 3, // In seconds (optional). Default 3.
//'ssl' => ['cafile' => 'ca.pem', 'verify_peer' => true], // SSL options https://www.php.net/manual/en/context.ssl.php (optional).
],*/
],
// Access
//'readonly' => true, // Block all destructive actions (deleting, editing, consoles, ...) - default false.
'console' => true, // Remove the consoles - default true.
'authusers' => [
// Auth is enabled when at least one user is defined. Passwords can be `password_hash()` hashes.
//'admin' => 'your-password',
],
//'settings' => true, // Show the settings modal (servers and options), saved to 'settingsfile' and loaded over this file. With auth enabled only logged-in users can save - default false.
//'settingsfile' => __DIR__.'/tmp/settings.php', // Where the settings modal saves, it can contain passwords - default tmpdir/settings.php.
'authwarning' => true, // Show a notice when no user is defined in 'authusers', it can also set the first one. Closing it hides the notice for a month - default true.
// Security
//'authtoken' => '', // Token for the metrics cronjob, only used when auth is enabled. Generate a long random one, e.g. `php -r "echo bin2hex(random_bytes(32));"`.
'securityheaders' => true, // Send CSP, X-Frame-Options, X-Content-Type-Options and Referrer-Policy - default true.
//'auditlog' => __DIR__.'/tmp/audit.log', // Log every requested change (deletes, edits, imports, flushes, console commands, settings...) as one JSON line, with the user and IP. Keep it out of the web root - default off.
//'allowedhosts' => ['127.0.0.1', 'localhost'], // Refuse requests with any other Host or Origin (port is ignored). Recommended without auth, it protects against DNS rebinding - default [] (any host).
// Decoding / Encoding functions
'converters' => [
'gzcompress' => [
'view' => static fn (string $value): ?string => @gzuncompress($value) !== false ? gzuncompress($value) : null,
'save' => static fn (string $value): string => gzcompress($value),
],
'gzencode' => [
'view' => static fn (string $value): ?string => @gzdecode($value) !== false ? gzdecode($value) : null,
'save' => static fn (string $value): string => gzencode($value),
],
'gzdeflate' => [
'view' => static fn (string $value): ?string => @gzinflate($value) !== false ? gzinflate($value) : null,
'save' => static fn (string $value): string => gzdeflate($value),
],
'zlib' => [
'view' => static fn (string $value): ?string => @zlib_decode($value) !== false ? zlib_decode($value) : null,
'save' => static fn (string $value): string => zlib_encode($value, ZLIB_ENCODING_DEFLATE),
],
/*'gz_magento' => [
'view' => static function (string $value): ?string {
$prefix = ':gz:';
$value = str_starts_with($value, $prefix) ? substr($value, strlen($prefix)) : $value;
return @gzuncompress($value) !== false ? gzuncompress($value) : null;
},
'save' => static fn (string $value): string => ':gz:'.gzcompress($value),
],*/
],
// Formatting functions, it runs after decoding
'formatters' => [
'unserialize' => RobiNN\Pca\Value::unserialize(...), // Arrays and objects, no class is created.
// igbinary and msgpack create the classes of the objects they hold, enable them only for values you trust.
/*'igbinary' => static fn (string $value): ?string => function_exists('igbinary_unserialize') && str_starts_with($value, "\x00\x00\x00\x02")
? RobiNN\Pca\Value::json(@igbinary_unserialize($value)) : null,
'msgpack' => static fn (string $value): ?string => function_exists('msgpack_unpack') && preg_match('/^[\x80-\x9f\xdc-\xdf]/', $value) === 1
? RobiNN\Pca\Value::json(@msgpack_unpack($value)) : null,*/
],
// Customizations
//'timezone' => 'Europe/Bratislava', // Leave empty (or commented out) to get it automatically obtained.
'timeformat' => 'd. m. Y H:i:s',
'decimalsep' => ',',
'thousandssep' => ' ',
'listview' => 'table', // table/tree/namespaces - default key list view, namespaces in Redis, Memcached and APCu
'keymodal' => false, // Open the key view in a modal instead of a separate page - default false
'sortthreshold' => 100_000, // Above this many keys a column sort only orders the page on screen, sorting them all would need too much memory. 0 disables the limit - default 100_000
'panelrefresh' => 30, // In seconds, refresh interval for panels - default 30
'metricsrefresh' => 60, // In seconds, refresh interval for metrics - default 60
'metricstab' => '1d', // Default tab in metrics, 1h - Last hour, 1d - Last day, 1w - Last week, 1m - Last month - default 1d
'liverefresh' => 2, // In seconds, sampling interval for the live mode toggle in metrics (1-60) - default 2
'metricsmaxage' => 30, // In days, how long the collected metrics are kept. 0 keeps everything - default 30
'hash' => 'pca', // Any random string to secure a metrics DB file.
'tmpdir' => __DIR__.'/tmp', // Directory for temporary files.
'metricsdir' => __DIR__.'/tmp/metrics', // Directory for metrics DB files.
'twigcache' => __DIR__.'/tmp/twig', // Directory for Twig cache files.
//'pcapath' => 'vendor/robinn/phpcacheadmin/', // Path to the package when installed via composer. Used for assets.
//'url' => '/', // URL to the dashboard when installed via composer, e.g., /phpcacheadmin
];