diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-11-26 18:47:10 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-11-26 18:47:10 +0100 |
commit | d8d46c33dc766b904124eaad2dee5d7964711060 (patch) | |
tree | f549b7cd3acfa99425d4c7248e8b431de695bc7f | |
parent | Bug fix in the crawler when logging the creation of articles. (diff) | |
download | newspipe-d8d46c33dc766b904124eaad2dee5d7964711060.tar.gz newspipe-d8d46c33dc766b904124eaad2dee5d7964711060.tar.bz2 newspipe-d8d46c33dc766b904124eaad2dee5d7964711060.zip |
More refactorization.
-rw-r--r-- | app.json | 8 | ||||
-rw-r--r-- | conf/conf.cfg-sample | 2 | ||||
-rw-r--r-- | documentation/conf.py | 2 | ||||
-rw-r--r-- | documentation/deployment.rst | 24 | ||||
-rw-r--r-- | documentation/index.rst | 6 | ||||
-rw-r--r-- | documentation/web-services.rst | 30 | ||||
-rwxr-xr-x | install.sh | 4 | ||||
-rwxr-xr-x | internationalization.sh | 4 | ||||
-rwxr-xr-x | manager.py | 4 | ||||
-rw-r--r-- | vagrant/bootstrap.sh | 12 |
10 files changed, 47 insertions, 49 deletions
@@ -1,5 +1,5 @@ { - "name": "JARR", + "name": "JARR (Just Another RSS Reader)", "description": "A news aggregator that can be deployed on Heroku.", "keywords": [ "aggregator", @@ -7,15 +7,15 @@ "RSS" ], "repository": "https://github.com/JARR-aggregator/JARR.git", - "logo": "https://raw.githubusercontent.com/cedricbonhomme/pyAggr3g470r/master/pyaggr3g470r/static/img/logo.png", + "logo": "https://raw.githubusercontent.com/JARR-aggregator/JARR/master/web/static/img/logo.png", "scripts": { "postdeploy": "python manager.py db_create" }, "env": { "HEROKU": "1", - "ADMIN_EMAIL": "root@pyAggr3g470r.localhost", + "ADMIN_EMAIL": "root@jarr.localhost", "ADMIN_PASSWORD": "password", - "NOTIFICATION_EMAIL": "pyAggr3g470r@no-reply.com", + "NOTIFICATION_EMAIL": "JARR@no-reply.com", "RECAPTCHA_PRIVATE_KEY": "REDACTED", "RECAPTCHA_PUBLIC_KEY": "REDACTED", "POSTMARK_API_KEY": "REDACTED" diff --git a/conf/conf.cfg-sample b/conf/conf.cfg-sample index 4b2229dc..be5fc87c 100644 --- a/conf/conf.cfg-sample +++ b/conf/conf.cfg-sample @@ -21,7 +21,7 @@ resolve_article_url = false api_login = api_passwd = [notification] -notification_email = jarr@no-reply.com +notification_email = JARR@no-reply.com host = smtp.googlemail.com port = 465 tls = false diff --git a/documentation/conf.py b/documentation/conf.py index ed031f9a..972d748b 100644 --- a/documentation/conf.py +++ b/documentation/conf.py @@ -40,7 +40,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'jarr' +project = u'JARR (Just Another RSS Reader)' copyright = u'2015, Cédric Bonhomme' # The version info for the project you're documenting, acts as replacement for diff --git a/documentation/deployment.rst b/documentation/deployment.rst index 59080b89..82fa3988 100644 --- a/documentation/deployment.rst +++ b/documentation/deployment.rst @@ -4,7 +4,7 @@ Deployment This application can be deployed on Heroku or on a traditional server. After installation, you will be able to connect with the email -*root@pyAggr3g470r.localhost* and the password *password*. +*root@jarr.localhost* and the password *password*. Deploying the application with Vagrant -------------------------------------- @@ -17,12 +17,12 @@ Installation of VirtualBox and Vagrant $ wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.2_x86_64.deb $ sudo dpkg -i vagrant_1.7.2_x86_64.deb -Deployment of pyAggr3g470r +Deployment of JARR .. code-block:: bash - $ git clone https://bitbucket.org/cedricbonhomme/pyaggr3g470r.git - $ cd pyaggr3g470r/vagrant/ + $ git clone https://github.com/JARR-aggregator/JARR.git + $ cd JARR/vagrant/ $ vagrant up Once the VM configured, go to the address http://127.0.0.1:5000. @@ -30,15 +30,15 @@ Once the VM configured, go to the address http://127.0.0.1:5000. Deploying the application on Heroku ----------------------------------- -An instance of pyAggr3g470r is running `here <https://pyaggr3g470r.herokuapp.com>`_. +An instance of JARR is running `here <https://jarr.herokuapp.com>`_. The geek way '''''''''''' .. code-block:: bash - $ git clone https://bitbucket.org/cedricbonhomme/pyaggr3g470r.git - $ cd pyaggr3g470r + $ git clone https://github.com/JARR-aggregator/JARR.git + $ cd JARR $ heroku create $ heroku addons:add heroku-postgresql:dev $ heroku config:set HEROKU=1 @@ -71,7 +71,7 @@ The simple way Alternatively, you can deploy your own copy of the app using this button: .. image:: https://www.herokucdn.com/deploy/button.png - :target: https://heroku.com/deploy?template=https://github.com/cedricbonhomme/pyAggr3g470r + :target: https://heroku.com/deploy?template=https://github.com/JARR-aggregator/JARR.git You will be prompted to choose an email and a password for the administrator's account. And some other optional environment variables, as previously presented. @@ -81,8 +81,8 @@ Deploying the application on a traditional server .. code-block:: bash - $ git clone https://bitbucket.org/cedricbonhomme/pyaggr3g470r.git - $ cd pyaggr3g470r/ + $ git clone https://github.com/JARR-aggregator/JARR.git + $ cd JARR/ If you want to use PostgreSQL ''''''''''''''''''''''''''''' @@ -114,7 +114,7 @@ Configuration (database url, email, proxy, user agent, etc.) is done via the file `conf/conf.cfg`. Check this file before initializing the database (with `manager.py`). -If you want to use pyAggr3g470r with Tor/Privoxy, you just have to set the value +If you want to use JARR with Tor/Privoxy, you just have to set the value of `http_proxy` (most of the time: `http_proxy = 127.0.0.1:8118`). Else leave the value blank. @@ -128,4 +128,4 @@ your cron rules (*crontab -e*): .. code-block:: bash - */30 * * * * cd ~/.pyaggr3g470r/ ; python manager.py fetch_asyncio None None + */30 * * * * cd ~/.JARR/ ; python manager.py fetch_asyncio None None diff --git a/documentation/index.rst b/documentation/index.rst index 947612a1..8f84c8a7 100644 --- a/documentation/index.rst +++ b/documentation/index.rst @@ -1,9 +1,9 @@ -.. pyAggr3g470r documentation master file, created by +.. JARR documentation master file, created by sphinx-quickstart on Fri Feb 20 07:23:42 2015. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to pyAggr3g470r's documentation! +Welcome to JARR's documentation! ======================================== @@ -31,5 +31,3 @@ Migrations :maxdepth: 2 migrations - - diff --git a/documentation/web-services.rst b/documentation/web-services.rst index 16a425ad..53035c3c 100644 --- a/documentation/web-services.rst +++ b/documentation/web-services.rst @@ -7,7 +7,7 @@ Articles .. code-block:: python >>> import requests, json - >>> r = requests.get("https://pyaggr3g470r.herokuapp.com/api/v2.0/article/1s", + >>> r = requests.get("https://jarr.herokuapp.com/api/v2.0/article/1s", ... headers={'Content-type': 'application/json'}, ... auth=("your-nickname", "your-password")) >>> r.status_code @@ -17,7 +17,7 @@ Articles 'Sponsors required for KDE code sprint in Randa' >>> rjson["date"] 'Wed, 18 Jun 2014 14:25:18 GMT' - >>> r = requests.get("https://pyaggr3g470r.herokuapp.com/api/v2.0/article/1s", + >>> r = requests.get("https://jarr.herokuapp.com/api/v2.0/article/1s", ... headers={'Content-type': 'application/json'}, ... auth=("your-nickname", "your-password"), ... data=json.dumps({'id__in': [1, 2]})) @@ -36,20 +36,20 @@ Add an article: ... 'content':'La page principale de pyAggr3g470r a été améliorée...', ... 'date':'2014/06/23T11:42:20 GMT', ... 'feed_id':'42'} - >>> r = requests.post("https://pyaggr3g470r.herokuapp.com/api/v2.0/article", + >>> r = requests.post("https://jarr.herokuapp.com/api/v2.0/article", ... headers=headers, auth=("your-nickname", "your-password"), ... data=json.dumps(payload)) >>> r.status_code 201 # Created >>> # creating several articles at once - >>> r = requests.post("https://pyaggr3g470r.herokuapp.com/api/v2.0/article", + >>> r = requests.post("https://jarr.herokuapp.com/api/v2.0/article", ... headers=headers, auth=("your-nickname", "your-password"), ... data=json.dumps([payload, payload])) >>> r.status_code 201 # Created >>> r.json() [123456, 234567] - >>> r = requests.get("https://pyaggr3g470r.herokuapp.com/api/v2.0/articles", + >>> r = requests.get("https://jarr.herokuapp.com/api/v2.0/articles", ... auth=("your-nickname", "your-password") ... data=json.dumps({'feed_id': 42, 'limit': 1})) >>> r.json()[0]["title"] @@ -60,13 +60,13 @@ Update an article: .. code-block:: python >>> import requests, json - >>> r = requests.put("https://pyaggr3g470r.herokuapp.com/api/v2.0/article/65", + >>> r = requests.put("https://jarr.herokuapp.com/api/v2.0/article/65", ... headers={'Content-Type': 'application/json'}, ... auth=("your-nickname", "your-password"), ... data=json.dumps({"like":True, "readed": False})) >>> r.status_code 200 # OK - >>> r = requests.put("https://pyaggr3g470r.herokuapp.com/api/v2.0/articles", + >>> r = requests.put("https://jarr.herokuapp.com/api/v2.0/articles", ... headers={'Content-Type': 'application/json'}, ... auth=("your-nickname", "your-password"), ... data=json.dumps([[1, {"like": True, "readed": False}], @@ -79,29 +79,29 @@ Delete one or several article(s): .. code-block:: python >>> import json, requests - >>> r = requests.delete("https://pyaggr3g470r.herokuapp.com/api/v2.0/article/84574", + >>> r = requests.delete("https://jarr.herokuapp.com/api/v2.0/article/84574", ... headers={'Content-Type': 'application/json'}, ... auth=("your-nickname", "your-password")) >>> r.status_code 204 # deleted - No content - >>> r = requests.delete("https://pyaggr3g470r.herokuapp.com/api/v2.0/article/84574", + >>> r = requests.delete("https://jarr.herokuapp.com/api/v2.0/article/84574", ... headers={'Content-Type': 'application/json'}, ... auth=("your-nickname", "your-password")) >>> r.status_code 404 # not found - >>> r = requests.delete("https://pyaggr3g470r.herokuapp.com/api/v2.0/articles", + >>> r = requests.delete("https://jarr.herokuapp.com/api/v2.0/articles", ... headers={'Content-Type': 'application/json'}, ... auth=("your-nickname", "your-password") ... data=json.dumps([84574])) >>> r.status_code 500 # already deleted - >>> r = requests.delete("https://pyaggr3g470r.herokuapp.com/api/v2.0/articles", + >>> r = requests.delete("https://jarr.herokuapp.com/api/v2.0/articles", ... headers={'Content-Type': 'application/json'}, ... auth=("your-nickname", "your-password") ... data=json.dumps([84575, 84576])) >>> r.status_code 204 # deleted - No content - >>> r = requests.delete("https://pyaggr3g470r.herokuapp.com/api/v2.0/articles", + >>> r = requests.delete("https://jarr.herokuapp.com/api/v2.0/articles", ... headers={'Content-Type': 'application/json'}, ... auth=("your-nickname", "your-password") ... data=json.dumps([84575, 84576, 84577])) @@ -119,7 +119,7 @@ Add a feed: .. code-block:: python >>> import json, requests - >>> r = requests.post("https://pyaggr3g470r.herokuapp.com/api/v2.0/feeds", + >>> r = requests.post("https://jarr.herokuapp.com/api/v2.0/feeds", ... auth=("your-nickname", "your-password"), ... headers={'Content-Type': 'application/json'}, ... data=json.dumps({'link': 'http://blog.cedricbonhomme.org/feed'})) @@ -131,7 +131,7 @@ Update a feed: .. code-block:: python >>> import json, requests - >>> r = requests.put("https://pyaggr3g470r.herokuapp.com/api/v2.0/feeds/42", + >>> r = requests.put("https://jarr.herokuapp.com/api/v2.0/feeds/42", ... auth=("your-nickname", "your-password"), ... headers={'Content-Type': 'application/json'}, ... data=json.dumps({"title":"Feed new title", "description":"New description"}) @@ -143,5 +143,5 @@ Delete a feed: .. code-block:: python >>> import requests - >>> r = requests.delete("https://pyaggr3g470r.herokuapp.com/api/v2.0/feeds/29", + >>> r = requests.delete("https://jarr.herokuapp.com/api/v2.0/feeds/29", ... auth=("your-nickname", "your-password")) @@ -1,7 +1,7 @@ #! /usr/bin/env bash # -# This script install all dependencies and configure pyAggr3g470r +# This script install all dependencies and configure JARR # for Python 3. # @@ -37,7 +37,7 @@ elif [ "$1" == sqlite ]; then sudo pip$PYTHON_VERSION install pysqlite # not working with Python 3! # Add configuration lines for SQLite echo '[database]' >> conf/conf.cfg - echo 'database_url = sqlite+pysqlite:///pyAggr3g470r.db' >> conf/conf.cfg + echo 'database_url = sqlite+pysqlite:///jarr.db' >> conf/conf.cfg fi python$PYTHON_VERSION manager.py db_empty diff --git a/internationalization.sh b/internationalization.sh index 46a8a9b4..6355c2b1 100755 --- a/internationalization.sh +++ b/internationalization.sh @@ -1,4 +1,4 @@ #! /bin/sh -pybabel extract -F babel.cfg -k lazy_gettext -o messages.pot pyaggr3g470r/ -poedit pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po +pybabel extract -F babel.cfg -k lazy_gettext -o messages.pot web/ +poedit web/translations/fr/LC_MESSAGES/messages.po @@ -17,14 +17,14 @@ def db_empty(): "Will drop every datas stocked in db." with application.app_context(): populate_g() - jarr.models.db_empty(db) + web.models.db_empty(db) @manager.command def db_create(): "Will create the database from conf parameters." with application.app_context(): populate_g() - jarr.models.db_create(db) + web.models.db_create(db) @manager.command def fetch(limit=100, retreive_all=False): diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index 76c20d44..c37acb2e 100644 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -4,8 +4,8 @@ apt-get update apt-get upgrade
apt-get install -y python3 python3-dev libpq-dev python3-pip build-essential git
-# Clone the source code of pyAggr3g470r
-git clone https://bitbucket.org/cedricbonhomme/pyaggr3g470r.git
+# Clone the source code of JARR
+git clone https://github.com/JARR-aggregator/JARR.git
if [ $? -ne 0 ]; then
echo "\nERROR: unable to clone the git repository\n"
exit 1;
@@ -15,7 +15,7 @@ fi apt-get install -y postgresql postgresql-server-dev-9.4 postgresql-client
# Install all Python requierements
-cd pyaggr3g470r
+cd JARR
# For lxml
apt-get install -y libxml2-dev libxslt1-dev
# installation with pip
@@ -33,14 +33,14 @@ echo "ALTER USER vagrant WITH ENCRYPTED PASSWORD 'xxYzToW42';" | sudo -u postgre echo "GRANT ALL PRIVILEGES ON DATABASE aggregator TO vagrant;" | sudo -u postgres psql
# Initializes the database
-cd pyaggr3g470r
+cd JARR
chown -R vagrant:vagrant .
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
-echo "cd /home/vagrant/pyaggr3g470r/" >> /etc/rc.local
+echo "cd /home/vagrant/JARR/" >> /etc/rc.local
echo "sudo -u vagrant python3 runserver.py &" >> /etc/rc.local
echo "exit 0" >> /etc/rc.local
chmod 755 /etc/rc.local
@@ -52,7 +52,7 @@ chmod 755 /etc/rc.local #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
+sudo -u vagrant echo "*/30 * * * * cd /home/vagrant/JARR/ ; python3 manager.py fetch_asyncio None None" >> mycron
#install new cron file
sudo -u vagrant crontab mycron
sudo -u vagrant rm mycron
|