Skip to content

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

Merged
engelgabriel merged 4 commits into
RocketChat:developfrom
alexbrazier:feature/shields
Apr 4, 2017
Merged

[NEW] Add shield.svg api route to generate custom shields/badges#6565
engelgabriel merged 4 commits into
RocketChat:developfrom
alexbrazier:feature/shields

Conversation

@alexbrazier

@alexbrazier alexbrazier commented Apr 2, 2017

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

@k0nsl

k0nsl commented Apr 2, 2017

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

This is awesome! 👍

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

rodrigok commented Apr 3, 2017

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor Author

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

@rodrigok

rodrigok commented Apr 3, 2017

Copy link
Copy Markdown
Member

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

@geekgonecrazy geekgonecrazy left a comment

Copy link
Copy Markdown
Contributor

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

geekgonecrazy commented Apr 3, 2017

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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