|
1 | 1 | <?php
|
| 2 | + |
2 | 3 | // @see ../../docs/USER_GUIDE.md for possible settings details
|
3 | 4 | use CrowdSecBouncer\Constants;
|
4 | 5 |
|
5 | 6 | $crowdSecStandaloneBouncerConfig = [
|
6 |
| - |
7 |
| - /** Select from 'api_key' and 'tls' |
| 7 | + /** Select from 'api_key' and 'tls'. |
8 | 8 | *
|
9 | 9 | * Choose if you want to use an API-KEY or a TLS (pki) authentification
|
10 | 10 | * TLS authentication is only available if you use CrowdSec agent with a version superior to 1.4.0
|
11 | 11 | */
|
12 | 12 | 'auth_type' => Constants::AUTH_KEY,
|
13 | 13 |
|
14 |
| - /** Absolute path to the bouncer certificate |
| 14 | + /** Absolute path to the bouncer certificate. |
15 | 15 | *
|
16 | 16 | * Only required if you choose tls as "auth_type"
|
17 | 17 | */
|
|
29 | 29 | * If "tls_verify_peer" is set to true, request handler verifies whether the certificate is authentic.
|
30 | 30 | * This trust is based on a chain of digital signatures,
|
31 | 31 | * rooted in certification authority (CA) certificates you supply using the "tls_ca_cert_path" setting below.
|
32 |
| - * |
33 | 32 | */
|
34 | 33 | 'tls_verify_peer' => true,
|
35 | 34 |
|
36 |
| - /** Absolute path to the CA used to process peer verification |
| 35 | + /** Absolute path to the CA used to process peer verification. |
37 | 36 | *
|
38 | 37 | * Only required if you choose tls as "auth_type" and "tls_verify_peer" is true
|
39 | 38 | */
|
|
43 | 42 | *
|
44 | 43 | * Key generated by the cscli (CrowdSec cli) command like "cscli bouncers add bouncer-php-library"
|
45 | 44 | * Only required if you choose api_key as "auth_type"
|
46 |
| - * |
47 | 45 | */
|
48 | 46 | 'api_key' => 'YOUR_BOUNCER_API_KEY',
|
49 | 47 |
|
50 | 48 | /** Define the URL to your LAPI server, default to http://localhost:8080.
|
51 | 49 | *
|
52 | 50 | * If you have installed the CrowdSec agent on your server, it should be "http://localhost:8080" or
|
53 | 51 | * "https://localhost:8080"
|
54 |
| - * |
55 | 52 | */
|
56 |
| - 'api_url'=> Constants::DEFAULT_LAPI_URL, |
| 53 | + 'api_url' => Constants::DEFAULT_LAPI_URL, |
57 | 54 |
|
58 | 55 | // In seconds. The timeout when calling LAPI. Must be greater or equal than 1. Defaults to 1 sec.
|
59 |
| - 'api_timeout'=> 1, |
| 56 | + 'api_timeout' => 1, |
60 | 57 |
|
61 | 58 | /**
|
62 | 59 | * By default, the lib call the REST LAPI using file_get_contents method (allow_url_fopen is required).
|
63 |
| - * Set 'use_curl' to true in order to use cURL request instead (curl is in then required) |
64 |
| - * |
| 60 | + * Set 'use_curl' to true in order to use cURL request instead (curl is in then required). |
65 | 61 | */
|
66 | 62 | 'use_curl' => false,
|
67 | 63 |
|
|
74 | 70 | *
|
75 | 71 | * Important note: be sur this path won't be publicly accessible
|
76 | 72 | */
|
77 |
| - 'log_directory_path' => __DIR__.'/.logs', |
| 73 | + 'log_directory_path' => __DIR__ . '/.logs', |
78 | 74 |
|
79 | 75 | // true to stop the process and display errors if any.
|
80 | 76 | 'display_errors' => false,
|
|
89 | 85 | *
|
90 | 86 | * If not empty, it will be used instead of the real forwarded ip.
|
91 | 87 | * If set to "no_forward", the x-forwarded-for mechanism will not be used at all.
|
92 |
| - * |
93 | 88 | */
|
94 | 89 | 'forced_test_forwarded_ip' => '',
|
95 | 90 |
|
|
107 | 102 | *
|
108 | 103 | * Handle unknown remediations as.
|
109 | 104 | */
|
110 |
| - 'fallback_remediation'=> Constants::REMEDIATION_CAPTCHA, |
| 105 | + 'fallback_remediation' => Constants::REMEDIATION_CAPTCHA, |
111 | 106 |
|
112 | 107 | /** Select from 'bypass' (minimum remediation),'captcha' or 'ban' (maximum remediation).
|
113 | 108 | * Default to 'ban'.
|
114 | 109 | *
|
115 | 110 | * Cap the remediation to the selected one.
|
116 | 111 | */
|
117 |
| - 'max_remediation_level'=> Constants::REMEDIATION_BAN, |
| 112 | + 'max_remediation_level' => Constants::REMEDIATION_BAN, |
118 | 113 |
|
119 | 114 | /** If you use a CDN, a reverse proxy or a load balancer, set an array of IPs.
|
120 | 115 | *
|
|
123 | 118 | 'trust_ip_forward_array' => [],
|
124 | 119 |
|
125 | 120 | /**
|
126 |
| - * array of URIs that will not be bounced |
| 121 | + * array of URIs that will not be bounced. |
127 | 122 | */
|
128 | 123 | 'excluded_uris' => ['/favicon.ico'],
|
129 | 124 |
|
130 | 125 | // Select from 'phpfs' (File system cache), 'redis' or 'memcached'.
|
131 | 126 | 'cache_system' => Constants::CACHE_SYSTEM_PHPFS,
|
132 | 127 |
|
133 |
| - /** Will be used only if you choose File system as cache_system |
| 128 | + /** Will be used only if you choose File system as cache_system. |
134 | 129 | *
|
135 | 130 | * Important note: be sur this path won't be publicly accessible
|
136 | 131 | */
|
137 |
| - 'fs_cache_path' => __DIR__.'/.cache', |
| 132 | + 'fs_cache_path' => __DIR__ . '/.cache', |
138 | 133 |
|
139 | 134 | // Will be used only if you choose Redis cache as cache_system
|
140 | 135 | 'redis_dsn' => 'redis://localhost:6379',
|
|
143 | 138 | 'memcached_dsn' => 'memcached://localhost:11211',
|
144 | 139 |
|
145 | 140 | // Set the duration we keep in cache the fact that an IP is clean. In seconds. Defaults to 5.
|
146 |
| - 'clean_ip_cache_duration'=> Constants::CACHE_EXPIRATION_FOR_CLEAN_IP, |
| 141 | + 'clean_ip_cache_duration' => Constants::CACHE_EXPIRATION_FOR_CLEAN_IP, |
147 | 142 |
|
148 | 143 | // Set the duration we keep in cache the fact that an IP is bad. In seconds. Defaults to 20.
|
149 |
| - 'bad_ip_cache_duration'=> Constants::CACHE_EXPIRATION_FOR_BAD_IP, |
| 144 | + 'bad_ip_cache_duration' => Constants::CACHE_EXPIRATION_FOR_BAD_IP, |
150 | 145 |
|
151 | 146 | // Set the duration we keep in cache the captcha flow variables for an IP. In seconds. Defaults to 86400.
|
152 |
| - 'captcha_cache_duration'=> Constants::CACHE_EXPIRATION_FOR_CAPTCHA, |
| 147 | + 'captcha_cache_duration' => Constants::CACHE_EXPIRATION_FOR_CAPTCHA, |
153 | 148 |
|
154 | 149 | // Set the duration we keep in cache a geolocation result for an IP . In seconds. Defaults to 86400.
|
155 |
| - 'geolocation_cache_duration'=> Constants::CACHE_EXPIRATION_FOR_GEO, |
| 150 | + 'geolocation_cache_duration' => Constants::CACHE_EXPIRATION_FOR_GEO, |
156 | 151 |
|
157 | 152 | /** true to enable stream mode, false to enable the live mode. Default to false.
|
158 | 153 | *
|
|
165 | 160 | * visitors. Besides, if your site has a lot of unique visitors at the same time, this will not influence the
|
166 | 161 | * traffic to the API of your CrowdSec instance.
|
167 | 162 | */
|
168 |
| - 'stream_mode'=> false, |
| 163 | + 'stream_mode' => false, |
169 | 164 |
|
170 | 165 | // Settings for geolocation remediation (i.e. country based remediation).
|
171 | 166 | 'geolocation' => [
|
|
187 | 182 | 'database_type' => Constants::MAXMIND_COUNTRY,
|
188 | 183 | // Absolute path to the MaxMind database (mmdb file).
|
189 | 184 | 'database_path' => '/some/path/GeoLite2-Country.mmdb',
|
190 |
| - ] |
| 185 | + ], |
191 | 186 | ],
|
192 | 187 |
|
193 |
| - //true to hide CrowdSec mentions on ban and captcha walls. |
| 188 | + // true to hide CrowdSec mentions on ban and captcha walls. |
194 | 189 | 'hide_mentions' => false,
|
195 | 190 |
|
196 | 191 | // Settings for ban and captcha walls
|
|
0 commit comments