Skip to content

Commit c0b43a0

Browse files
docs(*): Prepare release 2.0.0
1 parent aa693c4 commit c0b43a0

File tree

16 files changed

+73
-99
lines changed

16 files changed

+73
-99
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
echo "Version in CHANGELOG.md: KO"
5555
exit 1
5656
fi
57-
COMPARISON=$(grep -oP "\/compare\/\K(.*)$" CHANGELOG.md | head -1)
57+
COMPARISON=$(grep -oP "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/compare/\K(.*)$" CHANGELOG.md | head -1)
5858
LAST_TAG=$(curl -Ls -o /dev/null -w %{url_effective} $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/latest | grep -oP "\/tag\/\K(.*)$")
5959
if [[ $COMPARISON == "$LAST_TAG...v${{ env.VERSION_NUMBER }})" ]]
6060
then

.wordpress-org/screenshot-1.jpg

-13.5 KB
Loading

.wordpress-org/screenshot-2.jpg

-39.4 KB
Loading

.wordpress-org/screenshot-3.jpg

-90 KB
Loading

.wordpress-org/screenshot-4.jpg

-25.4 KB
Loading

.wordpress-org/screenshot-5.jpg

-13.3 KB
Loading

.wordpress-org/screenshot-6.jpg

-55.5 KB
Loading

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77

8+
## [2.0.0](https://github.com/crowdsecurity/cs-wordpress-bouncer/releases/tag/v2.0.0) - 2023-02-09
9+
[_Compare with previous release_](https://github.com/crowdsecurity/cs-wordpress-bouncer/compare/v1.11.0...v2.0.0)
10+
11+
### Changed
12+
- All source code has been refactored using new CrowdSec PHP librairies:
13+
- Logs messages have been changed
14+
- User Agent sent to CrowdSec LAPI has been changed to `csphplapi_WordPress/vX.Y.Z`
15+
16+
### Removed
17+
18+
- Remove `Geolocation save result` setting. To disable Geolocation result saving, we can set 0 in the `Geolocation
19+
cache lifetime` setting
20+
---
21+
822
## [1.11.0](https://github.com/crowdsecurity/cs-wordpress-bouncer/releases/tag/v1.11.0) - 2022-12-22
923
[_Compare with previous release_](https://github.com/crowdsecurity/cs-wordpress-bouncer/compare/v1.10.0...v1.11.0)
1024

crowdsec.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
* Plugin URI: https://github.com/crowdsecurity/cs-wordpress-bouncer
55
* Description: Safer Together. Protect your WordPress application with CrowdSec.
66
* Tags: crowdsec-bouncer, wordpress, security, firewall, captcha, ip-scanner, ip-blocker, ip-blocking, ip-address, ip-database, ip-range-check, crowdsec, ban-hosts, ban-management, anti-hacking, hacker-protection, captcha-image, captcha-generator, captcha-generation, captcha-service
7-
* Version: 1.11.0
7+
* Version: 2.0.0
88
* Author: CrowdSec
99
* Author URI: https://www.crowdsec.net/
10-
* Github: https://github.com/crowdsecurity/cs-wordpress-blocker
10+
* Github: https://github.com/crowdsecurity/cs-wordpress-bouncer
1111
* License: MIT
1212
* License URI: https://opensource.org/licenses/MIT
1313
* Requires PHP: 7.2
1414
* Requires at least: 4.9
1515
* Tested up to: 6.1
16-
* Stable tag: 1.11.0
16+
* Stable tag: 2.0.0
1717
* Text Domain: crowdsec-wp
1818
* First release: 2021.
1919
*/

docs/DEVELOPER.md

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ __We will suppose here that you want to install WordPress 5.9. Please change "5.
5454

5555
#### DDEV installation
5656

57-
This project is fully compatible with DDEV 1.21.4, and it is recommended to use this specific version.
58-
For the DDEV installation, please follow the [official instructions](https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/).
57+
This project is fully compatible with DDEV 1.21.4, and it is recommended to use this specific version. For the DDEV installation, please follow the [official instructions](https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/).
5958

6059
### Prepare DDEV WordPress environment
6160

@@ -80,23 +79,23 @@ wp-sources (choose the name you want for this folder)
8079
```
8180

8281
- Create an empty folder that will contain all necessary sources:
83-
```
82+
```shell
8483
mkdir wp-sources
8584
```
8685
- Create an empty `.ddev` folder for DDEV and clone our pre-configured DDEV repo:
8786

88-
```
87+
```shell
8988
mkdir wp-sources/.ddev && cd wp-sources/.ddev && git clone git@github.com:julienloizelet/ddev-wp.git ./
9089
```
9190
- Copy some configurations file:
9291

93-
```
92+
```shell
9493
cp .ddev/config_overrides/config.wp59.yaml .ddev/config.wp59.yaml
9594
cp .ddev/config_overrides/config.crowdsec.yaml .ddev/config.crowdsec.yaml
9695
```
9796
- Launch DDEV
9897

99-
```
98+
```shell
10099
cd .ddev && ddev start
101100
```
102101
This should take some times on the first launch as this will download all necessary docker images.
@@ -124,7 +123,7 @@ ddev exec wp core install --url='https://wp59.ddev.site' --title='WordPress' --a
124123

125124
##### Install the module
126125

127-
```
126+
```shell
128127
cd wp-sources
129128
mkdir my-own-modules && mkdir my-own-modules/crowdsec-bouncer && cd my-own-modules/crowdsec-bouncer
130129
git clone git@github.com:crowdsecurity/cs-wordpress-bouncer.git ./
@@ -136,7 +135,7 @@ ddev start
136135

137136
Login to the admin by browsing the url `https://wp59.ddev.site/admin` (username: `admin` and password: `admin123`)
138137

139-
Activate the CrowdSec plugin
138+
Activate the CrowdSec plugin.
140139

141140
##### End-to-end tests
142141

@@ -150,8 +149,7 @@ As we use a TLS ready CrowdSec container, you have first to copy some certificat
150149
cd wp-sources
151150
cp -r .ddev/custom_files/crowdsec/cfssl/* wp-content/plugins/crowdsec/tls
152151
```
153-
And we use also a custom php script to make some cache test. Thus, you should copy this php script too in the root
154-
folder:
152+
And we use also a custom PHP script to make some cache test. Thus, you should copy this PHP script too in the root folder:
155153

156154
```bash
157155
cd wp-sources
@@ -161,7 +159,7 @@ cp .ddev/custom_files/crowdsec/php/cache-actions.php cache-actions.php
161159

162160
Then, ensure that `run-tests.sh` and `test-init.sh` files are executable.
163161

164-
```
162+
```shell
165163
cd wp-sources/my-own-module/crowdsec-bouncer/tests/e2e-ddev/__scripts__
166164
```
167165
Run `chmod +x run-tests.sh test-init.sh` if not.
@@ -182,7 +180,7 @@ For example:
182180
./run-tests.sh host "./2-live-mode-remediations.js"
183181
```
184182

185-
**N.B**
183+
**N.B**.:
186184

187185
Before testing with the `docker` or `ci` parameter, you have to install all the required dependencies
188186
in the playwright container with this command :
@@ -200,25 +198,23 @@ yarn global add cross-env
200198

201199
#### Update composer dependencies
202200

203-
As WordPress plugins does not support `composer` installation, we have to add the vendor folder to sources. By doing
204-
that, we have to use only production ready dependencies and avoid `require-dev` parts. We have also set a config
205-
platform version of PHP in the `composer.json` that will force composer to install packages on this specific version.
206-
We are not setting the `"optimize-autoloader": true` in the `composer.json` because it implies a lot of issues during
207-
development phase.
201+
As WordPress plugins does not support `composer` installation, we have to add the vendor folder to sources. By doing that, we have to use only production ready dependencies and avoid `require-dev` parts. We have also set a `config` platform version of PHP in the `composer.json` that will force composer to install packages on this specific version.
202+
203+
We are not setting the `"optimize-autoloader": true` in the `composer.json` because it implies a lot of issues during development phase.
208204

209205
##### Development phase
210206

211207
In development phase, you could run the following command:
212208

213-
```
209+
```shell
214210
ddev composer update --working-dir ./my-own-modules/crowdsec-bouncer
215211
```
216212

217213
##### Production release
218214

219215
To release a new version of the plugin on the WordPress marketplace, you must run:
220216

221-
```
217+
```shell
222218
ddev composer update --no-dev --prefer-dist --optimize-autoloader --working-dir ./my-own-modules/crowdsec-bouncer
223219
```
224220

@@ -286,18 +282,15 @@ ddev exec -s exec crowdsec cscli decisions add --ip <YOUR_HOST_IP> --duration 15
286282

287283
* Unless you manage to solve the captcha, you'll not be able to access the website.
288284

289-
> Note: when you resolve the captcha in your browser, the result is stored in cache.
290-
> If you remove the captcha decision with `cscli`, then you add a new captcha decision for your IP, you'll not be
291-
> prompted until you clear the cache or the lifetime for captcha decision has been reached.
285+
> Note: when you resolve the captcha in your browser, the result is stored in cache. If you remove the captcha decision with `cscli`, then you add a new captcha decision for your IP, you'll not be prompted until you clear the cache or the lifetime for captcha decision has been reached.
292286
293287
### Stream mode, for the high traffic websites
294288

295289
With live mode, as you tried it just before, each time a user arrives to the website for the first time, a call is made to Local API. If the traffic on your website is high, the bouncer will call Local API very often.
296290

297-
To avoid this, Local API offers a "stream" mode. The decisions list is updated at a predefined frequency and kept in cache. Let's try it!
291+
To avoid this, Local API offers a "stream" mode. The decisions list is updated at a predefined frequency and kept in cache.
298292

299-
> This bouncer uses the WordPress cron system. For demo purposes, we encourage you to install the WP-Control plugin,
300-
> a plugin to view and control each WordPress Cron task jobs.
293+
> This bouncer uses the WordPress cron system. For demo purposes, we encourage you to install the WP-Control plugin, a plugin to view and control each WordPress Cron task jobs.
301294
302295
First, clear the previous decisions:
303296

@@ -349,8 +342,9 @@ In order to have an explicit commit history, we are using some commits message c
349342
<type>(<scope>): <subject>
350343

351344
Allowed `type` are defined below.
352-
`scope` value intends to clarify which part of the code has been modified. It can be empty or `*` if the change is a
353-
global or difficult to assign to a specific part.
345+
346+
`scope` value intends to clarify which part of the code has been modified. It can be empty or `*` if the change is a global or difficult to assign to a specific part.
347+
354348
`subject` describes what has been done using the imperative, present tense.
355349

356350
Example:
@@ -411,7 +405,3 @@ gh workflow run release.yml -f tag_name=vx.y.z
411405
```
412406

413407
Note that the GitHub action will fail if the tag `tag_name` already exits.
414-
415-
416-
417-

0 commit comments

Comments
 (0)