fds
This commit is contained in:
parent
cd758ef2c7
commit
694dfca0a4
23 changed files with 101 additions and 159 deletions
|
@ -3,11 +3,7 @@ from sqlalchemy.orm import relationship
|
||||||
from files.__main__ import Base
|
from files.__main__ import Base
|
||||||
from os import environ
|
from os import environ
|
||||||
from files.helpers.lazy import lazy
|
from files.helpers.lazy import lazy
|
||||||
from files.helpers.const import AWARDS
|
from files.helpers.const import *
|
||||||
|
|
||||||
site_name = environ.get("SITE_NAME").strip()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class AwardRelationship(Base):
|
class AwardRelationship(Base):
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,9 @@ from sqlalchemy.orm import relationship
|
||||||
from files.__main__ import Base, app
|
from files.__main__ import Base, app
|
||||||
from os import environ
|
from os import environ
|
||||||
from files.helpers.lazy import lazy
|
from files.helpers.lazy import lazy
|
||||||
from files.helpers.const import BADGES
|
from files.helpers.const import *
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
site_name = environ.get("SITE_NAME").strip()
|
|
||||||
|
|
||||||
class Badge(Base):
|
class Badge(Base):
|
||||||
|
|
||||||
__tablename__ = "badges"
|
__tablename__ = "badges"
|
||||||
|
@ -63,5 +61,5 @@ class Badge(Base):
|
||||||
return {'text': self.text,
|
return {'text': self.text,
|
||||||
'name': self.name,
|
'name': self.name,
|
||||||
'url': self.url,
|
'url': self.url,
|
||||||
'icon_url':f"https://{app.config['SERVER_NAME']}{self.path}"
|
'icon_url':f"{SITE_FULL}{self.path}"
|
||||||
}
|
}
|
|
@ -7,15 +7,11 @@ from sqlalchemy import *
|
||||||
from sqlalchemy.orm import relationship
|
from sqlalchemy.orm import relationship
|
||||||
from files.__main__ import Base
|
from files.__main__ import Base
|
||||||
from files.classes.votes import CommentVote
|
from files.classes.votes import CommentVote
|
||||||
from files.helpers.const import AUTOPOLLER_ID, AUTOBETTER_ID, censor_slurs
|
from files.helpers.const import *
|
||||||
from files.helpers.lazy import lazy
|
from files.helpers.lazy import lazy
|
||||||
from .flags import CommentFlag
|
from .flags import CommentFlag
|
||||||
from random import randint
|
from random import randint
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
|
||||||
if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN"
|
|
||||||
else: cc = "COUNTRY CLUB"
|
|
||||||
|
|
||||||
class Comment(Base):
|
class Comment(Base):
|
||||||
|
|
||||||
__tablename__ = "comments"
|
__tablename__ = "comments"
|
||||||
|
@ -324,7 +320,7 @@ class Comment(Base):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def realbody(self, v):
|
def realbody(self, v):
|
||||||
if self.post and self.post.club and not (v and (v.paid_dues or v.id in [self.author_id, self.post.author_id])): return f"<p>{cc} ONLY</p>"
|
if self.post and self.post.club and not (v and (v.paid_dues or v.id in [self.author_id, self.post.author_id])): return f"<p>{CC} ONLY</p>"
|
||||||
|
|
||||||
body = self.body_html
|
body = self.body_html
|
||||||
|
|
||||||
|
@ -364,7 +360,7 @@ class Comment(Base):
|
||||||
return body
|
return body
|
||||||
|
|
||||||
def plainbody(self, v):
|
def plainbody(self, v):
|
||||||
if self.post and self.post.club and not (v and (v.paid_dues or v.id in [self.author_id, self.post.author_id])): return f"<p>{cc} ONLY</p>"
|
if self.post and self.post.club and not (v and (v.paid_dues or v.id in [self.author_id, self.post.author_id])): return f"<p>{CC} ONLY</p>"
|
||||||
|
|
||||||
body = self.body
|
body = self.body
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,7 @@ import time
|
||||||
from files.helpers.lazy import lazy
|
from files.helpers.lazy import lazy
|
||||||
from os import environ
|
from os import environ
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
from files.helpers.const import *
|
||||||
site = environ.get("DOMAIN").strip()
|
|
||||||
if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN"
|
|
||||||
else: cc = "COUNTRY CLUB"
|
|
||||||
|
|
||||||
class ModAction(Base):
|
class ModAction(Base):
|
||||||
__tablename__ = "modactions"
|
__tablename__ = "modactions"
|
||||||
|
@ -94,7 +91,7 @@ class ModAction(Base):
|
||||||
def target_link(self):
|
def target_link(self):
|
||||||
if self.target_user: return f'<a href="{self.target_user.url}">{self.target_user.username}</a>'
|
if self.target_user: return f'<a href="{self.target_user.url}">{self.target_user.username}</a>'
|
||||||
elif self.target_post:
|
elif self.target_post:
|
||||||
if self.target_post.club: return f'<a href="{self.target_post.permalink}">{cc} ONLY</a>'
|
if self.target_post.club: return f'<a href="{self.target_post.permalink}">{CC} ONLY</a>'
|
||||||
return f'<a href="{self.target_post.permalink}">{self.target_post.title.replace("<","").replace(">","")}</a>'
|
return f'<a href="{self.target_post.permalink}">{self.target_post.title.replace("<","").replace(">","")}</a>'
|
||||||
elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}?context=9#context">comment</a>'
|
elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}?context=9#context">comment</a>'
|
||||||
|
|
||||||
|
|
|
@ -7,17 +7,12 @@ from flask import render_template
|
||||||
from sqlalchemy import *
|
from sqlalchemy import *
|
||||||
from sqlalchemy.orm import relationship
|
from sqlalchemy.orm import relationship
|
||||||
from files.__main__ import Base
|
from files.__main__ import Base
|
||||||
from files.helpers.const import AUTOPOLLER_ID, AUTOBETTER_ID, censor_slurs, TROLLTITLES
|
from files.helpers.const import *
|
||||||
from files.helpers.lazy import lazy
|
from files.helpers.lazy import lazy
|
||||||
from .flags import Flag
|
from .flags import Flag
|
||||||
from .comment import Comment
|
from .comment import Comment
|
||||||
from flask import g
|
from flask import g
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
|
||||||
site_name = environ.get("SITE_NAME").strip()
|
|
||||||
if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN"
|
|
||||||
else: cc = "COUNTRY CLUB"
|
|
||||||
|
|
||||||
class Submission(Base):
|
class Submission(Base):
|
||||||
__tablename__ = "submissions"
|
__tablename__ = "submissions"
|
||||||
|
|
||||||
|
@ -232,22 +227,22 @@ class Submission(Base):
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def thumb_url(self):
|
def thumb_url(self):
|
||||||
if self.over_18: return f"https://{site}/static/assets/images/nsfw.webp"
|
if self.over_18: return f"{SITE_FULL}/static/assets/images/nsfw.webp"
|
||||||
elif not self.url: return f"https://{site}/static/assets/images/{site_name}/default_text.webp"
|
elif not self.url: return f"{SITE_FULL}/static/assets/images/{SITE_NAME}/default_text.webp"
|
||||||
elif self.thumburl: return self.thumburl
|
elif self.thumburl: return self.thumburl
|
||||||
elif self.is_youtube or self.is_video: return f"https://{site}/static/assets/images/default_thumb_yt.webp"
|
elif self.is_youtube or self.is_video: return f"{SITE_FULL}/static/assets/images/default_thumb_yt.webp"
|
||||||
else: return f"https://{site}/static/assets/images/default_thumb_link.webp"
|
else: return f"{SITE_FULL}/static/assets/images/default_thumb_link.webp"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def full_thumb(self):
|
def full_thumb(self):
|
||||||
if self.thumb_url.startswith('/'): return f'https://{site}' + self.thumb_url
|
if self.thumb_url.startswith('/'): return SITE_FULL + self.thumb_url
|
||||||
return self.thumb_url
|
return self.thumb_url
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def full_url(self):
|
def full_url(self):
|
||||||
if self.url and self.url.startswith('/'): return f'https://{site}' + self.url
|
if self.url and self.url.startswith('/'): return SITE_FULL + self.url
|
||||||
return self.url
|
return self.url
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -352,7 +347,7 @@ class Submission(Base):
|
||||||
else: return ""
|
else: return ""
|
||||||
|
|
||||||
def realbody(self, v):
|
def realbody(self, v):
|
||||||
if self.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"<p>{cc} ONLY</p>"
|
if self.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"<p>{CC} ONLY</p>"
|
||||||
|
|
||||||
body = self.body_html
|
body = self.body_html
|
||||||
|
|
||||||
|
@ -382,7 +377,7 @@ class Submission(Base):
|
||||||
return body
|
return body
|
||||||
|
|
||||||
def plainbody(self, v):
|
def plainbody(self, v):
|
||||||
if self.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"<p>{cc} ONLY</p>"
|
if self.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"<p>{CC} ONLY</p>"
|
||||||
|
|
||||||
body = self.body
|
body = self.body
|
||||||
|
|
||||||
|
@ -402,7 +397,7 @@ class Submission(Base):
|
||||||
def realtitle(self, v):
|
def realtitle(self, v):
|
||||||
if self.club and not (v and (v.paid_dues or v.id == self.author_id)):
|
if self.club and not (v and (v.paid_dues or v.id == self.author_id)):
|
||||||
if v: return random.choice(TROLLTITLES).format(username=v.username)
|
if v: return random.choice(TROLLTITLES).format(username=v.username)
|
||||||
else: return f'{cc} MEMBERS ONLY'
|
else: return f'{CC} MEMBERS ONLY'
|
||||||
elif self.title_html: title = self.title_html
|
elif self.title_html: title = self.title_html
|
||||||
else: title = self.title
|
else: title = self.title
|
||||||
|
|
||||||
|
@ -414,7 +409,7 @@ class Submission(Base):
|
||||||
def plaintitle(self, v):
|
def plaintitle(self, v):
|
||||||
if self.club and not (v and (v.paid_dues or v.id == self.author_id)):
|
if self.club and not (v and (v.paid_dues or v.id == self.author_id)):
|
||||||
if v: return random.choice(TROLLTITLES).format(username=v.username)
|
if v: return random.choice(TROLLTITLES).format(username=v.username)
|
||||||
else: return f'{cc} MEMBERS ONLY'
|
else: return f'{CC} MEMBERS ONLY'
|
||||||
else: title = self.title
|
else: title = self.title
|
||||||
|
|
||||||
title = censor_slurs(title, v)
|
title = censor_slurs(title, v)
|
||||||
|
|
|
@ -18,8 +18,6 @@ from files.helpers.security import *
|
||||||
import random
|
import random
|
||||||
from os import environ, remove, path
|
from os import environ, remove, path
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
|
||||||
site_name = environ.get("SITE_NAME").strip()
|
|
||||||
defaulttheme = environ.get("DEFAULT_THEME", "midnight").strip()
|
defaulttheme = environ.get("DEFAULT_THEME", "midnight").strip()
|
||||||
defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip()
|
defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip()
|
||||||
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip()
|
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip()
|
||||||
|
@ -28,7 +26,7 @@ cardview = bool(int(environ.get("CARD_VIEW", 1)))
|
||||||
class User(Base):
|
class User(Base):
|
||||||
__tablename__ = "users"
|
__tablename__ = "users"
|
||||||
|
|
||||||
if site == "pcmemes.net":
|
if SITE == "pcmemes.net":
|
||||||
quadrant = Column(String)
|
quadrant = Column(String)
|
||||||
basedcount = Column(Integer, default=0)
|
basedcount = Column(Integer, default=0)
|
||||||
pills = deferred(Column(String, default=""))
|
pills = deferred(Column(String, default=""))
|
||||||
|
@ -428,15 +426,15 @@ class User(Base):
|
||||||
@lazy
|
@lazy
|
||||||
def banner_url(self):
|
def banner_url(self):
|
||||||
if self.bannerurl: return self.bannerurl
|
if self.bannerurl: return self.bannerurl
|
||||||
else: return f"https://{site}/static/assets/images/{site_name}/site_preview.webp?a=1"
|
else: return f"{SITE_FULL}/static/assets/images/{SITE_NAME}/site_preview.webp?a=1"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def profile_url(self):
|
def profile_url(self):
|
||||||
if self.agendaposter: return f"https://{site}/static/assets/images/defaultpictures/agendaposter/{random.randint(1, 50)}.webp?a=204"
|
if self.agendaposter: return f"{SITE_FULL}/static/assets/images/defaultpictures/agendaposter/{random.randint(1, 50)}.webp?a=204"
|
||||||
if self.profileurl: return self.profileurl
|
if self.profileurl: return self.profileurl
|
||||||
if "rama" in site: return f"https://{site}/static/assets/images/defaultpictures/{random.randint(1, 150)}.webp?a=202"
|
if SITE_NAME == 'Drama': return f"{SITE_FULL}/static/assets/images/defaultpictures/{random.randint(1, 150)}.webp?a=202"
|
||||||
return f"https://{site}/static/assets/images/default-profile-pic.webp?a=204"
|
return f"{SITE_FULL}/static/assets/images/default-profile-pic.webp?a=204"
|
||||||
|
|
||||||
@lazy
|
@lazy
|
||||||
def json_popover(self, v):
|
def json_popover(self, v):
|
||||||
|
@ -457,7 +455,7 @@ class User(Base):
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def full_profileurl(self):
|
def full_profileurl(self):
|
||||||
if self.profile_url.startswith('/'): return f'https://{site}' + self.profile_url
|
if self.profile_url.startswith('/'): return SITE_FULL + self.profile_url
|
||||||
return self.profile_url
|
return self.profile_url
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -2,9 +2,15 @@ from os import environ, listdir
|
||||||
import re
|
import re
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from json import loads
|
from json import loads
|
||||||
|
from files.__main__ import app
|
||||||
|
|
||||||
SITE = environ.get("DOMAIN", '').strip()
|
SITE = environ.get("DOMAIN", '').strip()
|
||||||
SITE_NAME = environ.get("SITE_NAME", '').strip()
|
SITE_NAME = environ.get("SITE_NAME", '').strip()
|
||||||
|
if SITE == "localhost": SITE_FULL = 'http://' + SITE
|
||||||
|
else: SITE_FULL = 'https://' + SITE
|
||||||
|
if SITE == 'pcmemes.net': CC = "SPLASH MOUNTAIN"
|
||||||
|
else: CC = "COUNTRY CLUB"
|
||||||
|
CC_TITLE = CC.title()
|
||||||
|
|
||||||
with open("files/assets/js/emoji_modal.js", 'r') as file:
|
with open("files/assets/js/emoji_modal.js", 'r') as file:
|
||||||
marseytext = file.read().split('emojis: ')[1].split('cops police"},')[0] + '"}}'
|
marseytext = file.read().split('emojis: ')[1].split('cops police"},')[0] + '"}}'
|
||||||
|
@ -787,4 +793,27 @@ NOTIFIED_USERS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
num_banners = len(listdir('files/assets/images/Drama/banners')) + 1
|
num_banners = len(listdir('files/assets/images/Drama/banners')) + 1
|
||||||
num_sidebar = len(listdir('files/assets/images/Drama/sidebar')) + 1
|
num_sidebar = len(listdir('files/assets/images/Drama/sidebar')) + 1
|
||||||
|
|
||||||
|
@app.template_filter("full_link")
|
||||||
|
def full_link(url):
|
||||||
|
|
||||||
|
return f"{SITE_FULL}{url}"
|
||||||
|
|
||||||
|
@app.template_filter("app_config")
|
||||||
|
def app_config(x):
|
||||||
|
return app.config.get(x)
|
||||||
|
|
||||||
|
@app.template_filter("post_embed")
|
||||||
|
def post_embed(id, v):
|
||||||
|
|
||||||
|
try: id = int(id)
|
||||||
|
except: return None
|
||||||
|
|
||||||
|
p = get_post(id, v, graceful=True)
|
||||||
|
|
||||||
|
return render_template("submission_listing.html", listing=[p], v=v)
|
||||||
|
|
||||||
|
@app.context_processor
|
||||||
|
def inject_constants():
|
||||||
|
return {"num_banners":num_banners, "num_sidebar":num_sidebar, "environ":environ, "SITE_NAME":SITE_NAME, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE}
|
|
@ -1,27 +0,0 @@
|
||||||
from files.__main__ import app
|
|
||||||
from .get import *
|
|
||||||
from os import listdir, environ
|
|
||||||
from .const import *
|
|
||||||
|
|
||||||
@app.template_filter("full_link")
|
|
||||||
def full_link(url):
|
|
||||||
|
|
||||||
return f"https://{app.config['SERVER_NAME']}{url}"
|
|
||||||
|
|
||||||
@app.template_filter("app_config")
|
|
||||||
def app_config(x):
|
|
||||||
return app.config.get(x)
|
|
||||||
|
|
||||||
@app.template_filter("post_embed")
|
|
||||||
def post_embed(id, v):
|
|
||||||
|
|
||||||
try: id = int(id)
|
|
||||||
except: return None
|
|
||||||
|
|
||||||
p = get_post(id, v, graceful=True)
|
|
||||||
|
|
||||||
return render_template("submission_listing.html", listing=[p], v=v)
|
|
||||||
|
|
||||||
@app.context_processor
|
|
||||||
def inject_constants():
|
|
||||||
return {"num_banners":num_banners, "num_sidebar":num_sidebar, "environ":environ, "SITE_NAME":SITE_NAME, "AUTOJANNY_ID": AUTOJANNY_ID, "NOTIFICATIONS_ID": NOTIFICATIONS_ID, "PUSHER_ID": PUSHER_ID}
|
|
|
@ -9,8 +9,6 @@ from mistletoe import markdown
|
||||||
from json import loads, dump
|
from json import loads, dump
|
||||||
from random import random
|
from random import random
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
|
||||||
|
|
||||||
allowed_tags = tags = ['b',
|
allowed_tags = tags = ['b',
|
||||||
'blockquote',
|
'blockquote',
|
||||||
'br',
|
'br',
|
||||||
|
@ -166,7 +164,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
||||||
|
|
||||||
for tag in soup.find_all("a"):
|
for tag in soup.find_all("a"):
|
||||||
if tag.get("href"):
|
if tag.get("href"):
|
||||||
if site not in tag["href"] and not tag["href"].startswith('/'):
|
if not tag["href"].startswith(SITE_FULL) and not tag["href"].startswith('/'):
|
||||||
tag["target"] = "_blank"
|
tag["target"] = "_blank"
|
||||||
tag["rel"] = "nofollow noopener noreferrer"
|
tag["rel"] = "nofollow noopener noreferrer"
|
||||||
|
|
||||||
|
|
|
@ -5,17 +5,16 @@ from urllib.parse import quote
|
||||||
|
|
||||||
from files.helpers.security import *
|
from files.helpers.security import *
|
||||||
from files.helpers.wrappers import *
|
from files.helpers.wrappers import *
|
||||||
|
from files.helpers.const import *
|
||||||
from files.classes import *
|
from files.classes import *
|
||||||
from files.__main__ import app, mail, limiter
|
from files.__main__ import app, mail, limiter
|
||||||
from flask_mail import Message
|
from flask_mail import Message
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
|
||||||
name = environ.get("SITE_NAME").strip()
|
name = environ.get("SITE_NAME").strip()
|
||||||
|
|
||||||
|
|
||||||
def send_mail(to_address, subject, html):
|
def send_mail(to_address, subject, html):
|
||||||
|
|
||||||
msg = Message(html=html, subject=subject, sender=f"{name}@{site}", recipients=[to_address])
|
msg = Message(html=html, subject=subject, sender=f"{name}@{SITE}", recipients=[to_address])
|
||||||
mail.send(msg)
|
mail.send(msg)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ from files.helpers.discord import add_role
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
SITE_NAME = environ.get("SITE_NAME", "").strip()
|
|
||||||
GUMROAD_ID = environ.get("GUMROAD_ID", "tfcvri").strip()
|
GUMROAD_ID = environ.get("GUMROAD_ID", "tfcvri").strip()
|
||||||
GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip()
|
GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip()
|
||||||
|
|
||||||
|
@ -25,11 +24,8 @@ CF_KEY = environ.get("CF_KEY", "").strip()
|
||||||
CF_ZONE = environ.get("CF_ZONE", "").strip()
|
CF_ZONE = environ.get("CF_ZONE", "").strip()
|
||||||
CF_HEADERS = {"Authorization": f"Bearer {CF_KEY}", "Content-Type": "application/json"}
|
CF_HEADERS = {"Authorization": f"Bearer {CF_KEY}", "Content-Type": "application/json"}
|
||||||
|
|
||||||
if SITE_NAME == 'PCM': cc = "splash mountain"
|
|
||||||
else: cc = "country club"
|
|
||||||
month = datetime.now().strftime('%B')
|
month = datetime.now().strftime('%B')
|
||||||
|
|
||||||
|
|
||||||
@app.get("/refund")
|
@app.get("/refund")
|
||||||
@admin_level_required(3)
|
@admin_level_required(3)
|
||||||
def refund(v):
|
def refund(v):
|
||||||
|
@ -166,7 +162,7 @@ def club_allow(v, username):
|
||||||
g.db.add(x)
|
g.db.add(x)
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return {"message": f"@{username} has been allowed into the {cc}!"}
|
return {"message": f"@{username} has been allowed into the {CC_TITLE}!"}
|
||||||
|
|
||||||
@app.post("/@<username>/club_ban")
|
@app.post("/@<username>/club_ban")
|
||||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||||
|
@ -186,7 +182,7 @@ def club_ban(v, username):
|
||||||
g.db.add(x)
|
g.db.add(x)
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return {"message": f"@{username} has been kicked from the {cc}. Deserved."}
|
return {"message": f"@{username} has been kicked from the {CC_TITLE}. Deserved."}
|
||||||
|
|
||||||
|
|
||||||
@app.post("/@<username>/make_meme_admin")
|
@app.post("/@<username>/make_meme_admin")
|
||||||
|
|
|
@ -11,9 +11,6 @@ from files.__main__ import app, limiter
|
||||||
from files.helpers.sanitize import filter_emojis_only
|
from files.helpers.sanitize import filter_emojis_only
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
|
||||||
if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN"
|
|
||||||
else: cc = "COUNTRY CLUB"
|
|
||||||
IMGUR_KEY = environ.get("IMGUR_KEY").strip()
|
IMGUR_KEY = environ.get("IMGUR_KEY").strip()
|
||||||
|
|
||||||
if PUSHER_ID: beams_client = PushNotifications(instance_id=PUSHER_ID, secret_key=PUSHER_KEY)
|
if PUSHER_ID: beams_client = PushNotifications(instance_id=PUSHER_ID, secret_key=PUSHER_KEY)
|
||||||
|
|
|
@ -11,7 +11,6 @@ BOT_TOKEN = environ.get("DISCORD_BOT_TOKEN").strip()
|
||||||
COINS_NAME = environ.get("COINS_NAME").strip()
|
COINS_NAME = environ.get("COINS_NAME").strip()
|
||||||
DISCORD_ENDPOINT = "https://discordapp.com/api/v6"
|
DISCORD_ENDPOINT = "https://discordapp.com/api/v6"
|
||||||
WELCOME_CHANNEL="846509313941700618"
|
WELCOME_CHANNEL="846509313941700618"
|
||||||
SITE_NAME = environ.get("SITE_NAME", "").strip()
|
|
||||||
|
|
||||||
@app.get("/discord")
|
@app.get("/discord")
|
||||||
@is_not_permabanned
|
@is_not_permabanned
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import html
|
import html
|
||||||
from .front import frontlist
|
from .front import frontlist
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from files.helpers.jinja2 import full_link
|
from files.helpers.const import *
|
||||||
from files.helpers.get import *
|
from files.helpers.get import *
|
||||||
from yattag import Doc
|
from yattag import Doc
|
||||||
from files.helpers.wrappers import *
|
from files.helpers.wrappers import *
|
||||||
|
|
|
@ -4,7 +4,6 @@ from files.__main__ import app, cache, limiter
|
||||||
from files.classes.submission import Submission
|
from files.classes.submission import Submission
|
||||||
|
|
||||||
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip()
|
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip()
|
||||||
SITE_NAME = environ.get("SITE_NAME", "").strip()
|
|
||||||
|
|
||||||
@app.post("/clear")
|
@app.post("/clear")
|
||||||
@auth_required
|
@auth_required
|
||||||
|
|
|
@ -19,17 +19,15 @@ import requests
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from psutil import cpu_percent
|
from psutil import cpu_percent
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
|
||||||
site_name = environ.get("SITE_NAME").strip()
|
|
||||||
IMGUR_KEY = environ.get("IMGUR_KEY").strip()
|
IMGUR_KEY = environ.get("IMGUR_KEY").strip()
|
||||||
|
|
||||||
CF_KEY = environ.get("CF_KEY", "").strip()
|
CF_KEY = environ.get("CF_KEY", "").strip()
|
||||||
CF_ZONE = environ.get("CF_ZONE", "").strip()
|
CF_ZONE = environ.get("CF_ZONE", "").strip()
|
||||||
CF_HEADERS = {"Authorization": f"Bearer {CF_KEY}", "Content-Type": "application/json"}
|
CF_HEADERS = {"Authorization": f"Bearer {CF_KEY}", "Content-Type": "application/json"}
|
||||||
|
|
||||||
if path.exists(f'snappy_{site_name}.txt'):
|
if path.exists(f'snappy_{SITE_NAME}.txt'):
|
||||||
with open(f'snappy_{site_name}.txt', "r") as f:
|
with open(f'snappy_{SITE_NAME}.txt', "r") as f:
|
||||||
if site == 'pcmemes.net': snappyquotes = f.read().split("{[para]}")
|
if SITE == 'pcmemes.net': snappyquotes = f.read().split("{[para]}")
|
||||||
else: snappyquotes = f.read().split("{[para]}") + [f':#{x}:' for x in marseys]
|
else: snappyquotes = f.read().split("{[para]}") + [f':#{x}:' for x in marseys]
|
||||||
|
|
||||||
@app.post("/toggle_club/<pid>")
|
@app.post("/toggle_club/<pid>")
|
||||||
|
@ -991,7 +989,7 @@ def submit_post(v):
|
||||||
|
|
||||||
if not new_post.thumburl and new_post.url:
|
if not new_post.thumburl and new_post.url:
|
||||||
if request.host in new_post.url or new_post.url.startswith('/') or request.host == 'rdrama.net' and 'rdrama' in new_post.domain:
|
if request.host in new_post.url or new_post.url.startswith('/') or request.host == 'rdrama.net' and 'rdrama' in new_post.domain:
|
||||||
new_post.thumburl = f'/static/assets/images/{site_name}/site_preview.webp'
|
new_post.thumburl = f'/static/assets/images/{SITE_NAME}/site_preview.webp'
|
||||||
elif request.headers.get('cf-ipcountry')!="T1":
|
elif request.headers.get('cf-ipcountry')!="T1":
|
||||||
gevent.spawn( thumbnail_thread, new_post.id)
|
gevent.spawn( thumbnail_thread, new_post.id)
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ valid_password_regex = re.compile("^.{8,100}$")
|
||||||
YOUTUBE_KEY = environ.get("YOUTUBE_KEY", "").strip()
|
YOUTUBE_KEY = environ.get("YOUTUBE_KEY", "").strip()
|
||||||
COINS_NAME = environ.get("COINS_NAME").strip()
|
COINS_NAME = environ.get("COINS_NAME").strip()
|
||||||
GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip()
|
GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip()
|
||||||
SITE_NAME = environ.get("SITE_NAME", "").strip()
|
|
||||||
IMGUR_KEY = environ.get("IMGUR_KEY").strip()
|
IMGUR_KEY = environ.get("IMGUR_KEY").strip()
|
||||||
GUMROAD_ID = environ.get("GUMROAD_ID", "tfcvri").strip()
|
GUMROAD_ID = environ.get("GUMROAD_ID", "tfcvri").strip()
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,6 @@ import calendar
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
from files.classes.mod_logs import ACTIONTYPES, ACTIONTYPES2
|
from files.classes.mod_logs import ACTIONTYPES, ACTIONTYPES2
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
|
||||||
site_name = environ.get("SITE_NAME").strip()
|
|
||||||
|
|
||||||
@app.get("/privacy")
|
@app.get("/privacy")
|
||||||
@auth_required
|
@auth_required
|
||||||
def privacy(v):
|
def privacy(v):
|
||||||
|
@ -246,7 +243,7 @@ def log_item(id, v):
|
||||||
|
|
||||||
@app.get("/static/assets/favicon.ico")
|
@app.get("/static/assets/favicon.ico")
|
||||||
def favicon():
|
def favicon():
|
||||||
return send_file(f"./assets/images/{site_name}/icon.webp")
|
return send_file(f"./assets/images/{SITE_NAME}/icon.webp")
|
||||||
|
|
||||||
@app.get("/api")
|
@app.get("/api")
|
||||||
@auth_required
|
@auth_required
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from files.helpers.wrappers import *
|
from files.helpers.wrappers import *
|
||||||
from files.helpers.get import *
|
from files.helpers.get import *
|
||||||
from files.helpers.const import AUTOBETTER_ID
|
from files.helpers.const import *
|
||||||
from files.classes import *
|
from files.classes import *
|
||||||
from flask import *
|
from flask import *
|
||||||
from files.__main__ import app, limiter, cache
|
from files.__main__ import app, limiter, cache
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
<p>Please remove the following link(s) from your comment, and then you will be able to post it:</p>
|
<p>Please remove the following link(s) from your comment, and then you will be able to post it:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{% for site in badlinks %}
|
{% for s in badlinks %}
|
||||||
<li>{{site}}</li>
|
<li>{{s}}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,13 @@
|
||||||
|
|
||||||
{% if p.award_count("wholesome") %}
|
{% if p.award_count("wholesome") %}
|
||||||
<style>
|
<style>
|
||||||
|
.seal {
|
||||||
|
position:fixed;
|
||||||
|
z-index:9999;
|
||||||
|
pointer-events: none;
|
||||||
|
width: 100% !important;
|
||||||
|
height: 100% !important;
|
||||||
|
}
|
||||||
.sealimg {
|
.sealimg {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 89.5px;
|
height: 89.5px;
|
||||||
|
@ -33,67 +40,38 @@
|
||||||
height: 27px;
|
height: 27px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.seal {
|
|
||||||
position:fixed;
|
|
||||||
z-index:9999;
|
|
||||||
pointer-events: none;
|
|
||||||
width: 100% !important;
|
|
||||||
height: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes moveX {
|
|
||||||
from { left: 0; } to { left: 98%; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes moveY {
|
|
||||||
from { top: 0; } to { top: 98%; }
|
|
||||||
}
|
|
||||||
|
|
||||||
.seal1 {
|
|
||||||
animation: moveX 4s linear 0s infinite alternate, moveY 6.8s linear 0s infinite alternate !important;
|
|
||||||
animation-delay:0s;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
<div class="seal seal1" height="100%" width="100%">
|
<div class="seal" height="100%" width="100%">
|
||||||
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
<marquee class="seal" scrollamount=10 behavior="alternate" direction="up" height="100%" width="100%">
|
||||||
|
<marquee direction="right" scrollamount=10 behavior="alternate" height="100%" width="100%">
|
||||||
|
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
||||||
|
</marquee>
|
||||||
|
</marquee>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if p.award_count("wholesome") > 1 %}
|
{% if p.award_count("wholesome") > 1 %}
|
||||||
<style>
|
<marquee class="seal" scrollamount=10 behavior="alternate" direction="down" height="100%">
|
||||||
.seal2 {
|
<marquee direction="right" scrollamount=10 behavior="alternate" width="100%">
|
||||||
animation: moveX 5s linear 0s infinite alternate, moveY 8s linear 0s infinite alternate !important;
|
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
||||||
animation-delay:1s;
|
</marquee>
|
||||||
}
|
</marquee>
|
||||||
</style>
|
|
||||||
<div class="seal seal2" height="100%" width="100%">
|
|
||||||
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if p.award_count("wholesome") > 2 %}
|
{% if p.award_count("wholesome") > 2 %}
|
||||||
<style>
|
<marquee class="seal" scrollamount=10 behavior="alternate" direction="up" height="100%">
|
||||||
.seal3 {
|
<marquee direction="left" scrollamount=10 behavior="alternate" width="100%">
|
||||||
animation: moveX 4s linear 0s infinite alternate, moveY 5s linear 0s infinite alternate !important;
|
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
||||||
animation-delay:2s;
|
</marquee>
|
||||||
}
|
</marquee>
|
||||||
</style>
|
|
||||||
<div class="seal seal3" height="100%" width="100%">
|
|
||||||
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if p.award_count("wholesome") > 3 %}
|
{% if p.award_count("wholesome") > 3 %}
|
||||||
<style>
|
<marquee class="seal" scrollamount=10 behavior="alternate" direction="down" height="100%">
|
||||||
.seal4 {
|
<marquee direction="left" scrollamount=10 behavior="alternate" width="100%">
|
||||||
animation: moveX 5s linear 0s infinite alternate, moveY 6.8s linear 0s infinite alternate !important;
|
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
||||||
animation-delay:3s;
|
</marquee>
|
||||||
}
|
</marquee>
|
||||||
</style>
|
|
||||||
<div class="seal seal4" height="100%" width="100%">
|
|
||||||
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if p.award_count("train") %}
|
{% if p.award_count("train") %}
|
||||||
|
@ -402,13 +380,13 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if p.realurl(v) %}
|
{% if p.realurl(v) %}
|
||||||
<h1 id="post-title" class="card-title post-title text-left mb-md-3 {% if p.author.agendaposter %}agendaposter{% endif %}"><a {% if not v or v.newtabexternal %}target="_blank"{% endif %} rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}">
|
<h1 id="post-title" class="card-title post-title text-left mb-md-3 {% if p.author.agendaposter %}agendaposter{% endif %}"><a {% if not v or v.newtabexternal %}target="_blank"{% endif %} rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}">
|
||||||
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{cc}}</span>{% endif %}
|
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{CC}}</span>{% endif %}
|
||||||
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% endif %}
|
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% endif %}
|
||||||
{{p.realtitle(v) | safe}}
|
{{p.realtitle(v) | safe}}
|
||||||
</a></h1>
|
</a></h1>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h1 id="post-title" class="card-title post-title text-left mb-md-3 {% if p.author.agendaposter %}agendaposter{% endif %}">
|
<h1 id="post-title" class="card-title post-title text-left mb-md-3 {% if p.author.agendaposter %}agendaposter{% endif %}">
|
||||||
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{cc}}</span>{% endif %}
|
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{CC}}</span>{% endif %}
|
||||||
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% endif %}
|
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% endif %}
|
||||||
{{p.realtitle(v) | safe}}
|
{{p.realtitle(v) | safe}}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
|
@ -200,7 +200,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h5 class="card-title post-title text-left w-lg-95 mb-0 pb-0 pb-md-1"><a {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}" class="stretched-link {% if p.author.agendaposter %}agendaposter{% endif %}">
|
<h5 class="card-title post-title text-left w-lg-95 mb-0 pb-0 pb-md-1"><a {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}" class="stretched-link {% if p.author.agendaposter %}agendaposter{% endif %}">
|
||||||
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{cc}}</span>{% endif %}
|
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{CC}}</span>{% endif %}
|
||||||
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% endif %}
|
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% endif %}
|
||||||
{{p.realtitle(v) | safe}}
|
{{p.realtitle(v) | safe}}
|
||||||
</a></h5>
|
</a></h5>
|
||||||
|
|
|
@ -160,7 +160,7 @@
|
||||||
{% if v.club_allowed != False %}
|
{% if v.club_allowed != False %}
|
||||||
<div class="custom-control custom-checkbox">
|
<div class="custom-control custom-checkbox">
|
||||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="clubCheck" name="club">
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="clubCheck" name="club">
|
||||||
<label class="custom-control-label" for="clubCheck">{{cc}} thread</label>
|
<label class="custom-control-label" for="clubCheck">{{CC_TITLE}} thread</label>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<pre>
|
<pre>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue