forked from fedora-infra/fas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
188 lines (118 loc) · 6.39 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
=================================
INSTALL the Fedora Account System
=================================
:Authors: Adam M. Dutko
:Contact: infrastructure@lists.fedoraproject.org
:Date: Wed, 02 November, 2011
:For FAS version: 0.8.x
This file provides a guideline to new developers hacking on the Fedora Account System and administrators attempting to install the Fedora Account System. It is not yet complete.
.. contents::
------------------
Installation Steps
------------------
Step One: Install Required Packages
===================================
As a privileged user on a Fedora system run the following:
yum install git-core postgresql-plpython postgresql-server postgresql-python \
python-TurboMail TurboGears pygpgme python-sqlalchemy python-genshi \
python-psycopg2 pytz python-babel babel python-GeoIP python-openid \
python-fedora-turbogears python-migrate python-memcached python-tgcaptcha2 \
pyOpenSSL gettext python-imaging python-pwquality tulrich-tuffy-fonts
NOTE: Please see the HACKING file located in the same directory as this file for caveats specific to various Fedora and RedHat Enterprise Linux releases.
Step Two: Setup the Database
============================
As a privileged user on a Fedora system run the following:
su - postgres
service postgresql initdb
NOTE: Please read the HACKING file for exceptions to this step for
newer versions of Fedora with systemd.
As a privileged user on other systems such as RHEL run the following:
su - postgres
/etc/init.d/postgresql initdb
Step Three: Adjust Postgresql Connection Settings
=================================================
As a privileged user on a Fedora system modify the pg_hba.conf file:
NOTE: Please read the HACKING file for exceptions to this step for
newer versions of Fedora.
vi /var/lib/pgsql/data/pg_hba.conf
ADJUST THE CONTENTS AT THE BOTTOM OF THE FILE TO MATCH THE FOLLOWING -->
# 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
host all all ::1/128 md5
#EOF
If you need to make other modifications to postgresql please make them now.
Step Four: Start Postgresql
===========================
As a privileged user on a Fedora system run the following:
service postgresql start
OR
sudo systemctl start postgresql.service
As a privileged user on other systems such as RHEL run the following:
/etc/init.d/postgresql start
Step Five: Generate Required Files
==================================
As the user you are using for development run the following from within the fresh fas clone:
python setup.py egg_info && python setup.py build
This step will regenerate files generated by the build script, setup.py. These files are stored in the fas.egg-info directory in your local clone of the fas module. This directory contains metadata about the program and enables components such as the identity provider to work.
Step Six: Setup a Database User for FAS
=========================================
As the postgres user run the following (be sure to remember your password):
createuser --encrypted --pwprompt fedora
** enter the password twice **
** setup the user as a superuser ** NOTE: Is this correct?
Step Seven: Setup plpython for FAS
=======================================
As the postgres user run the following:
createlang plpythonu template1
Step Eight: Setup the Schema
============================
As the user you are using for development run the following from within the fresh fas clone:
cp fas2.sql /tmp
Then change to the postgres user and issue the data definition statements by running the following:
su - postgres (or sudo su - postgres)
psql < /tmp/fas2.sql
exit
Then as the user you are using for development run the following from within the fresh fas clone:
rm -f /tmp/fas2.sql
Step Nine: Apply Schema Modifications (NOT NECESSARY FOR FRESH INSTALL)
=======================================================================
If you are updating your version to 0.8.12, you will need to upgrade the database schema.
As the user you are using for development run the following from within the fresh fas clone:
cp updates/fas2-0.8.11_to_0.8.12.sql /tmp
Then change to the postgres user and issue the data definition statements by running the following:
su - postgres (or sudo su - postgres)
psql < /tmp/fas2-0.8.11_to_0.8.12.sql
exit
Then as the user you are using for development run the following from within the fresh fas clone:
rm -f /tmp/fas2-0.8.11_to_0.8.12.sql
Step Ten: Customize the Configuration File
==========================================
As the user you are using for development run the following from within the fresh fas clone:
cp fas.cfg.sample fas.cfg
Once the sample file is copied to your local configuration file adjust the following parameters to suit your needs:
mail.on # Set to True if you want to test notifications
mail.smtp.server # adjust the host as needed
sqlalchemy.dburi # adjust the password for the postgres FAS host and user
server.socket_port # change if you want to run on a different port
base_url_filter.base_url # adjust the port and host as needed
fas.url # adjust the port and host as needed
key_securityquestion # adjust the key used to encrypt the security answers
You may also need to change some of the directories and settings in fas/config/app.cfg.
Step Eleven: Adjust your Firewall
=================================
Remember to adjust your firewall to allow TCP traffic through your port of choice configured in Step #10.
Step Twelve: Start FAS
======================
As the user you are using for development run the following from within the fresh fas clone:
./start-fas
Navigate to the URL you set for fas.url to test the installation works. The default administrative user is "admin" with password "admin". Then create a user to make sure that function works. As a reminder, using localhost.localdomain in your e-mail address is valid.
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