dffd
This commit is contained in:
parent
f804ad9125
commit
3eabdeafb9
13 changed files with 32 additions and 28 deletions
|
@ -39,6 +39,7 @@ services:
|
|||
- COINS_NAME=Dramacoins
|
||||
- DEFAULT_THEME=dark
|
||||
- DEFAULT_COLOR=ff66ac
|
||||
- SLOGAN=Dude bussy lmao
|
||||
links:
|
||||
- "redis"
|
||||
- "postgres"
|
||||
|
|
|
@ -47,6 +47,7 @@ app.config["SESSION_COOKIE_SAMESITE"] = "Lax"
|
|||
app.config["PERMANENT_SESSION_LIFETIME"] = 60 * 60 * 24 * 365
|
||||
app.config["SESSION_REFRESH_EACH_REQUEST"] = True
|
||||
|
||||
app.config["SLOGAN"] = environ.get("SLOGAN").strip()
|
||||
app.config["DEFAULT_COLOR"] = environ.get("DEFAULT_COLOR").strip()
|
||||
app.config["DEFAULT_THEME"] = environ.get("DEFAULT_THEME").strip() + "_" + environ.get("DEFAULT_COLOR").strip()
|
||||
|
||||
|
|
|
@ -535,7 +535,7 @@ class User(Base, Stndrd, Age_times):
|
|||
self.profileurl = None
|
||||
delete_role(self, "linked")
|
||||
|
||||
self.is_banned = admin.id if admin else 2317
|
||||
self.is_banned = admin.id if admin else 2360
|
||||
if reason: self.ban_reason = reason
|
||||
|
||||
g.db.add(self)
|
||||
|
|
|
@ -60,7 +60,7 @@ def check_ban_evade(v):
|
|||
|
||||
ma=ModAction(
|
||||
kind="ban_post",
|
||||
user_id=2317,
|
||||
user_id=2360,
|
||||
target_submission_id=post.id,
|
||||
note="ban evasion"
|
||||
)
|
||||
|
@ -78,7 +78,7 @@ def check_ban_evade(v):
|
|||
|
||||
ma=ModAction(
|
||||
kind="ban_comment",
|
||||
user_id=2317,
|
||||
user_id=2360,
|
||||
target_comment_id=comment.id,
|
||||
note="ban evasion"
|
||||
)
|
||||
|
|
|
@ -233,7 +233,7 @@ def api_comment(v):
|
|||
comment.ban_reason = "Automatic spam removal. This happened because the post's creator submitted too much similar content too quickly."
|
||||
g.db.add(comment)
|
||||
ma=ModAction(
|
||||
user_id=2317,
|
||||
user_id=2360,
|
||||
target_comment_id=comment.id,
|
||||
kind="ban_comment",
|
||||
note="spam"
|
||||
|
@ -302,7 +302,7 @@ def api_comment(v):
|
|||
|
||||
g.db.add(c)
|
||||
|
||||
c_jannied = Comment(author_id=2317,
|
||||
c_jannied = Comment(author_id=2360,
|
||||
parent_submission=parent_submission,
|
||||
distinguish_level=6,
|
||||
parent_comment_id=c.id,
|
||||
|
@ -335,7 +335,7 @@ def api_comment(v):
|
|||
n = Notification(comment_id=c_jannied.id, user_id=v.id)
|
||||
g.db.add(n)
|
||||
|
||||
if len(body) >= 1000 and v.username != "Snappy" and "</blockquote>" not in body_html:
|
||||
if "rdrama" in request.host and len(body) >= 1000 and v.username != "Snappy" and "</blockquote>" not in body_html:
|
||||
c2 = Comment(author_id=1832,
|
||||
parent_submission=parent_submission,
|
||||
parent_comment_id=c.id,
|
||||
|
@ -366,7 +366,7 @@ def api_comment(v):
|
|||
|
||||
|
||||
|
||||
if random.random() < 0.001 and v.username != "Snappy" and v.username != "zozbot":
|
||||
if "rdrama" in request.host and random.random() < 0.001 and v.username != "Snappy" and v.username != "zozbot":
|
||||
c2 = Comment(author_id=1833,
|
||||
parent_submission=parent_submission,
|
||||
parent_comment_id=c.id,
|
||||
|
@ -644,7 +644,7 @@ def edit_comment(cid, v):
|
|||
|
||||
g.db.add(c)
|
||||
|
||||
c_jannied = Comment(author_id=2317,
|
||||
c_jannied = Comment(author_id=2360,
|
||||
parent_submission=c.parent_submission,
|
||||
distinguish_level=6,
|
||||
parent_comment_id=c.id,
|
||||
|
|
|
@ -352,11 +352,10 @@ def sign_up_post(v):
|
|||
check_for_alts(new_user.id)
|
||||
|
||||
# send welcome/verify email
|
||||
if email:
|
||||
send_verification_email(new_user)
|
||||
if email: send_verification_email(new_user)
|
||||
|
||||
# send welcome message
|
||||
send_notification(1046, new_user, "Dude bussy lmao")
|
||||
if "rdrama" in request.host: send_notification(1046, new_user, "Dude bussy lmao")
|
||||
|
||||
session["user_id"] = new_user.id
|
||||
session["session_id"] = token_hex(16)
|
||||
|
|
|
@ -302,7 +302,7 @@ def edit_post(pid, v):
|
|||
|
||||
g.db.add(p)
|
||||
|
||||
c_jannied = Comment(author_id=2317,
|
||||
c_jannied = Comment(author_id=2360,
|
||||
parent_submission=p.id,
|
||||
level=1,
|
||||
over_18=False,
|
||||
|
@ -689,7 +689,7 @@ def submit_post(v):
|
|||
post.ban_reason = "Automatic spam removal. This happened because the post's creator submitted too much similar content too quickly."
|
||||
g.db.add(post)
|
||||
ma=ModAction(
|
||||
user_id=2317,
|
||||
user_id=2360,
|
||||
target_submission_id=post.id,
|
||||
kind="ban_post",
|
||||
note="spam"
|
||||
|
@ -851,7 +851,7 @@ def submit_post(v):
|
|||
|
||||
g.db.add(new_post)
|
||||
|
||||
c_jannied = Comment(author_id=2317,
|
||||
c_jannied = Comment(author_id=2360,
|
||||
parent_submission=new_post.id,
|
||||
level=1,
|
||||
over_18=False,
|
||||
|
@ -897,10 +897,13 @@ def submit_post(v):
|
|||
g.db.add(c)
|
||||
g.db.flush()
|
||||
|
||||
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"\n\n---\n\nSnapshots:\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)"
|
||||
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, linkgen=True)
|
||||
|
|
|
@ -839,7 +839,7 @@
|
|||
<meta property="og:site_name" content="{{request.host}}" />
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/assets/images/{{'SITE_NAME' | app_config}}/preview.png" />
|
||||
<meta property="og:url" content="{{request.path | full_link}}">
|
||||
<meta property="og:description" name="description" content="Dude bussy lmao">
|
||||
<meta property="og:description" name="description" content="{{'SLOGAN' | app_config}}">
|
||||
<meta property="og:author" name="author" content="@{{request.host_url}}" />
|
||||
<meta property="og:site_name" content="{{request.host}}" />
|
||||
|
||||
|
@ -847,7 +847,7 @@
|
|||
<meta name="twitter:site" content="@{{request.host_url}}">
|
||||
<meta name="twitter:title" content="{{'SITE_NAME' | app_config}}" />
|
||||
<meta name="twitter:creator" content="@{{request.host_url}}">
|
||||
<meta name="twitter:description" content="Dude bussy lmao" />
|
||||
<meta name="twitter:description" content="{{'SLOGAN' | app_config}}" />
|
||||
<meta name="twitter:image" content="/assets/images/{{'SITE_NAME' | app_config}}/preview.png" />
|
||||
<meta name="twitter:url" content="{{request.path | full_link}}" />
|
||||
{% endblock %}
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
</div>
|
||||
<hr class="my-2">
|
||||
<div class="px-2">
|
||||
<a class="dropdown-item" href="javascript:void(0)", onclick="post_toast('/logout')"><i class="fas fa-sign-out fa-fw text-left mr-3"></i>Log out</a>
|
||||
<a class="dropdown-item" href="javascript:void(0)", onclick="post('/logout', callback=function(){window.location.reload(true)})"><i class="fas fa-sign-out fa-fw text-left mr-3"></i>Log out</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
<meta property="og:site_name" content="{{request.host}}" />
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/assets/images/{{'SITE_NAME' | app_config}}/preview.png" />
|
||||
<meta property="og:url" content="{{request.host}}">
|
||||
<meta property="og:description" name="description" content="Dude bussy lmao">
|
||||
<meta property="og:description" name="description" content="{{'SLOGAN' | app_config}}">
|
||||
<meta property="og:author" name="author" content="@{{request.host_url}}" />
|
||||
<meta property="og:site_name" content="{{request.host}}" />
|
||||
|
||||
|
@ -63,7 +63,7 @@
|
|||
<meta name="twitter:site" content="@{{request.host_url}}">
|
||||
<meta name="twitter:title" content="{{'SITE_NAME' | app_config}}" />
|
||||
<meta name="twitter:creator" content="@{{request.host_url}}">
|
||||
<meta name="twitter:description" content="Dude bussy lmao" />
|
||||
<meta name="twitter:description" content="{{'SLOGAN' | app_config}}" />
|
||||
<meta name="twitter:image" content="{{'SITE_NAME' | app_config}}/assets/images/{{'SITE_NAME' | app_config}}/preview.png" />
|
||||
<meta name="twitter:url" content="{{request.host}}" />
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<meta property="og:site_name" content="{{request.host}}" />
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/assets/images/{{'SITE_NAME' | app_config}}/preview.png" />
|
||||
<meta property="og:url" content="{{request.path | full_link}}">
|
||||
<meta property="og:description" name="description" content="Dude bussy lmao">
|
||||
<meta property="og:description" name="description" content="{{'SLOGAN' | app_config}}">
|
||||
<meta property="og:author" name="author" content="{{request.host_url}}" />
|
||||
<meta property="og:site_name" content="{{request.host}}" />
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
|||
<meta name="twitter:site" content="{{request.host_url}}">
|
||||
<meta name="twitter:title" content="{{'SITE_NAME' | app_config}}" />
|
||||
<meta name="twitter:creator" content="{{request.host_url}}">
|
||||
<meta name="twitter:description" content="Dude bussy lmao" />
|
||||
<meta name="twitter:description" content="{{'SLOGAN' | app_config}}" />
|
||||
<meta name="twitter:image" content="/assets/images/{{'SITE_NAME' | app_config}}/preview.png" />
|
||||
<meta name="twitter:url" content="{{request.path | full_link}}" />
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
<meta property="og:site_name" content="{{request.host}}" />
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/assets/images/{{'SITE_NAME' | app_config}}/preview.png" />
|
||||
<meta property="og:url" content="{{request.host}}">
|
||||
<meta property="og:description" name="description" content="Sign up now! Dude bussy lmao">
|
||||
<meta property="og:description" name="description" content="Sign up now! {{'SLOGAN' | app_config}}">
|
||||
<meta property="og:author" name="author" content="{{request.host_url}}" />
|
||||
<meta property="og:site_name" content="{{request.host}}" />
|
||||
|
||||
|
@ -81,7 +81,7 @@
|
|||
<meta name="twitter:site" content="{{request.host_url}}">
|
||||
<meta name="twitter:title" content="{{'SITE_NAME' | app_config}}" />
|
||||
<meta name="twitter:creator" content="{{request.host_url}}">
|
||||
<meta name="twitter:description" content="Sign up now! Dude bussy lmao" />
|
||||
<meta name="twitter:description" content="Sign up now! {{'SLOGAN' | app_config}}" />
|
||||
<meta name="twitter:image" content="{{'SITE_NAME' | app_config}}/assets/images/{{'SITE_NAME' | app_config}}/preview.png" />
|
||||
<meta name="twitter:url" content="{{request.host}}" />
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<meta property="og:site_name" content="{{request.host}}" />
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/assets/images/{{'SITE_NAME' | app_config}}/preview.png" />
|
||||
<meta property="og:url" content="{{request.host}}">
|
||||
<meta property="og:description" name="description" content="Sign up now! Dude bussy lmao">
|
||||
<meta property="og:description" name="description" content="Sign up now! {{'SLOGAN' | app_config}}">
|
||||
<meta property="og:author" name="author" content="{{request.host_url}}" />
|
||||
<meta property="og:site_name" content="{{request.host}}" />
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
|||
<meta name="twitter:site" content="{{request.host_url}}">
|
||||
<meta name="twitter:title" content="{{'SITE_NAME' | app_config}}" />
|
||||
<meta name="twitter:creator" content="{{request.host_url}}">
|
||||
<meta name="twitter:description" content="Sign up now! Dude bussy lmao" />
|
||||
<meta name="twitter:description" content="Sign up now! {{'SLOGAN' | app_config}}" />
|
||||
<meta name="twitter:image" content="{{'SITE_NAME' | app_config}}/assets/images/{{'SITE_NAME' | app_config}}/preview.png" />
|
||||
<meta name="twitter:url" content="{{request.host}}" />
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue