From 683c9cc66c6ac8a8d9765f9b434cad2d624a5c6b Mon Sep 17 00:00:00 2001 From: Boris Bobrov Date: Tue, 23 May 2017 11:28:08 +0300 Subject: [PATCH 1/7] Change all tabs to spaces in js file It's bad to mix them --- mediagoblin/static/js/audio.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mediagoblin/static/js/audio.js b/mediagoblin/static/js/audio.js index 36b4eab2..59a8c801 100644 --- a/mediagoblin/static/js/audio.js +++ b/mediagoblin/static/js/audio.js @@ -116,9 +116,9 @@ var audioPlayer = new Object(); var im = audioPlayer.imageElement; var pos = (e.offsetX || e.originalEvent.layerX) / im.width(); - console.log('pos', (e.offsetX || e.originalEvent.layerX) / im.width()) - console.log('setting current time to', - pos * audioPlayer.audioElement.duration) + console.log('pos', (e.offsetX || e.originalEvent.layerX) / im.width()) + console.log('setting current time to', + pos * audioPlayer.audioElement.duration) audioPlayer.audioElement.currentTime = pos * audioPlayer.audioElement.duration; audioPlayer.audioElement.play(); @@ -158,13 +158,13 @@ var audioPlayer = new Object(); el = $('.audio-spectrogram .audio-control-play-pause') .removeClass('paused').addClass('playing') .text('▮▮').attr('aria-label', 'Pause'); - el[0].setAttribute('aria-label', 'Pause') + el[0].setAttribute('aria-label', 'Pause') break; case audioPlayer.PAUSED: el = $('.audio-spectrogram .audio-control-play-pause') .removeClass('playing').addClass('paused') .text('▶').attr('aria-label', 'Play'); - el[0].setAttribute('aria-label', 'Play') + el[0].setAttribute('aria-label', 'Play') break; } }; From 0cf78df85f9ad1db9675af31b703f2c4fa5bb7c2 Mon Sep 17 00:00:00 2001 From: Andrew Browning Date: Wed, 1 Mar 2017 02:02:36 -0500 Subject: [PATCH 2/7] Add register_captcha template hook --- mediagoblin/templates/mediagoblin/auth/register.html | 1 + 1 file changed, 1 insertion(+) diff --git a/mediagoblin/templates/mediagoblin/auth/register.html b/mediagoblin/templates/mediagoblin/auth/register.html index a7b8033f..b52ecff4 100644 --- a/mediagoblin/templates/mediagoblin/auth/register.html +++ b/mediagoblin/templates/mediagoblin/auth/register.html @@ -37,6 +37,7 @@ {% template_hook("register_link") %} {{ wtforms_util.render_divs(register_form, True) }} {{ csrf_token }} + {% template_hook("register_captcha") %}
From ec9a93fef02fb164e0a9a90e62bb76343a7e7aef Mon Sep 17 00:00:00 2001 From: Andrew Browning Date: Tue, 6 Jun 2017 16:51:05 -0400 Subject: [PATCH 3/7] Add space between words in blog message --- .../blog/templates/mediagoblin/blog/list_of_blogs.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/media_types/blog/templates/mediagoblin/blog/list_of_blogs.html b/mediagoblin/media_types/blog/templates/mediagoblin/blog/list_of_blogs.html index 8c16daeb..bad33c8c 100644 --- a/mediagoblin/media_types/blog/templates/mediagoblin/blog/list_of_blogs.html +++ b/mediagoblin/media_types/blog/templates/mediagoblin/blog/list_of_blogs.html @@ -52,7 +52,7 @@ {% if request.user and request.user.username==user.username %}

You have not created any blog yet.

{% else %} -

No blog has been created by {{ user.username }}yet.

+

No blog has been created by {{ user.username }} yet.

{% endif %} {% endif %}
From 2e1e96503ed363eb714dbbb149ea309c66f9985f Mon Sep 17 00:00:00 2001 From: Boris Bobrov Date: Fri, 9 Jun 2017 23:49:24 +0300 Subject: [PATCH 4/7] Switch to rabbitmq by default and in docs --- docs/source/siteadmin/deploying.rst | 9 +++++++-- mediagoblin/config_spec.ini | 3 +-- mediagoblin/processing/task.py | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index 80b60642..c7cc2403 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -70,20 +70,25 @@ derivatives) issue the following command:: sudo apt-get install git-core python python-dev python-lxml \ python-imaging python-virtualenv npm nodejs-legacy automake \ - nginx + nginx rabbitmq-server On a RPM-based system (e.g. Fedora, RedHat, and derivatives) issue the following command:: sudo yum install python-paste-deploy python-paste-script \ git-core python python-devel python-lxml python-imaging \ - python-virtualenv npm automake nginx + python-virtualenv npm automake nginx rabbitmq-server (Note: MediaGoblin now officially supports Python 3. You may instead substitute from "python" to "python3" for most package names in the Debian instructions and this should cover dependency installation. These instructions have not yet been tested on Fedora.) +(Note: you might have to include additional repositories to a RPM- +based system, because rabbitmq-server might be not included in +official repositories. As an alternative, you can try installing +redis-server and configure it as celery broker) + Configure PostgreSQL ~~~~~~~~~~~~~~~~~~~~ diff --git a/mediagoblin/config_spec.ini b/mediagoblin/config_spec.ini index 0a8da73e..bd3003d0 100644 --- a/mediagoblin/config_spec.ini +++ b/mediagoblin/config_spec.ini @@ -153,8 +153,7 @@ CELERY_RESULT_BACKEND = string(default="database") CELERY_RESULT_DBURI = string(default="sqlite:///%(here)s/celery.db") # default kombu stuff -BROKER_TRANSPORT = string(default="sqlalchemy") -BROKER_URL = string(default="sqlite:///%(here)s/kombu.db") +BROKER_URL = string(default="amqp://") # known booleans CELERY_RESULT_PERSISTENT = boolean() diff --git a/mediagoblin/processing/task.py b/mediagoblin/processing/task.py index 5e0e772d..bedfd32d 100644 --- a/mediagoblin/processing/task.py +++ b/mediagoblin/processing/task.py @@ -69,6 +69,9 @@ class ProcessMedia(celery.Task): """ Pass this entry off for processing. """ + + name = 'process_media' + def run(self, media_id, feed_url, reprocess_action, reprocess_info=None): """ Pass the media entry off to the appropriate processing function From 00d0bb714b76872e885d83281a328a67aa8fa9df Mon Sep 17 00:00:00 2001 From: Boris Bobrov Date: Sat, 10 Jun 2017 01:24:29 +0300 Subject: [PATCH 5/7] Remove upper cap on celery kombu Also remove kombu from requirements, because celery fetches it anyway --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6d309f7e..5dc30591 100644 --- a/setup.py +++ b/setup.py @@ -56,8 +56,7 @@ install_requires = [ 'pytest>=2.3.1', 'pytest-xdist', 'werkzeug>=0.7', - 'celery>=3.0,<4.0a0', - 'kombu<4.0a0', + 'celery>=3.0', 'jinja2', 'Babel>=1.3', 'WebTest>=2.0.18', From 411ae185bfbd0f607ef6a5e2a5bf325a01209f97 Mon Sep 17 00:00:00 2001 From: Boris Bobrov Date: Sat, 10 Jun 2017 01:29:19 +0300 Subject: [PATCH 6/7] move exifread to other dependencies --- setup.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 5dc30591..72c19735 100644 --- a/setup.py +++ b/setup.py @@ -74,6 +74,7 @@ install_requires = [ 'PasteScript', 'requests>=2.6.0', 'pyld', + 'ExifRead>=2.0.0' # This is optional: # 'translitcodec', # For now we're expecting that users will install this from @@ -82,10 +83,8 @@ install_requires = [ # 'Pillow', ] + pyversion_install_requires -dependency_links = [] if not PY2: # PyPI version (1.4.2) does not have proper Python 3 support - dependency_links.append('https://github.com/ianare/exif-py/zipball/develop#egg=ExifRead-2.0.0') install_requires.append('ExifRead>=2.0.0') with open(READMEFILE, encoding="utf-8") as fobj: @@ -100,7 +99,6 @@ try: include_package_data = True, # scripts and dependencies install_requires=install_requires, - dependency_links=dependency_links, test_suite='nose.collector', entry_points="""\ [console_scripts] From c3356889c9ad4965539a7bd63b672f9669816771 Mon Sep 17 00:00:00 2001 From: Boris Bobrov Date: Sat, 10 Jun 2017 12:22:58 +0300 Subject: [PATCH 7/7] Fix tests to reflect that we've moved to amqp --- mediagoblin/tests/test_celery_setup.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mediagoblin/tests/test_celery_setup.py b/mediagoblin/tests/test_celery_setup.py index df0d04b0..0749c7f4 100644 --- a/mediagoblin/tests/test_celery_setup.py +++ b/mediagoblin/tests/test_celery_setup.py @@ -55,7 +55,4 @@ def test_setup_celery_from_config(): 'sqlite:///' + pkg_resources.resource_filename('mediagoblin.tests', 'celery.db')) - assert fake_celery_module.BROKER_TRANSPORT == 'sqlalchemy' - assert fake_celery_module.BROKER_URL == ( - 'sqlite:///' + - pkg_resources.resource_filename('mediagoblin.tests', 'kombu.db')) + assert fake_celery_module.BROKER_URL == 'amqp://'