forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-08-28 11:47:05 +00:00
commit 96af13ebcb
14 changed files with 100 additions and 93 deletions

View File

@ -37,6 +37,7 @@ services:
- READ_ONLY=0
- BOT_DISABLE=0
- COINS_NAME=Dramacoins
- DEFAULT_TIME_FILTER=day
- DEFAULT_THEME=dark
- 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
- SLOGAN=Dude bussy lmao

View File

@ -19,6 +19,8 @@ from files.helpers.security import *
site = environ.get("DOMAIN").strip()
defaulttheme = environ.get("DEFAULT_THEME", "light").strip()
defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip()
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "day").strip()
class User(Base, Stndrd, Age_times):
__tablename__ = "users"
id = Column(Integer, primary_key=True)
@ -86,7 +88,7 @@ class User(Base, Stndrd, Age_times):
stored_subscriber_count = Column(Integer, default=0)
defaultsortingcomments = Column(String, default="top")
defaultsorting = Column(String, default="hot")
defaulttime = Column(String, default="day")
defaulttime = Column(String, default=defaulttimefilter)
is_nofollow = Column(Boolean, default=False)
custom_filter_list = Column(String(1000))

View File

@ -22,15 +22,15 @@ SLURS = {
" steve akins":" penny verity oaken",
" Steve Akins":" Penny Verity Oaken",
" STEVE AKINS":" PENNY VERITY OAKEN",
" trannie":" 🚄",
" Trannie":" 🚄",
" TRANNIE":" 🚄",
" tranny":" 🚄",
" Tranny":" 🚄",
" TRANNY":" 🚄",
" troon":" 🚄",
" Troon":" 🚄",
" TROON":" 🚄",
" trannie":" 🚂🚃🚃",
" Trannie":" 🚂🚃🚃",
" TRANNIE":" 🚂🚃🚃",
" tranny":" 🚂🚃🚃",
" Tranny":" 🚂🚃🚃",
" TRANNY":" 🚂🚃🚃",
" troon":" 🚂🚃🚃",
" Troon":" 🚂🚃🚃",
" TROON":" 🚂",
}
LONGPOST_REPLIES = ['Wow, you must be a JP fan.', 'This is one of the worst posts I have EVER seen. Delete it.', "No, don't reply like this, please do another wall of unhinged rant please.", '# 😴😴😴', "Ma'am we've been over this before. You need to stop.", "I've known more coherent downies.", "Your pulitzer's in the mail", "That's great and all, but I asked for my burger without cheese.", 'That degree finally paying off', "That's nice sweaty. Why don't you have a seat in the time out corner with Pizzashill until you calm down, then you can have your Capri Sun.", "All them words won't bring your pa back.", "You had a chance to not be completely worthless, but it looks like you threw it away. At least you're consistent.", 'Some people are able to display their intelligence by going on at length on a subject and never actually saying anything. This ability is most common in trades such as politics, public relations, and law. You have impressed me by being able to best them all, while still coming off as an absolute idiot.', "You can type 10,000 characters and you decided that these were the one's that you wanted.", 'Have you owned the libs yet?', "I don't know what you said, because I've seen another human naked.", 'Impressive. Normally people with such severe developmental disabilities struggle to write much more than a sentence or two. He really has exceded our expectations for the writing portion. Sadly the coherency of his writing, along with his abilities in the social skills and reading portions, are far behind his peers with similar disabilities.', "This is a really long way of saying you don't fuck.", "Sorry ma'am, looks like his delusions have gotten worse. We'll have to admit him,", '![](https://i.kym-cdn.com/photos/images/newsfeed/001/038/094/0a1.jpg)', 'If only you could put that energy into your relationships', 'Posts like this is why I do Heroine.', 'still unemployed then?', 'K', 'look im gunna have 2 ask u 2 keep ur giant dumps in the toilet not in my replys 😷😷😷', "Mommy is soooo proud of you, sweaty. Let's put this sperg out up on the fridge with all your other failures.", "Good job bobby, here's a star", "That was a mistake. You're about to find out the hard way why.", 'You sat down and wrote all this shit. You could have done so many other things with your life. What happened to your life that made you decide writing novels of bullshit on rdrama.net was the best option?', "I don't have enough spoons to read this shit", "All those words won't bring daddy back.", 'OUT!', "Mommy is soooo proud of you, sweaty. Let's put this sperg out up on the fridge with all your other failures."]

View File

@ -4,6 +4,8 @@ from files.helpers.get import *
from files.__main__ import app, cache
from files.classes.submission import Submission
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "day").strip()
@app.get("/post/")
def slash_post():
return redirect("/")
@ -158,7 +160,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
posts.remove(post)
break
if random.random() < 0.02:
if random.random() < 0.004:
for post in posts:
if post.author and post.author.shadowbanned:
rand = random.randint(500,1400)
@ -207,7 +209,7 @@ def front_all(v):
defaulttime = v.defaulttime
else:
defaultsorting = "hot"
defaulttime = "day"
defaulttime = defaulttimefilter
sort=request.args.get("sort", defaultsorting)
t=request.args.get('t', defaulttime)
@ -409,7 +411,7 @@ def all_comments(v):
page = int(request.args.get("page", 1))
sort=request.args.get("sort", "new")
t=request.args.get("t", "day")
t=request.args.get("t", defaulttimefilter)
idlist = comment_idlist(v=v,
page=page,

View File

@ -163,7 +163,7 @@ def post_id(pid, anything=None, v=None):
else:
abort(422)
if random.random() < 0.1:
if random.random() < 0.02:
for comment in comments:
if comment.author and comment.author.shadowbanned:
rand = random.randint(500,1400)
@ -871,41 +871,42 @@ def submit_post(v):
n = Notification(comment_id=c_jannied.id, user_id=v.id)
g.db.add(n)
c = Comment(author_id=261,
distinguish_level=6,
parent_submission=new_post.id,
level=1,
over_18=False,
is_bot=True,
app_id=None,
if "rdrama" in request.host or new_post.url:
c = Comment(author_id=261,
distinguish_level=6,
parent_submission=new_post.id,
level=1,
over_18=False,
is_bot=True,
app_id=None,
)
g.db.add(c)
g.db.flush()
new_post.comment_count = 1
g.db.add(new_post)
if "rdrama" in request.host:
if v.id == 995: body = "fuck off carp"
else: body = random.choice(snappyquotes)
body += "\n\n---\n\n"
else: body = ""
if new_post.url:
body += f"Snapshots:\n\n* [reveddit.com](https://reveddit.com/{new_post.url})\n* [archive.org](https://web.archive.org/{new_post.url})\n* [archive.ph](https://archive.ph/?url={urllib.parse.quote(new_post.url)}&run=1) (click to archive)"
gevent.spawn(archiveorg, new_post.url)
with CustomRenderer(post_id=new_post.id) as renderer: body_md = renderer.render(mistletoe.Document(body))
body_html = sanitize(body_md)
c_aux = CommentAux(
id=c.id,
body_html=body_html,
body=body
)
g.db.add(c)
g.db.flush()
new_post.comment_count = g.db.query(Comment).filter_by(parent_submission=new_post.id).count()
g.db.add(new_post)
if "rdrama" in request.host:
if v.id == 995: body = "fuck off carp"
else: body = random.choice(snappyquotes)
body += "\n\n---\n\n"
else: body = ""
if new_post.url:
body += f"Snapshots:\n\n* [reveddit.com](https://reveddit.com/{new_post.url})\n* [archive.org](https://web.archive.org/{new_post.url})\n* [archive.ph](https://archive.ph/?url={urllib.parse.quote(new_post.url)}&run=1) (click to archive)"
gevent.spawn(archiveorg, new_post.url)
with CustomRenderer(post_id=new_post.id) as renderer: body_md = renderer.render(mistletoe.Document(body))
body_html = sanitize(body_md)
c_aux = CommentAux(
id=c.id,
body_html=body_html,
body=body
)
g.db.add(c_aux)
g.db.flush()
n = Notification(comment_id=c.id, user_id=v.id)
g.db.add(n)
g.db.flush()
g.db.add(c_aux)
g.db.flush()
n = Notification(comment_id=c.id, user_id=v.id)
g.db.add(n)
g.db.flush()
v.post_count = v.submissions.filter_by(is_banned=False, deleted_utc=0).count()
g.db.add(v)

View File

@ -98,7 +98,7 @@ def index():
@app.get("/assets/favicon.ico")
def favicon():
return send_file(f"./assets/images/{site_name}/icon.gif")
return send_file(f"./assets/images/{site_name}/ico.gif")
@app.get("/api")
@auth_desired

View File

@ -126,8 +126,9 @@ def messagereply(v, username, id):
notif = Notification(comment_id=new_comment.id, user_id=user.id)
g.db.add(notif)
if request.referrer.endswith('/notifications'): return redirect("/notifications?all=true")
if not request.referrer or request.referrer.endswith('/notifications'): return redirect("/notifications?all=true")
else: return redirect(request.referrer)
@app.get("/songs/<id>")
def songs(id):
@ -187,7 +188,7 @@ def message2(v, username):
except Exception as e:
print(e)
return redirect(request.referrer)
return redirect(f"/@{username}")
@app.get("/2faqr/<secret>")
@auth_required

View File

@ -829,7 +829,7 @@
<meta name="thumbnail" content="/assets/images/{{'SITE_NAME' | app_config}}/preview.gif">
<link rel="icon" type="image/png" href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif">
<link rel="icon" type="image/png" href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif">
{% block title %}
<title>{{'SITE_NAME' | app_config}}</title>
@ -862,12 +862,12 @@
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<link rel="apple-touch-icon" sizes="180x180" href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif">
<!---<link rel="icon" type="image/png" sizes="32x32" href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif">--->
<link rel="apple-touch-icon" sizes="180x180" href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif">
<!---<link rel="icon" type="image/png" sizes="32x32" href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif">--->
<link rel="manifest" href="/assets/manifest.json">
<link rel="mask-icon" href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif" color="#{{'DEFAULT_COLOR' | app_config}}">
<link rel="shortcut icon" href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif">
<link rel="mask-icon" href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif" color="#{{'DEFAULT_COLOR' | app_config}}">
<link rel="shortcut icon" href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif">
<meta name="apple-mobile-web-app-title" content="{{'SITE_NAME' | app_config}}">
<meta name="application-name" content="{{'SITE_NAME' | app_config}}">
<meta name="msapplication-TileColor" content="#{{'DEFAULT_COLOR' | app_config}}">
@ -879,127 +879,127 @@
<link
rel="apple-touch-startup-image"
sizes="320x480"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="640x960"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-icon"
sizes="640x1136"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-icon"
sizes="750x1334"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="768x1004"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="768x1024"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="828x1792"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="1024x748"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="1024x768"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="1125x2436"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="1242x2208"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="1242x2688"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="1334x750"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="1536x2008"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="1536x2048"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="1668x2224"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="1792x828"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="2048x1496"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="2048x1536"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="2048x2732"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="2208x1242"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="2224x1668"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="2436x1125"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="2668x1242"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>
<link
rel="apple-touch-startup-image"
sizes="2737x2048"
href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif"
href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif"
/>

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="">
<link rel="icon" type="image/png" href="/assets/{{'SITE_NAME' | app_config}}/icon.gif">
<link rel="icon" type="image/png" href="/assets/{{'SITE_NAME' | app_config}}/ico.gif">
<title>503 Service Unavailable</title>
@ -18,7 +18,7 @@
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- iOS webapp -->
<link rel="apple-touch-icon" href="/assets/{{'SITE_NAME' | app_config}}/icon.gif">
<link rel="apple-touch-icon" href="/assets/{{'SITE_NAME' | app_config}}/ico.gif">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-title" content="{{'SITE_NAME' | app_config}}">

View File

@ -4,7 +4,7 @@
<div class="container-fluid" style="padding:0;">
<div class="flex-grow-1">
<a {% if v %}href="/"{% else %}href="/logged_out"{% endif %} class="navbar-brand">
<img height="30" src="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif">
<img height="30" src="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif">
<img src="/assets/images/{{'SITE_NAME' | app_config}}/logo.gif" height="20">
</a>
</div>

View File

@ -47,7 +47,7 @@
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif">
<link rel="icon" type="image/png" href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif">
<title>{% block pagetitle %}Settings - {{'SITE_NAME' | app_config}}{% endblock %}</title>
<meta property="og:type" content="article" />

View File

@ -9,7 +9,7 @@
<meta name="description" content="">
<meta name="author" content="">
<meta name="thumbnail" content="/assets/images/{{'SITE_NAME' | app_config}}/preview.gif">
<link rel="icon" type="image/png" href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif">
<link rel="icon" type="image/png" href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif">
<meta property="og:type" content="article" />
<meta property="og:title" content="{{'SITE_NAME' | app_config}}" />

View File

@ -234,7 +234,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" href="/assets/images/{{'SITE_NAME' | app_config}}/icon.gif">
<link rel="icon" type="image/png" href="/assets/images/{{'SITE_NAME' | app_config}}/ico.gif">
{% include "emoji_modal.html" %}
{% include "gif_modal.html" %}