浏览代码

upgrade documentation with pgtool

Damien ACCORSI 10 年前
父节点
当前提交
907484145f
共有 1 个文件被更改,包括 116 次插入60 次删除
  1. 116 60
      README.md

+ 116 - 60
README.md 查看文件

44
 
44
 
45
 Traceability and versionning is something important for quality-ready processes. Unfortunately, specialized software are hard to setup and to use. Let's try Tracim  ! You define access-control for each workspace and store documents and file there. Users can't delete information: everything is versionned and never deleted.
45
 Traceability and versionning is something important for quality-ready processes. Unfortunately, specialized software are hard to setup and to use. Let's try Tracim  ! You define access-control for each workspace and store documents and file there. Users can't delete information: everything is versionned and never deleted.
46
 
46
 
47
+----
48
+
47
 # Tracim - the software #
49
 # Tracim - the software #
48
 
50
 
49
 ## Licence ##
51
 ## Licence ##
63
 
65
 
64
 Hopefully it works on BSD and Windows OSes (but this has not been tested yet)
66
 Hopefully it works on BSD and Windows OSes (but this has not been tested yet)
65
 
67
 
68
+----
69
+
66
 # Use it (or give it a try) #
70
 # Use it (or give it a try) #
67
 
71
 
68
 ## Online Demo ##
72
 ## Online Demo ##
73
 * login as admin: admin@admin.admin
77
 * login as admin: admin@admin.admin
74
 * password: admin@admin.admin
78
 * password: admin@admin.admin
75
 
79
 
76
-_Note : this instance is reset every day_
77
-
78
 ## Ask for a dedicated instance ##
80
 ## Ask for a dedicated instance ##
79
 
81
 
80
-If you wan't your own dedicated instance but do not want to manage it by yourself, let's contact us at hello@trac.im
82
+If you wan't your own dedicated instance but do not want to manage it by yourself, let's contact me at damien.accorsi@free.fr
81
 
83
 
82
 ## Install Tracim on your server ##
84
 ## Install Tracim on your server ##
83
 
85
 
84
 Following the installation documentation below, you'll be able to run your own instance on your server.
86
 Following the installation documentation below, you'll be able to run your own instance on your server.
85
 
87
 
88
+----
89
+
86
 # Installation #
90
 # Installation #
87
 
91
 
88
 ## Dependencies ##
92
 ## Dependencies ##
127
 * Ubuntu (at least 14.04): you should remove _distribute_ and _wsgiref _
131
 * Ubuntu (at least 14.04): you should remove _distribute_ and _wsgiref _
128
   from the requirements.txt file
132
   from the requirements.txt file
129
 
133
 
130
-## Configuration ##
131
 ## Database Setup ##
134
 ## Database Setup ##
132
-## Running the server ##
133
-### Standalone mode ###
134
-### Apache WSGI configuration ###
135
-## Support ##
136
-
137
 
135
 
136
+### Minimalist introduction to PostgreSQL ###
138
 
137
 
139
-### Setup a database ###
138
+If you already use/know PostgreSQL, you can directly go to *Test the database access*.
140
 
139
 
141
 #### Allowing local connections on PostgreSQL ####
140
 #### Allowing local connections on PostgreSQL ####
142
 
141
 
143
-Check the pg_hba.conf file, it should allow connection for user/pass through loopback IP address.
144
-The file should include the following configuration:
142
+PostgreSQL stores connections ahtorization in *pg\_hba.conf*
143
+
144
+Edit the pg_hba.conf file and check that connectionx from 127.0.0.1 are allowed using user/password. You should find the following line in the file:
145
 
145
 
146
     # IPv4 local connections:
146
     # IPv4 local connections:
147
     host    all             all             127.0.0.1/32            md5
147
     host    all             all             127.0.0.1/32            md5
148
 
148
 
149
-Note: on Debian, the pg\_hba file is found at /etc/postgresql/9.1/main/pg_hba.conf
149
+Note: on Debian, the *pg\_hba.conf* file is found at */etc/postgresql/9.1/main/pg\_hba.conf*
150
 
150
 
151
 If you changed the file, reload PostgreSQL:
151
 If you changed the file, reload PostgreSQL:
152
 
152
 
153
     service postgresql reload
153
     service postgresql reload
154
 
154
 
155
-#### Create a new database and user on PostgreSQL ####
155
+#### Creating a user and associated database ####
156
 
156
 
157
-We suppose you will create a user named _tracimuser_ with passowrd _tracimpassword_
158
-and a database _tracimdb_
157
+You need a database and associated user/password.
159
 
158
 
160
-First login as root, then su as postgre and run a PostgreSQL client:
159
+Tracim comes with a tool that will make this step easy : pgtool.
161
 
160
 
162
-    root@hostname:~# su postgres
163
-    postgres@hostname:/root$ psql
164
-    psql (9.1.13)
165
-    Type "help" for help.
166
-    
167
-    postgres=# 
168
-    
169
-    
170
-Now, type the following commands:
161
+    ~/tracim$ ./bin/pgtool help
162
+
163
+login as *postgres* user and run the follwoing commands (which are self explanatory)
171
 
164
 
172
-    CREATE ROLE tracimuser WITH LOGIN PASSWORD 'tracimpassword';
173
-    CREATE DATABASE tracimdb OWNER tracimuser;
174
-    GRANT ALL PRIVILEGES ON DATABASE tracimdb TO tracimuser;
165
+    ./bin/pgtool create_user tracimuser tracimpassword
166
+    ./bin/pgtool create_database tracimdb
167
+    ./bin/pgtool grant_all_priviles tracimdb tracimuser
175
 
168
 
176
-At the end, you can quit the psql client by running the \q quit command:
169
+Notes :
177
 
170
 
178
-    postgres=# \q
179
-    postgres@mozart:/root$
171
+* in order to login as postgres user, su as root (with your password) then su postgres.
172
+* pgtool also offers options to delete users / databases. Run *./bin/pgtool help* for more information
180
 
173
 
181
 #### Test the database access ####
174
 #### Test the database access ####
182
 
175
 
183
-You can test your newly created user by running the following command:
176
+So, now you have a database and an associated user/password.
177
+
178
+A good habit is to test things before to use them, that's why we want to test the database access now. This is easily done with tracim pgtool :
184
 
179
 
185
-    psql -h 127.0.0.1 -W -U tracimuser tracimdb -c 'SELECT NOW();'
180
+    ./bin/pgtool test_connection tracimdb tracimuser tracimpassword 127.0.0.1
186
 
181
 
187
-The result should be similar to:
182
+The result is similar to the following :
183
+
184
+    PG # CONNECT TO DATABASE
185
+    ------------------------
186
+    server:     127.0.0.1
187
+    database:   tracimdb
188
+    username:   bibi
188
 
189
 
189
-    user@hostname:~$ psql -h 127.0.0.1 -W -U tracimuser tracimdb -c 'SELECT NOW();'
190
-    Password for user tracimuser: 
191
                   now              
190
                   now              
192
     -------------------------------
191
     -------------------------------
193
-     2014-06-16 11:35:48.590838+02
192
+     2014-11-10 09:40:23.306199+01
194
     (1 row)
193
     (1 row)
195
 
194
 
196
-#### Setup the database schema and initial data ####
195
+In case of failure, you would get something like this:
196
+
197
+    PG # CONNECT TO DATABASE
198
+    ------------------------
199
+    server:     127.0.0.1
200
+    database:   tracimdb
201
+    username:   bibi
197
 
202
 
198
-Your database is now ready. Fill it with the required schema and data by importing SQL:
203
+    psql: FATAL:  password authentication failed for user "bibi"
204
+    FATAL:  password authentication failed for user "bibi"
205
+    ERRROR
199
 
206
 
200
-    psql -h 127.0.0.1 -W -U tracimuser tracimdb < doc/database/tracim-init-database.sql
207
+In this case, delete the user and database you previously created (using pgtool) and do it again. Do not forget to run the grant_all_rights command!
201
 
208
 
202
-You can test it through the following command:
209
+## Configuration ##
203
 
210
 
204
-    user@hostname:~$ psql -h 127.0.0.1 -W -U tracimuser tracimdb -c 'SELECT * from tracim_user;'
211
+At this point, you have :
205
 
212
 
206
-You should find the admin@localhost user entry.
213
+* an installation of Tracim with its dedicated python3-ready virtualenv
214
+* a PostgreSQL server and dedicated database
207
 
215
 
216
+What you have to do now is to configure the application and to initialize the database content.
208
 
217
 
209
 ### Create configuration ###
218
 ### Create configuration ###
210
 
219
 
211
     cp tracim/development.ini.base tracim/development.ini
220
     cp tracim/development.ini.base tracim/development.ini
212
 
221
 
213
-#### Database 
222
+You can now edit the file and setup required files. Here are the main ones:
223
+
224
+#### Database access ####
214
 
225
 
215
 Configure database in the development.ini file. This is defined as sqlalchemy.url
226
 Configure database in the development.ini file. This is defined as sqlalchemy.url
216
 and the default value is below:
227
 and the default value is below:
217
 
228
 
218
-    sqlalchemy.url = postgresql://tracim_user:tracim_user_password@127.0.0.1:5432/tracim
229
+    sqlalchemy.url = postgresql://tracimuser:tracimpassword@127.0.0.1:5432/tracimdb?client_encoding=utf8
219
 
230
 
220
 #### Listening port
231
 #### Listening port
221
 
232
 
225
 
236
 
226
 #### Interface language
237
 #### Interface language
227
 
238
 
228
-The default language is English. You can change it to french by uncommenting the following line in the .ini file:
239
+The default language is English. You can change it to French by uncommenting the following line in the .ini file:
229
 
240
 
230
     lang = fr
241
     lang = fr
231
 
242
 
232
-    
233
-### Running Tracim as standalone ###
243
+#### SMTP parameters for resetpassword and notifications
244
+
245
+for some reason, you have to configure SMTP parameters for rest password process and SMTP parameters for notifications in separate places.
246
+
247
+The reset password related parameters are the follwoing ones :
248
+
249
+    resetpassword.email_sender = tracim@mycompany.com
250
+    resetpassword.smtp_host = smtp.mycompany.com
251
+    resetpassword.smtp_port = 25
252
+    resetpassword.smtp_login = username
253
+    resetpassword.smtp_passwd = password
254
+
255
+The main parameters for notifications are the following ones:
256
+
257
+    email.notification.from = Tracim Notification <tracim@tmycompany.com>
258
+    email.notification.smtp.server = smtp.mycompany.com
259
+    email.notification.smtp.port = 25
260
+    email.notification.smtp.user = username
261
+    email.notification.smtp.password = password
262
+
263
+#### Website ####
264
+
265
+You must define general parameters like the base_url and the website title which are required for home page and email notification links
266
+
267
+    website.title = My Company Intranet
268
+    website.base_url = http://intranet.mycompany.com:8080
269
+
270
+#### Other parameters  ####
271
+
272
+There are other parameters which may be of some interest for you. For example, you can:
273
+
274
+* include a JS tracker like Piwik or Google Analytics,
275
+* define your own notification email subject
276
+* personalize notification email
277
+* personalize home page (background image, title color...)
278
+* ...
279
+
280
+### database schema ###
281
+
282
+The last step before to run the application is to initialize the database schema. This is done through the following command:
283
+
284
+    source tg2env/bin/activate
285
+    cd tracim && gearbox setup-app && cd -
286
+
287
+## Running the server ##
288
+
289
+### Running Tracim in standalone mode ###
234
 
290
 
235
 Now you can run the standalone server:
291
 Now you can run the standalone server:
236
 
292
 
247
     
303
     
248
 You can now enter the application at [http://localhost:8080](http://localhost:8080) and login:
304
 You can now enter the application at [http://localhost:8080](http://localhost:8080) and login:
249
 
305
 
250
-* user : admin@localhost
251
-* password : admin
306
+* user : admin@admin.admin
307
+* password : admin@admin.admin
252
     
308
     
253
 Enjoy :)
309
 Enjoy :)
254
 
310
 
255
-
256
 ### Running Tracim through Apache WSGI ###
311
 ### Running Tracim through Apache WSGI ###
257
 
312
 
258
 #### Dependencies ####
313
 #### Dependencies ####
266
 Example of Apache WSGI configuration. This configuration refers to productionapp.wsgi which is a copy of the file *app.wsgi* available in the repo. (this file has to be updated to match with your environment and installation)
321
 Example of Apache WSGI configuration. This configuration refers to productionapp.wsgi which is a copy of the file *app.wsgi* available in the repo. (this file has to be updated to match with your environment and installation)
267
 
322
 
268
     <VirtualHost *:80>
323
     <VirtualHost *:80>
269
-        ServerAdmin webmaster@archipeldata.com
270
-        ServerName demo.archipeldata.com
324
+        ServerAdmin webmaster@tracim.mycompany.com
325
+        ServerName tracim.mycompany.com
271
 
326
 
272
         WSGIProcessGroup tracim
327
         WSGIProcessGroup tracim
273
         WSGIDaemonProcess tracim user=www-data group=adm threads=4 python-path=/opt/traciminstall/tg2env/lib/python3.2/site-packages
328
         WSGIDaemonProcess tracim user=www-data group=adm threads=4 python-path=/opt/traciminstall/tg2env/lib/python3.2/site-packages
274
         WSGIScriptAlias / /opt/traciminstall/tracim/productionapp.wsgi
329
         WSGIScriptAlias / /opt/traciminstall/tracim/productionapp.wsgi
275
 
330
 
276
         #Serve static files directly without TurboGears
331
         #Serve static files directly without TurboGears
277
-        Alias /img     /opt/traciminstall/tracim/tracim/public/img/
332
+        Alias /assets     /opt/traciminstall/tracim/tracim/public/assets
278
         Alias /favicon.ico /opt/traciminstall/tracim/tracim/public/favicon.ico
333
         Alias /favicon.ico /opt/traciminstall/tracim/tracim/public/favicon.ico
279
-        Alias /css        /opt/traciminstall/tracim/tracim/public/css
280
-        Alias /javascript /opt/traciminstall/tracim/tracim/public/javascript
281
 
334
 
282
         CustomLog /var/log/apache2/demotracim-access.log combined
335
         CustomLog /var/log/apache2/demotracim-access.log combined
283
         ErrorLog /var/log/apache2/demotracim-error.log
336
         ErrorLog /var/log/apache2/demotracim-error.log
284
         LogLevel debug
337
         LogLevel debug
285
     </VirtualHost>
338
     </VirtualHost>
286
 
339
 
287
-### Help required ###
340
+## Support ##
341
+
342
+### Community - Need help ? ###
343
+
344
+Building the community is a work in progress.
288
 
345
 
289
-If you need help, contact us. If you want to help, contact us. So... contact us ;)
346
+Do not hesitate to contact me : damien.accorsi@free.fr
290
 
347
 
291
-Damien Accorsi - damien.accorsi@free.fr