aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2017-04-06 13:27:52 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2017-04-06 13:27:52 +0200
commit9c8a6d28ac5780ca0634e0757e97fba0c5b4817e (patch)
tree483ae87d84c2c0219149968c1a27034513169600
parentvalidate app.json (diff)
parentfixed postdeploy script. (diff)
downloadnewspipe-9c8a6d28ac5780ca0634e0757e97fba0c5b4817e.tar.gz
newspipe-9c8a6d28ac5780ca0634e0757e97fba0c5b4817e.tar.bz2
newspipe-9c8a6d28ac5780ca0634e0757e97fba0c5b4817e.zip
merge and fixed conflict
-rw-r--r--app.json4
-rw-r--r--runtime.txt2
-rw-r--r--src/web/__init__.py8
-rw-r--r--src/web/templates/about.html1
-rw-r--r--src/web/templates/about_more.html12
-rw-r--r--src/web/views/views.py22
6 files changed, 37 insertions, 12 deletions
diff --git a/app.json b/app.json
index 7dc32571..e8bb2585 100644
--- a/app.json
+++ b/app.json
@@ -10,7 +10,7 @@
"repository": "https://github.com/newspipe/newspipe",
"logo": "https://raw.githubusercontent.com/newspipe/newspipe/master/src/web/static/img/newspipe.png",
"scripts": {
- "postdeploy": "python src/manager.py db_create, git submodule init; git submodule update"
+ "postdeploy": "python src/manager.py db_create; cd submodules/bootstrap/; git clone https://github.com/twbs/bootstrap.git"
},
"env": {
"PLATFORM_URL": {
@@ -65,4 +65,4 @@
"heroku-postgresql:hobby-dev",
"scheduler:standard"
]
-} \ No newline at end of file
+}
diff --git a/runtime.txt b/runtime.txt
index c0354eef..c91e43be 100644
--- a/runtime.txt
+++ b/runtime.txt
@@ -1 +1 @@
-python-3.5.2
+python-3.6.1
diff --git a/src/web/__init__.py b/src/web/__init__.py
index e69de29b..cca2a501 100644
--- a/src/web/__init__.py
+++ b/src/web/__init__.py
@@ -0,0 +1,8 @@
+__author__ = "Cedric Bonhomme"
+__version__ = "$Revision: 7.1.3 $"
+__date__ = "$Date: 2016/11/14 $"
+__revision__ = "$Date: 2016/11/14 $"
+__copyright__ = "Copyright (c) Cedric Bonhomme"
+__license__ = "GPLv3"
+
+__all__ = [__version__]
diff --git a/src/web/templates/about.html b/src/web/templates/about.html
index c2d0ae4d..70ae0a5f 100644
--- a/src/web/templates/about.html
+++ b/src/web/templates/about.html
@@ -12,6 +12,7 @@
redistribute the <a href="https://github.com/newspipe/newspipe">source code</a>
according to the <a href="https://www.gnu.org/licenses/agpl-3.0.html">Affero GPL</a> license.') }}</p>
<p>{{ _('Found a bug? Report it <a href="https://github.com/newspipe/newspipe/issues">here</a>.') }}</p>
+ <p><a href="{{ url_for('about_more') }}">More information</a> about this instance.</p>
</div>
<div class="well">
<h1>{{ _('Help') }}</h1>
diff --git a/src/web/templates/about_more.html b/src/web/templates/about_more.html
new file mode 100644
index 00000000..dd7088a5
--- /dev/null
+++ b/src/web/templates/about_more.html
@@ -0,0 +1,12 @@
+{% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ <ul class="list-group">
+ <li class="list-group-item">Newspipe version: <a href="https://github.com/newspipe/newspipe/releases/tag/{{newspipe_version}}">{{newspipe_version}}</a></li>
+ <li class="list-group-item">Running on Heroku: {{on_heroku}}</li>
+ <li class="list-group-item">Registration: {{registration}}</li>
+ <li class="list-group-item">Python version: {{python_version}}</li>
+ <li class="list-group-item">Number of users: {{nb_users}}</li>
+ </ul>
+</div><!-- /.container -->
+{% endblock %}
diff --git a/src/web/views/views.py b/src/web/views/views.py
index b8d9514f..03d6501d 100644
--- a/src/web/views/views.py
+++ b/src/web/views/views.py
@@ -1,3 +1,4 @@
+import sys
import logging
import operator
from datetime import datetime, timedelta
@@ -6,8 +7,10 @@ from flask import (request, render_template, flash,
from flask_babel import gettext
from sqlalchemy import desc
+import conf
+from web import __version__
from conf import API_ROOT, ADMIN_EMAIL
-from web.controllers import FeedController
+from web.controllers import FeedController, UserController
from web.lib.view_utils import etag_match
logger = logging.getLogger(__name__)
@@ -74,13 +77,14 @@ def popular():
@current_app.route('/about', methods=['GET'])
@etag_match
def about():
- print(ADMIN_EMAIL)
return render_template('about.html', contact=ADMIN_EMAIL)
-
-@current_app.route('/.well-known/acme-challenge/MmwFRp_wOgBGHcIULSUGVFDjpryEw_uWz7UgD6rE4t4')
-def letsencrypt():
- """
- To validate the TLS certificate.
- """
- return 'MmwFRp_wOgBGHcIULSUGVFDjpryEw_uWz7UgD6rE4t4.bUlx3NWj4YZ59CkBunuvzS0GnW5Kh9i4yehDEP4AEdU'
+@current_app.route('/about/more', methods=['GET'])
+@etag_match
+def about_more():
+ return render_template('about_more.html',
+ newspipe_version=__version__.split()[1],
+ on_heroku=[conf.ON_HEROKU and 'Yes' or 'No'][0],
+ registration=[conf.SELF_REGISTRATION and 'Open' or 'Closed'][0],
+ python_version="{}.{}.{}".format(*sys.version_info[:3]),
+ nb_users=UserController().read().count())
bgstack15