-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logger API #1113
Add logger API #1113
Conversation
This is cool, thank you @bgrgicak! The only thing I'd adjust before merging is disabling PHP error messages in case someone found a way to expose secrets by trigerring a warning or so. |
Should we add any sort of rate-limiting for specific IPs to help avoid people abusing the logging endpoint and causing DoS due to hitting Slack API limits? |
Perhaps there is already some kind of limiting at the web server as well. |
It's not designed to protect against that use-case so rate-limiting sounds like a good idea 👍 I wonder how is it implemented in other WP.org endpoints forwarding data to Slack. |
Sounds like a good idea. I need to check first what we can use on the server for this. Usually storing IPs and counts in Memcache worked well for me. |
I took a quick look and it seems like the server doesn't have Memcache. The only alternative I can think of is storing counts in a file or db. It would slow down the request, but I don't expect a lot so we should be ok. @adamziel do you have any suggestions? What does the server support and can we install things on it? |
cc @dd32 for comments – I wonder how WP.org services approach this problem. |
@adamziel @brandonpayton would it be ok for me to merge this as-is? I would add the rate-limiting once we decide on how to do it. Alternatively I could add a simple limiter to this PR and update it later if we find a better solution. |
Let's do that @bgrgicak and keep the discussion going – perhaps in a separate issue? |
👍 That sounds good. |
FWIW WordPress.org uses Memcache for it. You could potentially use |
Thanks, @dd32 🙇 |
It's not enabled on the server, but it seems like a good solution. |
What is this PR doing?
This PR adds a logger API endpoint to Playground.WordPress.net.
What problem is it solving?
It creates a standard place where users can send crash reports.
How is the problem addressed?
A PHP script accepts the log message, validates the format, and sends the log message to a Making WordPress Slack channel.
Testing Instructions
logger.php
file to the server