Skip to content

Commit

Permalink
feat(*): Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
julienloizelet committed Oct 4, 2024
1 parent 8b294f5 commit ea92f7a
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/doc-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ jobs:
run: |
gem install awesome_bot
cd extension
awesome_bot --files README.md --allow-dupe --allow-redirect --allow 401 --skip-save-results --white-list ddev.site --base-url http://localhost:8080/
awesome_bot docs/*.md --allow-dupe --allow-redirect --allow 401 --skip-save-results --white-list crowdsec.net/v2,ddev.site,your-lapi-url,your-appsec-url,https://crowdsec,http://crowdsec --base-url http://localhost:8080/docs/
awesome_bot --files README.md --allow-dupe --allow-redirect --allow 401,301 --skip-save-results --white-list ddev.site --base-url http://localhost:8080/
awesome_bot docs/*.md --allow-dupe --allow-redirect --allow 401,301 --skip-save-results --white-list crowdsec.net/v2,ddev.site,your-lapi-url,your-appsec-url,https://crowdsec,http://crowdsec,http://localhost:7422 --base-url http://localhost:8080/docs/
42 changes: 14 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Create Release
# example: gh workflow run release.yml -f tag_name=v1.1.4 -f draft=true
# example: gh workflow run release.yml -f tag_name=v1.1.4
on:
workflow_dispatch:
branches:
Expand All @@ -8,18 +8,7 @@ on:
tag_name:
type: string
required: true
draft:
type: boolean
description: Draft release
default: false
prerelease:
type: boolean
description: Prerelease
default: false
first-release:
type: boolean
description: First release
default: false


jobs:
prepare-release:
Expand Down Expand Up @@ -72,24 +61,21 @@ jobs:
fi
# Check top [_Compare with previous release_](GITHUB_URL/compare/vLAST_TAG...vVERSION_NUMBER) in CHANGELOG.md
if [[ ${{ github.event.inputs.first-release }} != "true" ]]
echo "VERSION COMPARISON START"
COMPARISON=$(grep -oP "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/compare/\K(.*)$" CHANGELOG.md | head -1)
LAST_TAG=$(curl -Ls -o /dev/null -w %{url_effective} $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/latest | grep -oP "\/tag\/\K(.*)$")
if [[ $COMPARISON == "$LAST_TAG...v${{ env.VERSION_NUMBER }})" ]]
then
echo "VERSION COMPARISON START"
COMPARISON=$(grep -oP "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/compare/\K(.*)$" CHANGELOG.md | head -1)
LAST_TAG=$(curl -Ls -o /dev/null -w %{url_effective} $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/latest | grep -oP "\/tag\/\K(.*)$")
if [[ $COMPARISON == "$LAST_TAG...v${{ env.VERSION_NUMBER }})" ]]
then
echo "VERSION COMPARISON OK"
else
echo "VERSION COMPARISON KO"
echo $COMPARISON
echo "$LAST_TAG...v${{ env.VERSION_NUMBER }})"
exit 1
fi
echo "VERSION COMPARISON OK"
else
echo "VERSION COMPARISON KO"
echo $COMPARISON
echo "$LAST_TAG...v${{ env.VERSION_NUMBER }})"
exit 1
fi
- name: Create Tag ${{ github.event.inputs.tag_name }}
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ github.token }}
script: |
Expand All @@ -107,7 +93,7 @@ jobs:
echo "$VERSION_RELEASE_NOTES" >> CHANGELOG.txt
- name: Create release ${{ env.VERSION_NUMBER }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.txt
name: ${{ env.VERSION_NUMBER }}
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ As far as possible, we try to adhere to [Symfony guidelines](https://symfony.com

---

## [3.4.0](https://github.com/crowdsecurity/php-remediation-engine/releases/tag/v3.3.0) - 2024-??-??
## [3.4.0](https://github.com/crowdsecurity/php-remediation-engine/releases/tag/v3.4.0) - 2024-10-04
[_Compare with previous release_](https://github.com/crowdsecurity/php-remediation-engine/compare/v3.3.0...v3.4.0)

### Added

- Add AppSec requests support with `getAppSecRemediation` public method in `LapiRemediation` class

- Add `appsec_fallback_remediation` configuration for Lapi remediation


### Changed

Expand Down
9 changes: 1 addition & 8 deletions docs/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,7 @@ Then, you have to [run the action manually from the GitHub repository](https://g


Alternatively, you could use the [GitHub CLI](https://github.com/cli/cli):
- create a draft release:
```
gh workflow run release.yml -f tag_name=vx.y.z -f draft=true
```
- publish a prerelease:
```
gh workflow run release.yml -f tag_name=vx.y.z -f prerelease=true
```

- publish a release:
```
gh workflow run release.yml -f tag_name=vx.y.z
Expand Down
18 changes: 18 additions & 0 deletions docs/USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- [Stream mode](#stream-mode)
- [Clean IP cache duration](#clean-ip-cache-duration)
- [Bad IP cache duration](#bad-ip-cache-duration)
- [AppSec fallback remediation](#appsec-fallback-remediation)
- [Cache configurations](#cache-configurations)
- [PhpFiles cache files directory](#phpfiles-cache-files-directory)
- [Redis cache DSN](#redis-cache-dsn)
Expand Down Expand Up @@ -596,6 +597,23 @@ This is only useful in live mode. In stream mode, the cache duration depends onl

In seconds. Must be greater or equal than 1. Default to 120 seconds if not set.

### AppSec fallback remediation

```php
$configs = [
...
'appsec_fallback_remediation' => 'captcha'
...
];
```
Will be used as remediation in case of AppSec failure (timeout).

Select from `bypass` (minimum remediation), `captcha` (recommended) or `ban` (maximum remediation).

This setting is not required. If you don't set any value, `captcha` will be used by default.

If you set some value, be aware to include this value in the `ordered_remediations` setting too.


## Cache configurations

Expand Down
2 changes: 1 addition & 1 deletion src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ class Constants extends CommonConstants
/**
* @var string The current version of this library
*/
public const VERSION = 'v3.3.0';
public const VERSION = 'v3.4.0';
}

0 comments on commit ea92f7a

Please sign in to comment.