Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db615aa1 authored by Adam Tauber's avatar Adam Tauber
Browse files

Merge remote-tracking branch 'origin/install-refactor'

parents 66f48c2b c873ddd7
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -5,24 +5,13 @@ env
robot_log.html
robot_output.xml
robot_report.html
test_basic/
setup.cfg

*.pyc
*/*.pyc
*~

bin/
build/
coverage/
develop-eggs/
dist/
eggs/
include/
lib/
local/
parts/
searx.egg-info/
var/
node_modules/

.tx/
+7 −7
Original line number Diff line number Diff line
@@ -11,16 +11,16 @@ before_install:
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
  - npm install -g less grunt-cli
  - ( cd searx/static/themes/oscar;npm install )
  - ( cd searx/static/themes/oscar;npm install; cd - )
install:
  - "make"
  - ./manage.sh update_dev_packages
  - pip install coveralls
script:
  - "make flake8"
  - "make robot"
  - "make styles"
  - "make grunt"
  - make coverage
  - ./manage.sh pep8_check
  - ./manage.sh styles
  - ./manage.sh grunt_build
  - ./manage.sh py_test_coverage
  - ./manage.sh robot_tests
after_success:
  coveralls
notifications:

Makefile

deleted100644 → 0
+0 −66
Original line number Diff line number Diff line
# convenience makefile to boostrap & run buildout
# use `make options=-v` to run buildout with extra options

version = 2.7
python = bin/python
options =

all: .installed.cfg

.installed.cfg: bin/buildout buildout.cfg setup.py
	bin/buildout $(options)

bin/buildout: $(python) buildout.cfg bootstrap.py
	$(python) bootstrap.py
	@touch $@

$(python):
	virtualenv -p python$(version) --no-site-packages .
	@touch $@

robot: .installed.cfg
	@bin/robot

flake8: .installed.cfg
	@bin/flake8 setup.py
	@bin/flake8 ./searx/

tests: .installed.cfg flake8
	@bin/test
	@grunt test --gruntfile searx/static/themes/oscar/gruntfile.js

coverage: .installed.cfg
	@bin/coverage run bin/test
	@bin/coverage report
	@bin/coverage html

production: bin/buildout production.cfg setup.py
	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: 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
	bin/buildout -c minimal.cfg $(options)

styles:
	@lessc -x searx/static/themes/default/less/style.less > searx/static/themes/default/css/style.css
	@lessc -x searx/static/themes/default/less/style-rtl.less > searx/static/themes/default/css/style-rtl.css
	@lessc -x searx/static/themes/courgette/less/style.less > searx/static/themes/courgette/css/style.css
	@lessc -x searx/static/themes/courgette/less/style-rtl.less > searx/static/themes/courgette/css/style-rtl.css
	@lessc -x searx/static/less/bootstrap/bootstrap.less > searx/static/css/bootstrap.min.css
	@lessc -x searx/static/themes/oscar/less/oscar/oscar.less > searx/static/themes/oscar/css/oscar.min.css
	@lessc -x searx/static/themes/pix-art/less/style.less > searx/static/themes/pix-art/css/style.css

grunt:
	@grunt --gruntfile searx/static/themes/oscar/gruntfile.js

locales:
	@pybabel compile -d searx/translations

clean:
	@rm -rf .installed.cfg .mr.developer.cfg bin parts develop-eggs eggs \
		searx.egg-info lib include .coverage coverage

.PHONY: all tests robot flake8 coverage production minimal styles locales clean
+2 −115
Original line number Diff line number Diff line
@@ -7,31 +7,16 @@ engine <https://en.wikipedia.org/wiki/Metasearch_engine>`__.
List of `running
instances <https://github.com/asciimoo/searx/wiki/Searx-instances>`__.

See the `wiki <https://github.com/asciimoo/searx/wiki>`__ for more information.
See the `documentation <https://asciimoo.github.io/searx>`__ and the `wiki <https://github.com/asciimoo/searx/wiki>`__ for more information.

|Flattr searx|

Features
~~~~~~~~

- Tracking free
- Supports multiple output formats

  - json ``curl https://searx.me/?format=json&q=[query]``
  - csv ``curl https://searx.me/?format=csv&q=[query]``
  - opensearch/rss ``curl https://searx.me/?format=rss&q=[query]``
- Opensearch support (you can set as default search engine)
- Configurable search engines/categories
- Different search languages
- Duckduckgo like !bang functionality with engine shortcuts
- Parallel queries - relatively fast

Installation
~~~~~~~~~~~~

-  clone source:
   ``git clone git@github.com:asciimoo/searx.git && cd searx``
-  install dependencies: ``pip install -r requirements.txt``
-  install dependencies: ``./manage.sh update_packages``
-  edit your
   `settings.yml <https://github.com/asciimoo/searx/blob/master/settings.yml>`__
   (set your ``secret_key``!)
@@ -40,104 +25,6 @@ Installation
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``
-  build in current folder: ``make minimal``
-  run ``bin/searx-run`` to start the application

Development
~~~~~~~~~~~

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

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``
''''''''

Builds development environment with testing support.

``make tests``
''''''''''''''

Runs tests. You can write tests
`here <https://github.com/asciimoo/searx/tree/master/searx/tests>`__ and
remember 'untested code is broken code'.

``make robot``
''''''''''''''

Runs robot (Selenium) tests, you must have ``firefox`` installed because
this functional tests actually run the browser and perform operations on
it. Also searx is executed with
`settings\_robot <https://github.com/asciimoo/searx/blob/master/searx/settings_robot.yml>`__.

``make flake8``
'''''''''''''''

'pep8 is a tool to check your Python code against some of the style
conventions in `PEP 8 <http://www.python.org/dev/peps/pep-0008/>`__.'

``make coverage``
'''''''''''''''''

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``
''''''''''''''''

Minimal build - without test frameworks, the quickest build option.

``make clean``
''''''''''''''

Deletes several folders and files (see ``Makefile`` for more), so that
next time you run any other ``make`` command it will rebuild everithing.

TODO
~~~~

- Moar engines
- Better ui
- Browser integration
- Documentation
- Tests

Bugs
~~~~

base.cfg

deleted100644 → 0
+0 −17
Original line number Diff line number Diff line
[buildout]
extends = versions.cfg
unzip = true
newest = false
prefer-final = true
develop = .

eggs =
    searx

parts =
    omelette


[omelette]
recipe = collective.recipe.omelette
eggs = ${buildout:eggs}
Loading