-
-
Notifications
You must be signed in to change notification settings - Fork 112
Setup
If you haven't done it already, clone the deployment repository:
git clone https://github.com/openfoodfoundation/ofn_deployment.git
You will need a vars.yml
file. It defines important customisations of your deployment like locale, domain name, database and admin passwords. Copy the example file and edit it:
cp vars.example.yml vars.yml
# edit vars.yml with your favourite editor
If you want to deploy to multiple servers, you probably want to have a vars file for each of them. Place them in the host_vars
directory, for example:
mkdir host_vars
cp vars.example.yml host_vars/www.openfoodnetwork.au.yml
cp vars.example.yml host_vars/staging.openfoodnetwork.au.yml
# edit host_vars/*.yml with your favourite editor
If you're not familiar with YAML, read more at the official YAML site. You can validate the syntax of your vars file with the Online YAML Parser.
By default, the OFN is installed with Australia specific data like states and postcodes.
The Open Food Foundation collects more localisation data repositories. They follow the name scheme l10n_<country-code>
like l10n_gb or l10n_fr.
If you are the first to run an OFN app for a country, you have to create a repository with that data first. It should contain the following files:
- countries.yml - optional
- states.yml
- suburbs.csv
Publish that repository somewhere accessible for your server. The Open Food Foundation will be happy to put your repository amongst the others. Then change the l10n_repo
variable in your vars file to match your repository.
The OFN comes with several language files in config/locales
. You choose the language in the vars file by setting the locale
variable. If you want to change the language of the application at a later point, you can do that directly on the server:
ssh example.com
cd apps/openfoodnetwork/current
vi config/application.yml # change LOCALE
rm public/assets/darkswarm/all*.js
bundle exec rake RAILS_ENV=staging assets:precompile:primary RAILS_GROUPS=assets
bundle exec rake RAILS_ENV=staging assets:precompile:nondigest RAILS_GROUPS=assets
service unicorn_openfoodnetwork restart
For production and staging environments, you will need SSL certificates for the domain name. (The domain name is specified in the vars.yml
file.)
- Purchase a certificate from a provider.
- Create two text files:
ssl.crt
andssl.key
. - In
ssl.crt
add the content of the certificate and chain bundle. - In
ssl.key
add the content of the private key.
Note: the formatting of these text blocks must be that there are no spaces other than in the start/end lines and each line is 64 characters long.
- Put these in the
files
folder.
Provisioning
Deployment
Sysadmin
External services
- Sending emails from OFN
- Email Deliverability
- SSL certificates
- Google Maps
- File storage
- Backups
- Server monitoring
- Issue reporting (Bugsnag)
Contributing