@@ -219,7 +219,7 @@ Finally, run
219219
220220
221221``` bash
222- ddev exec BOUNCER_KEY=your-bouncer-key AGENT_TLS_PATH=/var/www/html/cfssl LAPI_URL=http ://crowdsec:8080
222+ ddev exec BOUNCER_KEY=your-bouncer-key AGENT_TLS_PATH=/var/www/html/cfssl LAPI_URL=https ://crowdsec:8080
223223MEMCACHED_DSN=memcached://memcached:11211 REDIS_DSN=redis://redis:6379 /usr/bin/php ./my-own-modules/crowdsec-php-lib/vendor/bin/phpunit --testdox --colors --exclude-group ignore ./my-own-modules/crowdsec-php-lib/tests/Integration/IpVerificationTest.php
224224```
225225
@@ -230,14 +230,14 @@ and`GeoLite2-Country.mmdb`. You can download these databases by creating a maxmi
230230Then, you can run:
231231
232232``` bash
233- ddev exec BOUNCER_KEY=your-bouncer-key AGENT_TLS_PATH=/var/www/html/cfssl LAPI_URL=http ://crowdsec:8080
233+ ddev exec BOUNCER_KEY=your-bouncer-key AGENT_TLS_PATH=/var/www/html/cfssl LAPI_URL=https ://crowdsec:8080
234234/usr/bin/php ./my-own-modules/crowdsec-php-lib/vendor/bin/phpunit --testdox --colors --exclude-group ignore ./my-own-modules/crowdsec-php-lib/tests/Integration/GeolocationTest.php
235235```
236236
237237** N.B** : If you want to test with ` curl ` instead of ` file_get_contents ` calls to LAPI, you have to add ` USE_CURL=1 ` in
238238the previous commands.
239239
240- ** N.B** : If you want to test with ` tls ` authentification, you have to add ` BOUNCER_TLS_PATH ` environment varibale
240+ ** N.B** : If you want to test with ` tls ` authentification, you have to add ` BOUNCER_TLS_PATH ` environment variable
241241and specify the path where you store certificates and keys. For example:
242242
243243``` bash
@@ -386,7 +386,7 @@ ddev xdebug
386386
387387To generate a html report, you can run:
388388``` bash
389- ddev exec XDEBUG_MODE=coverage BOUNCER_KEY=your-bouncer-key LAPI_URL=http ://crowdsec:8080
389+ ddev exec XDEBUG_MODE=coverage BOUNCER_KEY=your-bouncer-key LAPI_URL=https ://crowdsec:8080
390390MEMCACHED_DSN=memcached://memcached:11211 REDIS_DSN=redis://redis:6379 /usr/bin/php ./my-own-modules/crowdsec-php-lib/tools/coding-standards/vendor/bin/phpunit --configuration ./my-own-modules/crowdsec-php-lib/tools/coding-standards/phpunit/phpunit.xml
391391
392392```
@@ -397,7 +397,7 @@ You should find the main report file `dashboard.html` in `tools/coding-standards
397397If you want to generate a text report in the same folder:
398398
399399``` bash
400- ddev exec XDEBUG_MODE=coverage BOUNCER_KEY=your-bouncer-key LAPI_URL=http ://crowdsec:8080
400+ ddev exec XDEBUG_MODE=coverage BOUNCER_KEY=your-bouncer-key LAPI_URL=https ://crowdsec:8080
401401MEMCACHED_DSN=memcached://memcached:11211 REDIS_DSN=redis://redis:6379 /usr/bin/php ./my-own-modules/crowdsec-php-lib/tools/coding-standards/vendor/bin/phpunit --configuration ./my-own-modules/crowdsec-php-lib/tools/coding-standards/phpunit/phpunit.xml --coverage-text=./my-own-modules/crowdsec-php-lib/tools/coding-standards/phpunit/code-coverage/report.txt
402402```
403403
@@ -519,7 +519,7 @@ Let's add the `max_remediation_level` configuration with `captcha` value:
519519``` php
520520$configs = [
521521 'api_key' => $bouncerKey,
522- 'api_url' => 'http ://crowdsec:8080',
522+ 'api_url' => 'https ://crowdsec:8080',
523523 'fs_cache_path' => __DIR__ . '/.cache'
524524 'max_remediation_level' => 'captcha' // <== ADD THIS LINE
525525 ];
@@ -543,7 +543,7 @@ Replace:
543543``` php
544544$configs = [
545545 'api_key' => $bouncerKey,
546- 'api_url' => 'http ://crowdsec:8080',
546+ 'api_url' => 'https ://crowdsec:8080',
547547 'fs_cache_path' => __DIR__ . '/.cache',
548548];
549549```
@@ -553,7 +553,7 @@ with:
553553``` php
554554$configs = [
555555 'api_key' => $bouncerKey,
556- 'api_url' => 'http ://crowdsec:8080',
556+ 'api_url' => 'https ://crowdsec:8080',
557557 'cache_system' => 'redis',
558558 'redis_dsn' => 'redis://redis:6379'
559559];
@@ -564,7 +564,7 @@ Or, if `Memcached` is more adapted than `Redis` to your needs:
564564``` php
565565$configs = [
566566 'api_key' => $bouncerKey,
567- 'api_url' => 'http ://crowdsec:8080',
567+ 'api_url' => 'https ://crowdsec:8080',
568568 'cache_system' => 'memcached',
569569 'memcached_dsn' => 'memcached://memcached:11211'
570570];
@@ -610,7 +610,7 @@ Try with the `full-example-live-mode.php` file:
610610
611611
612612` ` ` bash
613- ddev exec php my-own-modules/crowdsec-php-lib/scripts/full-example-live-mode.php < YOUR_BOUNCER_KEY> 1.2.3.4 http ://crowdsec:8080
613+ ddev exec php my-own-modules/crowdsec-php-lib/scripts/full-example-live-mode.php < YOUR_BOUNCER_KEY> 1.2.3.4 https ://crowdsec:8080
614614` ` `
615615
616616# ### Simulate LAPI down by using a bad url
@@ -619,7 +619,7 @@ If you run this script twice, LAPI will not be called, the cache system will rel
619619You can this behaviour by testing with a bad LAPI url.
620620
621621` ` ` bash
622- ddev exec php my-own-modules/crowdsec-php-lib/scripts/full-example-live-mode.php < YOUR_BOUNCER_KEY> 1.2.3.4 http ://crowdsec:BAD
622+ ddev exec php my-own-modules/crowdsec-php-lib/scripts/full-example-live-mode.php < YOUR_BOUNCER_KEY> 1.2.3.4 https ://crowdsec:BAD
623623` ` `
624624
625625As you can see, you can check the API event if LAPI is down. This is because of the caching system.
@@ -641,7 +641,7 @@ ddev exec php my-own-modules/crowdsec-php-lib/scripts/clear-cache.php <YOUR_BOUN
641641One more time, get the remediation for the IP " 1.2.3.4" :
642642
643643` ` ` bash
644- ddev exec php my-own-modules/crowdsec-php-lib/scripts/full-example-live-mode.php < YOUR_BOUNCER_KEY> 1.2.3.4 http ://crowdsec:8080
644+ ddev exec php my-own-modules/crowdsec-php-lib/scripts/full-example-live-mode.php < YOUR_BOUNCER_KEY> 1.2.3.4 https ://crowdsec:8080
645645` ` `
646646
647647This is a ban (and cache miss) as you can see in your terminal logs.
@@ -652,7 +652,7 @@ This is a ban (and cache miss) as you can see in your terminal logs.
652652This library interacts with a CrowdSec agent that you have installed on an accessible server.
653653
654654The easiest way to interact with the local API (LAPI) is to use the ` cscli` tool,but it is also possible to contact it
655- through a certain URL (e.g. ` http ://crowdsec:8080` ).
655+ through a certain URL (e.g. ` https ://crowdsec:8080` ).
656656
657657# ## Use the CrowdSec cli (`cscli`)
658658
@@ -739,10 +739,10 @@ Then, you should use some `curl` calls to contact the LAPI.
739739For example, you can get the list of decisions with commands like:
740740
741741` ` ` bash
742- curl -H " X-Api-Key: <YOUR_BOUNCER_KEY>" http ://crowdsec:8080/v1/decisions | jq
743- curl -H " X-Api-Key: <YOUR_BOUNCER_KEY>" http ://crowdsec:8080/v1/decisions? ip=1.2.3.4 | jq
744- curl -H " X-Api-Key: <YOUR_BOUNCER_KEY>" http ://crowdsec:8080/v1/decisions/stream? startup=true | jq
745- curl -H " X-Api-Key: <YOUR_BOUNCER_KEY>" http ://crowdsec:8080/v1/decisions/stream | jq
742+ curl -H " X-Api-Key: <YOUR_BOUNCER_KEY>" https ://crowdsec:8080/v1/decisions | jq
743+ curl -H " X-Api-Key: <YOUR_BOUNCER_KEY>" https ://crowdsec:8080/v1/decisions? ip=1.2.3.4 | jq
744+ curl -H " X-Api-Key: <YOUR_BOUNCER_KEY>" https ://crowdsec:8080/v1/decisions/stream? startup=true | jq
745+ curl -H " X-Api-Key: <YOUR_BOUNCER_KEY>" https ://crowdsec:8080/v1/decisions/stream | jq
746746` ` `
747747
748748# # Commit message
0 commit comments