Recently, I deployed Discourse on a Digital Ocean droplet. It is an excellent exercise for me to be doing cause I can easily nail down issues our install that should be addressed.
One very big problem I had with the install with install were all the magic sample files.
Let me describe my install process in laymen term.
I started by deploying a droplet, easy peasy. Ubuntu was up and running in minutes. Next I created some accounts, installed rvm, postgres, nginx and redis which was all pretty straight forward (the biggest annoyance being postgres security and all the custom apt repos needed)
Anyway, once this was all up it was time to get Discourse configured and that is where I saw the most pain.
Copy production.rb.sample to production.rb ... mess with it.
Copy redis.yml.sample to redis.yml ... mess with it.
Copy unicorn.rb.sample ... mess with it.
Create a bunch of tmp folders for pids and sockets
At the end of this process I have a directory structure that kind of looks like what we have in git, but has a bunch of local changes spread across the filesystem.
This also raised a fairly serious issue in my mind.
What happens when we update production.rb.sample
or any of the other samples? How do users know they need to update them?
Case in point.
At some point we introduced:
config.enable_mini_profiler = true
How do users that have the production.rb file prior to this change know that we added it? It is busywork and fragile.
There must be a saner way.
Can we rename production.rb.sample and for that matter https://github.com/discourse/discourse/blob/master/config/redis.yml.sample to the same without the .sample? That way we can still customise stuff using ENV, however we at least can have reasonable central list of what we expect is configurable and what is not.
This also raises the issue with us having a special database.yml file, which should be addresses, however production.rb and redis.ym are probably the most urgent.
This would very much ease deploying Discourse and more importantly ease updating it. There will be a slight amount of pain during the change, however I feel this .sample
approach is a failure which we should move away from.
cc @eviltrout @Neil @zogstrip