I am happy to share this 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 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 Discourse containers and cut over to it with zero down time (changing the reverse proxy configuration), so for us, it was 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.
TODO
My Ember skills are poor compared to the Discourse experts (still trying to learn Ember), so I had some issues in two areas so there are at least two open TODOs, and I welcome a PR if anyone is interested:
-
When the Discourse app (GUI) is running and we switch containers (via a reverse proxy configuration change) the page must be reloaded (or plugin disabled and re-enabled). I could not get the computed property to update automatically (I tried many different techniques).
-
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).
As mentioned, PRs are welcome, as I am still a Discourse plugin noob!
Comments and Updates Also Welcome Here:
PRs welcome!