Comments (5)
Hi @michacassola,
Thanks for your message.
Adding some wp-cli
commands seems indeed a great idea.
But I guess I need more details on the type of command you want available.
Considering the API Key, this is already possible to set it in setting (if you know the API Key):
wp option set crowdsec_api_key ${BOUNCER_KEY}
But if you want a command to create the key itself, I think this won't be possible to have something that will work in all possible cases.
The bouncer key cannot be created with a pure PHP script, as we have to use the CrowdSec CLI cscli
tool.
For example, the bouncer key can be retrieved as the result of the :
cscli bouncers add $BOUNCER_NAME -o raw
And, as the cscli command is only available on the server with the installed CrowdSec agent, it won't be possible to create it if the agent is not on the same server as the WordPress. There could also be some permission issues between the cscli
user and the wp
user.
For now, I guess the easiest way to script the installation of the CrowdSec plugin is to retrieve a bouncer key with the cscli
command and pass it as a parameter of the wp option set
command.
In my opinion, modifying the settings is already possible with the wp option set
command, but we could add some command to manage the cache (clear, refresh, ...)
Please let me know if you were thinking about other wp-cli integration.
from cs-wordpress-bouncer.
Hi @michacassola,
as a first step in the integration work of WP-CLI, I added a paragraph about How to update settings with WP-CLI.
Next step would be to add some real WP-CLI command to act on the bouncer (clearing, refreshing cache for example).
Thanks
from cs-wordpress-bouncer.
I don't use it, as I block request on the network level, but being able to manage plugins through wp-cli is a must have for a good plugin :)
from cs-wordpress-bouncer.
Yeah, you are right, if all the options can be passed like that it is sufficient.
Then I would like to request documentation on how to set and change all the options of the plugin that way. :)
Thanks!
from cs-wordpress-bouncer.
Then I would like to request documentation on how to set and change all the options of the plugin that way. :)
I add this to my TODO list :) . I think I will provide a wp-cli example for each item in this documentation part: https://github.com/crowdsecurity/cs-wordpress-bouncer/blob/main/docs/USER_GUIDE.md#configurations
If you can't wait, you could start by looking in the wp_options
table and search all items with option_name
beginning by crowdsec
.
Thanks
from cs-wordpress-bouncer.
Related Issues (20)
- WP Bouncer doesn't seem to be working HOT 9
- Question: Is the Trust these CDN Ips compatible with IPv6? HOT 1
- Stream mode causes ERROR 500 - Internal Server Error! HOT 9
- Exception while bouncing banned IP (not output captcha/ban page) HOT 4
- Fatal error: Uncaught TypeError: ltrim() expects parameter 1 to be string, bool given HOT 3
- [Feature Request] Multisite Support with Global Tables HOT 4
- nvm
- ive enabled crowdsec on my wp site HOT 2
- Fatal error on crowdsec WP plugin - The value 0 is too small for path "config.captcha_cache_duration" HOT 5
- Add vendor folder to sources and modify deploy process HOT 1
- Debug log is never active in the WordPress marketplace deployed version
- 2 Errors on WordPress Version 5.9.3 HOT 4
- CRITICAL Uncaught Error: Call to a member function error() on null in /wp-content/plugins/crowdsec/inc/Bounce.php:339 HOT 6
- PHP Fatal error: Uncaught Error: Call to a member function error() on null in wp-content/plugins/crowdsec/inc/Bounce.php:339 HOT 10
- Same redis DB for multiple WP sites HOT 5
- Change to user agent reported to crowdsec_api.log to include the site name HOT 3
- Cache refreshing in STREAM mode HOT 16
- Sync with crowdsec api in stream mode is inconsistent HOT 11
- safelyBounce error:session_start() HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cs-wordpress-bouncer.