Best practices for customizing deployment

It is common to edit app.yml in order to tweak Discourse settings.

Additionally, in How to avoid throttling limits with admin API key? - #7 by aas I discovered that I need to modify the nginx config to avoid rate-limiting API requests.

My question is, what are the recommended best practices for things like:

  • Versioning files such as app.yml
    • I’d need to version it outside of /var/discourse and move it to /var/discourse/containers/ any time I change it.
  • Modifying, overriding, or adding new templates
    • templates/web.ratelimited.template.yml is not ignored bit git. While it hasn’t changed for 6 years, editing it directly doesn’t seem wise. It is possible that ./launcher rebuild would clobber it. Or the git pull commands would fail.

Possible solution:

  • Create my own git repo with app.yml and a template.
  • Write a GitHub action that uses Ansible to copy app.yml into /var/discourse/containers/ and also copies the template to the server running Discourse

Questions

  • Where would be a good place to put my custom template?

It looks like I can add replace sections directly to app.yml instead of using templates as mentioned here:

Yes you can say with App.yml you can create backup copies and name them as per your needs

If your changing a particular section you can also add comments. Myself as self hosted I have my plugins organized by official, pavilion and other. I add a comment when installing a new plugin in the appropriate section.

Others though may have better ideas than mine.