You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+24-2Lines changed: 24 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,30 @@
1
1
# Changelog
2
2
All notable changes to this project will be documented in this file.
3
3
4
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/)
5
-
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
4
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
+
6
+
## Public API
7
+
8
+
The purpose of this section is to declare the public API of this library as required by [item 1 of semantic versioning specification](https://semver.org/spec/v2.0.0.html#spec-item-1).
9
+
10
+
The public API of this library consists of all public or protected methods, properties and constants belonging to the `src` folder.
By default, ddev will launch a PHP 7.2 container. If you want to work with another PHP version, copy the
126
-
corresponding config file. For example:
125
+
By default, ddev will launch a PHP 7.2 container. If you want to work with another PHP version, copy the corresponding configuration file. For example:
127
126
128
127
```bash
129
128
cd php-project-sources
@@ -142,7 +141,7 @@ This should take some times on the first launch as this will download all necess
142
141
143
142
#### Add CrowdSec bouncer and watcher
144
143
145
-
- To create a new bouncer in the crowdsec container, run:
144
+
- To create a new bouncer in the CrowdSec container, run:
146
145
147
146
```bash
148
147
ddev create-bouncer [name]
@@ -156,7 +155,7 @@ It will return the bouncer key.
156
155
ddev create-watcher [name] [password]
157
156
```
158
157
159
-
N.B : Since we are using TLS authentification for agent, you should avoid to create a watcher with this method.
158
+
**N.B.** : Since we are using TLS authentication for agent, you should avoid to create a watcher with this method.
160
159
161
160
162
161
#### Use composer to update or install the lib
@@ -177,8 +176,7 @@ To find it, just run:
177
176
ddev find-ip
178
177
```
179
178
180
-
You will have to know also the IP of the `ddev-router` container as it acts as a proxy, and you should set it in the
181
-
`trust_ip_forward_array` setting.
179
+
You will have to know also the IP of the `ddev-router` container as it acts as a proxy, and you should set it in the `trust_ip_forward_array` setting.
For geolocation Unit Test, you should first put 2 free MaxMind databases in the `tests` folder : `GeoLite2-City.mmdb`
222
-
and`GeoLite2-Country.mmdb`. You can download these databases by creating a maxmind account and browse to [the download page](https://www.maxmind.com/en/accounts/current/geoip/downloads).
220
+
and`GeoLite2-Country.mmdb`. You can download these databases by creating a MaxMind account and browse to [the download page](https://www.maxmind.com/en/accounts/current/geoip/downloads).
Before using the bouncer in a standalone mode (i.e. with an auto-prepend directive), you should copy the
245
-
[`scripts/auto-prepend/settings.example.php`](../scripts/auto-prepend/settings.example.php) file to a `scripts/auto-prepend/settings.
246
-
php` and edit it depending on your needs.
247
-
242
+
Before using the bouncer in a standalone mode (i.e. with an auto-prepend directive), you should copy the [`scripts/auto-prepend/settings.example.php`](../scripts/auto-prepend/settings.example.php) file to a `scripts/auto-prepend/settings.php` and edit it depending on your needs.
248
243
249
-
Then, to configure the Nginx service in order that it uses an auto-prepend directive pointing to the
250
-
[`scripts/auto-prepend/bounce.php`](../scripts/auto-prepend/bounce.php) script, please run the
251
-
following command from the `.ddev` folder:
244
+
Then, to configure the Nginx service in order that it uses an auto-prepend directive pointing to the [`scripts/auto-prepend/bounce.php`](../scripts/auto-prepend/bounce.php) script, please run the following command from the `.ddev` folder:
252
245
253
246
```bash
254
247
ddev crowdsec-prepend-nginx
255
248
```
256
249
257
-
With that done, every access to your ddev url (i.e. `https://phpXX.ddev.site` where `XX` is your php version) will
258
-
be bounce.
250
+
With that done, every access to your ddev url (i.e. `https://phpXX.ddev.site` where `XX` is your php version) will be bounce.
259
251
260
252
For example, you should try to browse the following url:
261
253
@@ -269,14 +261,13 @@ In auto-prepend mode, you can run some end-to-end tests.
269
261
270
262
We are using a Jest/Playwright Node.js stack to launch a suite of end-to-end tests.
271
263
272
-
Tests code is in the `tests/end-to-end` folder. You should have to `chmod +x` the scripts you will find in
273
-
`tests/end-to-end/__scripts__`.
264
+
Tests code is in the `tests/end-to-end` folder. You should have to `chmod +x` the scripts you will find in `tests/end-to-end/__scripts__`.
274
265
275
266
276
267
Then you can use the `run-test.sh` script to run the tests:
277
268
278
269
- the first parameter specifies if you want to run the test on your machine (`host`) or in the
279
-
docker containers (`docker`). You can also use `ci` if you want to have the same behavior as in Github action.
270
+
docker containers (`docker`). You can also use `ci` if you want to have the same behavior as in GitHub action.
280
271
- the second parameter list the test files you want to execute. If empty, all the test suite will be launched.
Before testing with the `docker` or `ci` parameter, you have to install all the required dependencies
289
-
in the playwright container with this command :
279
+
Before testing with the `docker` or `ci` parameter, you have to install all the required dependencies in the playwright container with this command :
290
280
291
281
./test-init.sh
292
282
@@ -299,18 +289,15 @@ yarn global add cross-env
299
289
300
290
#### Coding standards
301
291
302
-
We set up some coding standards tools that you will find in the `tools/coding-standards` folder.
303
-
In order to use these, you will need to work with a PHP version >= 7.4 and run first:
292
+
We set up some coding standards tools that you will find in the `tools/coding-standards` folder. In order to use these, you will need to work with a PHP version >= 7.4 and run first:
Please see the [CrowdSec LAPI documentation](https://crowdsecurity.github.io/api_doc/index.html?urls.primaryName=LAPI)
595
-
for an
596
-
exhaustive list of available calls.
579
+
Please see the [CrowdSec LAPI documentation](https://crowdsecurity.github.io/api_doc/index.html?urls.primaryName=LAPI) for an exhaustive list of available calls.
597
580
598
581
If you are using DDEV, you can enter the web by running:
599
582
@@ -619,16 +602,18 @@ In order to have an explicit commit history, we are using some commits message c
619
602
<type>(<scope>): <subject>
620
603
621
604
Allowed `type` are defined below.
605
+
622
606
`scope` value intends to clarify which part of the code has been modified. It can be empty or `*`if the change is a
623
607
global or difficult to assign to a specific part.
608
+
624
609
`subject` describes what has been done using the imperative, present tense.
625
610
626
611
Example:
627
612
628
613
feat(admin): Add css for admin actions
629
614
630
615
631
-
You can use the `commit-msg` git hook that you will find in the `.githooks` folder:
616
+
You can use the `commit-msg` git hook that you will find in the `.githooks` folder:
632
617
633
618
```
634
619
cp .githooks/commit-msg .git/hooks/commit-msg
@@ -678,6 +663,3 @@ gh workflow run release.yml -f tag_name=vx.y.z
678
663
```
679
664
680
665
Note that the GitHub action will fail if the tag `tag_name` already exits.
Copy file name to clipboardExpand all lines: docs/TECHNICAL_NOTES.md
+6-19Lines changed: 6 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -19,46 +19,33 @@
19
19
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
20
20
21
21
22
-
We explain here each important technical decision used to design this
23
-
library.
22
+
We explain here each important technical decision used to design this library.
24
23
25
24
## Why use *Symfony/Cache* and *Symfony/Config* component?
26
25
27
26
The Cache component is compatible with many cache systems.
28
27
29
-
The Config component provides several classes to help you find, load,
30
-
combine, fill and validate configuration values of any kind, whatever
31
-
their source may be (YAML, XML, INI files, or for instance a database).
32
-
A great job done by this library, tested and maintained under LTS
33
-
versions.
28
+
The Config component provides several classes to help you find, load, combine, fill and validate configuration values of any kind, whatever their source may be (YAML, XML, INI files, or for instance a database). A great job done by this library, tested and maintained under LTS versions.
34
29
35
30
This library is tested and maintained under LTS versions.
36
31
37
32
## Why not using Guzzle?
38
33
39
-
The last Guzzle versions remove the User-Agent to prevent risks. Since
40
-
LAPI or CAPI need a valid User-Agent, we can not use Guzzle to request
41
-
CAPI/LAPI.
34
+
The last Guzzle versions remove the User-Agent to prevent risks. Since LAPI or CAPI need a valid User-Agent, we can not use Guzzle to request CAPI/LAPI.
42
35
43
36
## Why not using Swagger Codegen?
44
37
45
-
We were not able to use this client with ease ex: impossible to get
46
-
JSON data, it seems there is a bug with unserialization, we received
47
-
an empty array.
38
+
We were not able to use this client with ease ex: impossible to get JSON data, it seems there is a bug with unserialization, we received an empty array.
48
39
49
40
## Which PHP compatibility matrix?
50
41
51
42
### Why not PHP 5.6?
52
43
53
-
Because this PHP version is no more supported since December 2018 (not even a security fix).
54
-
Also, a lot of libraries are no more compatible with this version.
55
-
We don't want to use an older version of these libraries because Composer can only install one version of each extension/package.
56
-
So, being compatible with this old PHP version means to be not compatible with projects using a new version of these libraries.
44
+
Because this PHP version is no more supported since December 2018 (not even a security fix). Also, a lot of libraries are no more compatible with this version. We don't want to use an older version of these libraries because Composer can only install one version of each extension/package. So, being compatible with this old PHP version means to be not compatible with projects using a new version of these libraries.
57
45
58
46
### Why not 7.0.x nor 7.1.x ?
59
47
60
-
These PHP versions are not anymore maintained for security fixes since 2019. We encourage you a lot to upgrade your
61
-
PHP version. You can view the [full list of PHP versions lifecycle](https://www.php.net/supported-versions.php).
48
+
These PHP versions are not anymore maintained for security fixes since 2019. We encourage you a lot to upgrade your PHP version. You can view the [full list of PHP versions lifecycle](https://www.php.net/supported-versions.php).
62
49
63
50
To get a robust library and not provide security bug unmaintained, we use [components](https://packagist.org/packages/symfony/cache#v3.4.47) under [LTS versioning](https://symfony.com/releases/3.4).
0 commit comments