Discourse Container Names Admin Plugin

I am happy to share this first public Discourse admin plugin which adds the names of containers (specified in the main app yml file), to the backups tab of the admin page.

This utility plugin is useful for Discourse sys admins who run multi-container configurations and wish to see, at a glance, which container is running.

SCREENSHOT

This is a simple utility plugin, and my first "public" one, so comments and PRs are very welcome to improve it. The container information comes from environmental vars in the yml file, for example:

  • DISCOURSE_CONTAINER_MAIN
  • DISCOURSE_CONTAINER_DATA

We run multiple containers live at the same time so we can rebuild a container and cut over to it with zero down time (changing the reverse proxy configuration), so for us, it is better to hard code this value into the yml file versus pulling it from docker ps because docker ps has no way of knowing which container is enabled by configuration in the reverse proxy.

In addition, getting the info from the reverse proxy configuration is "platform and web server specific" and so not a good option.

TODO

My Ember skills are poor compared to the Discourse experts, so I had issues in two areas so there are at least two open TODOs, and I welcome a PR if anyone is interested:

  1. When the Discourse app (GUI) is running and we switch containers (via a reverse proxy configuration change) the page must be reloaded (or the plugin disabled and re-enabled). I could not get the computed property to update automatically (I tried many different techniques).

  2. Could not get I18N to work as expected, so the <span> element is hard-coded into the JS code versus residing in the locale configuration (but draft placeholders are there).

If anyone here want to work to improve this, helping with the open TODOs, or adding more features, please feel free.

PRs welcome @hicksd8 and others :slight_smile:

See also (on Discourse meta):

2 Likes