forked from freifunk/meshkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
194 lines (140 loc) · 7.18 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
189
190
191
192
193
194
= Installation instructions =
== 1. Install web2py and meshkit ==
First you need to install the web2py framework and then the meshkit
application.
=== 1.1 Depencies ===
* python2.5 or python2.6
* If using python 2.5: python-simplejson
=== 1.2 install web2py ===
Fortunately web2py installation is documented really well so there is
not much to say here. Please consult the web2py documentation for general
web2py help: http://www.web2py.com/examples/default/documentation
First of all you need to download and extract the web2py source
code package:
$ wget http://www.web2py.com/examples/static/web2py_src.zip
$ unzip web2py_src.zip
=== 1.3 Install the meshkit application ===
Now change into the just extracted web2py folder and checkout the meshkit
application into the applications folder:
$ cd web2py/applications
$ git clone https://github.com/freifunk/meshkit.git
=== 1.3 Starting/Deploying web2py ===
There are different options for deployment, but the easiest one is
to just run the web2py application with its integrated rocket webserver
directly. This can be done with the follwing command in the web2py folder:
$ python web2py.py --ip=0.0.0.0 --password=foobar --port=8000 --nogui
For other kinds of deployment and integration with different webservers
see http://web2py.com/books/default/chapter/29/13
The meshkit/examples/ folder contains a sample config for apache2 + wsgi.
=== 1.4. Rewrite routes.py ===
Assume you only run web2py for the meshkit application. Thats why you want
to make meshkit the default application. To do this change into the web2py
directory and copy router.example.py to routes.py. Now edit the following
section like this:
routers = dict(
# base router
BASE = dict(
default_application = 'meshkit',
),
)
=== 1.5 Login into Appadmin ===
Now it is time to login into appadmin of your freshly installed web2py
with your browser. Note: Login is only possible if you connect from 127.0.0.1 or
over a secured https connection, but the latter one would require to use the ssl
options when starting web2py in the last step.
So if your installation is not on localhost help yourself with ssh-tunneling:
$ ssh <serverip> -L 8000:127.0.0.1:8000
Now open the url http://127.0.0.1:8000/meshkit/admin/default/index and login with the
password you set when starting web2py.
You will see 4 applications now: admin, examples, meshkit and welcome. If you like
you can delete examples and welcome now or any time later.
=== 1.6 Configure meshkit ===
==== 1.6.1 General app configuration ====
Click the "Edit" button of the meshkit application. After that click "Edit" next
to 0.py. Alternatively edit it from shell in the file
web2py/applications/meshkit/models/0.py
Edit the settings (starting with settings.*) to suit your needs here.
==== 1.6.2 Configure Meshkit ====
Now you need to configure meshkit. To do that go to:
http://127.0.0.1:8000/appadmin/select/db?query=db.config.id>0
Now click the "insert new config" link to create a new config database row.
Noconf: Globally disable configuration. Check this if you only
want to build images, but not configure anything.
Communitysupport: Check this if you want to use meshkit to create images
for wireless communities. It will support community
profiles then. Profiles are taken from:
http://luci.subsignal.org/trac/browser/luci/trunk/contrib/package/community-profiles/files/etc/config
You need to checkout those and save them in a local directory.
You should setup a cronjob to autoupdate them periodically.
Profiles: The path where the community profiles are stored locally.
You only need to set this if Communitysupport is enabled.
This must start end end with a slash ("/")
Communityfiles Dir: Directory where custom files files for communities are stored
which will be copied into the generated firmware image.
You only need to set this if Communitysupport is enabled.
This must start end end with a slash ("/")
Buildroots Dir: This is the directory where meshkit can find your
extracted OpenWrt imagebuilders. Make sure this path
exists and the user running web2py has read and write
access to everything inside it.
Web2py shows the single imagebuilders in this directory
with their full name in the dropdown selection. So you
may rename these to some nices names, e.g.
ar71xx-backfire-10.03.1
This must start end end with a slash ("/")
Images Output Dir: This is the local path where generated images should
be stored after they are generated. Make sure the
user running web2py has read and write access to it.
This must start end end with a slash ("/")
Images Web Dir: The web accessible path where users can download the
generated images. I assume you have some webserver
running which allows access to this path. If you don't
you may set Images Web Dir to static/images
and use http://<url>/static/images here.
Add Defaultpackages: A space seperated list of packages that should be added
to all generated images
Keep Images: How long (in hours) generated images are kept in
"Images Output Dir" before they are deleted by the
internal cronjob. Set to 0 to never delete them.
Webifs: Webinterfaces to offer in the select field for webinterface
seperated by comma, e.g.
luci, none
Lucipackages: Packages to add to the package list to install if luci
is selected as webinterface. Seperated by space.
IPv6Packages Packages to add to the package list if IPv6 is enabled.
Only used when Communitysupport is enabled.
Seperated by space.
Defaulttheme: Theme which should be preselected in the dropdown for theme
selection, e.g.: luci-theme-bootstrap
Adminmail: Your email. Mails about errors are sent there.
Lanprotos: Protocols to offer in the Protocol selectbox for LAN
configuration seperated by commas. Currently
static and olsr are possible values here. You should set
static first because thats the OpenWrt default, e.g.
static, olsr
Wanprotos: Protocols to offer in the Protocol selectbox for WAN
configuration seperated by commas. Currently
dhcp, static and olsr are possible values here. You should set
dhcp first because thats the OpenWrt default, e.g.
dhcp, static, olsr
Expandablehelp: If set helptexts will be expandable. If not they are always
shown.
Click to delete: This would delete this config row. Do NOT check this!
== 2. Build queue ==
The build queue will be started automatically if you visit your page
(the frontend of it to be precise) for the first time. On every request
to the frontend it checks if the build queue is still running. If not
it is restarted.
=== 2.1 Killing the build queue ===
You can do this with the usual linux commands:
$ ps ax |grep build_queue
$ kill <pid>
=== 2.2 manually starting the build queue ===
Change to the web2py folder and execute:
$ python web2py.py -S meshkit -M -R applications/meshkit/private/build_queue.py
== 3. Notes ==
* to speed things up some files like packagelists and output from "make info"
are permanantly cached. If you update the package lists of your imagebuilder
or change profiles you need to delete the static json files inside
applications/meshkit/static/package_lists
* if you want to use different favicons just replace the .ico and .png in static/