forked from rDrama/rDrama
master
parent
a711282a43
commit
78bf11342c
|
@ -254,19 +254,13 @@ def after_request(response):
|
|||
print(e)
|
||||
abort(500)
|
||||
|
||||
response.headers.add('Access-Control-Allow-Headers',
|
||||
"Origin, X-Requested-With, Content-Type, Accept, x-auth"
|
||||
)
|
||||
response.headers.add('Access-Control-Allow-Headers', "Origin, X-Requested-With, Content-Type, Accept, x-auth")
|
||||
response.headers.remove("Cache-Control")
|
||||
response.headers.add("Cache-Control",
|
||||
"public, maxage=600")
|
||||
response.headers.add("Cache-Control", "public, maxage=600")
|
||||
response.headers.add("Strict-Transport-Security", "max-age=31536000")
|
||||
response.headers.add("Referrer-Policy", "same-origin")
|
||||
response.headers.add("Feature-Policy",
|
||||
"geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment 'none';")
|
||||
if not request.path.startswith("/embed/"):
|
||||
response.headers.add("X-Frame-Options",
|
||||
"deny")
|
||||
response.headers.add("Feature-Policy", "geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment 'none';")
|
||||
if not request.path.startswith("/embed/"): response.headers.add("X-Frame-Options", "deny")
|
||||
|
||||
return response
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from files.helpers.images import *
|
|||
from files.helpers.session import *
|
||||
from files.classes import *
|
||||
from files.routes.front import comment_idlist
|
||||
from pusher_push_notifications import PushNotifications, PusherAuthError
|
||||
from pusher_push_notifications import PushNotifications
|
||||
|
||||
from flask import *
|
||||
from files.__main__ import app, limiter
|
||||
|
@ -550,11 +550,8 @@ def api_comment(v):
|
|||
},
|
||||
},
|
||||
)
|
||||
except PusherAuthError as e:
|
||||
sys.stderr.write(traceback.format_exc())
|
||||
sys.stderr.flush()
|
||||
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -787,7 +787,8 @@ def submit_post(v):
|
|||
url = url.replace(rd, "https://old.reddit.com/")
|
||||
|
||||
url = url.replace("https://mobile.twitter.com", "https://twitter.com")
|
||||
|
||||
if url.startswith("https://streamable.com/") and not url.startswith("https://streamable.com/e/"):
|
||||
url = url.replace("https://streamable.com/", "https://streamable.com/e/")
|
||||
# if url.startswith("https://old.reddit.com/") and '/comments/' in url and '?' not in url: url += "?sort=controversial"
|
||||
|
||||
title_html = sanitize(title, linkgen=True, flair=True)
|
||||
|
|
|
@ -11,7 +11,7 @@ from files.helpers.markdown import *
|
|||
from files.mail import *
|
||||
from flask import *
|
||||
from files.__main__ import app, limiter
|
||||
from pusher_push_notifications import PushNotifications, PusherAuthError
|
||||
from pusher_push_notifications import PushNotifications
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
|
||||
|
@ -194,9 +194,8 @@ def message2(v, username):
|
|||
},
|
||||
},
|
||||
)
|
||||
except PusherAuthError as e:
|
||||
sys.stderr.write(traceback.format_exc())
|
||||
sys.stderr.flush()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
return redirect('/notifications?all=true')
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
<h2 class="mt-3">Unlockable Badges</h2>
|
||||
<div>These badges are automatically granted through different kinds of activity on {{"SITE_NAME" | app_config}}.</div>
|
||||
<pre></pre>
|
||||
<table class="table table-striped mb-5">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
|
@ -29,7 +30,8 @@
|
|||
|
||||
|
||||
<h2 class="mt-3">Granted Badges</h2>
|
||||
<div>These badges can be granted by staff.</div>
|
||||
<div>These badges can be granted by badmins.</div>
|
||||
<pre></pre>
|
||||
<table class="table table-striped mb-5">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
|
@ -49,6 +51,7 @@
|
|||
|
||||
<h2 class="mt-3">Unobtainable Badges</h2>
|
||||
<div>There is no way to acquire these badges if you don't already have them.</div>
|
||||
<pre></pre>
|
||||
<table class="table table-striped mb-5">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
|
|
|
@ -194,7 +194,7 @@
|
|||
<pre></pre>
|
||||
<ul style="padding-left:20px; margin-bottom: 0;">
|
||||
{% for f in c.ordered_flags %}
|
||||
<li><a style="font-weight:bold" href="{{f.user.url}}">@{{f.user.username}}</a>{% if f.reason %}: {{f.reason}}{% endif %}</li>
|
||||
<li><a style="font-weight:bold" href="{{f.user.url}}">@{{f.user.username}}</a>{% if f.reason %}: {{f.reason | safe}}{% endif %}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -409,7 +409,7 @@
|
|||
<label class="text-black w-lg-25">Badges</label>
|
||||
|
||||
<div class="w-lg-100">
|
||||
<p>Profile badges show off all of your site achievements. If your badges look not quite up to date, use this tool to refresh them.</p>
|
||||
<p><a href="/badges">Profile badges</a> show off all of your site achievements. If your badges look not quite up to date, use this tool to refresh them.</p>
|
||||
<div class="d-flex">
|
||||
<a class="btn btn-primary ml-auto" id="badgeUpdate" href="javascript:void(0)" onclick="post_toast('/settings/badges')">Refresh badges</a>
|
||||
</div>
|
||||
|
|
|
@ -237,12 +237,7 @@
|
|||
<div id="post-body" class="post-body mt-3">
|
||||
{% if p.realurl(v) %}
|
||||
{% if "streamable.com/" in p.realurl(v) %}
|
||||
{% if "streamable.com/e/" in p.realurl(v) %}
|
||||
{% set streamurl=p.realurl(v) %}
|
||||
{% else %}
|
||||
{% set streamurl=p.realurl(v).replace("streamable.com/", "streamable.com/e/") %}
|
||||
{% endif %}
|
||||
<div style="width: 100%; height: 0px; position: relative; padding-bottom: 56.250%;"><iframe src="{{streamurl}}" frameborder="0" width="100%" height="100%" allowfullscreen="" style="width: 100%; height: 100%; position: absolute;"></iframe></div>
|
||||
<div style="width: 100%; height: 0px; position: relative; padding-bottom: 56.250%;"><iframe src="{{p.realurl(v)}}" frameborder="0" width="100%" height="100%" allowfullscreen="" style="width: 100%; height: 100%; position: absolute;"></iframe></div>
|
||||
<pre></pre>
|
||||
|
||||
{% elif "spotify.com/" in p.realurl(v) %}
|
||||
|
@ -489,7 +484,7 @@
|
|||
<pre></pre>
|
||||
<ul style="padding-left:20px; margin-bottom: 0;">
|
||||
{% for f in p.ordered_flags %}
|
||||
<li><a style="font-weight:bold" href="{{f.user.url}}">@{{f.user.username}}</a>{% if f.reason %}: {{f.reason}}{% endif %}</li>
|
||||
<li><a style="font-weight:bold" href="{{f.user.url}}">@{{f.user.username}}</a>{% if f.reason %}: {{f.reason | safe}}{% endif %}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -371,7 +371,7 @@
|
|||
<pre></pre>
|
||||
<ul style="padding-left:20px; margin-bottom: 0;">
|
||||
{% for f in p.ordered_flags %}
|
||||
<li><a style="font-weight:bold" href="{{f.user.url}}">@{{f.user.username}}</a>{% if f.reason %}: {{f.reason}}{% endif %}</li>
|
||||
<li><a style="font-weight:bold" href="{{f.user.url}}">@{{f.user.username}}</a>{% if f.reason %}: {{f.reason | safe}}{% endif %}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -286,9 +286,6 @@
|
|||
{% if u.is_private %}
|
||||
<p>User has private mode enabled.</p>
|
||||
{% endif %}
|
||||
{% if u.is_suspended %}
|
||||
<p>Banned by: <a href="{{u.banned_by.permalink}}">@{{u.banned_by.username}}</a></p>
|
||||
{% endif %}
|
||||
<p>Alts:</p>
|
||||
<ul>
|
||||
{% for account in u.alts %}
|
||||
|
@ -296,6 +293,9 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% if u.is_suspended %}
|
||||
<p>Banned by: <a href="{{u.banned_by.permalink}}">@{{u.banned_by.username}}</a></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
@ -493,9 +493,6 @@
|
|||
{% if u.is_private %}
|
||||
<p>User has private mode enabled.</p>
|
||||
{% endif %}
|
||||
{% if u.is_suspended %}
|
||||
<p>Banned by: <a href="{{u.banned_by.permalink}}">@{{u.banned_by.username}}</a></p>
|
||||
{% endif %}
|
||||
<p>Alts:</p>
|
||||
<ul>
|
||||
{% for account in u.alts %}
|
||||
|
@ -503,6 +500,9 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% if u.is_suspended %}
|
||||
<p>Banned by: <a href="{{u.banned_by.permalink}}">@{{u.banned_by.username}}</a></p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue