aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-09-27 12:59:44 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-09-27 12:59:44 +0200
commitf9c705fa0e6b6440bcf1d8adf5b58f5030c93e48 (patch)
treeebb24d0de08c4aeaadf17882ddd0467d377c26eb
parentFixed install.sh script. (diff)
downloadnewspipe-f9c705fa0e6b6440bcf1d8adf5b58f5030c93e48.tar.gz
newspipe-f9c705fa0e6b6440bcf1d8adf5b58f5030c93e48.tar.bz2
newspipe-f9c705fa0e6b6440bcf1d8adf5b58f5030c93e48.zip
Updated installation script.
-rwxr-xr-xinstall.sh13
-rw-r--r--src/conf/conf.cfg-sample2
-rw-r--r--src/crawler/classic_crawler.py2
3 files changed, 12 insertions, 5 deletions
diff --git a/install.sh b/install.sh
index 20444252..1a078619 100755
--- a/install.sh
+++ b/install.sh
@@ -11,9 +11,15 @@ PYTHON_VERSION="3.5"
sudo apt-get install -y build-essential git wget > /dev/null
sudo apt-get install -y libxml2-dev libxslt1-dev > /dev/null # for lxml
+sudo apt-get install -y libssl-dev openssl > /dev/null # for pip
echo "Installation of Python..."
+if [ "$1" == postgres ]; then
+ sudo apt-get install -y libpq-dev > /dev/null
+elif [ "$1" == sqlite ]; then
+ sudo apt-get install -y libsqlite3-dev > /dev/null
+fi
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz -o /dev/null > /dev/null
tar -xf Python-3.5.2.tar.xz > /dev/null
rm Python-3.5.2.tar.xz > /dev/null
@@ -29,19 +35,21 @@ sudo rm -Rf Python-3.5.2/
echo "Installing required Python libraries..."
sed -i '/psycopg2/d' requirements.txt > /dev/null
+sudo pip$PYTHON_VERSION install --upgrade pip
sudo pip$PYTHON_VERSION install --upgrade -r requirements.txt > /dev/null
+
# Initializes the configuration file
cp src/conf/conf.cfg-sample src/conf/conf.cfg
-
# Delete default database configuration
sed -i '/database/d' src/conf/conf.cfg
sed -i '/database_url/d' src/conf/conf.cfg
+
+# Configuration of the database
if [ "$1" == postgres ]; then
echo "Installing requirements for PostgreSQL..."
sudo apt-get install -y postgresql postgresql-server-dev-9.4 postgresql-client > /dev/null
- sudo apt-get install -y libpq-dev > /dev/null
sudo pip$PYTHON_VERSION install psycopg2 > /dev/null
echo "Configuring the database..."
echo "127.0.0.1:5433:aggregator:pgsqluser:pgsqlpwd" > ~/.pgpass
@@ -57,6 +65,7 @@ if [ "$1" == postgres ]; then
elif [ "$1" == sqlite ]; then
# Add configuration lines for SQLite
echo "Configuring the SQLite database..."
+
echo '[database]' >> src/conf/conf.cfg
echo 'database_url = sqlite:///jarr.db' >> src/conf/conf.cfg
fi
diff --git a/src/conf/conf.cfg-sample b/src/conf/conf.cfg-sample
index 811bde67..a9e59936 100644
--- a/src/conf/conf.cfg-sample
+++ b/src/conf/conf.cfg-sample
@@ -1,5 +1,5 @@
[webserver]
-host = 127.0.0.1
+host = 0.0.0.0
port = 5000
secret_key = a secret only you know
[cdn]
diff --git a/src/crawler/classic_crawler.py b/src/crawler/classic_crawler.py
index 8b952940..cd395d0f 100644
--- a/src/crawler/classic_crawler.py
+++ b/src/crawler/classic_crawler.py
@@ -148,8 +148,6 @@ async def insert_database(user, feed):
existing_article.dump())
continue
article = construct_article(article, feed)
- print("test.............................................")
- print(article)
try:
new_articles.append(art_contr.create(**article))
logger.info("New article % (%r) added.",
bgstack15