mygetlist/pin — pull request #14 by camilotorresf (2014-03-13 17:29:52+00:00)
Title: Added administrative users and image upload servers for scaling

You need to update the database to test this. See changes at the end of pg-pin-schema.sql.
You need to insert a user into the database to test this. See point 1.5 below.

1. Now the admin interface does not have a fixed password for one only user, but users in the DB (separated from site users).
1.1. Users can be super users with access to all of the admin.
1.2. Users can have roles to access different parts of the admin.
1.3. For pin loaders, you should create users in the admin, and provide the user email in the optional email field to associate both users.
1.4. Pin loaders, with the pin_loader rol, will login in:
http://mypinnings.com/admin
But will only have access to:
http://mypinnings.com/admin/input/
They can go there by selecting 'Load Pins' in the admin menu.
1.5. IMPORTANT: to use the admin you should need to insert by hand the first user, a super user, following these instructions:
- Use the program mypinnings/admin/generate_salt_and_hash.py to generate a random salt and hash by selecting a password. Please do not provide the same password you are using right now in the admin. That is leaked by now.
- Copy the salt and hash provided into this statement, and execute the statement in the DB:
insert into admin_users (username, pwsalt, pwhash, super, manager) values
('david', '', '', TRUE, FALSE);
- After that you can log-in with the password you selected, create another super users for the rest of us and tell us the username/password by other means.

2. The way we upload the images has changed in the code. Now it is a separate module with a simple API (for now) to upload images and for getting back the URL of an image given the URL.
2.1. The documentation to use the module is in:
https://github.com/mygetlist/pin/wiki/Image-storing-and-serving
We will improve any documentation issue there.
2.1. In the admin, verify that there is created a media server after you upgrade the DB. The DB has a sentence to insert that media server.
2.2. Test that there are no error uploading images to the server by using, in the admin, 'Load Pins'. There may be configuration errors we can easily fix by changing the media server parameter in the admin (without code, only admin).

3. We should update all the code, site wide, that updates or shows images to this new feature. I will start to do that, but may be it is ready for the next week because I may not have good connection next 2-3 days (travel).