diff --git a/docker-compose.yml b/docker-compose.yml index 363d0b0ec..7cab26997 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,7 +32,7 @@ services: - BOT_DISABLE=0 - DEFAULT_TIME_FILTER=all - DEFAULT_THEME=midnight - - DEFAULT_COLOR=ff66ac #YOU HAVE TO PICK ONE OF THOSE COLORS OR SHIT WILL BREAK: ff66ac, 805ad5, 62ca56, 38a169, 80ffff, 2a96f3, eb4963, ff0000, f39731, 30409f, 3e98a7, e4432d, 7b9ae4, ec72de, 7f8fa6, f8db58 + - DEFAULT_COLOR=ff66ac - GUMROAD_TOKEN=3435tdfsdudebussylmaoxxt43 - GUMROAD_LINK=https://marsey1.gumroad.com/l/tfcvri - GUMROAD_ID=tfcvri diff --git a/env b/env index 4e2b4e1b4..8c4b8a59e 100644 --- a/env +++ b/env @@ -27,7 +27,7 @@ export CARD_VIEW="1" export DISABLE_DOWNVOTES="0" export DUES="0" export DEFAULT_THEME="midnight" -export DEFAULT_COLOR="ff66ac" # YOU HAVE TO PICK ONE OF THOSE COLORS OR SHIT WILL BREAK: ff66ac, 805ad5, 62ca56, 38a169, 80ffff, 2a96f3, eb4963, ff0000, f39731, 30409f, 3e98a7, e4432d, 7b9ae4, ec72de, 7f8fa6, f8db58 +export DEFAULT_COLOR="ff66ac" export MAIL_USERNAME="blahblahblah@gmail.com" export MAIL_PASSWORD="3435tdfsdudebussylmaoxxt43" export DESCRIPTION="rdrama.net caters to drama in all forms such as: Real life, videos, photos, gossip, rumors, news sites, Reddit, and Beyond™. There isn't drama we won't touch, and we want it all!" diff --git a/files/classes/user.py b/files/classes/user.py index ffa2e9264..a8daff557 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -19,7 +19,6 @@ import random from os import environ, remove, path defaulttheme = environ.get("DEFAULT_THEME", "midnight").strip() -defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip() defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip() cardview = bool(int(environ.get("CARD_VIEW", 1))) @@ -33,13 +32,13 @@ class User(Base): id = Column(Integer, primary_key=True) username = Column(String) - namecolor = Column(String, default=defaultcolor) + namecolor = Column(String, default=DEFAULT_COLOR) background = Column(String) customtitle = Column(String) customtitleplain = deferred(Column(String)) - titlecolor = Column(String, default=defaultcolor) + titlecolor = Column(String, default=DEFAULT_COLOR) theme = Column(String, default=defaulttheme) - themecolor = Column(String, default=defaultcolor) + themecolor = Column(String, default=DEFAULT_COLOR) cardview = Column(Boolean, default=cardview) song = Column(String) highres = Column(String) diff --git a/files/helpers/const.py b/files/helpers/const.py index 0d54620dc..96b7c1cd3 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -229,6 +229,8 @@ else: PUSHER_ID = environ.get("PUSHER_ID", "").strip() PUSHER_KEY = environ.get("PUSHER_KEY", "").strip() +DEFAULT_COLOR = environ.get("DEFAULT_COLOR", "fff").strip() +COLORS = {'ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58', DEFAULT_COLOR} AWARDS = { "snow": { diff --git a/files/helpers/jinja2.py b/files/helpers/jinja2.py index 4d71e1545..7b4e1409f 100644 --- a/files/helpers/jinja2.py +++ b/files/helpers/jinja2.py @@ -16,4 +16,4 @@ def post_embed(id, v): @app.context_processor def inject_constants(): - return {"environ":environ, "SITE_NAME":SITE_NAME, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "config":app.config.get} + return {"environ":environ, "SITE_NAME":SITE_NAME, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "config":app.config.get, "DEFAULT_COLOR":DEFAULT_COLOR, "COLORS":COLORS} diff --git a/files/routes/votes.py b/files/routes/votes.py index 94ecc4853..9d464896d 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -7,8 +7,6 @@ from files.__main__ import app, limiter, cache from sqlalchemy.orm import joinedload from os import environ -defaultcolor = environ.get("DEFAULT_COLOR").strip() - @app.get("/votes") @limiter.limit("5/second;60/minute;200/hour;1000/day") @auth_required @@ -104,7 +102,7 @@ def api_vote_post(post_id, new, v): post.author.coins += 1 post.author.truecoins += 1 g.db.add(post.author) - real = new == -1 or (not v.agendaposter and not v.shadowbanned and (bool(v.profileurl) or bool(v.customtitle) or v.namecolor != defaultcolor)) + real = new == -1 or (not v.agendaposter and not v.shadowbanned and (bool(v.profileurl) or bool(v.customtitle) or v.namecolor != DEFAULT_COLOR)) vote = Vote(user_id=v.id, vote_type=new, submission_id=post_id, @@ -167,7 +165,7 @@ def api_vote_comment(comment_id, new, v): comment.author.coins += 1 comment.author.truecoins += 1 g.db.add(comment.author) - real = new == -1 or (not v.agendaposter and not v.shadowbanned and (bool(v.profileurl) or bool(v.customtitle) or v.namecolor != defaultcolor)) + real = new == -1 or (not v.agendaposter and not v.shadowbanned and (bool(v.profileurl) or bool(v.customtitle) or v.namecolor != DEFAULT_COLOR)) vote = CommentVote(user_id=v.id, vote_type=new, comment_id=comment_id, diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html index 5296844b5..4c301c630 100644 --- a/files/templates/settings_profile.html +++ b/files/templates/settings_profile.html @@ -112,7 +112,7 @@
- {% for themecolor in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58'] %} + {% for themecolor in COLORS %}