[NEW] Add shield.svg api route to generate custom shields/badges#6565
[NEW] Add shield.svg api route to generate custom shields/badges#6565engelgabriel merged 4 commits intoRocketChat:developfrom
Conversation
|
Maybe add some settings to enable or disable this for the private servers who don't want this enabled. Otherwise looking good |
|
Yeah, I was thinking it might be an issue with the online users option. Do you think it should be a setting to disable all, or just the online users one? |
|
Maybe a setting to disable them each individually? That way it's highly configurable? |
|
Yes, I echo the same sentiments already emitted by @graywolf336 — especially about servers which are private, but other than that? I like it! |
|
This is awesome! 👍 |
|
This is awesome. Can we secure that against DDOS attack? Maybe cache the count of online users for 1min, idk if it will help :) |
|
@rodrigok I've changed it to cache online count for 1 minute as you suggested |
|
@graywolf336 @geekgonecrazy @marceloschmidt @sampaiodiego what do you think guys? Is that good in the code point of view? |
geekgonecrazy
left a comment
There was a problem hiding this comment.
👍 looks good to me!
|
I think for github specifically this won't be too bad in terms of DDoS. They do caching I believe here as well |
|
This is really awesome, thanks for this. |
@RocketChat/core
Related to #867
Add api route to generate svg shields/badges for channels, online users and generally to join chat.
Example badges
/api/v1/shield.svg/api/v1/shield.svg?type=online/api/v1/shield.svg?type=online&name=Rocket.Chat/api/v1/shield.svg?type=channel&channel=general/api/v1/shield.svg?type=channel&name=Rocket.Chat&channel=generalapi/v1/shield.svg?icon=false&name=Rocket.ChatAdmin Option