144 lines
4.5 KiB
Text
144 lines
4.5 KiB
Text
=====================
|
|
Fedora Account System
|
|
=====================
|
|
|
|
:Authors: Ricky Zhou
|
|
Mike McGrath
|
|
Toshio Kuratomi
|
|
:Contact: fedora-infrastructure-list@redhat.com
|
|
:Date: Friday, 29 February, 2008
|
|
:Version: 0.1
|
|
|
|
The Fedora Account System holds information on Fedora Contributors to give
|
|
them access to the wonderful things that Fedora has.
|
|
|
|
.. contents::
|
|
|
|
This is a TurboGears_ project. It can be started by running the start-fas.py
|
|
script.
|
|
|
|
.. _TurboGears: http://www.turbogears.org
|
|
|
|
-------------
|
|
Prerequisites
|
|
-------------
|
|
Before you can get started, make sure to have the following packages installed
|
|
(example being from Fedora 8 with a local postgres database server)::
|
|
|
|
yum install git-core postgresql-plpython postgresql-server postgresql-python \
|
|
python-TurboMail TurboGears pygpgme python-sqlalchemy python-genshi \
|
|
python-psycopg2 pytz python-babel babel
|
|
|
|
# Note: on RHEL5 you need postgresql-pl instead of postgresql-plpython
|
|
|
|
At present, the database needs to be a postgres database since we use triggers
|
|
to manage some of the data (like syncing accounts with bugzilla).
|
|
|
|
If you are unfamiliar with postgres and this is your first time installing it,
|
|
you will want to generate the database and allow users to connect. First as
|
|
root run::
|
|
|
|
/etc/init.d/postgresql initdb
|
|
|
|
Then make sure the bottom of /var/lib/pgsql/data/pg_hba.conf looks like::
|
|
|
|
# TYPE DATABASE USER CIDR-ADDRESS METHOD
|
|
|
|
# "local" is for Unix domain socket connections only
|
|
local all all ident sameuser
|
|
# IPv4 local connections:
|
|
#host all all 127.0.0.1/32 ident sameuser
|
|
# IPv6 local connections:
|
|
#host all all ::1/128 ident sameuser
|
|
|
|
host all all 0.0.0.0 0.0.0.0 md5
|
|
|
|
Then just start the postgres database:
|
|
|
|
/etc/init.d/postgresql start
|
|
|
|
-------
|
|
Hacking
|
|
-------
|
|
If you want to hack on the Account System you need to checkout the module.
|
|
It's presently part of the fedora-infrastructure git repo::
|
|
git clone git://git.fedorahosted.org/git/fedora-infrastructure
|
|
cd fedora-infrastructure/fas
|
|
|
|
Once you are inside you're fresh checkout, you need to regenerate some files
|
|
that are created by the build script, setup.py::
|
|
python setup.py egg_info
|
|
|
|
This will create the fas.egg-info directory which has metadata about the
|
|
program. It allows things like the identity provider to work.
|
|
|
|
Do any configuration necessary and start up the postgres server. Then make the
|
|
plpython language available on new databases, create a postgres user to manage
|
|
the data and import the schema::
|
|
sudo -u postgres createlang plpythonu template1
|
|
sudo -u postgres createuser --encrypted --pwprompt fedora
|
|
sudo -u postgres psql < fas2.sql
|
|
|
|
The last thing to do is configure the application to use your settings.
|
|
You'll need to edit dev.cfg and change the following lines::
|
|
mail.on = False # Set to True if you want to test notification sending
|
|
mail.server = 'localhost' # Your mail server
|
|
sqlalchemy.dburi = "postgres://fedora:pass@localhost/fas2" # Fill in the
|
|
# password you gave in the createuser step and the db host if it's not
|
|
# localhost.
|
|
server.socket_port=8080 # Change if you don't want to run on port 8080
|
|
base_url_filter.base_url = "http://localhost:8080/fas" # Change the port if
|
|
# you changed server.socket_port above.
|
|
|
|
You may also need to change some of the directories and settings in
|
|
fas/config/app.cfg.
|
|
|
|
You should then be able to start the server and test things out::
|
|
./start-fas.py
|
|
# browse to http://localhost:8080/fas/
|
|
|
|
The default administrative user is "admin" with password "admin"
|
|
|
|
Another handy command for trying short snippets of code is tg-admin shell.
|
|
Make sure you're in the top level directory that start-fas.py and dev.cfg is
|
|
in, then run::
|
|
tg-admin shell
|
|
|
|
--------------------
|
|
Enabling Local Users
|
|
--------------------
|
|
* THIS IS EXPERIMENTAL *
|
|
|
|
To allow local users to log in to your system, first enable fas via the
|
|
client in fas/client/fasClient.py
|
|
|
|
./fasClient -e
|
|
|
|
To disable run
|
|
|
|
./fasClient -d
|
|
|
|
To sync with your local install run:
|
|
|
|
./fasClient -i
|
|
|
|
To test, look and see if your groups or users show up with getent. For
|
|
example:
|
|
|
|
getent passwd
|
|
getent group
|
|
|
|
------------
|
|
Localization
|
|
------------
|
|
To generate the POT file (located in the po/ subdirectory), run the
|
|
following from the top level directory:
|
|
|
|
pybabel extract -F pybabel.conf -o po/fas.pot .
|
|
To add a language: tg-admin i18n add <locale>
|
|
This will create a PO file at po/<locale>/LC_MESSAGES/fas.po
|
|
|
|
To update (merge) PO files with the POT file, run:
|
|
|
|
tg-admin i18n merge
|
|
|