[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Moving to a central db
- Subject: Moving to a central db
- From: "Christopher Murtagh" <..hidden..>
- Date: Fri, 3 Nov 2006 13:11:55 -0500
Last night I just did a huge commit that expected the user data to be
in a central db rather than the users/members file or
users/username.conf. The work on this is about 95% done, with some
functionality that still needs to be restored to the admin.pl script
(like viewing and editing users for example).
If your working on svn HEAD (something that is defenitely *not* what
you want to do for a production system), you will not be able to login
until you do a couple of things. Here are the steps needed:
1) You will need to create your central DB (the default db name and
owner in the ledger-smb.conf file is 'ledgersmb'). Ideally this will
have a user and password that differ from all other accounts on the
system. This account should not have access to any of the data sets.
Once the db is created you should go in (as said user) via psql and
run the Pg-central.sql script that is in the sql directory.
2) While you are there you should also set the 'admin' user's password
by doing: 'update users_conf set password = md5('some password here')
where id = 1;'. That password will become the password for the admin
3) Next step is to import user data. Unfortunately I don't have a
script yet, but hope to have one by early to mid next week that will
import all users from your members file. First step in this process is
the create the user by doing 'SELECT create_user('username');'. It
will give you back an integer value (keep that for the 2nd step).
Converting a username.conf file to a .sql file is fairly easy. A
search and replace regex to do so would look something like this:
%s/^\(.*\) => \(.*\),$/UPDATE users_conf SET \1 = \2 WHERE id =
<integer in first step>;/g
You then need to manually change the password = 'something garbled' to
password = md5('the real password')
Then you save the resulting file as username.sql and run it in the
central db as well.
4) The ledger-smb.conf file has the database parameters for the
central db. You need to uncomment and set these three lines
That should get you a mostly working install. Like I said, there are
things in the admin tool that are still not complete. More to come
soon when I get these features done and an import script written.