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

Providing overrides / white label container via docker volume mounts #540

Closed
geekgonecrazy opened this issue Aug 21, 2015 · 8 comments
Closed

Comments

@geekgonecrazy
Copy link
Member

@Sing-Li asked me to create this issue.

Pretty much I started with just wanting to be able to override the favicon. So I came up with this snippet below.

docker run --name rocketchat -p 3000:3000 \ 
-v $(pwd)/favicon.ico:/app/bundle/programs/web.browser/app/favicon.ico \
-v $(pwd)/logo.png:/app/bundle/programs/web.browser/app/images/logo/16x16.png \
-v $(pwd)/logo.png:/app/bundle/programs/web.browser/app/images/logo/57x57.png \
-v $(pwd)/logo.png:/app/bundle/programs/web.browser/app/images/logo/75x75.png \
-v $(pwd)/logo.png:/app/bundle/programs/web.browser/app/images/logo/128x128.png \
--env ROOT_URL=http://site.com:3000 --link db:db -d rocket.chat 

So I guess the idea would be that you could override things like this via environment variables.

So things like:

  • Favicon
  • logo
  • css overrides

I'm sure several more.

This would allow many instances of this to be spawned up.

In code this would probably be something like:

variable = process.env.favicon || defaultvalue;

@geekgonecrazy geekgonecrazy changed the title Providing overrides via environment variables Providing overrides / white label container via environment variables Aug 21, 2015
@Sing-Li
Copy link
Member

Sing-Li commented Aug 21, 2015

Related to #277.

The real ingenious part of @geekgonecrazy's approach is that each deployed instance can have a completely different look - configured at deployment time, with assets independent from the build image - without having to customize and re-build and maintain multiple code bases.

For those deploying via docker, this can allow one single VPS or bare-metal to host multiple private-labeled instances of Rocket.Chat simultaneously. If these are lightly loaded instances, over provisioning (just like shared hosting) is possible.

Our work is to enable more 'customization points', in the core code, using this technique.

@Sing-Li Sing-Li changed the title Providing overrides / white label container via environment variables Providing overrides / white label container via docker volume mounts Aug 21, 2015
@rodrigok
Copy link
Member

What about use db to store these settings? Maybe the url that respond the favicon can read the settings and look the right file in FS or load from GridFS (maybe we can upload these files in the settings page)

@geekgonecrazy
Copy link
Member Author

@rodrigok problem with that is, now the UI depends on the db just to render the page right? Also increasing the load on the db in larger instances.

@rodrigok
Copy link
Member

@geekgonecrazy If we use only the settings and get the file from FS using the path in settings we don't use DB, just "redirect" the normal behavior.

@geekgonecrazy
Copy link
Member Author

ah! I get what you're saying now.

So technically I could do something like:

docker run --name rocketchat -p 3000:3000 \
-v $(pwd)/data:/customdata \ 
-e ROOT_URL=http://site.com:3000 --link db:db -d rocket.chat

Then in the settings set favicon to load from disk path at /customdata/favicon.ico

This would then work great for docker or even other setups.

@rodrigok
Copy link
Member

Exactly

@engelgabriel engelgabriel added this to the v1.0 milestone Aug 23, 2015
@mitar
Copy link
Contributor

mitar commented Aug 29, 2015

It would be great if those theming would also be pushed to mobile apps. So that when an user open a hosted project, it gets logos and colors over.

@rodrigok rodrigok modified the milestones: v1.0, v1.1 Aug 30, 2015
@engelgabriel
Copy link
Member

Icons, logos and favicons can now be set on the Admin Panel.

image

image

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

No branches or pull requests

6 participants