1from fabric.api import cd, run, sudo, put
2from cStringIO import StringIO
7searx_dir = base_dir + '/searx'
8searx_ve_dir = searx_dir + '/searx-ve'
9current_user = run('whoami').stdout.strip()
13# Who will run the code
20# The right granted on the created socket
23# Plugin to use and interpretor config
24single-interpreter = true
31# Virtualenv and python path
32virtualenv = {searx_ve_dir}
33pythonpath = {searx_dir}
34chdir = {searx_dir}/searx
35'''.format(user=current_user,
37 searx_ve_dir=searx_ve_dir)
42 server_name {hostname};
43 server_name www.{hostname};
44 root /usr/local/searx;
48 uwsgi_pass unix:/run/uwsgi/app/searx/socket;
51'''.format(hostname=hostname)
55 sudo('/etc/init.d/uwsgi stop')
59 sudo('/etc/init.d/uwsgi start')
63 sudo('/etc/init.d/uwsgi restart')
67 if not run('test -d ' + searx_dir, warn_only=True).failed:
70 sudo('apt-get update')
72 sudo('apt-get install git'
80 ' uwsgi-plugin-python'
83 sudo('mkdir -p ' + base_dir)
85 put(StringIO(nginx_config), '/etc/nginx/sites-enabled/searx', use_sudo=True)
86 sudo('/etc/init.d/nginx restart')
89 sudo('git clone https://github.com/asciimoo/searx')
91 sudo('chown -R {user}:{user} {searx_dir}'.format(user=current_user, searx_dir=searx_dir))
92 put(StringIO(uwsgi_file), searx_dir+'/uwsgi.ini')
93 sudo('ln -s {0}/uwsgi.ini /etc/uwsgi/apps-enabled/searx.ini'.format(searx_dir))
95 run('virtualenv {0}'.format(searx_ve_dir))
98 run('source {0}/bin/activate && pip install -r requirements.txt'.format(searx_ve_dir))
107 run("git stash", warn_only=True)
108 run("git pull origin master")
109 run("git stash pop", warn_only=True)
115 sudo('rm -rf {searx_dir}'.format(searx_dir=searx_dir), warn_only=True)
116 sudo('rm /etc/uwsgi/apps-enabled/searx.ini', warn_only=True)
117 sudo('rm /etc/nginx/sites-enabled/searx', warn_only=True)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list