Self-upgrade and app configuration functionalities: modular?

Question about two features of discourse: both the upgrade and the configuration features are great, and I would like to implement something like each of them on other rails apps I am working on. Short of just cribbing from the source, is either of those features easily ported to other apps? Thanks!

Feel free to extract whatever you want we are open to relicensing the extractions under MIT

Discourse docker is already MIT