Skip to content
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

[NEW] Add shield.svg api route to generate custom shields/badges #6565

Merged
merged 4 commits into from
Apr 4, 2017

Conversation

alexbrazier
Copy link
Contributor

@alexbrazier alexbrazier commented Apr 2, 2017

@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
shield 4

/api/v1/shield.svg?type=online
shield

/api/v1/shield.svg?type=online&name=Rocket.Chat
shield 1

/api/v1/shield.svg?type=channel&channel=general
shield 3

/api/v1/shield.svg?type=channel&name=Rocket.Chat&channel=general
shield 2

api/v1/shield.svg?icon=false&name=Rocket.Chat
shield 5

Admin Option

image

@graywolf336
Copy link
Contributor

Maybe add some settings to enable or disable this for the private servers who don't want this enabled. Otherwise looking good

@alexbrazier
Copy link
Contributor Author

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?

@graywolf336
Copy link
Contributor

Maybe a setting to disable them each individually? That way it's highly configurable?

@k0nsl
Copy link
Contributor

k0nsl commented Apr 2, 2017

Yes, I echo the same sentiments already emitted by @graywolf336 — especially about servers which are private, but other than that? I like it!

@geekgonecrazy
Copy link
Contributor

This is awesome! 👍

@engelgabriel engelgabriel added this to the 0.55.0 milestone Apr 3, 2017
@rodrigok
Copy link
Member

rodrigok commented Apr 3, 2017

This is awesome.

Can we secure that against DDOS attack? Maybe cache the count of online users for 1min, idk if it will help :)

@alexbrazier
Copy link
Contributor Author

@rodrigok I've changed it to cache online count for 1 minute as you suggested

@rodrigok
Copy link
Member

rodrigok commented Apr 3, 2017

@graywolf336 @geekgonecrazy @marceloschmidt @sampaiodiego what do you think guys? Is that good in the code point of view?

Copy link
Contributor

@geekgonecrazy geekgonecrazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 looks good to me!

@geekgonecrazy
Copy link
Contributor

geekgonecrazy commented Apr 3, 2017

I think for github specifically this won't be too bad in terms of DDoS. They do caching I believe here as well

@engelgabriel engelgabriel merged commit d88a153 into RocketChat:develop Apr 4, 2017
@TheReal1604
Copy link
Contributor

This is really awesome, thanks for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants