forked from rDrama/rDrama
1
0
Fork 0

Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost

master
Aevann1 2022-09-01 19:47:39 +00:00
commit 8422ae4802
13 changed files with 25 additions and 26 deletions

2
env
View File

@ -23,7 +23,7 @@ GUMROAD_LINK=https://marsey1.gumroad.com/l/rdrama
GUMROAD_ID=rdrama
CARD_VIEW=0
DISABLE_DOWNVOTES=0
DUES=10
DUES=0
DEFAULT_THEME=midnight
DEFAULT_COLOR=ff66ac
MAIL_USERNAME=blahblahblah@gmail.com

View File

@ -45,15 +45,12 @@ app.config['MAIL_SERVER'] = 'smtp.gmail.com'
app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_TLS'] = True
# if environ.get("MAIL_USERNAME2") and random.random() < 0.5:
# app.config['MAIL_USERNAME'] = environ.get("MAIL_USERNAME2", "").strip()
# app.config['MAIL_PASSWORD'] = environ.get("MAIL_PASSWORD2", "").strip()
# else:
# app.config['MAIL_USERNAME'] = environ.get("MAIL_USERNAME", "").strip()
# app.config['MAIL_PASSWORD'] = environ.get("MAIL_PASSWORD", "").strip()
app.config['MAIL_USERNAME'] = environ.get("MAIL_USERNAME", "").strip()
app.config['MAIL_PASSWORD'] = environ.get("MAIL_PASSWORD", "").strip()
if environ.get("MAIL_USERNAME2") and random.random() < 0.5:
app.config['MAIL_USERNAME2'] = environ.get("MAIL_USERNAME2", "").strip()
app.config['MAIL_PASSWORD2'] = environ.get("MAIL_PASSWORD2", "").strip()
else:
app.config['MAIL_USERNAME'] = environ.get("MAIL_USERNAME", "").strip()
app.config['MAIL_PASSWORD'] = environ.get("MAIL_PASSWORD", "").strip()
app.config['SETTINGS'] = {}

View File

@ -305,7 +305,7 @@ class User(Base):
def paid_dues(self):
if not FEATURES['COUNTRY_CLUB']:
return True
return not self.shadowbanned and not (self.is_banned and not self.unban_utc) and (self.admin_level or self.club_allowed or (self.club_allowed != False and self.truecoins > dues))
return not self.shadowbanned and not (self.is_banned and not self.unban_utc) and (self.admin_level or self.club_allowed or (self.club_allowed != False and self.truecoins >= dues))
@lazy
def any_block_exists(self, other):

View File

@ -1033,7 +1033,7 @@ GUMROAD_ID = environ.get("GUMROAD_ID", "rdrama").strip()
DEFAULT_THEME = environ.get("DEFAULT_THEME", "midnight").strip()
DEFAULT_TIME_FILTER = environ.get("DEFAULT_TIME_FILTER", "all").strip()
CARD_VIEW = bool(int(environ.get("CARD_VIEW", 1)))
DISABLE_DOWNVOTES = bool(int(environ.get("CARD_VIEW", 0)))
DISABLE_DOWNVOTES = bool(int(environ.get("DISABLE_DOWNVOTES", 0)))
DISCORD_SERVER_ID = environ.get("DISCORD_SERVER_ID",'').strip()
DISCORD_CLIENT_ID = environ.get("DISCORD_CLIENT_ID",'').strip()
DISCORD_CLIENT_SECRET = environ.get("DISCORD_CLIENT_SECRET",'').strip()

View File

@ -53,9 +53,9 @@ def inject_constants():
"AUTOJANNY_ID":AUTOJANNY_ID, "PUSHER_ID":PUSHER_ID,
"CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID,
"PIZZASHILL_ID":PIZZASHILL_ID, "DEFAULT_COLOR":DEFAULT_COLOR,
"COLORS":COLORS, "time":time, "PERMS": PERMS, "FEATURES": FEATURES,
"HOLE_NAME": HOLE_NAME, "HOLE_STYLE_FLAIR": HOLE_STYLE_FLAIR, "HOLE_REQUIRED": HOLE_REQUIRED,
"LOTTERY_ENABLED": LOTTERY_ENABLED, "GUMROAD_LINK": GUMROAD_LINK,
"DEFAULT_THEME": DEFAULT_THEME, "DESCRIPTION": DESCRIPTION,
"has_sidebar": has_sidebar, "has_logo": has_logo, "has_app": has_app,
"FP": FP, "NOTIF_MODACTION_JL_MIN": NOTIF_MODACTION_JL_MIN, "cache": cache, "ONLINE_STR": ONLINE_STR, "patron": patron, "approved_embed_hosts": approved_embed_hosts}
"COLORS":COLORS, "time":time, "PERMS":PERMS, "FEATURES":FEATURES,
"HOLE_NAME":HOLE_NAME, "HOLE_STYLE_FLAIR":HOLE_STYLE_FLAIR, "HOLE_REQUIRED":HOLE_REQUIRED,
"LOTTERY_ENABLED":LOTTERY_ENABLED, "GUMROAD_LINK":GUMROAD_LINK,
"DEFAULT_THEME":DEFAULT_THEME, "DESCRIPTION":DESCRIPTION,
"has_sidebar":has_sidebar, "has_logo":has_logo, "has_app":has_app,
"FP":FP, "NOTIF_MODACTION_JL_MIN":NOTIF_MODACTION_JL_MIN, "cache":cache, "ONLINE_STR":ONLINE_STR, "patron":patron, "approved_embed_hosts":approved_embed_hosts, "dues":dues}

View File

@ -82,7 +82,7 @@ def get_logged_in_user():
ip = request.headers.get('CF-Connecting-IP')
if f'@{v.username}, ' not in f.read():
t = str(time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(time.time())))
f.write(f'{f.read()}@{v.username}, {ip}, {t}\n')
f.write(f'{f.read()}@{v.username}, {v.truecoins}, {ip}, {t}\n')
elif not v and request.path not in ('/login','/signup'):
abort(401)

View File

@ -18,7 +18,8 @@ def error_401(e):
else:
path = request.path
qs = urlencode(dict(request.values))
argval = quote(f"{path}?{qs}", safe='')
argval = quote(f"{path}?{qs}", safe='').replace('/logged_out','')
if not argval: argval = '/'
if session.get("history"): return redirect(f"/login?redirect={argval}")
else: return redirect(f"/signup?redirect={argval}")

View File

@ -354,7 +354,7 @@ def gumroad(v):
procoins = procoins_li[tier] - procoins_li[v.patron]
if procoins < 0: return {"error": f"{patron} rewards already claimed"}, 400
existing = g.db.query(User.id).filter(User.email == v.email, User.is_activated == True, User.patron >= tier).one_or_none()
existing = g.db.query(User.id).filter(User.email == v.email, User.is_activated == True, User.patron >= tier).first()
if existing: return {"error": f"{patron} rewards already claimed on another account"}, 400
v.patron = tier

View File

@ -927,6 +927,7 @@ def u_username(username, v=None):
abort(404)
if v and v.id not in (u.id, DAD_ID) and u.viewers_recorded:
g.db.flush()
view = g.db.query(ViewerRelationship).filter_by(viewer_id=v.id, user_id=u.id).one_or_none()
if view: view.last_view_utc = int(time.time())

View File

@ -159,7 +159,7 @@ def vote_comment(comment_id, new, v):
coin_mult = 1
g.db.flush()
g.db.commit()
existing = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=comment.id).one_or_none()
if DOUBLE_XP_ENABLED > 0:

View File

@ -3,13 +3,13 @@
<div class="modal-content bg-transparent shadow-none">
<div class="modal-body text-center p-0">
<div class="d-inline-block position-relative">
<div style="height:50px" data-bs-dismiss="modal"></div>
<div style="height:10vh" data-bs-dismiss="modal"></div>
<a href="/" rel="nofollow noopener noreferrer" target="_blank" id="desktop-expanded-image-wrap-link">
<img loading="lazy" alt="expanded image" referrerpolicy="no-referrer" src="" class="img-fluid rounded" id="desktop-expanded-image" style="min-width: 250px;min-width: max(250px,50vw)">
</a>
<div style="height:50px" data-bs-dismiss="modal"></div>
<div style="height:50vh" data-bs-dismiss="modal"></div>
</div>
</div>
</div>

View File

@ -181,7 +181,7 @@
{% if FEATURES['COUNTRY_CLUB'] -%}
<div class="custom-control custom-checkbox">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="post-club" name="club" onchange="savetext()">
<label class="custom-control-label" for="post-club">{{CC_TITLE}} thread</label>
<label class="custom-control-label" for="post-club">{{CC_TITLE}} thread {% if dues <= 0 %}(hides threads from logged-out users){% endif %}</label>
</div>
{%- endif %}

View File

@ -1,6 +1,6 @@
{%-
set CACHE_VER = {
'css/main.css': 498,
'css/main.css': 499,
'css/catalog.css': 2,
'css/4chan.css': 61,