fedora-infrastructure/fas
2008-03-14 13:05:01 -04:00
..
client removed some debug 2008-03-13 16:06:37 -05:00
fas Woohoo, click-through CLA! 2008-03-14 13:05:01 -04:00
po Fix bug in user list template, regenerate POT 2008-03-13 11:06:26 -04:00
.gitignore Get l10n working. Anonymous users can choose a language through a form on the sidebar. Authenticated users can set a language in their user settings. 2008-03-03 00:22:15 -05:00
convert.py Fix convert, user.py imports, remove test translation. 2008-03-11 19:47:07 -04:00
COPYING Add a GPLv2 license file. 2008-03-09 18:03:08 -07:00
fas.cfg Get auto-approve working. 2008-03-12 22:47:03 -04:00
fas.spec Preping for another release 2008-03-11 14:02:18 -05:00
fas2.sql Organize the CLA just like we had in FAS1 (we can recover this if we ever need to split into cla_sign/click) 2008-03-12 18:18:12 -04:00
MANIFEST.in Get python setup.py sdist to include all the files we need to distribute. 2008-03-09 13:01:56 -07:00
pybabel.conf Fix some problems with extraction, dedent wasn't worth it. To test, set locale to "test" using either of the previously mentioned methods. 2008-03-03 00:48:26 -05:00
README Update README with l10n info. 2008-03-04 22:05:59 -05:00
sample-prod.cfg Initial import. Old location http://cvs.fedoraproject.org/viewcvs/accounts2/?root=fedora 2007-07-06 09:24:13 -05:00
setup.py * Bah. Not perfect but we need to get an rpm out. 2008-03-10 11:39:12 -07:00
start-fas * Replace start-fas.py with start-fas. 2008-03-09 12:39:13 -07:00
test.cfg Initial import. Old location http://cvs.fedoraproject.org/viewcvs/accounts2/?root=fedora 2007-07-06 09:24:13 -05:00
TODO * Initial spec file. Update TODO with setup.py problems we have to work 2008-03-10 12:24:21 -07:00

=====================
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