SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 782899fa authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Link flower

parent 4663fdf6
No related branches found
No related tags found
No related merge requests found
...@@ -379,8 +379,9 @@ LOGGING = { ...@@ -379,8 +379,9 @@ LOGGING = {
# Celery scheduled tasks # Celery scheduled tasks
CELERY_RESULT_BACKEND = 'django-db' CELERY_RESULT_BACKEND = 'django-db'
CELERY_BROKER_URL = 'amqp://guest:guest@localhost:5672//' CELERY_BROKER_URL = get_secret('CELERY_BROKER_URL')
CELERY_IMPORTS = ('submissions.tasks', ) CELERY_IMPORTS = ('submissions.tasks', )
FLOWER_PORT = get_secret('FLOWER_PORT')
# Automation. # Automation.
......
...@@ -53,6 +53,3 @@ ITHENTICATE_PASSWORD = get_secret('ITHENTICATE_PASSWORD') ...@@ -53,6 +53,3 @@ ITHENTICATE_PASSWORD = get_secret('ITHENTICATE_PASSWORD')
# Logging # Logging
LOGGING['handlers']['scipost_file_arxiv']['filename'] = '/home/scipost/webapps/scipost/logs/arxiv.log' LOGGING['handlers']['scipost_file_arxiv']['filename'] = '/home/scipost/webapps/scipost/logs/arxiv.log'
LOGGING['handlers']['scipost_file_doi']['filename'] = '/home/scipost/webapps/scipost/logs/doi.log' LOGGING['handlers']['scipost_file_doi']['filename'] = '/home/scipost/webapps/scipost/logs/doi.log'
# Celery scheduled tasks
CELERY_BROKER_URL = get_secret('CELERY_BROKER_URL')
...@@ -19,6 +19,7 @@ JOURNAL_REGEX = '(?P<doi_label>%s)' % REGEX_CHOICES ...@@ -19,6 +19,7 @@ JOURNAL_REGEX = '(?P<doi_label>%s)' % REGEX_CHOICES
urlpatterns = [ urlpatterns = [
url(r'^$', views.index, name='index'), url(r'^$', views.index, name='index'),
url(r'^flower/', views.flower, name='flower'), # monitor for Celery tasks; su only
url(r'^files/secure/(?P<path>.*)$', views.protected_serve, name='secure_file'), url(r'^files/secure/(?P<path>.*)$', views.protected_serve, name='secure_file'),
# General use pages # General use pages
......
...@@ -129,6 +129,16 @@ def index(request): ...@@ -129,6 +129,16 @@ def index(request):
return render(request, 'scipost/index.html', context) return render(request, 'scipost/index.html', context)
def flower(request):
"""
Monitoring pages for the Celery-driven scheduled tasks.
This view is accessible to superusers only.
"""
if not request.user.is_authenticated or not request.user.is_superuser:
raise Http404
return redirect('https://localhost:%s' % settings.FLOWER_PORT)
def protected_serve(request, path, show_indexes=False): def protected_serve(request, path, show_indexes=False):
""" """
Serve media files from outside the public MEDIA_ROOT folder. Serve media files from outside the public MEDIA_ROOT folder.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment