Skip to content

Commit 055323f

Browse files
docs(*): Change http to https [skip ci]
1 parent 6eba74f commit 055323f

File tree

6 files changed

+31
-31
lines changed

6 files changed

+31
-31
lines changed

.github/workflows/markdown.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
run: |
2828
gem install awesome_bot
2929
cd extension
30-
awesome_bot --files README.md --allow-dupe --allow 401 --skip-save-results --white-list ddev.site,crowdsec --base-url http://localhost:8080/
31-
awesome_bot docs/*.md --skip-save-results --allow-dupe --allow 401 --white-list ddev.site,crowdsec,php.net/supported-versions.php --base-url http://localhost:8080/docs/
30+
awesome_bot --files README.md --allow-dupe --allow 401 --skip-save-results --white-list ddev.site --base-url http://localhost:8080/
31+
awesome_bot docs/*.md --skip-save-results --allow-dupe --allow 401 --white-list ddev.site,https://crowdsec,php.net/supported-versions.php --base-url http://localhost:8080/docs/
3232
3333
- name: Generate table of contents
3434
uses: technote-space/toc-generator@v4

docs/DEVELOPER.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -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
223223
MEMCACHED_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
230230
Then, 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
238238
the 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
241241
and specify the path where you store certificates and keys. For example:
242242

243243
```bash
@@ -386,7 +386,7 @@ ddev xdebug
386386

387387
To 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
390390
MEMCACHED_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
397397
If 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
401401
MEMCACHED_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
619619
You 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

625625
As 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
641641
One 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

647647
This 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.
652652
This library interacts with a CrowdSec agent that you have installed on an accessible server.
653653

654654
The 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.
739739
For 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

scripts/check-ip.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
if (!$requestedIp || !$bouncerKey) {
1717
die('Usage: php check-ip.php <IP> <BOUNCER_KEY>');
1818
}
19-
// Instantiate the Stream logger with info level(optional)
19+
// Instantiate the Stream logger
2020
$logger = new Logger('example');
2121

22-
// Display logs with INFO verbosity
22+
// Display logs with DEBUG verbosity
2323
$streamHandler = new StreamHandler('php://stdout', Logger::DEBUG);
2424
$streamHandler->setFormatter(new LineFormatter("[%datetime%] %message% %context%\n"));
2525
$logger->pushHandler($streamHandler);
@@ -31,7 +31,7 @@
3131
// Init
3232
$configs = [
3333
'api_key' => $bouncerKey,
34-
'api_url' => 'http://crowdsec:8080',
34+
'api_url' => 'https://crowdsec:8080',
3535
'fs_cache_path' => __DIR__ . '/.cache',
3636
];
3737
$bouncer = new Bouncer($configs, $logger);

scripts/clear-cache.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// Parse arguments
1515
$bouncerApiKey = $argv[1]; // required
16-
$apiUrl = $argv[3] ?: 'http://crowdsec:8080';
16+
$apiUrl = $argv[3] ?: 'https://crowdsec:8080';
1717

1818
if (!$bouncerApiKey) {
1919
echo 'Usage: php clear-cache.php <api_key>';
@@ -24,10 +24,10 @@
2424
// Configure paths
2525
$logPath = __DIR__.'/.crowdsec.log';
2626

27-
// Instantiate the Stream logger with info level(optional)
27+
// Instantiate the Stream logger
2828
$logger = new Logger('example');
2929

30-
// Display logs with INFO verbosity
30+
// Display logs with DEBUG verbosity
3131
$streamHandler = new StreamHandler('php://stdout', Logger::DEBUG);
3232
$streamHandler->setFormatter(new LineFormatter("[%datetime%] %message% %context%\n"));
3333
$logger->pushHandler($streamHandler);
@@ -39,7 +39,7 @@
3939
// Instantiate the bouncer
4040
$configs = [
4141
'api_key' => $bouncerApiKey,
42-
'api_url' => 'http://crowdsec:8080',
42+
'api_url' => 'https://crowdsec:8080',
4343
'fs_cache_path' => __DIR__ . '/.cache',
4444
];
4545
$bouncer = new Bouncer($configs, $logger);

scripts/full-example-live-mode.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// Parse arguments
1212
$bouncerApiKey = $argv[1]; // required
1313
$requestedIp = $argv[2]; // required
14-
$apiUrl = $argv[3] ?: 'http://crowdsec:8080';
14+
$apiUrl = $argv[3] ?: 'https://crowdsec:8080';
1515

1616
if (!$bouncerApiKey || !$requestedIp) {
1717
echo 'Usage: php full-example-live-mode.php <api_key> <requested_ip> [<api_url>]';
@@ -22,10 +22,10 @@
2222
// Configure paths
2323
$logPath = __DIR__.'/crowdsec.log';
2424

25-
// Instantiate the Stream logger with info level(optional)
25+
// Instantiate the Stream logger
2626
$logger = new Logger('example');
2727

28-
// Display logs with INFO verbosity
28+
// Display logs with DEBUG verbosity
2929
$streamHandler = new StreamHandler('php://stdout', Logger::DEBUG);
3030
$streamHandler->setFormatter(new LineFormatter("[%datetime%] %message% %context%\n"));
3131
$logger->pushHandler($streamHandler);

scripts/refresh-cache.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
die('Usage: php refresh-cache.php <BOUNCER_KEY>');
1515
}
1616

17-
// Instantiate the Stream logger with info level(optional)
17+
// Instantiate the Stream logger with warning level
1818
$logger = new Logger('example');
1919
$fileHandler = new RotatingFileHandler(__DIR__ . '/crowdsec.log', 0, Logger::WARNING);
2020
$logger->pushHandler($fileHandler);
2121

2222
// Instantiate the bouncer
2323
$configs = [
2424
'api_key' => $bouncerKey,
25-
'api_url' => 'http://crowdsec:8080',
25+
'api_url' => 'https://crowdsec:8080',
2626
'fs_cache_path' => __DIR__ . '/.cache'
2727
];
2828
$bouncer = new Bouncer($configs, $logger);

0 commit comments

Comments
 (0)