diff --git a/docker-compose.yml b/docker-compose.yml index 53ee97c31..496cf97a3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,7 +42,7 @@ services: - DUES=0 - MAIL_USERNAME=blahblahblah@gmail.com - MAIL_PASSWORD=3435tdfsdudebussylmaoxxt43 - - CHRISTMAS=1 + - CHRISTMAS=0 links: - "redis" - "postgres" diff --git a/files/classes/submission.py b/files/classes/submission.py index 731df7acd..db83abb06 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -207,8 +207,7 @@ class Submission(Base): @property @lazy def domain(self): - - if not self.url: return "text post" + if self.is_image: return "image" domain = urlparse(self.url).netloc if domain.startswith("www."): domain = domain.split("www.")[1] return domain.replace("old.reddit.com", "reddit.com") diff --git a/files/helpers/const.py b/files/helpers/const.py index c341fa873..1391c5bc6 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -1,5 +1,6 @@ from os import environ import re +from copy import deepcopy SITE = environ.get("DOMAIN", '').strip() SITE_NAME = environ.get("SITE_NAME", '').strip() @@ -129,7 +130,7 @@ if 'rdrama.net' in SITE: MOM_ID = 4588 DONGER_ID = 541 FARTBINN_ID = 2256 - BUG_THREAD = 18459 + BUG_THREAD = 29748 EMOJI_THREAD = 16583 elif SITE == "pcmemes.net": BASEDBOT_ID = 800 @@ -673,216 +674,8 @@ AWARDS = { } -AWARDS2 = { - "snow": { - "kind": "snow", - "title": "Snow", - "description": "???", - "icon": "fas fa-snowflake", - "color": "text-blue-200", - "price": 300 - }, - "gingerbread": { - "kind": "gingerbread", - "title": "Gingerbread", - "description": "???", - "icon": "fas fa-gingerbread-man", - "color": "", - "price": 300 - }, - "lights": { - "kind": "lights", - "title": "Lights", - "description": "???", - "icon": "fad fa-lights-holiday", - "color": "", - "price": 300 - }, - "candycane": { - "kind": "candycane", - "title": "Candy Cane", - "description": "???", - "icon": "fad fa-candy-cane", - "color": "", - "price": 400 - }, - "fireplace": { - "kind": "fireplace", - "title": "Fireplace", - "description": "???", - "icon": "fad fa-fireplace", - "color": "", - "price": 600 - }, - "grinch": { - "kind": "grinch", - "title": "Grinch", - "description": "???", - "icon": "fas fa-angry", - "color": "text-green-500", - "price": 1000 - }, - "lootbox": { - "kind": "lootbox", - "title": "Lootstocking", - "description": "???", - "icon": "fas fa-stocking", - "color": "text-red", - "price": 1000 - }, - "shit": { - "kind": "shit", - "title": "Shit", - "description": "Makes flies swarm the post.", - "icon": "fas fa-poop", - "color": "text-black-50", - "price": 500 - }, - "fireflies": { - "kind": "fireflies", - "title": "Fireflies", - "description": "Makes fireflies swarm the post.", - "icon": "fas fa-sparkles", - "color": "text-warning", - "price": 500 - }, - "train": { - "kind": "train", - "title": "Train", - "description": "Summons a train on the post.", - "icon": "fas fa-train", - "color": "text-pink", - "price": 500 - }, - "pin": { - "kind": "pin", - "title": "1-Hour Pin", - "description": "Pins the post/comment.", - "icon": "fas fa-thumbtack fa-rotate--45", - "color": "text-warning", - "price": 1000 - }, - "unpin": { - "kind": "unpin", - "title": "1-Hour Unpin", - "description": "Removes 1 hour from the pin duration of the post/comment.", - "icon": "fas fa-thumbtack fa-rotate--45", - "color": "text-black", - "price": 1000 - }, - "flairlock": { - "kind": "flairlock", - "title": "1-Day Flairlock", - "description": "Sets a flair for the recipient and locks it or 24 hours.", - "icon": "fas fa-lock", - "color": "text-black", - "price": 1250 - }, - "pizzashill": { - "kind": "pizzashill", - "title": "Pizzashill", - "description": "Forces the recipient to make all posts/comments > 280 characters for 24 hours.", - "icon": "fas fa-pizza-slice", - "color": "text-orange", - "price": 1500 - }, - "bird": { - "kind": "bird", - "title": "Bird Site", - "description": "Forces the recipient to make all posts/comments < 140 characters for 24 hours.", - "icon": "fab fa-twitter", - "color": "text-blue", - "price": 1500 - }, - "agendaposter": { - "kind": "agendaposter", - "title": "Agendaposter", - "description": "Forces the agendaposter theme on the recipient for 24 hours.", - "icon": "fas fa-snooze", - "color": "text-purple", - "price": 2500 - }, - "marsey": { - "kind": "marsey", - "title": "Marsey", - "description": "Makes the recipient unable to post/comment anything but marsey emojis for 24 hours.", - "icon": "fas fa-cat", - "color": "text-orange", - "price": 3000 - }, - "ban": { - "kind": "ban", - "title": "1-Day Ban", - "description": "Bans the recipient for a day.", - "icon": "fas fa-gavel", - "color": "text-danger", - "price": 3000 - }, - "unban": { - "kind": "unban", - "title": "1-Day Unban", - "description": "Removes 1 day from the ban duration of the recipient.", - "icon": "fas fa-gavel", - "color": "text-success", - "price": 3500 - }, - "grass": { - "kind": "grass", - "title": "Grass", - "description": "Ban the recipient permanently (must provide a timestamped picture of them touching grass to the admins to get unbanned)", - "icon": "fas fa-seedling", - "color": "text-success", - "price": 10000 - }, - "eye": { - "kind": "eye", - "title": "All-Seeing Eye", - "description": "Gives the recipient the ability to view private profiles.", - "icon": "fas fa-eye", - "color": "text-silver", - "price": 10000 - }, - "unblockable": { - "kind": "unblockable", - "title": "Unblockable", - "description": "Makes the recipient unblockable and removes all blocks on them.", - "icon": "far fa-laugh-squint", - "color": "text-lightgreen", - "price": 10000 - }, - "fish": { - "kind": "fish", - "title": "Fish", - "description": "This user cannot be unfollowed", - "icon": "fas fa-fish", - "color": "text-lightblue", - "price": 20000 - }, - "pause": { - "kind": "pause", - "title": "Pause", - "description": "Gives the recipient the ability to pause profile anthems.", - "icon": "fas fa-volume-mute", - "color": "text-danger", - "price": 20000 - }, - "unpausable": { - "kind": "unpausable", - "title": "Unpausable", - "description": "Makes the profile anthem of the recipient unpausable.", - "icon": "fas fa-volume", - "color": "text-success", - "price": 40000 - }, - "alt": { - "kind": "alt", - "title": "Alt-Seeing Eye", - "description": "Gives the recipient the ability to view alts.", - "icon": "fas fa-eye", - "color": "text-gold", - "price": 50000 - }, -} +AWARDS2 = deepcopy(AWARDS) +for i in ["haunt", "upsidedown", "stab", "ghosts", "spiders", "fog"]: del AWARDS2[i] TROLLTITLES = [ "how will @{username} ever recover?", diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index dd391d48c..3f5d6f94f 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -172,14 +172,14 @@ def sanitize(sanitized, noimages=False): if emoji.startswith("#!") or emoji.startswith("!#"): classes = 'class="emoji-lg mirrored" ' remoji = emoji[2:] - elif emoji.startswith("!"): - classes = 'height=60 class="emoji mirrored" ' - remoji = emoji[1:] elif emoji.startswith("#"): classes = 'class="emoji-lg" ' remoji = emoji[1:] + elif emoji.startswith("!"): + classes = 'height=60 class="emoji-md mirrored" ' + remoji = emoji[1:] else: - classes = 'height=60 class="emoji" ' + classes = 'height=60 class="emoji-md" ' remoji = emoji if path.isfile(f'files/assets/images/emojis/{remoji}.webp'): diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index 8de3a0eb8..5d6db79c0 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -48,8 +48,7 @@ def auth_desired(f): v = get_logged_in_user() if request.host == 'old.rdrama.net' and not (v and v.admin_level) and '/log' not in request.path: - if request.headers.get("Authorization"): return {"error": "403 Forbidden"}, 403 - else: return render_template('errors/403.html', v=v), 403 + return redirect(request.full_path.replace('https://old.','https://')) check_ban_evade(v) resp = make_response(f(*args, v=v, **kwargs)) @@ -67,7 +66,8 @@ def auth_required(f): if not v: abort(401) - if request.host == 'old.rdrama.net' and not v.admin_level: abort(403) + if request.host == 'old.rdrama.net' and not v.admin_level: + return redirect(request.full_path.replace('https://old.','https://')) check_ban_evade(v) @@ -88,8 +88,8 @@ def is_not_banned(f): if not v: abort(401) - if request.host == 'old.rdrama.net' and not v.admin_level: abort(403) - + if request.host == 'old.rdrama.net' and not v.admin_level: + return redirect(request.full_path.replace('https://old.','https://')) check_ban_evade(v) if v.is_suspended: return {"error": "You can't perform this action while being banned."}, 403 diff --git a/files/routes/awards.py b/files/routes/awards.py index 5aa9c515e..80a617730 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -7,6 +7,7 @@ from files.classes.award import * from .front import frontlist from flask import g, request from files.helpers.sanitize import filter_emojis_only +from copy import deepcopy discounts = { 69: 0.02, @@ -47,216 +48,7 @@ AWARDS3 = { @app.get("/settings/shop") @auth_required def shop(v): - AWARDS = { - "snow": { - "kind": "snow", - "title": "Snow", - "description": "???", - "icon": "fas fa-snowflake", - "color": "text-blue-200", - "price": 300 - }, - "gingerbread": { - "kind": "gingerbread", - "title": "Gingerbread", - "description": "???", - "icon": "fas fa-gingerbread-man", - "color": "", - "price": 300 - }, - "lights": { - "kind": "lights", - "title": "Lights", - "description": "???", - "icon": "fad fa-lights-holiday", - "color": "", - "price": 300 - }, - "candycane": { - "kind": "candycane", - "title": "Candy Cane", - "description": "???", - "icon": "fad fa-candy-cane", - "color": "", - "price": 400 - }, - "fireplace": { - "kind": "fireplace", - "title": "Fireplace", - "description": "???", - "icon": "fad fa-fireplace", - "color": "", - "price": 600 - }, - "grinch": { - "kind": "grinch", - "title": "Grinch", - "description": "???", - "icon": "fas fa-angry", - "color": "text-green-500", - "price": 1000 - }, - "lootbox": { - "kind": "lootbox", - "title": "Lootstocking", - "description": "???", - "icon": "fas fa-stocking", - "color": "text-red", - "price": 1000 - }, - "shit": { - "kind": "shit", - "title": "Shit", - "description": "Makes flies swarm the post.", - "icon": "fas fa-poop", - "color": "text-black-50", - "price": 500 - }, - "fireflies": { - "kind": "fireflies", - "title": "Fireflies", - "description": "Makes fireflies swarm the post.", - "icon": "fas fa-sparkles", - "color": "text-warning", - "price": 500 - }, - "train": { - "kind": "train", - "title": "Train", - "description": "Summons a train on the post.", - "icon": "fas fa-train", - "color": "text-pink", - "price": 500 - }, - "pin": { - "kind": "pin", - "title": "1-Hour Pin", - "description": "Pins the post/comment.", - "icon": "fas fa-thumbtack fa-rotate--45", - "color": "text-warning", - "price": 1000 - }, - "unpin": { - "kind": "unpin", - "title": "1-Hour Unpin", - "description": "Removes 1 hour from the pin duration of the post/comment.", - "icon": "fas fa-thumbtack fa-rotate--45", - "color": "text-black", - "price": 1000 - }, - "flairlock": { - "kind": "flairlock", - "title": "1-Day Flairlock", - "description": "Sets a flair for the recipient and locks it or 24 hours.", - "icon": "fas fa-lock", - "color": "text-black", - "price": 1250 - }, - "pizzashill": { - "kind": "pizzashill", - "title": "Pizzashill", - "description": "Forces the recipient to make all posts/comments > 280 characters for 24 hours.", - "icon": "fas fa-pizza-slice", - "color": "text-orange", - "price": 1500 - }, - "bird": { - "kind": "bird", - "title": "Bird Site", - "description": "Forces the recipient to make all posts/comments < 140 characters for 24 hours.", - "icon": "fab fa-twitter", - "color": "text-blue", - "price": 1500 - }, - "agendaposter": { - "kind": "agendaposter", - "title": "Agendaposter", - "description": "Forces the agendaposter theme on the recipient for 24 hours.", - "icon": "fas fa-snooze", - "color": "text-purple", - "price": 2500 - }, - "marsey": { - "kind": "marsey", - "title": "Marsey", - "description": "Makes the recipient unable to post/comment anything but marsey emojis for 24 hours.", - "icon": "fas fa-cat", - "color": "text-orange", - "price": 3000 - }, - "ban": { - "kind": "ban", - "title": "1-Day Ban", - "description": "Bans the recipient for a day.", - "icon": "fas fa-gavel", - "color": "text-danger", - "price": 3000 - }, - "unban": { - "kind": "unban", - "title": "1-Day Unban", - "description": "Removes 1 day from the ban duration of the recipient.", - "icon": "fas fa-gavel", - "color": "text-success", - "price": 3500 - }, - "grass": { - "kind": "grass", - "title": "Grass", - "description": "Ban the recipient permanently (must provide a timestamped picture of them touching grass to the admins to get unbanned)", - "icon": "fas fa-seedling", - "color": "text-success", - "price": 10000 - }, - "eye": { - "kind": "eye", - "title": "All-Seeing Eye", - "description": "Gives the recipient the ability to view private profiles.", - "icon": "fas fa-eye", - "color": "text-silver", - "price": 10000 - }, - "unblockable": { - "kind": "unblockable", - "title": "Unblockable", - "description": "Makes the recipient unblockable and removes all blocks on them.", - "icon": "far fa-laugh-squint", - "color": "text-lightgreen", - "price": 10000 - }, - "fish": { - "kind": "fish", - "title": "Fish", - "description": "This user cannot be unfollowed", - "icon": "fas fa-fish", - "color": "text-lightblue", - "price": 20000 - }, - "pause": { - "kind": "pause", - "title": "Pause", - "description": "Gives the recipient the ability to pause profile anthems.", - "icon": "fas fa-volume-mute", - "color": "text-danger", - "price": 20000 - }, - "unpausable": { - "kind": "unpausable", - "title": "Unpausable", - "description": "Makes the profile anthem of the recipient unpausable.", - "icon": "fas fa-volume", - "color": "text-success", - "price": 40000 - }, - "alt": { - "kind": "alt", - "title": "Alt-Seeing Eye", - "description": "Gives the recipient the ability to view alts.", - "icon": "fas fa-eye", - "color": "text-gold", - "price": 50000 - }, - } + AWARDS = deepcopy(AWARDS2) for val in AWARDS.values(): val["owned"] = 0 @@ -284,216 +76,7 @@ def shop(v): @auth_required @validate_formkey def buy(v, award): - AWARDS = { - "snow": { - "kind": "snow", - "title": "Snow", - "description": "???", - "icon": "fas fa-snowflake", - "color": "text-blue-200", - "price": 300 - }, - "gingerbread": { - "kind": "gingerbread", - "title": "Gingerbread", - "description": "???", - "icon": "fas fa-gingerbread-man", - "color": "", - "price": 300 - }, - "lights": { - "kind": "lights", - "title": "Lights", - "description": "???", - "icon": "fad fa-lights-holiday", - "color": "", - "price": 300 - }, - "candycane": { - "kind": "candycane", - "title": "Candy Cane", - "description": "???", - "icon": "fad fa-candy-cane", - "color": "", - "price": 400 - }, - "fireplace": { - "kind": "fireplace", - "title": "Fireplace", - "description": "???", - "icon": "fad fa-fireplace", - "color": "", - "price": 600 - }, - "grinch": { - "kind": "grinch", - "title": "Grinch", - "description": "???", - "icon": "fas fa-angry", - "color": "text-green-500", - "price": 1000 - }, - "lootbox": { - "kind": "lootbox", - "title": "Lootstocking", - "description": "???", - "icon": "fas fa-stocking", - "color": "text-red", - "price": 1000 - }, - "shit": { - "kind": "shit", - "title": "Shit", - "description": "Makes flies swarm the post.", - "icon": "fas fa-poop", - "color": "text-black-50", - "price": 500 - }, - "fireflies": { - "kind": "fireflies", - "title": "Fireflies", - "description": "Makes fireflies swarm the post.", - "icon": "fas fa-sparkles", - "color": "text-warning", - "price": 500 - }, - "train": { - "kind": "train", - "title": "Train", - "description": "Summons a train on the post.", - "icon": "fas fa-train", - "color": "text-pink", - "price": 500 - }, - "pin": { - "kind": "pin", - "title": "1-Hour Pin", - "description": "Pins the post/comment.", - "icon": "fas fa-thumbtack fa-rotate--45", - "color": "text-warning", - "price": 1000 - }, - "unpin": { - "kind": "unpin", - "title": "1-Hour Unpin", - "description": "Removes 1 hour from the pin duration of the post/comment.", - "icon": "fas fa-thumbtack fa-rotate--45", - "color": "text-black", - "price": 1000 - }, - "flairlock": { - "kind": "flairlock", - "title": "1-Day Flairlock", - "description": "Sets a flair for the recipient and locks it or 24 hours.", - "icon": "fas fa-lock", - "color": "text-black", - "price": 1250 - }, - "pizzashill": { - "kind": "pizzashill", - "title": "Pizzashill", - "description": "Forces the recipient to make all posts/comments > 280 characters for 24 hours.", - "icon": "fas fa-pizza-slice", - "color": "text-orange", - "price": 1500 - }, - "bird": { - "kind": "bird", - "title": "Bird Site", - "description": "Forces the recipient to make all posts/comments < 140 characters for 24 hours.", - "icon": "fab fa-twitter", - "color": "text-blue", - "price": 1500 - }, - "agendaposter": { - "kind": "agendaposter", - "title": "Agendaposter", - "description": "Forces the agendaposter theme on the recipient for 24 hours.", - "icon": "fas fa-snooze", - "color": "text-purple", - "price": 2500 - }, - "marsey": { - "kind": "marsey", - "title": "Marsey", - "description": "Makes the recipient unable to post/comment anything but marsey emojis for 24 hours.", - "icon": "fas fa-cat", - "color": "text-orange", - "price": 3000 - }, - "ban": { - "kind": "ban", - "title": "1-Day Ban", - "description": "Bans the recipient for a day.", - "icon": "fas fa-gavel", - "color": "text-danger", - "price": 3000 - }, - "unban": { - "kind": "unban", - "title": "1-Day Unban", - "description": "Removes 1 day from the ban duration of the recipient.", - "icon": "fas fa-gavel", - "color": "text-success", - "price": 3500 - }, - "grass": { - "kind": "grass", - "title": "Grass", - "description": "Ban the recipient permanently (must provide a timestamped picture of them touching grass to the admins to get unbanned)", - "icon": "fas fa-seedling", - "color": "text-success", - "price": 10000 - }, - "eye": { - "kind": "eye", - "title": "All-Seeing Eye", - "description": "Gives the recipient the ability to view private profiles.", - "icon": "fas fa-eye", - "color": "text-silver", - "price": 10000 - }, - "unblockable": { - "kind": "unblockable", - "title": "Unblockable", - "description": "Makes the recipient unblockable and removes all blocks on them.", - "icon": "far fa-laugh-squint", - "color": "text-lightgreen", - "price": 10000 - }, - "fish": { - "kind": "fish", - "title": "Fish", - "description": "This user cannot be unfollowed", - "icon": "fas fa-fish", - "color": "text-lightblue", - "price": 20000 - }, - "pause": { - "kind": "pause", - "title": "Pause", - "description": "Gives the recipient the ability to pause profile anthems.", - "icon": "fas fa-volume-mute", - "color": "text-danger", - "price": 20000 - }, - "unpausable": { - "kind": "unpausable", - "title": "Unpausable", - "description": "Makes the profile anthem of the recipient unpausable.", - "icon": "fas fa-volume", - "color": "text-success", - "price": 40000 - }, - "alt": { - "kind": "alt", - "title": "Alt-Seeing Eye", - "description": "Gives the recipient the ability to view alts.", - "icon": "fas fa-eye", - "color": "text-gold", - "price": 50000 - }, - } + AWARDS = deepcopy(AWARDS2) if award not in AWARDS: abort(400) price = AWARDS[award]["price"] diff --git a/files/static/src/main.css b/files/static/src/main.css index 0547dc12b..525a982bb 100644 --- a/files/static/src/main.css +++ b/files/static/src/main.css @@ -163,9 +163,13 @@ img.emoji { @apply inline-block object-contain } -img.emoji-lg { +img.emoji-md { width: 60px; height: 60px; @apply inline-block object-contain } +img.emoji-lg { + max-width: 100%; + @apply inline-block object-contain +} diff --git a/files/templates/CHRISTMAS/changelog.html b/files/templates/CHRISTMAS/changelog.html index c6e8b84c1..50541444d 100644 --- a/files/templates/CHRISTMAS/changelog.html +++ b/files/templates/CHRISTMAS/changelog.html @@ -15,11 +15,13 @@