curs.execute("SELECT varnish_purge_expr(%s)", (expr, ))
return HttpResponse("Purged %s entries\n" % n)
-@nocache
-@csrf_exempt
-def api_repo_updated(request):
- if not get_client_ip(request) in settings.SITE_UPDATE_HOSTS:
- return HttpServerError("Invalid client address")
- # Ignore methods and contents, just drop the trigger
- open(settings.SITE_UPDATE_TRIGGER_FILE, 'a').close()
- return HttpResponse("OK")
-
# Merge two organisations
@login_required
@user_passes_test(lambda u: u.is_superuser)
VARNISH_PURGERS=() # Extra servers that can do varnish purges through our queue
ARCHIVES_SEARCH_SERVER="archives.postgresql.org" # Where to post REST request for archives search
FRONTEND_SMTP_RELAY="magus.postgresql.org" # Where to relay user generated email
-SITE_UPDATE_TRIGGER_FILE='/tmp/pgweb.update_trigger' # Where to drop update trigger file
-SITE_UPDATE_HOSTS=('127.0.0.1', ) # Hosts that can trigger a site update
# Load local settings overrides
from settings_local import *
# API endpoints
(r'^api/varnish/purge/$', 'pgweb.core.views.api_varnish_purge'),
- # Pingback from git repo to update site
- (r'^api/repo_updated/$', 'pgweb.core.views.api_repo_updated'),
-
# Override some URLs in admin, to provide our own pages
(r'^admin/pending/$', 'pgweb.core.views.admin_pending'),
(r'^admin/purge/$', 'pgweb.core.views.admin_purge'),