-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Overview: We run an etherpad-lite
instance on Heroku, which is publicly available at https://etherpad.opennews.org. The instance uses a Postgres db and a Standard 1X dyno (512MB RAM, 1x CPU share). In testing via etherpad-load-test
, these resources are more than enough to handle our normal traffic.
Deployment details: We use SSL for our etherpad-lite instance, which means that to run on Heroku, we need our own forked version of etherpad-lite
that includes heroku-ssl-redirect
. That means we also use a forked version of etherpad-lite-heroku
, which pulls in our version of the etherpad software as a submodule.
The etherpad-lite-heroku
wrapper is what actually gets deployed to Heroku, where it runs a launch script that does some config and starts the etherpad service.
We run an OpenNews fork of etherpad-lite so we can customize a couple things:
- Since we're running on Heroku, we use
heroku-ssl-redirect
to force all traffic over to https. That means we need to add it as a project dependency and make a small change to etherpad-lite's routing code. - We also tweak a few font, font-size, and font-color settings in etherpad-lite's standard "colibris" theme.
To update the OpenNews fork to a new release of etherpad-lite:
- in your local git directory for the project, run
git fetch upstream
- run
git merge upstream/master [ RELEASE ID ]
(e.g. "git merge upstream/master 1.8.6") - you should see merge conflicts in
src/package.json
andsrc/package-lock.json
. Resolve them by first accepting all the upstream changes (steps 4 and 5 in this process), which will temporarily removeheroku-ssl-redirect
: - run
git checkout --theirs src/package-lock.json
- run
git checkout --theirs src/package.json
- edit
src/package.json
to add"heroku-ssl-redirect": "0.0.3",
to the list of dependencies. (We pin to that version because later versions change fromrequire
toimport
syntax and this one works fine for our needs.) - cd into the
etherpad-lite/src
directory, then runnpm install --save
(this will add aheroku-ssl-redirect
listing topackage-lock.json
) - cd back out to the
etherpad-lite
directory and commit changes with a message like "update local to upstream [ RELEASE ID]" - push those changes to our fork of etherpad-lite on GitHub. (They have to be on GitHub for the build process to work later on.)
This is a light wrapper around etherpad-lite that makes it easier to run on Heroku. We run an OpenNews fork of this project as well, to track our customized etherpad settings. It also references the OpenNews fork of etherpad-lite as a git submodule.
To update the submodule reference:
- copy the git commit ID for the update you just made to the OpenNews fork of etherpad-lite. (You can just click on the commit from the project's GitHub homepage, and then copy the commit ID from that page.)
- in your local git directory for
etherpad-lite-heroku
, cd into theetherpad-lite
directory - run
git pull
- run
git checkout [ COMMIT ID ]
(You should then see a message that says "HEAD is now at [ COMMIT ID] [ COMMIT MESSAGE]") - cd back out to the project root directory and run
git add etherpad-lite/
- run
npm install --save
to make surepackage-lock.json
gets any updates - commit changes with a message like "update etherpad-lite to [ RELEASE ID]"
- push those changes to our fork of etherpad-lite-heroku on GitHub
Now that both of the OpenNews project forks are updated, it's time for Heroku.
- open the opennews-staging-etherpad app dashboard on Heroku, and click the Papertrail resource to open real-time logging so you can monitor this next part
- in your local git directory for
etherpad-lite-heroku
, rungit remote -v
- you should see two Heroku remotes: one called
heroku
(our production install), and one calledheroku-staging
(our staging install). If you don't see those remotes, or if this is the first time you're running through this process, you'll need to add them - run
git push heroku-staging master
, which will trigger a new build - watch the logging for any errors. If it happens to take too long to install the node modules, you may need to manually restart the Heroku dynos to trigger that process again
- once you see that the app is up and running, visit an etherpad at our staging installation on Heroku to test the new version of the software
- open the opennews-etherpad app dashboard on Heroku, and click the Papertrail resource to open real-time logging so you can monitor this next part
- from your local git directory for
etherpad-lite-heroku
, rungit push heroku master
to trigger a new production build - follow the same process as above for monitoring and testing
v1.8.6
etherpad-lite https://github.com/OpenNews/etherpad-lite/commit/1039ba6d8cc9097b2063c9b40a29b380b5a83850
etherpad-lite-heroku https://github.com/OpenNews/etherpad-lite-heroku/commit/9cba67e0a09d49117f6639f39c78c29740b5b915
v1.8.0
etherpad-lite https://github.com/OpenNews/etherpad-lite/commit/df18194a9394386061ecc9ec14da8b42a3177226
etherpad-lite-heroku https://github.com/OpenNews/etherpad-lite-heroku/commit/ee901df8b81da946a5d2567f8dc7a1cc55e8d371