master
Aevann1 2022-02-05 13:31:05 +02:00
parent a666a2d12a
commit dbdcb5d56b
7 changed files with 14 additions and 15 deletions

View File

@ -32,7 +32,7 @@ services:
- BOT_DISABLE=0 - BOT_DISABLE=0
- DEFAULT_TIME_FILTER=all - DEFAULT_TIME_FILTER=all
- DEFAULT_THEME=midnight - 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_TOKEN=3435tdfsdudebussylmaoxxt43
- GUMROAD_LINK=https://marsey1.gumroad.com/l/tfcvri - GUMROAD_LINK=https://marsey1.gumroad.com/l/tfcvri
- GUMROAD_ID=tfcvri - GUMROAD_ID=tfcvri

2
env
View File

@ -27,7 +27,7 @@ export CARD_VIEW="1"
export DISABLE_DOWNVOTES="0" export DISABLE_DOWNVOTES="0"
export DUES="0" export DUES="0"
export DEFAULT_THEME="midnight" 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_USERNAME="blahblahblah@gmail.com"
export MAIL_PASSWORD="3435tdfsdudebussylmaoxxt43" 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!" 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!"

View File

@ -19,7 +19,6 @@ import random
from os import environ, remove, path from os import environ, remove, path
defaulttheme = environ.get("DEFAULT_THEME", "midnight").strip() defaulttheme = environ.get("DEFAULT_THEME", "midnight").strip()
defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip()
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip() defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip()
cardview = bool(int(environ.get("CARD_VIEW", 1))) cardview = bool(int(environ.get("CARD_VIEW", 1)))
@ -33,13 +32,13 @@ class User(Base):
id = Column(Integer, primary_key=True) id = Column(Integer, primary_key=True)
username = Column(String) username = Column(String)
namecolor = Column(String, default=defaultcolor) namecolor = Column(String, default=DEFAULT_COLOR)
background = Column(String) background = Column(String)
customtitle = Column(String) customtitle = Column(String)
customtitleplain = deferred(Column(String)) customtitleplain = deferred(Column(String))
titlecolor = Column(String, default=defaultcolor) titlecolor = Column(String, default=DEFAULT_COLOR)
theme = Column(String, default=defaulttheme) theme = Column(String, default=defaulttheme)
themecolor = Column(String, default=defaultcolor) themecolor = Column(String, default=DEFAULT_COLOR)
cardview = Column(Boolean, default=cardview) cardview = Column(Boolean, default=cardview)
song = Column(String) song = Column(String)
highres = Column(String) highres = Column(String)

View File

@ -229,6 +229,8 @@ else:
PUSHER_ID = environ.get("PUSHER_ID", "").strip() PUSHER_ID = environ.get("PUSHER_ID", "").strip()
PUSHER_KEY = environ.get("PUSHER_KEY", "").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 = { AWARDS = {
"snow": { "snow": {

View File

@ -16,4 +16,4 @@ def post_embed(id, v):
@app.context_processor @app.context_processor
def inject_constants(): 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}

View File

@ -7,8 +7,6 @@ from files.__main__ import app, limiter, cache
from sqlalchemy.orm import joinedload from sqlalchemy.orm import joinedload
from os import environ from os import environ
defaultcolor = environ.get("DEFAULT_COLOR").strip()
@app.get("/votes") @app.get("/votes")
@limiter.limit("5/second;60/minute;200/hour;1000/day") @limiter.limit("5/second;60/minute;200/hour;1000/day")
@auth_required @auth_required
@ -104,7 +102,7 @@ def api_vote_post(post_id, new, v):
post.author.coins += 1 post.author.coins += 1
post.author.truecoins += 1 post.author.truecoins += 1
g.db.add(post.author) 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 = Vote(user_id=v.id,
vote_type=new, vote_type=new,
submission_id=post_id, submission_id=post_id,
@ -167,7 +165,7 @@ def api_vote_comment(comment_id, new, v):
comment.author.coins += 1 comment.author.coins += 1
comment.author.truecoins += 1 comment.author.truecoins += 1
g.db.add(comment.author) 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 = CommentVote(user_id=v.id,
vote_type=new, vote_type=new,
comment_id=comment_id, comment_id=comment_id,

View File

@ -112,7 +112,7 @@
<form action="/settings/themecolor" id="themecolor-form" method="post" class="color-picker" style="line-height: 0"> <form action="/settings/themecolor" id="themecolor-form" method="post" class="color-picker" style="line-height: 0">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}"> <input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
{% for themecolor in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58'] %} {% for themecolor in COLORS %}
<input autocomplete="off" type="radio" name="themecolor" id="themecolor-{{themecolor}}" value="{{themecolor}}" {% if v.themecolor == themecolor %}checked{% endif %} onclick="document.getElementById('themecolor-form').submit()"> <input autocomplete="off" type="radio" name="themecolor" id="themecolor-{{themecolor}}" value="{{themecolor}}" {% if v.themecolor == themecolor %}checked{% endif %} onclick="document.getElementById('themecolor-form').submit()">
<label class="color-radio" for="themecolor-{{themecolor}}"> <label class="color-radio" for="themecolor-{{themecolor}}">
<span style="background-color: #{{themecolor}}"> <span style="background-color: #{{themecolor}}">
@ -392,7 +392,7 @@
<form action="/settings/namecolor" id="color-form" method="post" class="color-picker" style="line-height: 0"> <form action="/settings/namecolor" id="color-form" method="post" class="color-picker" style="line-height: 0">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}"> <input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
{% for color in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58'] %} {% for color in COLORS %}
<input autocomplete="off" type="radio" name="color" id="color-{{color}}" value="{{color}}" {% if v.namecolor == color %}checked{% endif %} onclick="document.getElementById('color-form').submit()"> <input autocomplete="off" type="radio" name="color" id="color-{{color}}" value="{{color}}" {% if v.namecolor == color %}checked{% endif %} onclick="document.getElementById('color-form').submit()">
<label class="color-radio" for="color-{{color}}"> <label class="color-radio" for="color-{{color}}">
<span style="background-color: #{{color}}"> <span style="background-color: #{{color}}">
@ -448,7 +448,7 @@
<form action="/settings/titlecolor" id="titlecolor-form" method="post" class="color-picker" style="line-height: 0"> <form action="/settings/titlecolor" id="titlecolor-form" method="post" class="color-picker" style="line-height: 0">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}"> <input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
{% for titlecolor in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58'] %} {% for titlecolor in COLORS %}
<input autocomplete="off" type="radio" name="titlecolor" id="titlecolor-{{titlecolor}}" value="{{titlecolor}}" {% if v.titlecolor == titlecolor %}checked{% endif %} onclick="document.getElementById('titlecolor-form').submit()"> <input autocomplete="off" type="radio" name="titlecolor" id="titlecolor-{{titlecolor}}" value="{{titlecolor}}" {% if v.titlecolor == titlecolor %}checked{% endif %} onclick="document.getElementById('titlecolor-form').submit()">
<label class="color-radio" for="titlecolor-{{titlecolor}}"> <label class="color-radio" for="titlecolor-{{titlecolor}}">
<span style="background-color: #{{titlecolor}}"> <span style="background-color: #{{titlecolor}}">
@ -493,7 +493,7 @@
<form action="/settings/verifiedcolor" id="verifiedcolor-form" method="post" class="color-picker" style="line-height: 0"> <form action="/settings/verifiedcolor" id="verifiedcolor-form" method="post" class="color-picker" style="line-height: 0">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}"> <input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
{% for verifiedcolor in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58'] %} {% for verifiedcolor in COLORS %}
<input autocomplete="off" type="radio" name="verifiedcolor" id="verifiedcolor-{{verifiedcolor}}" value="{{verifiedcolor}}" {% if v.verifiedcolor == verifiedcolor %}checked{% endif %} onclick="document.getElementById('verifiedcolor-form').submit()"> <input autocomplete="off" type="radio" name="verifiedcolor" id="verifiedcolor-{{verifiedcolor}}" value="{{verifiedcolor}}" {% if v.verifiedcolor == verifiedcolor %}checked{% endif %} onclick="document.getElementById('verifiedcolor-form').submit()">
<label class="color-radio" for="verifiedcolor-{{verifiedcolor}}"> <label class="color-radio" for="verifiedcolor-{{verifiedcolor}}">
<span style="background-color: #{{verifiedcolor}}"> <span style="background-color: #{{verifiedcolor}}">