- to make passenger restart: touch /pub/www/compendium-acc/tmp/restart.txt
- RAILS_ENV=acceptance rails c to start console in acceptance environment (as compendium user obviously!)
- Reset db on acceptance (shouldnt ever have to do this)
service apache2 stop (as root)
RAILS_ENV=acceptance rake db:migrate:resetdb:seed (as compendium user)
service apache2 start (as root)
molotov.terena.org
acceptance and integration
import legacy compendia
Parse legacy HTML pages.
Visit a legacy compendium, go to all the sections and click on edit and save the file to /lib/legacy/<year>/file.html
Also create a folder in /db/legacy/<year>
run: rake legacy:convert:questions_2010 to import the questions to the new compendium.
Import legacy db
Make an .sql dump of the legacy compendium
Locally create a new database and import the legacy data in it (note that you have to run this import as compendium user)
$ psql -h localhost -U compendium postgres
postgres=> create database compendium2010;
$ psql -h localhost -U compendium compendium2010 < compendium2010.sql
(You might want to remove all the GRANT calls from the .sql file first!)
Create a /lib/legacy/2010/schema.rb with the custom table 'translations' and add the new database environment to config/database.yml
Now import the legacy database to the new compendium:
$ rake legacy:convert:answers_2010
This will create /db/legacy/2010/answers.yml
Running the seed
To prevent everything from being seeded, comment out the imports you do NOT want
$ rake db:migrate:reset db:seed
if this fails, you should run them as separate rake tasks: rake db:migrate:reset && rake db:seed
Add a new user
The process is very similar to EventR.
- Send user to the url: https://compendiumdatabase.geant.org/request_access
- User has to sign in using federated authentication
- After sign in, user gets redirected back to the page where they have to select their NREN and enter their email address
- After successful completion of the form, an email gets sent to: compendium-admin@lists.geant.org
- Please follow instructions in said email to approve account (You have to a Compendium admin in order to approve other users)
- On the 'NREN users' page, next to the respective user tick the approve checkbox and hit 'update NREN'
- User automatically gets a notification email
To make the user Admin, please follow these instructions: - ssh rykov.terena.org (not yet migrated)
sudo su - compendium
cd /pub/www/compendium/
RAILS_ENV=production rails console
User.find_by(tal_id: xxx).update(roles: ["ADMIN", "PANEL"])
- Inform user that they now have super powers!