diff --git a/files/__main__.py b/files/__main__.py index ffc6bd4f3..58a6f5927 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -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 diff --git a/files/routes/comments.py b/files/routes/comments.py index e62242177..b2b0d3f9b 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -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) diff --git a/files/routes/posts.py b/files/routes/posts.py index 59fa50dcc..0a4937b67 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -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) diff --git a/files/routes/users.py b/files/routes/users.py index 985a02bc5..938d60e10 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -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') diff --git a/files/templates/badges.html b/files/templates/badges.html index 7982aa2e4..1877cccf9 100644 --- a/files/templates/badges.html +++ b/files/templates/badges.html @@ -10,6 +10,7 @@

Unlockable Badges

These badges are automatically granted through different kinds of activity on {{"SITE_NAME" | app_config}}.
+

 
@@ -29,7 +30,8 @@
 
 
 

Granted Badges

-
These badges can be granted by staff.
+
These badges can be granted by badmins.
+
@@ -49,6 +51,7 @@

Unobtainable Badges

There is no way to acquire these badges if you don't already have them.
+
diff --git a/files/templates/comments.html b/files/templates/comments.html index 4aaeb695f..e830d92f9 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -194,7 +194,7 @@

diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html
index d1c1a03ac..97a171aad 100644
--- a/files/templates/settings_profile.html
+++ b/files/templates/settings_profile.html
@@ -409,7 +409,7 @@
 								
-

Profile badges show off all of your site achievements. If your badges look not quite up to date, use this tool to refresh them.

+

Profile badges show off all of your site achievements. If your badges look not quite up to date, use this tool to refresh them.

Refresh badges
diff --git a/files/templates/submission.html b/files/templates/submission.html index a786bfb70..18eadfd1b 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -237,12 +237,7 @@
{% 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 %} -
+

 								
 							{% elif "spotify.com/" in p.realurl(v) %}
@@ -489,7 +484,7 @@
 		

         
     
diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index dd2e9757b..546748d36 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -371,7 +371,7 @@

         
     
diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 939becc37..690dc907e 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -286,9 +286,6 @@ {% if u.is_private %}

User has private mode enabled.

{% endif %} - {% if u.is_suspended %} -

Banned by: @{{u.banned_by.username}}

- {% endif %}

Alts:

{% endif %} + {% if u.is_suspended %} +

Banned by: @{{u.banned_by.username}}

+ {% endif %}
@@ -406,7 +406,7 @@
- {% if v.admin_level > 1 and u.admin_level <= 1 %} + {% if v.admin_level > 1 and u.admin_level <= 1 %}

@@ -493,9 +493,6 @@ {% if u.is_private %}

User has private mode enabled.

{% endif %} - {% if u.is_suspended %} -

Banned by: @{{u.banned_by.username}}

- {% endif %}

Alts:

{% endif %} + {% if u.is_suspended %} +

Banned by: @{{u.banned_by.username}}

{% endif %} + {% endif %}