Skip to content

Commit 64393f0

Browse files
authored
Merge pull request #5 from crowdsecurity/fix-release-process
- add WordPress support from 4.9 to 5.6 - add functional tests for every WordPress version - add wp scan dev tool - fix various bug
2 parents 8749f9e + 65c3196 commit 64393f0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+6906
-65
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ vendor/
55
.DS_Store
66

77
#Tools
8+
node_modules/
9+
.test-results*
810

911
# App
1012
.bouncer-key
1113
.cache/
12-
*.log
14+
*.log

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,16 @@
77
- Go to 'Plugins' -> 'Add New' And click on "Upload Plugin" (at the top of the page)
88
- Choose your zipped plugins file and install it
99
- Now you can activate it and see a new menu named "CrowdSec"
10-
```
10+
```
11+
12+
## Demo guide
13+
14+
Follow the [Demo Guide](docs/full-guide.md) to discover the main features this plugin is capable of.
15+
16+
## How to contribute?
17+
18+
Look at the [Contributor guide](docs/contribute.md).
19+
20+
## FAQ
21+
22+
Look at the [FAQ of this plugin](docs/faq.md).

crowdsec.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
Github: https://github.com/crowdsecurity/cs-wordpress-blocker
1111
License: MIT
1212
Requires PHP: 7.2
13+
Requires at least: 4.9
14+
Tested up to: 5.6
1315
Stable tag: 0.3.0
1416
Text Domain: crowdsec-wp
1517
*/

docker-compose.yml

Lines changed: 150 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,171 @@
11
version: "3"
22
services:
3-
web:
3+
wordpress:
44
build:
55
context: .
66
dockerfile: ./docker/php-${CS_WORDPRESS_BOUNCER_PHP_VERSION}.Dockerfile
7-
links:
7+
depends_on:
88
- crowdsec
99
- mysql
1010
- redis
1111
- memcached
12+
environment:
13+
WORDPRESS_DB_PASSWORD: super_secret_password
14+
WORDPRESS_DEBUG: 1
15+
WORDPRESS_CONFIG_EXTRA: |
16+
define('WP_CRON_LOCK_TIMEOUT', 1);
17+
# more here https://hub.docker.com/_/wordpress
18+
ports:
19+
- "80:80"
20+
volumes:
21+
- .:/var/www/html/wp-content/plugins/cs-wordpress-bouncer
22+
23+
wordpress5.5:
24+
build:
25+
context: .
26+
dockerfile: ./docker/wp5.5/php-${CS_WORDPRESS_BOUNCER_PHP_VERSION}.Dockerfile
27+
depends_on:
28+
- crowdsec
29+
- mysql
30+
- redis
31+
- memcached
32+
environment:
33+
WORDPRESS_DB_PASSWORD: super_secret_password
34+
WORDPRESS_DEBUG: 1
35+
WORDPRESS_CONFIG_EXTRA: |
36+
define('WP_CRON_LOCK_TIMEOUT', 1);
37+
# more here https://hub.docker.com/_/wordpress
38+
ports:
39+
- "80:80"
40+
volumes:
41+
- .:/var/www/html/wp-content/plugins/cs-wordpress-bouncer
42+
43+
wordpress5.4:
44+
build:
45+
context: .
46+
dockerfile: ./docker/wp5.4/php-${CS_WORDPRESS_BOUNCER_PHP_VERSION}.Dockerfile
47+
depends_on:
48+
- crowdsec
49+
- mysql
50+
- redis
51+
- memcached
52+
environment:
53+
WORDPRESS_DB_PASSWORD: super_secret_password
54+
WORDPRESS_DEBUG: 1
55+
WORDPRESS_CONFIG_EXTRA: |
56+
define('WP_CRON_LOCK_TIMEOUT', 1);
57+
# more here https://hub.docker.com/_/wordpress
58+
ports:
59+
- "80:80"
60+
volumes:
61+
- .:/var/www/html/wp-content/plugins/cs-wordpress-bouncer
62+
63+
wordpress5.3:
64+
build:
65+
context: .
66+
dockerfile: ./docker/wp5.3/php-${CS_WORDPRESS_BOUNCER_PHP_VERSION}.Dockerfile
67+
depends_on:
68+
- crowdsec
69+
- mysql
70+
- redis
71+
- memcached
72+
environment:
73+
WORDPRESS_DB_PASSWORD: super_secret_password
74+
WORDPRESS_DEBUG: 1
75+
WORDPRESS_CONFIG_EXTRA: |
76+
define('WP_CRON_LOCK_TIMEOUT', 1);
77+
# more here https://hub.docker.com/_/wordpress
78+
ports:
79+
- "80:80"
80+
volumes:
81+
- .:/var/www/html/wp-content/plugins/cs-wordpress-bouncer
82+
83+
wordpress5.2:
84+
build:
85+
context: .
86+
dockerfile: ./docker/wp5.2/php-${CS_WORDPRESS_BOUNCER_PHP_VERSION}.Dockerfile
87+
depends_on:
88+
- crowdsec
89+
- mysql
90+
- redis
91+
- memcached
92+
environment:
93+
WORDPRESS_DB_PASSWORD: super_secret_password
94+
WORDPRESS_DEBUG: 1
95+
WORDPRESS_CONFIG_EXTRA: |
96+
define('WP_CRON_LOCK_TIMEOUT', 1);
97+
# more here https://hub.docker.com/_/wordpress
98+
ports:
99+
- "80:80"
100+
volumes:
101+
- .:/var/www/html/wp-content/plugins/cs-wordpress-bouncer
12102

103+
wordpress5.1:
104+
build:
105+
context: .
106+
dockerfile: ./docker/wp5.1/php-${CS_WORDPRESS_BOUNCER_PHP_VERSION}.Dockerfile
107+
depends_on:
108+
- crowdsec
109+
- mysql
110+
- redis
111+
- memcached
13112
environment:
14-
- WORDPRESS_DB_PASSWORD=super_secret_password
15-
- WORDPRESS_DEBUG=1
16-
#- WORDPRESS_CONFIG_EXTRA=define('DISABLE_WP_CRON', true);
113+
WORDPRESS_DB_PASSWORD: super_secret_password
114+
WORDPRESS_DEBUG: 1
115+
WORDPRESS_CONFIG_EXTRA: |
116+
define('WP_CRON_LOCK_TIMEOUT', 1);
17117
# more here https://hub.docker.com/_/wordpress
18118
ports:
19119
- "80:80"
20120
volumes:
21121
- .:/var/www/html/wp-content/plugins/cs-wordpress-bouncer
122+
123+
wordpress5.0:
124+
build:
125+
context: .
126+
dockerfile: ./docker/wp5.0/php-${CS_WORDPRESS_BOUNCER_PHP_VERSION}.Dockerfile
127+
depends_on:
128+
- crowdsec
129+
- mysql
130+
- redis
131+
- memcached
132+
environment:
133+
WORDPRESS_DB_PASSWORD: super_secret_password
134+
WORDPRESS_DEBUG: 1
135+
WORDPRESS_CONFIG_EXTRA: |
136+
define('WP_CRON_LOCK_TIMEOUT', 1);
137+
# more here https://hub.docker.com/_/wordpress
138+
ports:
139+
- "80:80"
140+
volumes:
141+
- .:/var/www/html/wp-content/plugins/cs-wordpress-bouncer
142+
143+
wordpress4.9:
144+
build:
145+
context: .
146+
dockerfile: ./docker/wp4.9/php-${CS_WORDPRESS_BOUNCER_PHP_VERSION}.Dockerfile
147+
depends_on:
148+
- crowdsec
149+
- mysql
150+
- redis
151+
- memcached
152+
environment:
153+
WORDPRESS_DB_PASSWORD: super_secret_password
154+
WORDPRESS_DEBUG: 1
155+
WORDPRESS_CONFIG_EXTRA: |
156+
define('WP_CRON_LOCK_TIMEOUT', 1);
157+
# more here https://hub.docker.com/_/wordpress
158+
ports:
159+
- "80:80"
160+
volumes:
161+
- .:/var/www/html/wp-content/plugins/cs-wordpress-bouncer
162+
22163
crowdsec:
23164
image: crowdsecurity/crowdsec:latest
24165
environment:
25166
- DISABLE_AGENT=true
167+
ports:
168+
- "8080:8080"
26169
mysql:
27170
image: mysql:5.7
28171
environment:
@@ -34,3 +177,5 @@ services:
34177
- "6379:6379"
35178
memcached:
36179
image: memcached:1-alpine
180+
wpscan:
181+
image: wpscanteam/wpscan

docker/php-7.2.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM wordpress:5.6-php7.2
22

3+
RUN a2disconf remoteip && a2dismod remoteip && service apache2 restart
4+
35
RUN apt-get update && apt-get install -y git libmemcached-dev zlib1g-dev \
46
&& pecl install -o -f redis memcached \
57
&& rm -rf /tmp/pear \

docker/php-7.3.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM wordpress:5.6-php7.3
22

3+
RUN a2disconf remoteip && a2dismod remoteip && service apache2 restart
4+
35
RUN apt-get update && apt-get install -y git libmemcached-dev zlib1g-dev \
46
&& pecl install -o -f redis memcached \
57
&& rm -rf /tmp/pear \

docker/php-7.4.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM wordpress:5.6-php7.4
22

3+
RUN a2disconf remoteip && a2dismod remoteip && service apache2 restart
4+
35
RUN apt-get update && apt-get install -y git libmemcached-dev zlib1g-dev \
46
&& pecl install -o -f redis memcached \
57
&& rm -rf /tmp/pear \

docker/wp4.9/php-7.2.Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM wordpress:4.9-php7.2
2+
3+
RUN apt-get update && apt-get install -y git libmemcached-dev zlib1g-dev \
4+
&& pecl install -o -f redis memcached \
5+
&& rm -rf /tmp/pear \
6+
&& docker-php-ext-enable redis memcached \
7+
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
8+
9+
RUN apt-get install -y \
10+
libfreetype6-dev \
11+
libmcrypt-dev \
12+
libjpeg-dev \
13+
libpng-dev \
14+
&& docker-php-ext-configure gd \
15+
--with-freetype-dir=/usr/include/freetype2 \
16+
--with-png-dir=/usr/include \
17+
--with-jpeg-dir=/usr/include \
18+
&& docker-php-ext-install gd
19+
20+

docker/wp5.0/php-7.2.Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM wordpress:5.0-php7.2
2+
3+
RUN apt-get update && apt-get install -y git libmemcached-dev zlib1g-dev \
4+
&& pecl install -o -f redis memcached \
5+
&& rm -rf /tmp/pear \
6+
&& docker-php-ext-enable redis memcached \
7+
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
8+
9+
RUN apt-get install -y \
10+
libfreetype6-dev \
11+
libmcrypt-dev \
12+
libjpeg-dev \
13+
libpng-dev \
14+
&& docker-php-ext-configure gd \
15+
--with-freetype-dir=/usr/include/freetype2 \
16+
--with-png-dir=/usr/include \
17+
--with-jpeg-dir=/usr/include \
18+
&& docker-php-ext-install gd

docker/php-8.0.Dockerfile renamed to docker/wp5.0/php-7.3.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM wordpress:5.6-php8.0
1+
FROM wordpress:5.0-php7.3
22

33
RUN apt-get update && apt-get install -y git libmemcached-dev zlib1g-dev \
44
&& pecl install -o -f redis memcached \

0 commit comments

Comments
 (0)