Revert "pull opi"

This reverts commit 1257e1c570.
This commit is contained in:
Adrien Beudin 2014-07-22 23:58:04 +02:00
parent 1257e1c570
commit 43ea3945cd
6 changed files with 161 additions and 119 deletions

View File

@ -8,13 +8,7 @@ location PATHTOCHANGE {
location @searx {
uwsgi_pass unix:///run/uwsgi/app/searx/socket;
include uwsgi_params;
<<<<<<< HEAD
# Include SSOWAT user panel.
#include conf.d/yunohost_panel.conf.inc;
=======
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
>>>>>>> 90736b2cc32bd424c78355499e1bfb61062af8ca
}

View File

@ -8,14 +8,7 @@ location @searx {
uwsgi_param SCRIPT_NAME PATHTOCHANGE;
include uwsgi_params;
uwsgi_modifier1 30;
<<<<<<< HEAD
uwsgi_pass unix:///run/uwsgi/app/searx/socket;
# Include SSOWAT user panel.
#include conf.d/yunohost_panel.conf.inc;
=======
uwsgi_pass unix:/run/uwsgi/app/searx/socket;
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
>>>>>>> 90736b2cc32bd424c78355499e1bfb61062af8ca
}

View File

@ -3,7 +3,7 @@ server:
secret_key : "ultrasecretkey" # change this!
debug : True
request_timeout : 2.0 # seconds
base_url : ynhbaseurl
base_url : False
engines:
- name : wikipedia

156
conf/settings.yml-noroot Normal file
View File

@ -0,0 +1,156 @@
server:
port : 8888
secret_key : "ultrasecretkey" # change this!
debug : True
request_timeout : 2.0 # seconds
base_url : True
engines:
- name : wikipedia
engine : wikipedia
number_of_results : 1
paging : False
shortcut : wp
- name : bing
engine : bing
locale : en-US
shortcut : bi
- name : bing news
engine : bing_news
locale : en-US
shortcut : bin
- name : currency
engine : currency_convert
categories : general
shortcut : cc
- name : deviantart
engine : deviantart
categories : images
shortcut : da
timeout: 3.0
- name : ddg definitions
engine : duckduckgo_definitions
shortcut : ddd
- name : duckduckgo
engine : duckduckgo
locale : en-us
shortcut : ddg
- name : filecrop
engine : filecrop
categories : files
shortcut : fc
- name : flickr
engine : flickr
categories : images
shortcut : fl
timeout: 3.0
- name : github
engine : github
categories : it
shortcut : gh
- name : google
engine : google
shortcut : go
- name : google images
engine : google_images
shortcut : goi
- name : google news
engine : google_news
shortcut : gon
- name : piratebay
engine : piratebay
categories : videos, music, files
shortcut : tpb
- name : soundcloud
engine : soundcloud
categories : music
shortcut : sc
- name : stackoverflow
engine : stackoverflow
categories : it
shortcut : st
- name : startpage
engine : startpage
base_url : 'https://startpage.com/'
search_url : 'https://startpage.com/do/search'
shortcut : sp
# +30% page load time
# - name : ixquick
# engine : startpage
# base_url : 'https://www.ixquick.com/'
# search_url : 'https://www.ixquick.com/do/search'
- name : twitter
engine : twitter
categories : social media
shortcut : tw
# maybe in a fun category
# - name : uncyclopedia
# engine : mediawiki
# categories : general
# shortcut : unc
# url : https://uncyclopedia.wikia.com/
# tmp suspended - too slow, too many errors
# - name : urbandictionary
# engine : xpath
# search_url : http://www.urbandictionary.com/define.php?term={query}
# url_xpath : //div[@class="word"]//a/@href
# title_xpath : //div[@class="word"]//a
# content_xpath : //div[@class="definition"]
# shortcut : ud
- name : yahoo
engine : yahoo
shortcut : yh
- name : yahoo news
engine : yahoo_news
shortcut : yhn
- name : youtube
engine : youtube
categories : videos
shortcut : yt
- name : dailymotion
engine : dailymotion
locale : en_US
categories : videos
shortcut : dm
- name : vimeo
engine : vimeo
categories : videos
results_xpath : //div[@id="browse_content"]/ol/li
url_xpath : ./a/@href
title_xpath : ./a/div[@class="data"]/p[@class="title"]/text()
content_xpath : ./a/img/@src
shortcut : vm
locales:
en : English
de : Deutsch
hu : Magyar
fr : Français
es : Español
it : Italiano
nl : Nederlands

View File

@ -8,16 +8,9 @@ is_public=$3
# Check domain/path availability
sudo yunohost app checkurl $domain$path -a searx
if [[ ! $? -eq 0 ]]; then
<<<<<<< HEAD
exit 1
fi
=======
exit 1
fi
# Save specific settings
>>>>>>> 90736b2cc32bd424c78355499e1bfb61062af8ca
sudo yunohost app setting searx is_public -v $is_public
# Check depends installation
@ -31,7 +24,7 @@ then
sudo mkswap /tmp/myswapfile
sudo swapon /tmp/myswapfile
fi
# Init virtualenv
if [ ! -d /opt/yunohost/searx ];
@ -50,22 +43,13 @@ then
fi
#Configuration Searx
sudo cp ../conf/settings.yml /opt/searx/searx/
sudo sed -i -e "s/ultrasecretkey/`openssl rand -hex 16`/g" /opt/searx/searx/settings.yml
if [ "$path" != "/" ];
if [ $path != "/" ];
then
<<<<<<< HEAD
sudo cp ../conf/settings.yml-noroot /opt/yunohost/searx/searx/settings.yml
else
sudo cp ../conf/settings.yml /opt/yunohost/searx/searx/
fi
sudo sed -i -e "s/ultrasecretkey/`openssl rand -hex 16`/g" /opt/yunohost/searx/searx/settings.yml
=======
sudo sed -i -e "s@ynhbaseurl@https://$domain$path/@g" /opt/searx/searx/settings.yml
else
sudo sed -i -e "s@ynhbaseurl@https://$domain$path@g" /opt/searx/searx/settings.yml
fi
>>>>>>> 90736b2cc32bd424c78355499e1bfb61062af8ca
# Set permissions to searx directory
sudo useradd searx -d /opt/yunohost/searx
@ -77,7 +61,7 @@ sudo ln -s /etc/uwsgi/apps-available/searx.ini /etc/uwsgi/apps-enabled/
# Modify Nginx configuration file and copy it to Nginx conf directory
sudo sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf*
if [ "$path" != "/" ];
if [ $path != "/" ];
then
sudo cp ../conf/nginx.conf-noroot /etc/nginx/conf.d/$domain.d/searx.conf
else
@ -92,13 +76,10 @@ fi
sudo service nginx reload
sudo service uwsgi restart
if [ "$is_public" = "Yes" ];
if [ $is_public = "Yes" ];
then
sudo yunohost app setting searx skipped_uris -v "/"
<<<<<<< HEAD
else
sudo sed -i 's/#include conf/include conf/' /etc/nginx/conf.d/$domain.d/searx.conf
=======
>>>>>>> 90736b2cc32bd424c78355499e1bfb61062af8ca
fi
sudo yunohost app ssowatconf

View File

@ -1,29 +1,17 @@
<<<<<<< HEAD
#!/bin/bash
=======
>>>>>>> 90736b2cc32bd424c78355499e1bfb61062af8ca
# Retrieve arguments
domain=$(sudo yunohost app setting searx domain)
path=$(sudo yunohost app setting searx path)
is_public=$(sudo yunohost app setting searx is_public)
<<<<<<< HEAD
# Check depends installation
sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-pybabel zlib1g-dev uwsgi uwsgi-plugin-python -y
=======
# Remove trailing "/" for next commands
path=${path%/}
# Check depends installation
sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-pybabel zlib1g-dev -y
>>>>>>> 90736b2cc32bd424c78355499e1bfb61062af8ca
# Check Swap
if [ $(sudo swapon -s | wc -l) = 1 ];
then
<<<<<<< HEAD
sudo dd if=/dev/zero of=/tmp/myswapfile bs=1M count=128
sudo chmod 600 /tmp/myswapfile
sudo mkswap /tmp/myswapfile
@ -46,28 +34,10 @@ sudo cp ../conf/searx.ini /etc/uwsgi/apps-available/
sudo cp -r ../sources/* /opt/yunohost/searx/
sudo virtualenv /opt/yunohost/searx
sudo bash -c "source /opt/yunohost/searx/bin/activate && pip install -r /opt/yunohost/searx/requirements.txt"
=======
sudo dd if=/dev/zero of=/tmp/myswapfile bs=1M count=1024
sudo chmod 600 /tmp/myswapfile
sudo mkswap /tmp/myswapfile
sudo swapon /tmp/myswapfile
fi
# Init virtualenv
if [ ! -d /opt/searx ];
then
sudo mkdir /opt/searx
fi
sudo cp -r ../sources/* /opt/searx
sudo virtualenv /opt/searx
sudo bash -c "source /opt/searx/bin/activate && pip install -r /opt/searx/requirements.txt"
>>>>>>> 90736b2cc32bd424c78355499e1bfb61062af8ca
# Disable swapfile
if [ -f /tmp/myswapfile ];
then
<<<<<<< HEAD
sudo swapoff /tmp/myswapfile
sudo rm -f /tmp/myswapfile
fi
@ -89,55 +59,3 @@ fi
## Reload Nginx and regenerate SSOwat conf
sudo service nginx reload
sudo service uwsgi restart
=======
sudo swapoff /tmp/myswapfile
sudo rm -f /tmp/myswapfile
fi
# Remove trailing "/" for next commands if installing on a subpath
if [ "$path" != "/" ];
then
path=${path%/}
fi
#Configuration Searx
sudo cp ../conf/settings.yml /opt/searx/searx/
sudo sed -i -e "s/ultrasecretkey/`openssl rand -hex 16`/g" /opt/searx/searx/settings.yml
if [ "$path" != "/" ];
then
sudo sed -i -e "s@ynhbaseurl@https://$domain$path/@g" /opt/searx/searx/settings.yml
else
sudo sed -i -e "s@ynhbaseurl@https://$domain$path@g" /opt/searx/searx/settings.yml
fi
# Set permissions to searx directory
sudo useradd searx -d /opt/searx
sudo chown searx:searx -R /opt/searx
# Copy uwsgi config
sudo cp ../conf/searx.ini /etc/uwsgi/apps-available/
sudo ln -s /etc/uwsgi/apps-available/searx.ini /etc/uwsgi/apps-enabled/
# Modify Nginx configuration file and copy it to Nginx conf directory
sudo sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf*
if [ "$path" != "/" ];
then
sudo cp ../conf/nginx.conf-noroot /etc/nginx/conf.d/$domain.d/searx.conf
else
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/searx.conf
fi
# Fix permission
#sudo find /opt/searx/ -type d -exec chmod 2755 {} \;
#sudo find /opt/searx/ -type f -exec chmod g+r,o+r {} \;
## Reload Nginx and regenerate SSOwat conf
sudo service nginx reload
sudo service uwsgi restart
if [ "$is_public" = "Yes" ];
then
sudo yunohost app setting searx skipped_uris -v "/"
fi
sudo yunohost app ssowatconf
>>>>>>> 90736b2cc32bd424c78355499e1bfb61062af8ca