I stumbled a bit (quite a bit) until I managed [1] to have a running deployment.
To potentially save some time for future newcomers, seeing that the documentation is somewhat outdated, I'll list here my steps along with some hurdles I ran into and some corresponding questions.
1. started from fresh fresh
Ubuntu 18.04 *docs need to be updated, the Debian Wheezy 64-bit or Ubuntu Trusty - 14.04 are outdated.
updated packages:
>
sudo apt upgrade
*not sure this is a necessary step, I previously had bundle error [2] and later updating the packages might've helped?
2. added my domain to
hosts,
both on the VPS and my local machine
*to be found
/etc/hosts for Ubuntu, Debian, MacOS
3. downloaded & ran the install script:
>
curl -O https://raw.githubusercontent.com/mysociety/commonlib/master/bin/install-site.sh >
sudo sh install-site.sh alaveteli alaveteli-usr alaveteli.myfoia.org4. set the password for the newly created user
>
sudo passwd alaveteli-usrthen switched to it:
>
su alaveteli-usr
5. in the Alaveteli folder (
/var/www/alaveteli.myfoia.org/alaveteli) ran:
>
bundle pristine 6. created the production database –
as suggested here>
RAILS_ENV=production bin/rake db:create db:migrate db:seedthen
>
script/rails-post-deploy7. launched Alaveteli:
>
service alaveteli start interestingly, each time I touch the alaveteli service as the alaveteli user I get prompted for the user initially used to run the installation script
8. by this time I had a running app with no styling - some assets, styles and javascript not found – guess they didn't get compiled and moved in the alaveteli/public folder.
Also ran
bundle exec rake themes:install but that didn't help by itself.
bundle exec rake assets:precompile – copies some images into alaveteli/public/assets but not the css/js
I sloppily fixed this by stealing the compiled css & js from a Vagrant install.
9. Creating the admin user.
following
Create an admin account I created then confirmed via email (I used
mailinator.com to make sure the message doesn't get rejected) and proceeded to /admin?emergency=1 where I logged in with the emergency user,
see:
ADMIN_USERNAME /
ADMIN_PASSWORD found in
alaveteli/config/general.ymlThen I ran into
this issue: I could edit the new user, but the admin checkbox was disabled. After this step, the emergency user gets disabled, so I got stuck – I eventually managed to elevate my newly created user to admin by editing the users_roles table,
as described here.
--------
Are all the above steps necessary, or it's just that the install script failed some tasks?
I saved some logs doing the installation steps:
--------
The installation script page states:
>
This is not suitable for production (it runs in development mode, for example) but should set up a functional installation of the site, which can send and receive email.* even-though the install script uses
alavateli_production database
Does this relate to some configuration items that need changed before going into production, or the install-sh way is not generally suitable for production, the suggested way being the manual install?
thank you,
alex
_____________
[1] with the kind help of
Andrei which was familiar with an old version of Alaveteli.
[2]
/usr/bin/bundle: bundle: line 5: syntax error near unexpected token `"INT"' /usr/bin/bundle: bundle: line 5: `Signal.trap("INT") do'