logo

searx

My custom branche(s) on searx, a meta-search engine
commit: ad72c16050932ac5c71e27e4199582b5de38b561
parent: 688818bc34ad37f546f91cd4e6cc9bbeaaf89990
Author: asciimoo <asciimoo@gmail.com>
Date:   Thu, 16 Jan 2014 17:44:57 +0100

Merge branch 'master' of github.com:asciimoo/searx

Diffstat:

M.gitignore1+
MMakefile10+++++++---
MREADME.md30+++++++++++++++++++++++++++---
Cproduction.cfg -> minimal.cfg0
Mproduction.cfg19+++++++++++++++++++
5 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -15,3 +15,4 @@ eggs/ local/ searx.egg-info/ parts/ +var/ diff --git a/Makefile b/Makefile @@ -37,14 +37,18 @@ coverage: .installed.cfg @bin/coverage report --show-missing @bin/coverage html --directory ./coverage -minimal: bin/buildout production.cfg setup.py enginescfg +production: bin/buildout production.cfg setup.py enginescfg bin/buildout -c production.cfg $(options) @echo "* Please modify `readlink --canonicalize-missing ./searx/settings.py`" @echo "* Hint 1: on production, disable debug mode and change secret_key" - @echo "* Hint 2: to run server execute 'bin/searx-run'" + @echo "* Hint 2: searx will be executed at server startup by crontab" + @echo "* Hint 3: to run immediatley, execute 'bin/supervisord'" + +minimal: bin/buildout minimal.cfg setup.py enginescfg + bin/buildout -c minimal.cfg $(options) clean: @rm -rf .installed.cfg .mr.developer.cfg bin parts develop-eggs \ searx.egg-info lib include .coverage coverage -.PHONY: all tests enginescfg robot flake8 coverage minimal clean +.PHONY: all tests enginescfg robot flake8 coverage production minimal clean diff --git a/README.md b/README.md @@ -7,6 +7,7 @@ List of [running instances](https://github.com/asciimoo/searx/wiki/Searx-instanc [![Flattr searx](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=asciimoo&url=https://github.com/asciimoo/searx&title=searx&language=&tags=github&category=software) + ### Features * Tracking free @@ -19,6 +20,7 @@ List of [running instances](https://github.com/asciimoo/searx/wiki/Searx-instanc * Opensearch support (you can set as default search engine) * Configurable search engines/categories + ### Installation * clone source: `git clone git@github.com:asciimoo/searx.git && cd searx` @@ -29,6 +31,7 @@ List of [running instances](https://github.com/asciimoo/searx/wiki/Searx-instanc For all the details, follow this [step by step installation](https://github.com/asciimoo/searx/wiki/Installation) + ### Alternative (Recommended) Installation * clone source: `git clone git@github.com:asciimoo/searx.git && cd searx` @@ -38,9 +41,26 @@ For all the details, follow this [step by step installation](https://github.com/ ### Development -Just run `make`. Versions of dependencies are pinned down inside `versions.cfg` to produce most stable build. +Just run `make`. Versions of dependencies are pinned down inside `versions.cfg` to produce most stable build. Also remember, NO make command should be run as root, not even `make production` + + +### Deployment + +* clone source: `git clone git@github.com:asciimoo/searx.git && cd searx` +* build in current folder: `make production` +* run `bin/supervisord` to start the application -#### Command make + +### Upgrading + +* inside previously cloned searx directory run: `git stash` to temporarily save any changes you have made +* pull source: `git pull origin master` +* re-build in current folder: `make production` +* run `bin/supervisorctl stop searx` to stop searx, if it does not, then run `fuser -k 8888/tcp` +* run `bin/supervisorctl reload` to re-read supervisor config and start searx + + +### Command make ##### `make` @@ -62,9 +82,13 @@ Runs robot (Selenium) tests, you must have `firefox` installed because this func Checks coverage of tests, after running this, execute this: `firefox ./coverage/index.html` +##### `make production` + +Used to make co-called production environment - without tests (you should ran tests before deploying searx on the server). This installs supervisord, so if searx crashes, it will try to pick itself up again. And crontab entry is added to start supervisord at server boot. + ##### `make minimal` -Used to make co-called production environment - without tests (you should ran tests before deploying searx on the server). +Minimal build - without test frameworks, the quickest build option. ##### `make clean` diff --git a/production.cfg b/minimal.cfg diff --git a/production.cfg b/production.cfg @@ -7,6 +7,8 @@ eggs = parts += pyscripts + supervisor + crontab_reboot [pyscripts] @@ -15,3 +17,20 @@ eggs = ${buildout:eggs} interpreter = py entry-points = searx-run=searx.webapp:run + + +[supervisor] +recipe = collective.recipe.supervisor +http-socket = unix +user = searxer +password = ohpleasedochangeme +file = /tmp/supervisor.sock +chmod = 0700 +programs = + 50 searx ${buildout:bin-directory}/searx-run + + +[crontab_reboot] +recipe = z3c.recipe.usercrontab +times = @reboot +command = ${buildout:bin-directory}/supervisord