Browse Source

Merge pull request #544 from kvch/gh-pages

install docs update && dev tips
Adam Tauber 8 years ago
parent
commit
485978276b

+ 2
- 0
_sources/dev/contribution_guide.txt View File

@@ -64,6 +64,8 @@ In order to submit a patch, please follow the steps below:
64 64
 
65 65
 - Create a pull request.
66 66
 
67
+For more help on getting started with searx development, see :ref:`devquickstart`.
68
+
67 69
 
68 70
 Translation
69 71
 ~~~~~~~~~~~

+ 18
- 0
_sources/dev/install/installation.txt View File

@@ -179,6 +179,24 @@ Add this configuration in the server config file
179 179
             uwsgi_pass unix:/run/uwsgi/app/searx/socket;
180 180
     }
181 181
 
182
+
183
+OR
184
+
185
+using reverse proxy
186
+(Please, note that reverse proxy advised to be used in case of single-user or low-traffic instances.)
187
+
188
+.. code:: nginx
189
+
190
+    location /searx {
191
+        proxy_pass http://127.0.0.1:8888;
192
+        proxy_set_header Host $host;
193
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
194
+        proxy_set_header X-Scheme $scheme;
195
+        proxy_set_header X-Script-Name /searx;
196
+        proxy_buffering off;
197
+    }
198
+
199
+
182 200
 Enable base\_url in searx/settings.yml
183 201
 
184 202
 ::

+ 18
- 0
_sources/dev/quickstart.txt View File

@@ -1,3 +1,5 @@
1
+.. _devquickstart:
2
+
1 3
 Development Quickstart
2 4
 ----------------------
3 5
 
@@ -88,3 +90,19 @@ After installing grunt, the files can be built using the following command:
88 90
 .. code:: sh
89 91
 
90 92
     ./manage.sh build_grunt
93
+
94
+
95
+
96
+Tips for debugging/development
97
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98
+
99
+1. Turn on debug logging
100
+    Whether you are working on a new engine or trying to eliminate a bug, it is always a good idea
101
+    to turn on debug logging. When debug logging is enabled a stack trace appears,
102
+    instead of the cryptic ``Internal Server Error`` message. It can be turned on by setting
103
+    ``debug: False`` to ``debug: True`` in settings.yml.
104
+
105
+2. Run ``./manage.sh tests`` before creating a PR.
106
+    Failing build on Travis is common because of PEP8 checks. So a new commit must be created
107
+    containing these format fixes. This phase can be skipped if ``./manage.sh tests`` is run
108
+    locally before creating a PR.

+ 2
- 1
dev/contribution_guide.html View File

@@ -25,7 +25,7 @@
25 25
     <script type="text/javascript" src="../_static/doctools.js"></script>
26 26
     <link rel="top" title="searx 0.8.0 documentation" href="../index.html" />
27 27
     <link rel="next" title="Installation" href="install/installation.html" />
28
-    <link rel="prev" title="Search syntax" href="../user/search_syntax.html" />
28
+    <link rel="prev" title="Development Quickstart" href="quickstart.html" />
29 29
    
30 30
   
31 31
   <link media="only screen and (max-device-width: 480px)" href="../_static/small_flask.css" type= "text/css" rel="stylesheet" />
@@ -92,6 +92,7 @@ above privacy concerns do not fancy you, simply fork it.</p>
92 92
 <li>Add yourself to the AUTHORS file.</li>
93 93
 <li>Create a pull request.</li>
94 94
 </ul>
95
+<p>For more help on getting started with searx development, see <a class="reference internal" href="quickstart.html#devquickstart"><span class="std std-ref">Development Quickstart</span></a>.</p>
95 96
 </div>
96 97
 <div class="section" id="translation">
97 98
 <h2>Translation<a class="headerlink" href="#translation" title="Permalink to this headline">¶</a></h2>

+ 90
- 77
dev/install/installation.html View File

@@ -68,28 +68,28 @@ certificate</a></p>
68 68
 <h2><a class="toc-backref" href="#id3">Basic installation</a><a class="headerlink" href="#basic-installation" title="Permalink to this headline">¶</a></h2>
69 69
 <p>For Ubuntu, be sure to have enable universe repository.</p>
70 70
 <p>Install packages:</p>
71
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-pybabel zlib1g-dev libffi-dev libssl-dev
71
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">git</span> <span class="n">build</span><span class="o">-</span><span class="n">essential</span> <span class="n">libxslt</span><span class="o">-</span><span class="n">dev</span> <span class="n">python</span><span class="o">-</span><span class="n">dev</span> <span class="n">python</span><span class="o">-</span><span class="n">virtualenv</span> <span class="n">python</span><span class="o">-</span><span class="n">pybabel</span> <span class="n">zlib1g</span><span class="o">-</span><span class="n">dev</span> <span class="n">libffi</span><span class="o">-</span><span class="n">dev</span> <span class="n">libssl</span><span class="o">-</span><span class="n">dev</span>
72 72
 </pre></div>
73 73
 </div>
74 74
 <p>Install searx:</p>
75
-<div class="code sh highlight-python"><div class="highlight"><pre>cd /usr/local
76
-sudo git clone https://github.com/asciimoo/searx.git
77
-sudo useradd searx -d /usr/local/searx
78
-sudo chown searx:searx -R /usr/local/searx
75
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">cd</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">local</span>
76
+<span class="n">sudo</span> <span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">asciimoo</span><span class="o">/</span><span class="n">searx</span><span class="o">.</span><span class="n">git</span>
77
+<span class="n">sudo</span> <span class="n">useradd</span> <span class="n">searx</span> <span class="o">-</span><span class="n">d</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">searx</span>
78
+<span class="n">sudo</span> <span class="n">chown</span> <span class="n">searx</span><span class="p">:</span><span class="n">searx</span> <span class="o">-</span><span class="n">R</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">searx</span>
79 79
 </pre></div>
80 80
 </div>
81 81
 <p>Install dependencies in a virtualenv:</p>
82
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo -u searx -i
83
-cd /usr/local/searx
84
-virtualenv searx-ve
85
-. ./searx-ve/bin/activate
86
-./manage.sh update_packages
82
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="o">-</span><span class="n">u</span> <span class="n">searx</span> <span class="o">-</span><span class="n">i</span>
83
+<span class="n">cd</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">searx</span>
84
+<span class="n">virtualenv</span> <span class="n">searx</span><span class="o">-</span><span class="n">ve</span>
85
+<span class="o">.</span> <span class="o">./</span><span class="n">searx</span><span class="o">-</span><span class="n">ve</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">activate</span>
86
+<span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">update_packages</span>
87 87
 </pre></div>
88 88
 </div>
89 89
 </div>
90 90
 <div class="section" id="configuration">
91 91
 <h2><a class="toc-backref" href="#id4">Configuration</a><a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h2>
92
-<div class="code sh highlight-python"><div class="highlight"><pre>sed -i -e &quot;s/ultrasecretkey/`openssl rand -hex 16`/g&quot; searx/settings.yml
92
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sed</span> <span class="o">-</span><span class="n">i</span> <span class="o">-</span><span class="n">e</span> <span class="s">&quot;s/ultrasecretkey/`openssl rand -hex 16`/g&quot;</span> <span class="n">searx</span><span class="o">/</span><span class="n">settings</span><span class="o">.</span><span class="n">yml</span>
93 93
 </pre></div>
94 94
 </div>
95 95
 <p>Edit searx/settings.yml if necessary.</p>
@@ -97,12 +97,12 @@ virtualenv searx-ve
97 97
 <div class="section" id="check">
98 98
 <h2><a class="toc-backref" href="#id5">Check</a><a class="headerlink" href="#check" title="Permalink to this headline">¶</a></h2>
99 99
 <p>Start searx:</p>
100
-<div class="code sh highlight-python"><div class="highlight"><pre>python searx/webapp.py
100
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">python</span> <span class="n">searx</span><span class="o">/</span><span class="n">webapp</span><span class="o">.</span><span class="n">py</span>
101 101
 </pre></div>
102 102
 </div>
103 103
 <p>Go to <a class="reference external" href="http://localhost:8888">http://localhost:8888</a></p>
104 104
 <p>If everything works fine, disable the debug option in settings.yml:</p>
105
-<div class="code sh highlight-python"><div class="highlight"><pre>sed -i -e &quot;s/debug : True/debug : False/g&quot; searx/settings.yml
105
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sed</span> <span class="o">-</span><span class="n">i</span> <span class="o">-</span><span class="n">e</span> <span class="s">&quot;s/debug : True/debug : False/g&quot;</span> <span class="n">searx</span><span class="o">/</span><span class="n">settings</span><span class="o">.</span><span class="n">yml</span>
106 106
 </pre></div>
107 107
 </div>
108 108
 <p>At this point searx is not demonized ; uwsgi allows this.</p>
@@ -112,43 +112,43 @@ twice).</p>
112 112
 <div class="section" id="uwsgi">
113 113
 <h2><a class="toc-backref" href="#id6">uwsgi</a><a class="headerlink" href="#uwsgi" title="Permalink to this headline">¶</a></h2>
114 114
 <p>Install packages:</p>
115
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo apt-get install uwsgi uwsgi-plugin-python
115
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">uwsgi</span> <span class="n">uwsgi</span><span class="o">-</span><span class="n">plugin</span><span class="o">-</span><span class="n">python</span>
116 116
 </pre></div>
117 117
 </div>
118 118
 <p>Create the configuration file /etc/uwsgi/apps-available/searx.ini with
119 119
 this content:</p>
120
-<div class="highlight-python"><div class="highlight"><pre>[uwsgi]
121
-# Who will run the code
122
-uid = searx
123
-gid = searx
120
+<div class="highlight-default"><div class="highlight"><pre><span class="p">[</span><span class="n">uwsgi</span><span class="p">]</span>
121
+<span class="c"># Who will run the code</span>
122
+<span class="n">uid</span> <span class="o">=</span> <span class="n">searx</span>
123
+<span class="n">gid</span> <span class="o">=</span> <span class="n">searx</span>
124 124
 
125
-# disable logging for privacy
126
-disable-logging = true
125
+<span class="c"># disable logging for privacy</span>
126
+<span class="n">disable</span><span class="o">-</span><span class="n">logging</span> <span class="o">=</span> <span class="n">true</span>
127 127
 
128
-# Number of workers (usually CPU count)
129
-workers = 4
128
+<span class="c"># Number of workers (usually CPU count)</span>
129
+<span class="n">workers</span> <span class="o">=</span> <span class="mi">4</span>
130 130
 
131
-# The right granted on the created socket
132
-chmod-socket = 666
131
+<span class="c"># The right granted on the created socket</span>
132
+<span class="n">chmod</span><span class="o">-</span><span class="n">socket</span> <span class="o">=</span> <span class="mi">666</span>
133 133
 
134
-# Plugin to use and interpretor config
135
-single-interpreter = true
136
-master = true
137
-plugin = python
134
+<span class="c"># Plugin to use and interpretor config</span>
135
+<span class="n">single</span><span class="o">-</span><span class="n">interpreter</span> <span class="o">=</span> <span class="n">true</span>
136
+<span class="n">master</span> <span class="o">=</span> <span class="n">true</span>
137
+<span class="n">plugin</span> <span class="o">=</span> <span class="n">python</span>
138 138
 
139
-# Module to import
140
-module = searx.webapp
139
+<span class="c"># Module to import</span>
140
+<span class="n">module</span> <span class="o">=</span> <span class="n">searx</span><span class="o">.</span><span class="n">webapp</span>
141 141
 
142
-# Virtualenv and python path
143
-virtualenv = /usr/local/searx/searx-ve/
144
-pythonpath = /usr/local/searx/
145
-chdir = /usr/local/searx/searx/
142
+<span class="c"># Virtualenv and python path</span>
143
+<span class="n">virtualenv</span> <span class="o">=</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">searx</span><span class="o">/</span><span class="n">searx</span><span class="o">-</span><span class="n">ve</span><span class="o">/</span>
144
+<span class="n">pythonpath</span> <span class="o">=</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">searx</span><span class="o">/</span>
145
+<span class="n">chdir</span> <span class="o">=</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">searx</span><span class="o">/</span><span class="n">searx</span><span class="o">/</span>
146 146
 </pre></div>
147 147
 </div>
148 148
 <p>Activate the uwsgi application and restart:</p>
149
-<div class="code sh highlight-python"><div class="highlight"><pre>cd /etc/uwsgi/apps-enabled
150
-ln -s ../apps-available/searx.ini
151
-/etc/init.d/uwsgi restart
149
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">cd</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">uwsgi</span><span class="o">/</span><span class="n">apps</span><span class="o">-</span><span class="n">enabled</span>
150
+<span class="n">ln</span> <span class="o">-</span><span class="n">s</span> <span class="o">../</span><span class="n">apps</span><span class="o">-</span><span class="n">available</span><span class="o">/</span><span class="n">searx</span><span class="o">.</span><span class="n">ini</span>
151
+<span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">init</span><span class="o">.</span><span class="n">d</span><span class="o">/</span><span class="n">uwsgi</span> <span class="n">restart</span>
152 152
 </pre></div>
153 153
 </div>
154 154
 </div>
@@ -158,28 +158,28 @@ ln -s ../apps-available/searx.ini
158 158
 <h3><a class="toc-backref" href="#id8">with nginx</a><a class="headerlink" href="#with-nginx" title="Permalink to this headline">¶</a></h3>
159 159
 <p>If nginx is not installed (uwsgi will not work with the package
160 160
 nginx-light):</p>
161
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo apt-get install nginx
161
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">nginx</span>
162 162
 </pre></div>
163 163
 </div>
164 164
 <div class="section" id="hosted-at">
165 165
 <h4>Hosted at /<a class="headerlink" href="#hosted-at" title="Permalink to this headline">¶</a></h4>
166 166
 <p>Create the configuration file /etc/nginx/sites-available/searx with this
167 167
 content:</p>
168
-<div class="code nginx highlight-python"><div class="highlight"><pre>server {
169
-    listen 80;
170
-    server_name searx.example.com;
171
-    root /usr/local/searx;
168
+<div class="code nginx highlight-default"><div class="highlight"><pre><span class="n">server</span> <span class="p">{</span>
169
+    <span class="n">listen</span> <span class="mi">80</span><span class="p">;</span>
170
+    <span class="n">server_name</span> <span class="n">searx</span><span class="o">.</span><span class="n">example</span><span class="o">.</span><span class="n">com</span><span class="p">;</span>
171
+    <span class="n">root</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">searx</span><span class="p">;</span>
172 172
 
173
-    location / {
174
-            include uwsgi_params;
175
-            uwsgi_pass unix:/run/uwsgi/app/searx/socket;
176
-    }
177
-}
173
+    <span class="n">location</span> <span class="o">/</span> <span class="p">{</span>
174
+            <span class="n">include</span> <span class="n">uwsgi_params</span><span class="p">;</span>
175
+            <span class="n">uwsgi_pass</span> <span class="n">unix</span><span class="p">:</span><span class="o">/</span><span class="n">run</span><span class="o">/</span><span class="n">uwsgi</span><span class="o">/</span><span class="n">app</span><span class="o">/</span><span class="n">searx</span><span class="o">/</span><span class="n">socket</span><span class="p">;</span>
176
+    <span class="p">}</span>
177
+<span class="p">}</span>
178 178
 </pre></div>
179 179
 </div>
180 180
 <p>Restart service:</p>
181
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo service nginx restart
182
-sudo service uwsgi restart
181
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="n">service</span> <span class="n">nginx</span> <span class="n">restart</span>
182
+<span class="n">sudo</span> <span class="n">service</span> <span class="n">uwsgi</span> <span class="n">restart</span>
183 183
 </pre></div>
184 184
 </div>
185 185
 </div>
@@ -187,7 +187,7 @@ sudo service uwsgi restart
187 187
 <h4>from subdirectory URL (/searx)<a class="headerlink" href="#from-subdirectory-url-searx" title="Permalink to this headline">¶</a></h4>
188 188
 <p>Add this configuration in the server config file
189 189
 /etc/nginx/sites-available/default:</p>
190
-<div class="code nginx highlight-python"><div class="highlight"><pre>location = /searx { rewrite ^ /searx/; }
190
+<div class="code nginx highlight-default"><div class="highlight"><pre>location = /searx { rewrite ^ /searx/; }
191 191
 location /searx {
192 192
         try_files $uri @searx;
193 193
 }
@@ -199,13 +199,26 @@ location @searx {
199 199
 }
200 200
 </pre></div>
201 201
 </div>
202
+<p>OR</p>
203
+<p>using reverse proxy
204
+(Please, note that reverse proxy advised to be used in case of single-user or low-traffic instances.)</p>
205
+<div class="code nginx highlight-default"><div class="highlight"><pre>location /searx {
206
+    proxy_pass http://127.0.0.1:8888;
207
+    proxy_set_header Host $host;
208
+    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
209
+    proxy_set_header X-Scheme $scheme;
210
+    proxy_set_header X-Script-Name /searx;
211
+    proxy_buffering off;
212
+}
213
+</pre></div>
214
+</div>
202 215
 <p>Enable base_url in searx/settings.yml</p>
203
-<div class="highlight-python"><div class="highlight"><pre>base_url : http://your.domain.tld/searx/
216
+<div class="highlight-default"><div class="highlight"><pre><span class="n">base_url</span> <span class="p">:</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">your</span><span class="o">.</span><span class="n">domain</span><span class="o">.</span><span class="n">tld</span><span class="o">/</span><span class="n">searx</span><span class="o">/</span>
204 217
 </pre></div>
205 218
 </div>
206 219
 <p>Restart service:</p>
207
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo service nginx restart
208
-sudo service uwsgi restart
220
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="n">service</span> <span class="n">nginx</span> <span class="n">restart</span>
221
+<span class="n">sudo</span> <span class="n">service</span> <span class="n">uwsgi</span> <span class="n">restart</span>
209 222
 </pre></div>
210 223
 </div>
211 224
 <div class="section" id="disable-logs">
@@ -213,12 +226,12 @@ sudo service uwsgi restart
213 226
 <p>for better privacy you can disable nginx logs about searx.</p>
214 227
 <p>how to proceed: below <code class="docutils literal"><span class="pre">uwsgi_pass</span></code> in
215 228
 /etc/nginx/sites-available/default add</p>
216
-<div class="highlight-python"><div class="highlight"><pre><span class="n">access_log</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">null</span><span class="p">;</span>
229
+<div class="highlight-default"><div class="highlight"><pre><span class="n">access_log</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">null</span><span class="p">;</span>
217 230
 <span class="n">error_log</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">null</span><span class="p">;</span>
218 231
 </pre></div>
219 232
 </div>
220 233
 <p>Restart service:</p>
221
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo service nginx restart
234
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="n">service</span> <span class="n">nginx</span> <span class="n">restart</span>
222 235
 </pre></div>
223 236
 </div>
224 237
 </div>
@@ -227,23 +240,23 @@ sudo service uwsgi restart
227 240
 <div class="section" id="with-apache">
228 241
 <h3><a class="toc-backref" href="#id9">with apache</a><a class="headerlink" href="#with-apache" title="Permalink to this headline">¶</a></h3>
229 242
 <p>Add wsgi mod:</p>
230
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo apt-get install libapache2-mod-uwsgi
231
-sudo a2enmod uwsgi
243
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">libapache2</span><span class="o">-</span><span class="n">mod</span><span class="o">-</span><span class="n">uwsgi</span>
244
+<span class="n">sudo</span> <span class="n">a2enmod</span> <span class="n">uwsgi</span>
232 245
 </pre></div>
233 246
 </div>
234 247
 <p>Add this configuration in the file /etc/apache2/apache2.conf:</p>
235
-<div class="code apache highlight-python"><div class="highlight"><pre>&lt;Location /&gt;
236
-    Options FollowSymLinks Indexes
237
-    SetHandler uwsgi-handler
238
-    uWSGISocket /run/uwsgi/app/searx/socket
239
-&lt;/Location&gt;
248
+<div class="code apache highlight-default"><div class="highlight"><pre><span class="o">&lt;</span><span class="n">Location</span> <span class="o">/&gt;</span>
249
+    <span class="n">Options</span> <span class="n">FollowSymLinks</span> <span class="n">Indexes</span>
250
+    <span class="n">SetHandler</span> <span class="n">uwsgi</span><span class="o">-</span><span class="n">handler</span>
251
+    <span class="n">uWSGISocket</span> <span class="o">/</span><span class="n">run</span><span class="o">/</span><span class="n">uwsgi</span><span class="o">/</span><span class="n">app</span><span class="o">/</span><span class="n">searx</span><span class="o">/</span><span class="n">socket</span>
252
+<span class="o">&lt;/</span><span class="n">Location</span><span class="o">&gt;</span>
240 253
 </pre></div>
241 254
 </div>
242 255
 <p>Note that if your instance of searx is not at the root, you should
243 256
 change <code class="docutils literal"><span class="pre">&lt;Location</span> <span class="pre">/&gt;</span></code> by the location of your instance, like
244 257
 <code class="docutils literal"><span class="pre">&lt;Location</span> <span class="pre">/searx&gt;</span></code>.</p>
245 258
 <p>Restart Apache:</p>
246
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo /etc/init.d/apache2 restart
259
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">init</span><span class="o">.</span><span class="n">d</span><span class="o">/</span><span class="n">apache2</span> <span class="n">restart</span>
247 260
 </pre></div>
248 261
 </div>
249 262
 <div class="section" id="id1">
@@ -253,11 +266,11 @@ change <code class="docutils literal"><span class="pre">&lt;Location</span> <spa
253 266
 <p>WARNING: you can only disable logs for the whole (virtual) server not
254 267
 for a specific path.</p>
255 268
 <p>Go back to /etc/apache2/apache2.conf and above <code class="docutils literal"><span class="pre">&lt;Location</span> <span class="pre">/&gt;</span></code> add:</p>
256
-<div class="code apache highlight-python"><div class="highlight"><pre>CustomLog /dev/null combined
269
+<div class="code apache highlight-default"><div class="highlight"><pre><span class="n">CustomLog</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">null</span> <span class="n">combined</span>
257 270
 </pre></div>
258 271
 </div>
259 272
 <p>Restart Apache:</p>
260
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo /etc/init.d/apache2 restart
273
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">init</span><span class="o">.</span><span class="n">d</span><span class="o">/</span><span class="n">apache2</span> <span class="n">restart</span>
261 274
 </pre></div>
262 275
 </div>
263 276
 </div>
@@ -265,30 +278,30 @@ for a specific path.</p>
265 278
 </div>
266 279
 <div class="section" id="how-to-update">
267 280
 <h2><a class="toc-backref" href="#id10">How to update</a><a class="headerlink" href="#how-to-update" title="Permalink to this headline">¶</a></h2>
268
-<div class="code sh highlight-python"><div class="highlight"><pre>cd /usr/local/searx
269
-sudo -u searx -i
270
-. ./searx-ve/bin/activate
271
-git stash
272
-git pull origin master
273
-git stash apply
274
-./manage.sh update_packages
275
-sudo service uwsgi restart
281
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">cd</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">local</span><span class="o">/</span><span class="n">searx</span>
282
+<span class="n">sudo</span> <span class="o">-</span><span class="n">u</span> <span class="n">searx</span> <span class="o">-</span><span class="n">i</span>
283
+<span class="o">.</span> <span class="o">./</span><span class="n">searx</span><span class="o">-</span><span class="n">ve</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">activate</span>
284
+<span class="n">git</span> <span class="n">stash</span>
285
+<span class="n">git</span> <span class="n">pull</span> <span class="n">origin</span> <span class="n">master</span>
286
+<span class="n">git</span> <span class="n">stash</span> <span class="n">apply</span>
287
+<span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">update_packages</span>
288
+<span class="n">sudo</span> <span class="n">service</span> <span class="n">uwsgi</span> <span class="n">restart</span>
276 289
 </pre></div>
277 290
 </div>
278 291
 </div>
279 292
 <div class="section" id="docker">
280 293
 <h2><a class="toc-backref" href="#id11">Docker</a><a class="headerlink" href="#docker" title="Permalink to this headline">¶</a></h2>
281 294
 <p>Make sure you have installed Docker. For instance, you can deploy searx like this:</p>
282
-<div class="code sh highlight-python"><div class="highlight"><pre>docker pull wonderfall/searx
295
+<div class="code sh highlight-default"><div class="highlight"><pre>docker pull wonderfall/searx
283 296
 docker run -d --name searx -p $PORT:8888 wonderfall/searx
284 297
 </pre></div>
285 298
 </div>
286 299
 <p>Go to <a class="reference external" href="http://localhost:$PORT">http://localhost:$PORT</a>.</p>
287 300
 <p>See <a class="reference external" href="https://hub.docker.com/r/wonderfall/searx/">https://hub.docker.com/r/wonderfall/searx/</a> for more informations.</p>
288 301
 <p>It&#8217;s also possible to build searx from the embedded Dockerfile.</p>
289
-<div class="code sh highlight-python"><div class="highlight"><pre>git clone https://github.com/asciimoo/searx.git
290
-cd searx
291
-docker build -t whatever/searx .
302
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">asciimoo</span><span class="o">/</span><span class="n">searx</span><span class="o">.</span><span class="n">git</span>
303
+<span class="n">cd</span> <span class="n">searx</span>
304
+<span class="n">docker</span> <span class="n">build</span> <span class="o">-</span><span class="n">t</span> <span class="n">whatever</span><span class="o">/</span><span class="n">searx</span> <span class="o">.</span>
292 305
 </pre></div>
293 306
 </div>
294 307
 </div>

+ 39
- 15
dev/quickstart.html View File

@@ -24,6 +24,8 @@
24 24
     <script type="text/javascript" src="../_static/underscore.js"></script>
25 25
     <script type="text/javascript" src="../_static/doctools.js"></script>
26 26
     <link rel="top" title="searx 0.8.0 documentation" href="../index.html" />
27
+    <link rel="next" title="How to contribute" href="contribution_guide.html" />
28
+    <link rel="prev" title="Search syntax" href="../user/search_syntax.html" />
27 29
    
28 30
   
29 31
   <link media="only screen and (max-device-width: 480px)" href="../_static/small_flask.css" type= "text/css" rel="stylesheet" />
@@ -38,7 +40,7 @@
38 40
           <div class="body" role="main">
39 41
             
40 42
   <div class="section" id="development-quickstart">
41
-<h1>Development Quickstart<a class="headerlink" href="#development-quickstart" title="Permalink to this headline">¶</a></h1>
43
+<span id="devquickstart"></span><h1>Development Quickstart<a class="headerlink" href="#development-quickstart" title="Permalink to this headline">¶</a></h1>
42 44
 <p>This quickstart guide gets your environment set up with searx. Furthermore, it gives a
43 45
 short introduction to the new manage.sh script.</p>
44 46
 <div class="section" id="how-to-setup-your-development-environment">
@@ -46,12 +48,12 @@ short introduction to the new manage.sh script.</p>
46 48
 <p>First, clone the source code of searx to the desired folder. In this case the source
47 49
 is cloned to ~/myprojects/searx. Then create and activate the searx-ve
48 50
 virtualenv and install the required packages using manage.sh.</p>
49
-<div class="code sh highlight-python"><div class="highlight"><pre>cd ~/myprojects
50
-git clone https://github.com/asciimoo/searx.git
51
-cd searx
52
-virtualenv searx-ve
53
-. ./searx-ve/bin/activate
54
-./manage.sh update_dev_packages
51
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">cd</span> <span class="o">~/</span><span class="n">myprojects</span>
52
+<span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">asciimoo</span><span class="o">/</span><span class="n">searx</span><span class="o">.</span><span class="n">git</span>
53
+<span class="n">cd</span> <span class="n">searx</span>
54
+<span class="n">virtualenv</span> <span class="n">searx</span><span class="o">-</span><span class="n">ve</span>
55
+<span class="o">.</span> <span class="o">./</span><span class="n">searx</span><span class="o">-</span><span class="n">ve</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">activate</span>
56
+<span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">update_dev_packages</span>
55 57
 </pre></div>
56 58
 </div>
57 59
 </div>
@@ -66,7 +68,7 @@ virtualenv searx-ve
66 68
 <li>Unit test coverage check</li>
67 69
 </ul>
68 70
 <p>For example unit tests are run with the command below:</p>
69
-<div class="code sh highlight-python"><div class="highlight"><pre>./manage.sh unit_tests
71
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">unit_tests</span>
70 72
 </pre></div>
71 73
 </div>
72 74
 <p>For further test options, please consult the help of the manage.sh script.</p>
@@ -76,16 +78,16 @@ virtualenv searx-ve
76 78
 <div class="section" id="how-to-build-styles">
77 79
 <h3>How to build styles<a class="headerlink" href="#how-to-build-styles" title="Permalink to this headline">¶</a></h3>
78 80
 <p>Less is required to build the styles of searx. Less can be installed using either NodeJS or Apt.</p>
79
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo apt-get install nodejs
80
-sudo npm install -g less
81
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">nodejs</span>
82
+<span class="n">sudo</span> <span class="n">npm</span> <span class="n">install</span> <span class="o">-</span><span class="n">g</span> <span class="n">less</span>
81 83
 </pre></div>
82 84
 </div>
83 85
 <p>OR</p>
84
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo apt-get install node-less
86
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">node</span><span class="o">-</span><span class="n">less</span>
85 87
 </pre></div>
86 88
 </div>
87 89
 <p>After satisfying the requirements styles can be build using manage.sh</p>
88
-<div class="code sh highlight-python"><div class="highlight"><pre>./manage.sh styles
90
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">styles</span>
89 91
 </pre></div>
90 92
 </div>
91 93
 </div>
@@ -93,16 +95,38 @@ sudo npm install -g less
93 95
 <h3>How to build the source of the oscar theme<a class="headerlink" href="#how-to-build-the-source-of-the-oscar-theme" title="Permalink to this headline">¶</a></h3>
94 96
 <p>Grunt must be installed in order to build the javascript sources. It depends on NodeJS, so first
95 97
 Node has to be installed.</p>
96
-<div class="code sh highlight-python"><div class="highlight"><pre>sudo apt-get install nodejs
97
-sudo npm install -g grunt-cli
98
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">nodejs</span>
99
+<span class="n">sudo</span> <span class="n">npm</span> <span class="n">install</span> <span class="o">-</span><span class="n">g</span> <span class="n">grunt</span><span class="o">-</span><span class="n">cli</span>
98 100
 </pre></div>
99 101
 </div>
100 102
 <p>After installing grunt, the files can be built using the following command:</p>
101
-<div class="code sh highlight-python"><div class="highlight"><pre>./manage.sh build_grunt
103
+<div class="code sh highlight-default"><div class="highlight"><pre><span class="o">./</span><span class="n">manage</span><span class="o">.</span><span class="n">sh</span> <span class="n">build_grunt</span>
102 104
 </pre></div>
103 105
 </div>
104 106
 </div>
105 107
 </div>
108
+<div class="section" id="tips-for-debugging-development">
109
+<h2>Tips for debugging/development<a class="headerlink" href="#tips-for-debugging-development" title="Permalink to this headline">¶</a></h2>
110
+<ol class="arabic">
111
+<li><dl class="first docutils">
112
+<dt>Turn on debug logging</dt>
113
+<dd><p class="first last">Whether you are working on a new engine or trying to eliminate a bug, it is always a good idea
114
+to turn on debug logging. When debug logging is enabled a stack trace appears,
115
+instead of the cryptic <code class="docutils literal"><span class="pre">Internal</span> <span class="pre">Server</span> <span class="pre">Error</span></code> message. It can be turned on by setting
116
+<code class="docutils literal"><span class="pre">debug:</span> <span class="pre">False</span></code> to <code class="docutils literal"><span class="pre">debug:</span> <span class="pre">True</span></code> in settings.yml.</p>
117
+</dd>
118
+</dl>
119
+</li>
120
+<li><dl class="first docutils">
121
+<dt>Run <code class="docutils literal"><span class="pre">./manage.sh</span> <span class="pre">tests</span></code> before creating a PR.</dt>
122
+<dd><p class="first last">Failing build on Travis is common because of PEP8 checks. So a new commit must be created
123
+containing these format fixes. This phase can be skipped if <code class="docutils literal"><span class="pre">./manage.sh</span> <span class="pre">tests</span></code> is run
124
+locally before creating a PR.</p>
125
+</dd>
126
+</dl>
127
+</li>
128
+</ol>
129
+</div>
106 130
 </div>
107 131
 
108 132
 

+ 2
- 0
docs/dev/contribution_guide.rst View File

@@ -64,6 +64,8 @@ In order to submit a patch, please follow the steps below:
64 64
 
65 65
 - Create a pull request.
66 66
 
67
+For more help on getting started with searx development, see :ref:`devquickstart`.
68
+
67 69
 
68 70
 Translation
69 71
 ~~~~~~~~~~~

+ 18
- 0
docs/dev/install/installation.rst View File

@@ -179,6 +179,24 @@ Add this configuration in the server config file
179 179
             uwsgi_pass unix:/run/uwsgi/app/searx/socket;
180 180
     }
181 181
 
182
+
183
+OR
184
+
185
+using reverse proxy
186
+(Please, note that reverse proxy advised to be used in case of single-user or low-traffic instances.)
187
+
188
+.. code:: nginx
189
+
190
+    location /searx {
191
+        proxy_pass http://127.0.0.1:8888;
192
+        proxy_set_header Host $host;
193
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
194
+        proxy_set_header X-Scheme $scheme;
195
+        proxy_set_header X-Script-Name /searx;
196
+        proxy_buffering off;
197
+    }
198
+
199
+
182 200
 Enable base\_url in searx/settings.yml
183 201
 
184 202
 ::

+ 18
- 0
docs/dev/quickstart.rst View File

@@ -1,3 +1,5 @@
1
+.. _devquickstart:
2
+
1 3
 Development Quickstart
2 4
 ----------------------
3 5
 
@@ -88,3 +90,19 @@ After installing grunt, the files can be built using the following command:
88 90
 .. code:: sh
89 91
 
90 92
     ./manage.sh build_grunt
93
+
94
+
95
+
96
+Tips for debugging/development
97
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98
+
99
+1. Turn on debug logging
100
+    Whether you are working on a new engine or trying to eliminate a bug, it is always a good idea
101
+    to turn on debug logging. When debug logging is enabled a stack trace appears,
102
+    instead of the cryptic ``Internal Server Error`` message. It can be turned on by setting
103
+    ``debug: False`` to ``debug: True`` in settings.yml.
104
+
105
+2. Run ``./manage.sh tests`` before creating a PR.
106
+    Failing build on Travis is common because of PEP8 checks. So a new commit must be created
107
+    containing these format fixes. This phase can be skipped if ``./manage.sh tests`` is run
108
+    locally before creating a PR.