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

Commit 22e7c1e2 authored by Johnny Kalajdzic's avatar Johnny Kalajdzic
Browse files

Merge branch 'eelo_theme' into 'master'

Eelo theme

See merge request spot/my-spot!2
parents c1890578 e7b0883e
Loading
Loading
Loading
Loading
+31 −1
Original line number Diff line number Diff line
@@ -14,6 +14,36 @@ See the `documentation <https://asciimoo.github.io/searx>`__ and the `wiki <http
|OpenCollective searx backers|
|OpenCollective searx sponsors|

Setup MySql
~~~~~~~~~~~

**Install MySql**
 ``$ sudo apt-get install mysql-server
 $ pip install mymysql``

**Start MySql**
 ``$ sudo service mysql start
 $ mysql -u root -p``

**Create a new database and give all rights to a new searx user**
 change password!
 
 ``mysql> create database searx;
 mysql> create user "searx"@"localhost" identified by "password";
 mysql> grant all on searx.* to "searx"@"localhost" identified by "password";``

**You can now quit the MySql console by typing ``quit`` and connect as searx user**
 ``$ mysql -u searx -p``
 
**Here are some commands to init the database**
 ``mysql> use searx;``

 ``mysql> create table SEARCH_HISTORY(QUERY varchar(512), CATEGORIY varchar(256), PAGENO int(11), PAGING tinyint(1), SAFE_SEARCH int(11), LANGUAGE varchar(8), TIME_RANGE varchar(16), ENGINES varchar(4096), RESULTS mediumtext), RESULTS_NUMBER int(11), ANSWERS varchar(2048), CORRECTIONS varchar(256), INFOBOXES varchar(8192), SUGGESTIONS varchar(1024), UNRESPONSIVE_ENGINES varchar(1024));``
 
 ``mysql> quit``
 
 MySql is done !

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

@@ -22,7 +52,7 @@ Installation
-  install dependencies: ``./manage.sh update_packages``
-  edit your
   `settings.yml <https://github.com/asciimoo/searx/blob/master/searx/settings.yml>`__
   (set your ``secret_key``!)
   (set your ``secret_key`` and ``mysql password``!)
-  run ``python searx/webapp.py`` to start the application

For all the details, follow this `step by step
+1 −0
Original line number Diff line number Diff line
pymysql
certifi==2017.11.5
flask==0.12.2
flask-babel==0.11.2
+1 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ def https_url_rewrite(result):
    return result


def on_result(request, search, result):
def on_result(request, searchData, result):
    if result['parsed_url'].scheme == 'http':
        https_url_rewrite(result)
    return True
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ def get_doi_resolver(args, preference_doi_resolver):
    return doi_resolver


def on_result(request, search, result):
def on_result(request, searchData, result):
    doi = extract_doi(result['parsed_url'])
    if doi and len(doi) < 50:
        for suffix in ('/', '.pdf', '/full', '/meta', '/abstract'):
+8 −8
Original line number Diff line number Diff line
@@ -28,19 +28,19 @@ p = re.compile(b'.*user[ -]agent.*', re.IGNORECASE)
# attach callback to the post search hook
#  request: flask request object
#  ctx: the whole local context of the pre search hook
def post_search(request, search):
    if search.search_query.pageno > 1:
def post_search(request, searchData):
    if searchData.pageno > 1:
        return True
    if search.search_query.query == b'ip':
    if searchData.query == b'ip':
        x_forwarded_for = request.headers.getlist("X-Forwarded-For")
        if x_forwarded_for:
            ip = x_forwarded_for[0]
        else:
            ip = request.remote_addr
        search.result_container.answers.clear()
        search.result_container.answers.add(ip)
    elif p.match(search.search_query.query):
        searchData.answers.clear()
        searchData.answers.add(ip)
    elif p.match(searchData.query):
        ua = request.user_agent
        search.result_container.answers.clear()
        search.result_container.answers.add(ua)
        searchData.answers.clear()
        searchData.answers.add(ua)
    return True
Loading