Skip to content
This repository
Newer
Older
100644 107 lines (76 sloc) 3.039 kb
d4ca1b1d »
2012-03-14 add info about postgresql authentication config
1 ## Server setup
3d626e08 »
2012-03-10 update README and add server setup README file
2
3 The server is using in Python, using the Flask web framework and SQLAlchemy for the models.
4
5 To install the server in a virtualenv do the following:
6
7 Clone the repository
8
7f12ea58 »
2012-03-10 README markdown formatting
9 ```git clone git://github.com/mapleoin/popcorn.git
10 ```
3d626e08 »
2012-03-10 update README and add server setup README file
11
12 Create the virtualenv and activate it
13
7f12ea58 »
2012-03-10 README markdown formatting
14 ```
15 $ virtualenv vpopcorn
16 $ source vpopcorn/bin/activate
17 ```
3d626e08 »
2012-03-10 update README and add server setup README file
18
53cf635f »
2012-03-14 added notes about the python-devel dependency
19 You will need the postgresql and python development files to install psycopg2 which
3d626e08 »
2012-03-10 update README and add server setup README file
20 is a required dependency for popcorn you should install this using your
53cf635f »
2012-03-14 added notes about the python-devel dependency
21 distribution's package manager. Example: `zypper install gcc python-devel postgresql-devel`
3d626e08 »
2012-03-10 update README and add server setup README file
22
23 Set up your development environment. This will add the popcorn package
24 to your python path, but will not install it anywhere else. You can now
25 edit the files in the git clone directory and the changes will be
26 immediately visible to the server.
27
7f12ea58 »
2012-03-10 README markdown formatting
28 ```
29 $ cd popcorn
30 $ ./setup.py develop
31 ```
3d626e08 »
2012-03-10 update README and add server setup README file
32
33 You can check that the unittests run fine
34
7f12ea58 »
2012-03-10 README markdown formatting
35 ```$ ./setup.py test```
3d626e08 »
2012-03-10 update README and add server setup README file
36
d4ca1b1d »
2012-03-14 add info about postgresql authentication config
37
38 ### Setup the database
39
3d626e08 »
2012-03-10 update README and add server setup README file
40 Install and setup postgresql-server for your distribution, then turn it
41 on. Create the popcorn user and database.
42
7f12ea58 »
2012-03-10 README markdown formatting
43 ```
44 $ su - postgres
45 $ createuser popcorn -P
46 Enter password for new role: <enter popcorn as the password>
47 Enter it again: <popcorn again>
48 Shall the new role be a superuser? (y/n) n
49 Shall the new role be allowed to create databases? (y/n) n
50 Shall the new role be allowed to create more new roles? (y/n) n
51 $ createdb popcorn --owner=popcorn
52 ```
3d626e08 »
2012-03-10 update README and add server setup README file
53
54 If you've set different values here than the default, edit `DB_ENGINE` in
55 `popcorn/configs.py` and set them there as well
56
d4ca1b1d »
2012-03-14 add info about postgresql authentication config
57 Setup the database to use md5 authentication for local users by editing your system's `pg_hba.conf` file and replacing these lines:
58
59 ```
60 # "local" is for Unix domain socket connections only
61 local all all ident sameuser
62 # IPv4 local connections:
63 host all all 127.0.0.1/32 ident sameuser
64 ```
65
66 with these:
67
68 ```
69 # "local" is for Unix domain socket connections only
70 local all all md5
71 # IPv4 local connections:
72 host all all 127.0.0.1/32 md5
73 ```
74
75
3d626e08 »
2012-03-10 update README and add server setup README file
76 Initialize the database (installs tables and initial data).
77
7f12ea58 »
2012-03-10 README markdown formatting
78 ```$ ./server/popcorn-server init_db
79 ```
3d626e08 »
2012-03-10 update README and add server setup README file
80
81 Start the server with the `--debug` flag (changes to files will cause
82 the server to reload them immediately + nice traceback pages)
83
7f12ea58 »
2012-03-10 README markdown formatting
84 ```
85 $ ./server/popcorn-server --debug
86 * Running on http://127.0.0.1:5000/
87 * Restarting with reloader
88 ```
3d626e08 »
2012-03-10 update README and add server setup README file
89
90 You can now point your browser to http://127.0.0.1:5000/ (there won't be
91 much to see).
92
93
d4ca1b1d »
2012-03-14 add info about postgresql authentication config
94 ## Client
3d626e08 »
2012-03-10 update README and add server setup README file
95
96 In order to test the client, you will need to have the `python-rpm`
97 package installed. It's easier to do this from outside the virtualenv,
98 because virtualenv will hide your system's site-packages by default (and
99 this is also how `popcorn-client` will run *in the wild*).
100
7f12ea58 »
2012-03-10 README markdown formatting
101 ```
102 $ POPCORN_ENABLED=1 ./popcorn-client
103 Submission received. Thanks!
104 ```
3d626e08 »
2012-03-10 update README and add server setup README file
105
106 If you now look on the popcorn webUI, you should see a lot of data about
107 your currently installed packages.
Something went wrong with that request. Please try again.