aboutsummaryrefslogtreecommitdiff
path: root/vagrant
diff options
context:
space:
mode:
Diffstat (limited to 'vagrant')
-rw-r--r--vagrant/bootstrap.sh21
-rw-r--r--vagrant/conf.cfg-sample3
2 files changed, 18 insertions, 6 deletions
diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh
index 1d931cf8..62747f64 100644
--- a/vagrant/bootstrap.sh
+++ b/vagrant/bootstrap.sh
@@ -11,6 +11,9 @@ if [ $? -ne 0 ]; then
exit 1;
fi
+# Installation of PostgreSQL
+apt-get install -y postgresql postgresql-server-dev-9.4 postgresql-client
+
# Install all Python requierements
cd pyaggr3g470r
# For lxml
@@ -19,15 +22,13 @@ apt-get install -y libxml2-dev libxslt1-dev
sudo pip3 install --upgrade -r requirements.txt
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python3 get-pip.py
-sudo pip3 uninstall feedparser
+rm get-pip.py
+sudo pip3 uninstall -y feedparser
sudo pip3 install feedparser==5.1.2
# copy of the default configuration files for vagrant
cp vagrant/conf.cfg-sample conf/conf.cfg
cd ..
-# Installation of PostgreSQL
-apt-get install -y postgresql postgresql-server-dev-9.4 postgresql-client
-
# Configuration of the database
echo "127.0.0.1:5432:aggregator:vagrant:xxYzToW42" > .pgpass
chmod 700 .pgpass
@@ -39,7 +40,8 @@ echo "GRANT ALL PRIVILEGES ON DATABASE aggregator TO vagrant;" | sudo -u postgre
# Initializes the database
cd pyaggr3g470r
chown -R vagrant:vagrant .
-sudo -u vagrant python3 db_create.py
+sudo -u vagrant python3 manager.py db_empty
+sudo -u vagrant python3 manager.py db_create
# start pyAggr3g470r at startup
echo "#!/bin/sh -e" > /etc/rc.local
@@ -50,3 +52,12 @@ chmod 755 /etc/rc.local
# Start the application.
/etc/init.d/rc.local start
+
+
+#write out current crontab
+sudo -u vagrant crontab -l > mycron
+#echo new cron into cron file
+sudo -u vagrant echo "*/30 * * * * cd /home/vagrant/pyaggr3g470r/ ; python3 manager.py fetch_asyncio None None" >> mycron
+#install new cron file
+sudo -u vagrant crontab mycron
+sudo -u vagrant rm mycron
diff --git a/vagrant/conf.cfg-sample b/vagrant/conf.cfg-sample
index 93a0b89c..fa76caad 100644
--- a/vagrant/conf.cfg-sample
+++ b/vagrant/conf.cfg-sample
@@ -1,10 +1,11 @@
[misc]
-platform_url = https://pyaggr3g470r.herokuapp.com/
+platform_url = http://127.0.0.1:5000/
admin_email =
recaptcha_public_key =
recaptcha_private_key =
log_path = ./pyaggr3g470r/var/pyaggr3g470r.log
python = python3
+nb_worker = 5
[database]
uri = postgres://vagrant:xxYzToW42@127.0.0.1:5432/aggregator
[feedparser]
bgstack15