Browse Source

add default documentation

Damien Accorsi 10 years ago
parent
commit
f6190c317b
1 changed files with 212 additions and 0 deletions
  1. 212 0
      README.md

+ 212 - 0
README.md View File

@@ -0,0 +1,212 @@
1
+# Introduction to POD #
2
+
3
+Pod is collaborative software designed to allow people to work on and share various data and document types. 
4
+
5
+It is [AGPL licenced](http://fr.wikipedia.org/wiki/GNU_Affero_General_Public_License) software.
6
+
7
+Pod is licensed under the terms of the 
8
+[GNU Affero General Public License](http://www.gnu.org/licenses/agpl.txt)
9
+as published by the [Free Software Foundation](http://www.fsf.org/).
10
+
11
+It is currently unstable, it is recommended to use it for test purpose only.
12
+
13
+It's a python 3 web application based on [TurboGears](http://www.turbogears.org/); it uses [PostgreSQL](http://www.postgresql.org/) as storage engine.
14
+
15
+## Features ##
16
+
17
+* Data and document sharing: text documents, files, contact, calendar, comments
18
+* Data and document status
19
+* Full traceability
20
+* Access control management, document granularity.
21
+
22
+It allows to keep private and shared data in the same place.
23
+The ACL is based on share with groups or individual users.
24
+
25
+## Give it a try ##
26
+
27
+### Online demo ###
28
+The fastest way to test it is to test the demo:
29
+
30
+* http://demo.archipeldata.com
31
+* login: demo@archipeldata.com
32
+* password: demo
33
+
34
+### Install your own instance ###
35
+
36
+The other way to test it is to install it on your computer. See documentation below.
37
+
38
+## Installation ##
39
+
40
+### Dependencies###
41
+
42
+Note: the following information is for Debian. For other OS, adapt the package names.
43
+
44
+You'll need to install the following packages:
45
+
46
+    apt-get install realpath python3 python-virtualenv python-dev python-pip build-essential
47
+
48
+If you work on a local database, then you also need to install PostgreSQL:
49
+
50
+    apt-get install postgresql postgresql-client
51
+
52
+### Get the source ###
53
+
54
+Get the sources from Bitbucket:
55
+
56
+    git clone https://bitbucket.org/lebouquetin/pod.git
57
+
58
+### Setup a database ###
59
+
60
+#### Allowing local connections on PostgreSQL ####
61
+
62
+Check the pg_hba.conf file, it should allow connection for user/pass through loopback IP address.
63
+The file should include the following configuration:
64
+
65
+    # IPv4 local connections:
66
+    host    all             all             127.0.0.1/32            md5
67
+
68
+Note: on Debian, the pg\_hba file is found at /etc/postgresql/9.1/main/pg_hba.conf
69
+
70
+If you changed the file, reload PostgreSQL:
71
+
72
+    service postgresql reload
73
+
74
+#### Create a new database and user on PostgreSQL ####
75
+
76
+We suppose you will create a user named _poduser_ with passowrd _podpassword_
77
+and a database _poddb_
78
+
79
+First login as root, then su as postgre and run a PostgreSQL client:
80
+
81
+    root@hostname:~# su postgres
82
+    postgres@hostname:/root$ psql
83
+    could not change directory to "/root"
84
+    psql (9.1.13)
85
+    Type "help" for help.
86
+    
87
+    postgres=# 
88
+    
89
+    
90
+Now, type the following commands:
91
+
92
+    CREATE ROLE poduser WITH LOGIN PASSWORD 'podpassword';
93
+    CREATE DATABASE poddb OWNER poduser;
94
+    GRANT ALL PRIVILEGES ON DATABASE poddb to poduser;
95
+
96
+At the end, you can quit the psql client by running the \q quit command:
97
+
98
+    postgres=# \q
99
+    postgres@mozart:/root$
100
+
101
+#### Test the database access ####
102
+
103
+You can test your newly created user by running the following command:
104
+
105
+    psql -h 127.0.0.1 -W -U poduser poddb -c 'SELECT NOW();'
106
+
107
+The result should be similar to:
108
+
109
+    user@hostname:~$ psql -h 127.0.0.1 -W -U poduser poddb -c 'SELECT NOW();'
110
+    Password for user poduser: 
111
+                  now              
112
+    -------------------------------
113
+     2014-06-16 11:35:48.590838+02
114
+    (1 row)
115
+
116
+#### Setup the database schema and initial data ####
117
+
118
+Your database is now ready. Fill it with the required schema and data by importing SQL:
119
+
120
+    psql -h 127.0.0.1 -W -U poduser poddb < doc/database/pod-init-database.sql
121
+
122
+You can test it through the following command:
123
+
124
+    user@hostname:~$ psql -h 127.0.0.1 -W -U poduser poddb -c 'SELECT * from pod_user;'
125
+
126
+You should find the admin@localhost user entry.
127
+
128
+### Setup python virtualenv ###
129
+
130
+Pod uses virtualenv as deployment environment. This ensure that there will be no 
131
+conflict between system-wide python modules and pod required ones.
132
+
133
+    virtualenv -p /usr/bin/python3 tg2env
134
+    source tg2env/bin/activate
135
+    cd pboard && python setup.py develop && cd -
136
+    pip install -r install/requirement.txt
137
+    
138
+Note: you may get errors with stevedore/pbr which is not supported by python 3.2
139
+(debian version of python 3). This is not a real problem
140
+
141
+### Create configuration ###
142
+
143
+    cp pboard/development.ini.base pboard/development.ini
144
+
145
+Configure database in the development.ini file. This is defined as sqlalchemy.url
146
+and the default value is below:
147
+
148
+    sqlalchemy.url = postgresql://pod_user:pod_user_password@127.0.0.1:5432/pod
149
+
150
+
151
+    
152
+### Running Pod as standalone ###
153
+
154
+Now you can run the standalone server:
155
+
156
+    ./bin/run.sh
157
+    
158
+Which should result in something like this:
159
+
160
+    13:53:49,982 INFO  [gearbox] Starting subprocess with file monitor
161
+    13:53:50,646 WARNI [py.warnings] /tmp/pod/protov1/tg2env/lib/python3.2/site-packages/tw2/core/validation.py:12: ImportWarning: Not importing directory '/tmp/pod/protov1/tg2env/lib/python3.2/site-packages/tw2/core/i18n': missing __init__.py
162
+      from .i18n import _
163
+    
164
+    13:53:50,862 INFO  [gearbox] Starting server in PID 11174.
165
+    Starting HTTP server on http://0.0.0.0:8080
166
+    
167
+You can now enter the application at [http://localhost:8080](http://localhost:8080) and login:
168
+
169
+* user : admin@localhost
170
+* password : admin
171
+    
172
+Enjoy :)
173
+
174
+
175
+### Running Pod through Apache WSGI ###
176
+
177
+#### Dependencies ####
178
+
179
+Install dependencies:
180
+
181
+    apt-get install apache2 libapache2-mod-wsgi-py3
182
+
183
+#### WSGI configuration ####
184
+
185
+    <VirtualHost *:80>
186
+        ServerAdmin webmaster@archipeldata.com
187
+        ServerName demo.archipeldata.com
188
+
189
+        WSGIProcessGroup pod
190
+        WSGIDaemonProcess pod user=www-data group=adm threads=4 python-path=/opt/demo.archipeldata.com/tg2env/lib/python3.2/site-packages
191
+        WSGIScriptAlias / /opt/demo.archipeldata.com/pboard/productionapp.wsgi
192
+
193
+        #Serve static files directly without TurboGears
194
+        Alias /img     /opt/demo.archipeldata.com/pboard/pboard/public/img/
195
+        Alias /favicon.ico /opt/demo.archipeldata.com/pboard/pboard/public/favicon.ico
196
+        Alias /css        /opt/demo.archipeldata.com/pboard/pboard/public/css
197
+        Alias /javascript /opt/demo.archipeldata.com/pboard/pboard/public/javascript
198
+
199
+        CustomLog /var/log/apache2/demopod-access.log combined
200
+        ErrorLog /var/log/apache2/demopod-error.log
201
+        LogLevel debug
202
+
203
+    </VirtualHost>
204
+
205
+### Help required ###
206
+
207
+Contact us:
208
+
209
+* damien.accorsi@free.fr
210
+* sylvain.ferot@hotmail.xxx
211
+
212
+