From 8658db8ff6fb91c1de39ca1cc22a140f0d12aa32 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Wed, 23 Jul 2014 00:14:40 +0200 Subject: [PATCH] boulet de git --- conf/nginx.conf | 5 -- conf/nginx.conf-noroot | 6 -- conf/nginx.conf-noroot.orig | 21 ----- conf/nginx.conf.BACKUP.10178.conf | 20 ----- conf/nginx.conf.BASE.10178.conf | 12 --- conf/nginx.conf.LOCAL.10178.conf | 14 --- conf/nginx.conf.REMOTE.10178.conf | 15 ---- conf/nginx.conf.orig | 20 ----- scripts/install | 19 ---- scripts/install.orig | 104 ---------------------- scripts/upgrade | 61 +------------ scripts/upgrade.orig | 143 ------------------------------ 12 files changed, 1 insertion(+), 439 deletions(-) delete mode 100644 conf/nginx.conf-noroot.orig delete mode 100644 conf/nginx.conf.BACKUP.10178.conf delete mode 100644 conf/nginx.conf.BASE.10178.conf delete mode 100644 conf/nginx.conf.LOCAL.10178.conf delete mode 100644 conf/nginx.conf.REMOTE.10178.conf delete mode 100644 conf/nginx.conf.orig delete mode 100644 scripts/install.orig delete mode 100644 scripts/upgrade.orig diff --git a/conf/nginx.conf b/conf/nginx.conf index 9a25138..eb797dc 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -8,13 +8,8 @@ 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 } diff --git a/conf/nginx.conf-noroot b/conf/nginx.conf-noroot index 1806ff9..a4da5d2 100644 --- a/conf/nginx.conf-noroot +++ b/conf/nginx.conf-noroot @@ -8,14 +8,8 @@ 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 } diff --git a/conf/nginx.conf-noroot.orig b/conf/nginx.conf-noroot.orig deleted file mode 100644 index 1806ff9..0000000 --- a/conf/nginx.conf-noroot.orig +++ /dev/null @@ -1,21 +0,0 @@ -location = PATHTOCHANGE { rewrite ^ PATHTOCHANGE/; } -location PATHTOCHANGE { - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - try_files $uri @searx; } -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 -} diff --git a/conf/nginx.conf.BACKUP.10178.conf b/conf/nginx.conf.BACKUP.10178.conf deleted file mode 100644 index 9a25138..0000000 --- a/conf/nginx.conf.BACKUP.10178.conf +++ /dev/null @@ -1,20 +0,0 @@ -location PATHTOCHANGE { - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - try_files $uri @searx; -} - -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 -} - diff --git a/conf/nginx.conf.BASE.10178.conf b/conf/nginx.conf.BASE.10178.conf deleted file mode 100644 index ab9cf55..0000000 --- a/conf/nginx.conf.BASE.10178.conf +++ /dev/null @@ -1,12 +0,0 @@ -location PATHTOCHANGE { - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - try_files $uri @searx; -} - -location @searx { - uwsgi_pass unix:/run/uwsgi/app/searx/socket; - include uwsgi_params; -} - diff --git a/conf/nginx.conf.LOCAL.10178.conf b/conf/nginx.conf.LOCAL.10178.conf deleted file mode 100644 index fe5fff0..0000000 --- a/conf/nginx.conf.LOCAL.10178.conf +++ /dev/null @@ -1,14 +0,0 @@ -location PATHTOCHANGE { - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - try_files $uri @searx; -} - -location @searx { - uwsgi_pass unix:///run/uwsgi/app/searx/socket; - include uwsgi_params; - # Include SSOWAT user panel. - #include conf.d/yunohost_panel.conf.inc; -} - diff --git a/conf/nginx.conf.REMOTE.10178.conf b/conf/nginx.conf.REMOTE.10178.conf deleted file mode 100644 index e17b794..0000000 --- a/conf/nginx.conf.REMOTE.10178.conf +++ /dev/null @@ -1,15 +0,0 @@ -location PATHTOCHANGE { - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - try_files $uri @searx; -} - -location @searx { - uwsgi_pass unix:/run/uwsgi/app/searx/socket; - include uwsgi_params; - - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; -} - diff --git a/conf/nginx.conf.orig b/conf/nginx.conf.orig deleted file mode 100644 index 9a25138..0000000 --- a/conf/nginx.conf.orig +++ /dev/null @@ -1,20 +0,0 @@ -location PATHTOCHANGE { - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - try_files $uri @searx; -} - -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 -} - diff --git a/scripts/install b/scripts/install index 879ac1e..192bda6 100644 --- a/scripts/install +++ b/scripts/install @@ -8,16 +8,10 @@ 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 @@ -54,18 +48,10 @@ 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 -<<<<<<< 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 @@ -95,10 +81,5 @@ sudo service uwsgi restart 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 diff --git a/scripts/install.orig b/scripts/install.orig deleted file mode 100644 index 879ac1e..0000000 --- a/scripts/install.orig +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/bash - -# Retrieve arguments -domain=$1 -path=$2 -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 -sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-pybabel zlib1g-dev uwsgi uwsgi-plugin-python -y - -# Check Swap -if [ $(sudo swapon -s | wc -l) = 1 ]; -then - sudo dd if=/dev/zero of=/tmp/myswapfile bs=1M count=256 - sudo chmod 600 /tmp/myswapfile - sudo mkswap /tmp/myswapfile - sudo swapon /tmp/myswapfile -fi - - -# Init virtualenv -if [ ! -d /opt/yunohost/searx ]; -then - sudo mkdir -p /opt/yunohost/searx -fi -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" - -# Disable swapfile -if [ -f /tmp/myswapfile ]; -then - sudo swapoff /tmp/myswapfile - sudo rm -f /tmp/myswapfile -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 -<<<<<<< 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 -sudo chown searx:searx -R /opt/yunohost/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/yunohost/searx/ -type d -exec chmod 2755 {} \; -#sudo find /opt/yunohost/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 "/" -<<<<<<< HEAD -else - sudo sed -i 's/#include conf/include conf/' /etc/nginx/conf.d/$domain.d/searx.conf -======= ->>>>>>> 90736b2cc32bd424c78355499e1bfb61062af8ca -fi -sudo yunohost app ssowatconf diff --git a/scripts/upgrade b/scripts/upgrade index c1b53a0..ed28ff9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,52 +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 -sudo swapon /tmp/myswapfile -fi - -# Move searx -if [ -d /opt/searx ]; -then - sudo mkdir -p /opt/yunohost/searx - sudo mv /opt/searx /opt/yunohost/ - sudo usermod -d /opt/yunohost/searx searx - sudo chown searx:searx -R /opt/yunohost/searx -fi - -# Copy uwsgi config -sudo cp ../conf/searx.ini /etc/uwsgi/apps-available/ - -# Init virtualenv -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 @@ -62,34 +27,10 @@ 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 - -# 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 - -if [ $is_public = "No" ]; -then - sudo sed -i 's/#include conf/include conf/' /etc/nginx/conf.d/$domain.d/searx.conf -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 @@ -140,4 +81,4 @@ then sudo yunohost app setting searx skipped_uris -v "/" fi sudo yunohost app ssowatconf ->>>>>>> 90736b2cc32bd424c78355499e1bfb61062af8ca + diff --git a/scripts/upgrade.orig b/scripts/upgrade.orig deleted file mode 100644 index c1b53a0..0000000 --- a/scripts/upgrade.orig +++ /dev/null @@ -1,143 +0,0 @@ -<<<<<<< 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 -sudo swapon /tmp/myswapfile -fi - -# Move searx -if [ -d /opt/searx ]; -then - sudo mkdir -p /opt/yunohost/searx - sudo mv /opt/searx /opt/yunohost/ - sudo usermod -d /opt/yunohost/searx searx - sudo chown searx:searx -R /opt/yunohost/searx -fi - -# Copy uwsgi config -sudo cp ../conf/searx.ini /etc/uwsgi/apps-available/ - -# Init virtualenv -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 - -# 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 - -if [ $is_public = "No" ]; -then - sudo sed -i 's/#include conf/include conf/' /etc/nginx/conf.d/$domain.d/searx.conf -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