Skip to content

Commit 83f97e0

Browse files
feat(*): Bump version
1 parent 53ca295 commit 83f97e0

File tree

7 files changed

+16
-28
lines changed

7 files changed

+16
-28
lines changed

.github/workflows/doc-links.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ jobs:
3434
run: |
3535
gem install awesome_bot
3636
cd extension
37-
awesome_bot --files README.md --allow-dupe --allow 401 --skip-save-results --white-list ddev.site --base-url http://localhost:8080/
38-
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/
37+
awesome_bot --files README.md --allow-dupe --allow 401,301 --skip-save-results --white-list ddev.site --base-url http://localhost:8080/
38+
awesome_bot docs/*.md --skip-save-results --allow-dupe --allow 401,301 --white-list ddev.site,https://crowdsec,http://crowdsec,php.net/supported-versions.php --base-url http://localhost:8080/docs/
3939

.github/workflows/release.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
name: Create Release
2-
# example: gh workflow run release.yml -f tag_name=v1.1.4 -f draft=true
2+
# example: gh workflow run release.yml -f tag_name=v1.1.4
33
on:
44
workflow_dispatch:
55
inputs:
66
tag_name:
77
type: string
88
required: true
9-
draft:
10-
type: boolean
11-
description: Draft release
12-
default: false
13-
prerelease:
14-
type: boolean
15-
description: Prerelease
16-
default: false
9+
1710

1811
jobs:
1912
prepare-release:
@@ -35,7 +28,7 @@ jobs:
3528
echo "VERSION_NUMBER=$(echo ${{ github.event.inputs.tag_name }} | sed 's/v//g' )" >> $GITHUB_ENV
3629
3730
- name: Clone sources
38-
uses: actions/checkout@v3
31+
uses: actions/checkout@v4
3932

4033
- name: Check version ${{ env.VERSION_NUMBER }} consistency in files
4134
# Check src/Constants.php and CHANGELOG.md
@@ -77,7 +70,7 @@ jobs:
7770
fi
7871
7972
- name: Create Tag ${{ github.event.inputs.tag_name }}
80-
uses: actions/github-script@v6
73+
uses: actions/github-script@v7
8174
with:
8275
github-token: ${{ github.token }}
8376
script: |

.github/workflows/test-suite.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ jobs:
101101
102102
- name: Run "IP verification" test
103103
run: |
104-
ddev exec BOUNCER_KEY=${{ env.BOUNCER_KEY }} AGENT_TLS_PATH=/var/www/html/cfssl LAPI_URL=https://crowdsec:8080 MEMCACHED_DSN=memcached://memcached:11211 REDIS_DSN=redis://redis:6379 /usr/bin/php ./${{env.EXTENSION_PATH}}/vendor/bin/phpunit --testdox --colors --exclude-group ignore ./${{env.EXTENSION_PATH}}/tests/Integration/AbstractBouncerTest.php
104+
ddev exec BOUNCER_KEY=${{ env.BOUNCER_KEY }} AGENT_TLS_PATH=/var/www/html/cfssl APPSEC_URL=http://crowdsec:7422 LAPI_URL=https://crowdsec:8080 MEMCACHED_DSN=memcached://memcached:11211 REDIS_DSN=redis://redis:6379 /usr/bin/php ./${{env.EXTENSION_PATH}}/vendor/bin/phpunit --testdox --colors --exclude-group ignore ./${{env.EXTENSION_PATH}}/tests/Integration/AbstractBouncerTest.php
105105
106106
- name: Run "IP verification with TLS" test
107107
run: |
108-
ddev exec AGENT_TLS_PATH=/var/www/html/cfssl BOUNCER_TLS_PATH=/var/www/html/cfssl LAPI_URL=https://crowdsec:8080 MEMCACHED_DSN=memcached://memcached:11211 REDIS_DSN=redis://redis:6379 /usr/bin/php ./${{env.EXTENSION_PATH}}/vendor/bin/phpunit --testdox --colors --exclude-group ignore ./${{env.EXTENSION_PATH}}/tests/Integration/AbstractBouncerTest.php
108+
ddev exec AGENT_TLS_PATH=/var/www/html/cfssl BOUNCER_TLS_PATH=/var/www/html/cfssl APPSEC_URL=http://crowdsec:7422 LAPI_URL=https://crowdsec:8080 MEMCACHED_DSN=memcached://memcached:11211 REDIS_DSN=redis://redis:6379 /usr/bin/php ./${{env.EXTENSION_PATH}}/vendor/bin/phpunit --testdox --colors --exclude-group ignore ./${{env.EXTENSION_PATH}}/tests/Integration/AbstractBouncerTest.php
109109
110110
- name: Run "Geolocation with cURL" test
111111
run: |
112-
ddev exec BOUNCER_KEY=${{ env.BOUNCER_KEY }} AGENT_TLS_PATH=/var/www/html/cfssl LAPI_URL=https://crowdsec:8080 /usr/bin/php ./${{env.EXTENSION_PATH}}/vendor/bin/phpunit --testdox --colors --exclude-group ignore ./${{env.EXTENSION_PATH}}/tests/Integration/GeolocationTest.php
112+
ddev exec BOUNCER_KEY=${{ env.BOUNCER_KEY }} AGENT_TLS_PATH=/var/www/html/cfssl APPSEC_URL=http://crowdsec:7422 LAPI_URL=https://crowdsec:8080 /usr/bin/php ./${{env.EXTENSION_PATH}}/vendor/bin/phpunit --testdox --colors --exclude-group ignore ./${{env.EXTENSION_PATH}}/tests/Integration/GeolocationTest.php

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ As far as possible, we try to adhere to [Symfony guidelines](https://symfony.com
1111

1212
---
1313

14-
## [3.0.0](https://github.com/crowdsecurity/php-cs-bouncer/releases/tag/v3.0.0) - 2024-??-??
14+
## [3.0.0](https://github.com/crowdsecurity/php-cs-bouncer/releases/tag/v3.0.0) - 2024-10-04
1515
[_Compare with previous release_](https://github.com/crowdsecurity/php-cs-bouncer/compare/v2.2.0...v3.0.0)
1616

1717

1818
### Added
1919

20+
- Add AppSec support
2021
- Add `use_appsec` configuration
2122

2223
### Changed

docs/DEVELOPER.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
- [Unit test](#unit-test)
2020
- [Integration test](#integration-test)
2121
- [Coding standards](#coding-standards)
22-
- [PHPCS Fixer](#phpcs-fixer)
23-
- [PHPSTAN](#phpstan)
24-
- [PHP Mess Detector](#php-mess-detector)
25-
- [PHPCS and PHPCBF](#phpcs-and-phpcbf)
26-
- [PSALM](#psalm)
27-
- [PHP Unit Code coverage](#php-unit-code-coverage)
2822
- [Generate CrowdSec tools and settings on start](#generate-crowdsec-tools-and-settings-on-start)
2923
- [Redis debug](#redis-debug)
3024
- [Memcached debug](#memcached-debug)
@@ -312,7 +306,8 @@ With AppSec integration tests:
312306

313307
```bash
314308
ddev exec XDEBUG_MODE=coverage APPSEC_URL=http://crowdsec:7422 BOUNCER_KEY=your-bouncer-key
315-
LAPI_URL=http://crowdsec:8080 REDIS_DSN=redis://redis:6379 MEMCACHED_DSN=memcached://memcached:11211 /usr/bin/php ./my-code/crowdsec-bouncer-lib/tools/coding-standards/vendor/bin/phpunit --configuration ./my-code/crowdsec-bouncer-lib/tools/coding-standards/phpunit/phpunit.xml
309+
LAPI_URL=https://crowdsec:8080 REDIS_DSN=redis://redis:6379 MEMCACHED_DSN=memcached://memcached:11211 /usr/bin/php
310+
./my-code/crowdsec-bouncer-lib/tools/coding-standards/vendor/bin/phpunit --configuration ./my-code/crowdsec-bouncer-lib/tools/coding-standards/phpunit/phpunit.xml
316311
```
317312

318313

docs/USER_GUIDE.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Please note that first and foremost a CrowdSec agent must be installed on a serv
4444
- CrowdSec Local API support
4545
- Handle `ip`, `range` and `country` scoped decisions
4646
- `Live mode` or `Stream mode`
47+
- AppSec support
4748
- Support IpV4 and Ipv6 (Ipv6 range decisions are yet only supported in `Live mode`)
4849
- Large PHP matrix compatibility: 7.2, 7.3, 7.4, 8.0, 8.1, 8.2 and 8.3
4950
- Built-in support for the most known cache systems Redis, Memcached and PhpFiles
@@ -191,17 +192,15 @@ Below is the list of available settings:
191192

192193
- `bouncing_level`: Select from `bouncing_disabled`, `normal_bouncing` or `flex_bouncing`. Choose if you want to apply CrowdSec directives (Normal bouncing) or be more permissive (Flex bouncing). With the `Flex mode`, it is impossible to accidentally block access to your site to people who don’t deserve it. This mode makes it possible to never ban an IP but only to offer a captcha, in the worst-case scenario.
193194

195+
- `use_appsec`: true to enable AppSec support. Default to false. If enabled, the bouncer will check the AppSec decisions if the IP is not found in the Local API decisions.
194196

195197
- `fallback_remediation`: Select from `bypass` (minimum remediation), `captcha` or `ban` (maximum remediation). Default to 'captcha'. Handle unknown remediations as.
196198

197-
198199
- `trust_ip_forward_array`: If you use a CDN, a reverse proxy or a load balancer, set an array of comparable IPs arrays:
199200
(example: `[['001.002.003.004', '001.002.003.004'], ['005.006.007.008', '005.006.007.008']]` for CDNs with IPs `1.2.3.4` and `5.6.7.8`). For other IPs, the bouncer will not trust the X-Forwarded-For header.
200201

201-
202202
- `excluded_uris`: array of URIs that will not be bounced.
203203

204-
205204
- `stream_mode`: true to enable stream mode, false to enable the live mode. Default to false. By default, the `live mode` is enabled. The first time a stranger connects to your website, this mode means that the IP will be checked directly by the CrowdSec API. The rest of your user’s browsing will be even more transparent thanks to the fully customizable cache system. But you can also activate the `stream mode`. This mode allows you to constantly feed the bouncer with the malicious IP list via a background task (CRON), making it to be even faster when checking the IP of your visitors. Besides, if your site has a lot of unique visitors at the same time, this will not influence the traffic to the API of your CrowdSec instance.
206205

207206
### Local API Connection

src/Constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Constants extends RemConstants
3737
/** @var string Path for html templates folder (e.g. ban and captcha wall) */
3838
public const TEMPLATES_DIR = __DIR__ . '/templates';
3939
/** @var string The last version of this library */
40-
public const VERSION = 'v2.2.0';
40+
public const VERSION = 'v3.0.0';
4141
/** @var string The "disabled" x-forwarded-for setting */
4242
public const X_FORWARDED_DISABLED = 'no_forward';
4343
}

0 commit comments

Comments
 (0)