diff --git a/compilecss.py b/compilecss.py index b8d4de186..50e0d0ef4 100644 --- a/compilecss.py +++ b/compilecss.py @@ -1,7 +1,7 @@ for theme in ['midnight', 'dark', 'light', 'coffee', 'tron', '4chan']: - with open(f"./drama/assets/style/{theme}_ff66ac.css", encoding='utf-8') as t: + with open(f"./files/assets/style/{theme}_ff66ac.css", encoding='utf-8') as t: text = t.read() for color in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','62ca56','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58']: newtext = text.replace("ff66ac", color).replace("ff4097", color).replace("ff1a83", color).replace("ff3390", color).replace("rgba(255, 102, 172, 0.25)", color) - with open(f"./drama/assets/style/{theme}_{color}.css", encoding='utf-8', mode='w') as nt: + with open(f"./files/assets/style/{theme}_{color}.css", encoding='utf-8', mode='w') as nt: nt.write(newtext) \ No newline at end of file diff --git a/drama/classes/lolwtf.py b/drama/classes/lolwtf.py deleted file mode 100644 index 5e4a7a5ee..000000000 --- a/drama/classes/lolwtf.py +++ /dev/null @@ -1,2 +0,0 @@ - -from drama.__main__ import Base, app \ No newline at end of file diff --git a/drama/__main__.py b/files/__main__.py similarity index 97% rename from drama/__main__.py rename to files/__main__.py index 63a2d19b2..c90e60b02 100644 --- a/drama/__main__.py +++ b/files/__main__.py @@ -196,9 +196,9 @@ UA_BAN_CACHE_TTL = int(environ.get("UA_BAN_CACHE_TTL", 3600)) # import and bind all routing functions -import drama.classes -from drama.routes import * -import drama.helpers.jinja2 +import files.classes +from files.routes import * +import files.helpers.jinja2 @cache.memoize(UA_BAN_CACHE_TTL) def get_useragent_ban_response(user_agent_str): @@ -210,8 +210,8 @@ def get_useragent_ban_response(user_agent_str): # return False, (None, None) result = g.db.query( - drama.classes.Agent).filter( - drama.classes.Agent.kwd.in_( + files.classes.Agent).filter( + files.classes.Agent.kwd.in_( user_agent_str.split())).first() if result: return True, (result.mock or "Follow the robots.txt, dumbass", diff --git a/drama/classes/__init__.py b/files/classes/__init__.py similarity index 100% rename from drama/classes/__init__.py rename to files/classes/__init__.py diff --git a/drama/classes/agents.py b/files/classes/agents.py similarity index 91% rename from drama/classes/agents.py rename to files/classes/agents.py index fb0d0ad2e..dfce0c62d 100644 --- a/drama/classes/agents.py +++ b/files/classes/agents.py @@ -1,5 +1,5 @@ from sqlalchemy import * -from drama.__main__ import Base +from files.__main__ import Base class Agent(Base): diff --git a/drama/classes/alts.py b/files/classes/alts.py similarity index 90% rename from drama/classes/alts.py rename to files/classes/alts.py index 5bc5c16d8..04a6f00ef 100644 --- a/drama/classes/alts.py +++ b/files/classes/alts.py @@ -1,5 +1,5 @@ from sqlalchemy import * -from drama.__main__ import Base +from files.__main__ import Base class Alt(Base): diff --git a/drama/classes/award.py b/files/classes/award.py similarity index 97% rename from drama/classes/award.py rename to files/classes/award.py index 9eb2e7c1a..cc1f1ea0d 100644 --- a/drama/classes/award.py +++ b/files/classes/award.py @@ -1,6 +1,6 @@ from sqlalchemy import * from sqlalchemy.orm import relationship -from drama.__main__ import Base +from files.__main__ import Base AWARDS = { "ban": { diff --git a/drama/classes/badges.py b/files/classes/badges.py similarity index 97% rename from drama/classes/badges.py rename to files/classes/badges.py index 2af5edc35..bd5787dfc 100644 --- a/drama/classes/badges.py +++ b/files/classes/badges.py @@ -1,7 +1,7 @@ from sqlalchemy import * from sqlalchemy.orm import relationship -from drama.__main__ import Base, app +from files.__main__ import Base, app class BadgeDef(Base): diff --git a/drama/classes/clients.py b/files/classes/clients.py similarity index 94% rename from drama/classes/clients.py rename to files/classes/clients.py index 588db1f47..b1449e11b 100644 --- a/drama/classes/clients.py +++ b/files/classes/clients.py @@ -5,7 +5,7 @@ from sqlalchemy.orm import relationship, lazyload from .mix_ins import Stndrd from .submission import Submission from .comment import Comment -from drama.__main__ import Base +from files.__main__ import Base class OauthApp(Base, Stndrd): diff --git a/drama/classes/comment.py b/files/classes/comment.py similarity index 99% rename from drama/classes/comment.py rename to files/classes/comment.py index 38e0db165..da0528dec 100644 --- a/drama/classes/comment.py +++ b/files/classes/comment.py @@ -1,8 +1,8 @@ from flask import * from sqlalchemy import * from sqlalchemy.orm import relationship, deferred -from drama.helpers.lazy import lazy -from drama.__main__ import Base +from files.helpers.lazy import lazy +from files.__main__ import Base from .mix_ins import * from .flags import CommentFlag diff --git a/drama/classes/domains.py b/files/classes/domains.py similarity index 81% rename from drama/classes/domains.py rename to files/classes/domains.py index 17e620f6a..5fbb26b9e 100644 --- a/drama/classes/domains.py +++ b/files/classes/domains.py @@ -1,5 +1,5 @@ from sqlalchemy import * -from drama.__main__ import Base +from files.__main__ import Base class BannedDomain(Base): diff --git a/drama/classes/flags.py b/files/classes/flags.py similarity index 96% rename from drama/classes/flags.py rename to files/classes/flags.py index 3d8f3519a..7d36ba7f0 100644 --- a/drama/classes/flags.py +++ b/files/classes/flags.py @@ -1,6 +1,6 @@ from sqlalchemy import * from sqlalchemy.orm import relationship -from drama.__main__ import Base +from files.__main__ import Base from .mix_ins import * class Flag(Base, Stndrd): diff --git a/drama/classes/images.py b/files/classes/images.py similarity index 95% rename from drama/classes/images.py rename to files/classes/images.py index 701dd8dcd..5840c350a 100644 --- a/drama/classes/images.py +++ b/files/classes/images.py @@ -1,6 +1,6 @@ from sqlalchemy import * from flask import g -from drama.__main__ import Base +from files.__main__ import Base class Image(Base): diff --git a/files/classes/lolwtf.py b/files/classes/lolwtf.py new file mode 100644 index 000000000..5d26c7cf8 --- /dev/null +++ b/files/classes/lolwtf.py @@ -0,0 +1,2 @@ + +from files.__main__ import Base, app \ No newline at end of file diff --git a/drama/classes/mix_ins.py b/files/classes/mix_ins.py similarity index 98% rename from drama/classes/mix_ins.py rename to files/classes/mix_ins.py index 9f5728008..731d36ab4 100644 --- a/drama/classes/mix_ins.py +++ b/files/classes/mix_ins.py @@ -1,4 +1,4 @@ -from drama.helpers.lazy import lazy +from files.helpers.lazy import lazy import math import random import time diff --git a/drama/classes/mod_logs.py b/files/classes/mod_logs.py similarity index 99% rename from drama/classes/mod_logs.py rename to files/classes/mod_logs.py index b18fc4d81..941e08d3c 100644 --- a/drama/classes/mod_logs.py +++ b/files/classes/mod_logs.py @@ -1,6 +1,6 @@ from sqlalchemy import * from sqlalchemy.orm import relationship -from drama.__main__ import Base +from files.__main__ import Base from .mix_ins import * import time diff --git a/drama/classes/submission.py b/files/classes/submission.py similarity index 99% rename from drama/classes/submission.py rename to files/classes/submission.py index 7bab4d740..9b47918eb 100644 --- a/drama/classes/submission.py +++ b/files/classes/submission.py @@ -3,8 +3,8 @@ from sqlalchemy import * from sqlalchemy.orm import relationship, deferred import re, random from urllib.parse import urlparse -from drama.helpers.lazy import lazy -from drama.__main__ import Base +from files.helpers.lazy import lazy +from files.__main__ import Base from .mix_ins import * from .flags import * from os import environ diff --git a/drama/classes/subscriptions.py b/files/classes/subscriptions.py similarity index 93% rename from drama/classes/subscriptions.py rename to files/classes/subscriptions.py index 9cd327e39..8c41470fa 100644 --- a/drama/classes/subscriptions.py +++ b/files/classes/subscriptions.py @@ -1,6 +1,6 @@ from sqlalchemy import * from sqlalchemy.orm import relationship -from drama.__main__ import Base +from files.__main__ import Base import time diff --git a/drama/classes/user.py b/files/classes/user.py similarity index 99% rename from drama/classes/user.py rename to files/classes/user.py index 33d102c55..18aaa5c71 100644 --- a/drama/classes/user.py +++ b/files/classes/user.py @@ -2,8 +2,8 @@ from sqlalchemy.orm import deferred, contains_eager, aliased from secrets import token_hex import pyotp -from drama.helpers.discord import delete_role -from drama.helpers.images import * +from files.helpers.discord import delete_role +from files.helpers.images import * from .alts import Alt from .submission import SaveRelationship from .comment import Notification @@ -11,8 +11,8 @@ from .subscriptions import * from .userblock import * from .badges import * from .clients import * -from drama.__main__ import Base, cache -from drama.helpers.security import * +from files.__main__ import Base, cache +from files.helpers.security import * site = environ.get("domain").strip() diff --git a/drama/classes/userblock.py b/files/classes/userblock.py similarity index 94% rename from drama/classes/userblock.py rename to files/classes/userblock.py index 547fab79b..ee491901a 100644 --- a/drama/classes/userblock.py +++ b/files/classes/userblock.py @@ -1,7 +1,7 @@ from sqlalchemy import * from sqlalchemy.orm import relationship from .mix_ins import * -from drama.__main__ import Base +from files.__main__ import Base class UserBlock(Base, Stndrd, Age_times): diff --git a/drama/classes/votes.py b/files/classes/votes.py similarity index 97% rename from drama/classes/votes.py rename to files/classes/votes.py index 4873d50bb..8b19f2685 100644 --- a/drama/classes/votes.py +++ b/files/classes/votes.py @@ -1,7 +1,7 @@ from flask import * from sqlalchemy import * from sqlalchemy.orm import relationship -from drama.__main__ import Base +from files.__main__ import Base class Vote(Base): diff --git a/drama/helpers/alerts.py b/files/helpers/alerts.py similarity index 99% rename from drama/helpers/alerts.py rename to files/helpers/alerts.py index ec0d44296..44eb22d9f 100644 --- a/drama/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -1,6 +1,6 @@ import mistletoe -from drama.classes import * +from files.classes import * from flask import g from .markdown import * from .sanitize import * diff --git a/drama/helpers/base36.py b/files/helpers/base36.py similarity index 100% rename from drama/helpers/base36.py rename to files/helpers/base36.py diff --git a/drama/helpers/discord.py b/files/helpers/discord.py similarity index 100% rename from drama/helpers/discord.py rename to files/helpers/discord.py diff --git a/drama/helpers/filters.py b/files/helpers/filters.py similarity index 95% rename from drama/helpers/filters.py rename to files/helpers/filters.py index e6bc67d47..c4c33cebe 100644 --- a/drama/helpers/filters.py +++ b/files/helpers/filters.py @@ -1,7 +1,7 @@ from bs4 import BeautifulSoup from flask import * from urllib.parse import urlparse -from drama.classes import BannedDomain +from files.classes import BannedDomain def filter_comment_html(html_text): diff --git a/drama/helpers/get.py b/files/helpers/get.py similarity index 99% rename from drama/helpers/get.py rename to files/helpers/get.py index 43110e8ee..efa3b333b 100644 --- a/drama/helpers/get.py +++ b/files/helpers/get.py @@ -1,4 +1,4 @@ -from drama.classes import * +from files.classes import * from flask import g from sqlalchemy.orm import joinedload, aliased diff --git a/drama/helpers/images.py b/files/helpers/images.py similarity index 96% rename from drama/helpers/images.py rename to files/helpers/images.py index d16158b6e..5d4a50c0c 100644 --- a/drama/helpers/images.py +++ b/files/helpers/images.py @@ -2,7 +2,7 @@ import requests from os import environ from PIL import Image as IImage, ImageSequence import base64 -from drama.classes.images import * +from files.classes.images import * CF_KEY = environ.get("CLOUDFLARE_KEY").strip() CF_ZONE = environ.get("CLOUDFLARE_ZONE").strip() diff --git a/drama/helpers/jinja2.py b/files/helpers/jinja2.py similarity index 87% rename from drama/helpers/jinja2.py rename to files/helpers/jinja2.py index d19bdbdfc..20897b42b 100644 --- a/drama/helpers/jinja2.py +++ b/files/helpers/jinja2.py @@ -1,6 +1,6 @@ from os import environ, path from .get import * -from drama.__main__ import app, cache +from files.__main__ import app, cache @app.template_filter("total_users") @@ -14,7 +14,7 @@ def total_users(x): @cache.memoize(timeout=60 * 60 * 24) def source_code(file_name): - return open(path.expanduser('~') + '/drama/' + + return open(path.expanduser('~') + '/files/' + file_name, mode="r+").read() diff --git a/drama/helpers/lazy.py b/files/helpers/lazy.py similarity index 100% rename from drama/helpers/lazy.py rename to files/helpers/lazy.py diff --git a/drama/helpers/markdown.py b/files/helpers/markdown.py similarity index 100% rename from drama/helpers/markdown.py rename to files/helpers/markdown.py diff --git a/drama/helpers/redis.py b/files/helpers/redis.py similarity index 100% rename from drama/helpers/redis.py rename to files/helpers/redis.py diff --git a/drama/helpers/sanitize.py b/files/helpers/sanitize.py similarity index 98% rename from drama/helpers/sanitize.py rename to files/helpers/sanitize.py index 70e5ce973..b0fd9ddce 100644 --- a/drama/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -183,7 +183,7 @@ def sanitize(text, linkgen=False, flair=False): if flair: emojisize = 20 else: emojisize = 30 for i in re.finditer(':(.{1,30}?):', sanitized): - if path.isfile(f'./drama/assets/images/emojis/{i.group(1)}.gif'): + if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.gif'): sanitized = sanitized.replace(f':{i.group(1)}:', f'') sanitized = sanitized.replace("https://www.", "https://").replace("https://youtu.be/", "https://youtube.com/embed/").replace("https://music.youtube.com/watch?v=", "https://youtube.com/embed/").replace("/watch?v=", "/embed/").replace("https://open.spotify.com/", "https://open.spotify.com/embed/").replace("https://streamable.com/", "https://streamable.com/e/").replace("https://youtube.com/shorts/", "https://youtube.com/embed/") diff --git a/drama/helpers/security.py b/files/helpers/security.py similarity index 100% rename from drama/helpers/security.py rename to files/helpers/security.py diff --git a/drama/helpers/session.py b/files/helpers/session.py similarity index 100% rename from drama/helpers/session.py rename to files/helpers/session.py diff --git a/drama/helpers/sqla_values.py b/files/helpers/sqla_values.py similarity index 100% rename from drama/helpers/sqla_values.py rename to files/helpers/sqla_values.py diff --git a/drama/helpers/thumbs.py b/files/helpers/thumbs.py similarity index 100% rename from drama/helpers/thumbs.py rename to files/helpers/thumbs.py diff --git a/drama/helpers/wrappers.py b/files/helpers/wrappers.py similarity index 98% rename from drama/helpers/wrappers.py rename to files/helpers/wrappers.py index 4ba2bd33b..04e0d35eb 100644 --- a/drama/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -3,7 +3,7 @@ from sqlalchemy.sql import visitors from werkzeug.wrappers.response import Response as RespObj from .get import * from .alerts import send_notification -from drama.__main__ import app +from files.__main__ import app def get_logged_in_user(): diff --git a/drama/mail/__init__.py b/files/mail/__init__.py similarity index 100% rename from drama/mail/__init__.py rename to files/mail/__init__.py diff --git a/drama/mail/mail.py b/files/mail/mail.py similarity index 94% rename from drama/mail/mail.py rename to files/mail/mail.py index 5738978e2..17bae3aa7 100644 --- a/drama/mail/mail.py +++ b/files/mail/mail.py @@ -4,10 +4,10 @@ import time from flask import * from urllib.parse import quote -from drama.helpers.security import * -from drama.helpers.wrappers import * -from drama.classes import * -from drama.__main__ import app +from files.helpers.security import * +from files.helpers.wrappers import * +from files.classes import * +from files.__main__ import app site = environ.get("domain").strip() mailgun_domain = environ.get("MAILGUN_DOMAIN").strip() diff --git a/drama/routes/__init__.py b/files/routes/__init__.py similarity index 100% rename from drama/routes/__init__.py rename to files/routes/__init__.py diff --git a/drama/routes/admin.py b/files/routes/admin.py similarity index 98% rename from drama/routes/admin.py rename to files/routes/admin.py index cf616d986..6fc1db456 100644 --- a/drama/routes/admin.py +++ b/files/routes/admin.py @@ -5,17 +5,17 @@ import imagehash from os import remove from PIL import Image as IMAGE -from drama.helpers.wrappers import * -from drama.helpers.alerts import * -from drama.helpers.sanitize import * -from drama.helpers.markdown import * -from drama.helpers.security import * -from drama.helpers.get import * -from drama.helpers.images import * -from drama.classes import * +from files.helpers.wrappers import * +from files.helpers.alerts import * +from files.helpers.sanitize import * +from files.helpers.markdown import * +from files.helpers.security import * +from files.helpers.get import * +from files.helpers.images import * +from files.classes import * from flask import * import matplotlib.pyplot as plt -from drama.__main__ import app, cache +from files.__main__ import app, cache from .front import frontlist @app.get("/admin/shadowbanned") diff --git a/drama/routes/awards.py b/files/routes/awards.py similarity index 97% rename from drama/routes/awards.py rename to files/routes/awards.py index 12b500018..46a654aaf 100644 --- a/drama/routes/awards.py +++ b/files/routes/awards.py @@ -1,8 +1,8 @@ -from drama.__main__ import app -from drama.helpers.wrappers import * -from drama.helpers.alerts import * -from drama.helpers.get import * -from drama.classes.award import * +from files.__main__ import app +from files.helpers.wrappers import * +from files.helpers.alerts import * +from files.helpers.get import * +from files.classes.award import * from flask import g, request diff --git a/drama/routes/comments.py b/files/routes/comments.py similarity index 98% rename from drama/routes/comments.py rename to files/routes/comments.py index f70f00400..7aa37ada7 100644 --- a/drama/routes/comments.py +++ b/files/routes/comments.py @@ -1,14 +1,14 @@ -from drama.helpers.wrappers import * -from drama.helpers.filters import * -from drama.helpers.alerts import * -from drama.helpers.images import * -from drama.helpers.session import * -from drama.classes import * -from drama.routes.front import comment_idlist +from files.helpers.wrappers import * +from files.helpers.filters import * +from files.helpers.alerts import * +from files.helpers.images import * +from files.helpers.session import * +from files.classes import * +from files.routes.front import comment_idlist from pusher_push_notifications import PushNotifications from flask import * -from drama.__main__ import app, limiter +from files.__main__ import app, limiter site = environ.get("domain").strip() diff --git a/drama/routes/discord.py b/files/routes/discord.py similarity index 95% rename from drama/routes/discord.py rename to files/routes/discord.py index 72f7a6d95..a702d4d8a 100644 --- a/drama/routes/discord.py +++ b/files/routes/discord.py @@ -1,7 +1,7 @@ -from drama.helpers.wrappers import * -from drama.helpers.security import * -from drama.helpers.discord import add_role -from drama.__main__ import app +from files.helpers.wrappers import * +from files.helpers.security import * +from files.helpers.discord import add_role +from files.__main__ import app SERVER_ID = environ.get("DISCORD_SERVER_ID",'').strip() CLIENT_ID = environ.get("DISCORD_CLIENT_ID",'').strip() diff --git a/drama/routes/errors.py b/files/routes/errors.py similarity index 97% rename from drama/routes/errors.py rename to files/routes/errors.py index 4b43a2380..01281af43 100644 --- a/drama/routes/errors.py +++ b/files/routes/errors.py @@ -1,11 +1,11 @@ import jinja2.exceptions -from drama.helpers.wrappers import * -from drama.helpers.session import * +from files.helpers.wrappers import * +from files.helpers.session import * from flask import * from urllib.parse import quote, urlencode import time -from drama.__main__ import app +from files.__main__ import app # Errors diff --git a/drama/routes/feeds.py b/files/routes/feeds.py similarity index 91% rename from drama/routes/feeds.py rename to files/routes/feeds.py index 91582b42b..bcee4c7bf 100644 --- a/drama/routes/feeds.py +++ b/files/routes/feeds.py @@ -1,11 +1,11 @@ import html from .front import frontlist from datetime import datetime -from drama.helpers.jinja2 import full_link -from drama.helpers.get import * +from files.helpers.jinja2 import full_link +from files.helpers.get import * from yattag import Doc -from drama.__main__ import app +from files.__main__ import app @app.get('/rss//') def feeds_user(sort='hot', t='all'): diff --git a/drama/routes/flagging.py b/files/routes/flagging.py similarity index 84% rename from drama/routes/flagging.py rename to files/routes/flagging.py index ce62d97ac..59dacd76a 100644 --- a/drama/routes/flagging.py +++ b/files/routes/flagging.py @@ -1,8 +1,8 @@ -from drama.helpers.wrappers import * -from drama.helpers.get import * +from files.helpers.wrappers import * +from files.helpers.get import * from flask import g -from drama.__main__ import app -from drama.helpers.sanitize import sanitize +from files.__main__ import app +from files.helpers.sanitize import sanitize @app.post("/flag/post/") @auth_desired diff --git a/drama/routes/front.py b/files/routes/front.py similarity index 98% rename from drama/routes/front.py rename to files/routes/front.py index dff0e095e..272af70d1 100644 --- a/drama/routes/front.py +++ b/files/routes/front.py @@ -1,8 +1,8 @@ -from drama.helpers.wrappers import * -from drama.helpers.get import * +from files.helpers.wrappers import * +from files.helpers.get import * -from drama.__main__ import app, cache -from drama.classes.submission import Submission +from files.__main__ import app, cache +from files.classes.submission import Submission @app.get("/post/") def slash_post(): diff --git a/drama/routes/login.py b/files/routes/login.py similarity index 99% rename from drama/routes/login.py rename to files/routes/login.py index 875c2f008..bce1a850b 100644 --- a/drama/routes/login.py +++ b/files/routes/login.py @@ -1,6 +1,6 @@ from urllib.parse import urlencode -from drama.mail import * -from drama.__main__ import app, limiter +from files.mail import * +from files.__main__ import app, limiter valid_username_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$") valid_password_regex = re.compile("^.{8,100}$") diff --git a/drama/routes/oauth.py b/files/routes/oauth.py similarity index 95% rename from drama/routes/oauth.py rename to files/routes/oauth.py index 16283b14c..802ccd8b7 100644 --- a/drama/routes/oauth.py +++ b/files/routes/oauth.py @@ -1,9 +1,9 @@ -from drama.helpers.wrappers import * -from drama.helpers.alerts import * -from drama.helpers.get import * -from drama.classes import * +from files.helpers.wrappers import * +from files.helpers.alerts import * +from files.helpers.get import * +from files.classes import * from flask import * -from drama.__main__ import app +from files.__main__ import app @app.get("/authorize") @auth_required diff --git a/drama/routes/posts.py b/files/routes/posts.py similarity index 98% rename from drama/routes/posts.py rename to files/routes/posts.py index 1a574b59c..f5651dfc2 100644 --- a/drama/routes/posts.py +++ b/files/routes/posts.py @@ -3,18 +3,18 @@ import mistletoe import urllib.parse import gevent -from drama.helpers.wrappers import * -from drama.helpers.sanitize import * -from drama.helpers.filters import * -from drama.helpers.markdown import * -from drama.helpers.session import * -from drama.helpers.thumbs import * -from drama.helpers.alerts import send_notification -from drama.helpers.discord import send_message -from drama.classes import * +from files.helpers.wrappers import * +from files.helpers.sanitize import * +from files.helpers.filters import * +from files.helpers.markdown import * +from files.helpers.session import * +from files.helpers.thumbs import * +from files.helpers.alerts import send_notification +from files.helpers.discord import send_message +from files.classes import * from flask import * from io import BytesIO -from drama.__main__ import app, limiter, cache +from files.__main__ import app, limiter, cache from PIL import Image as PILimage from .front import frontlist diff --git a/drama/routes/search.py b/files/routes/search.py similarity index 98% rename from drama/routes/search.py rename to files/routes/search.py index 31cd8dc76..ee3cca08d 100644 --- a/drama/routes/search.py +++ b/files/routes/search.py @@ -1,8 +1,8 @@ -from drama.helpers.wrappers import * +from files.helpers.wrappers import * import re from sqlalchemy import * from flask import * -from drama.__main__ import app, cache +from files.__main__ import app, cache import random query_regex=re.compile("(\w+):(\S+)") diff --git a/drama/routes/settings.py b/files/routes/settings.py similarity index 98% rename from drama/routes/settings.py rename to files/routes/settings.py index 78a20e73c..5f89d524c 100644 --- a/drama/routes/settings.py +++ b/files/routes/settings.py @@ -1,11 +1,11 @@ from __future__ import unicode_literals -from drama.helpers.alerts import * -from drama.helpers.sanitize import * -from drama.helpers.filters import filter_comment_html -from drama.helpers.markdown import * -from drama.helpers.discord import remove_user, set_nick -from drama.mail import * -from drama.__main__ import app, cache +from files.helpers.alerts import * +from files.helpers.sanitize import * +from files.helpers.filters import filter_comment_html +from files.helpers.markdown import * +from files.helpers.discord import remove_user, set_nick +from files.mail import * +from files.__main__ import app, cache import youtube_dl from .front import frontlist @@ -454,7 +454,7 @@ def settings_block_user(v): return {"error": f"You have already blocked @{user.username}."}, 409 if user.id == 1046: - return {"error": "You can't block @Drama."}, 409 + return {"error": "You can't block @files."}, 409 new_block = UserBlock(user_id=v.id, target_id=user.id, diff --git a/drama/routes/static.py b/files/routes/static.py similarity index 98% rename from drama/routes/static.py rename to files/routes/static.py index f84aec5ae..8587f6dba 100644 --- a/drama/routes/static.py +++ b/files/routes/static.py @@ -1,6 +1,6 @@ -from drama.mail import * -from drama.__main__ import app, limiter -from drama.helpers.alerts import * +from files.mail import * +from files.__main__ import app, limiter +from files.helpers.alerts import * site = environ.get("domain").strip() diff --git a/drama/routes/users.py b/files/routes/users.py similarity index 98% rename from drama/routes/users.py rename to files/routes/users.py index d2f1e18cd..8ce12c5c2 100644 --- a/drama/routes/users.py +++ b/files/routes/users.py @@ -2,13 +2,13 @@ import qrcode import io import time -from drama.classes.user import ViewerRelationship -from drama.helpers.alerts import * -from drama.helpers.sanitize import * -from drama.helpers.markdown import * -from drama.mail import * +from files.classes.user import ViewerRelationship +from files.helpers.alerts import * +from files.helpers.sanitize import * +from files.helpers.markdown import * +from files.mail import * from flask import * -from drama.__main__ import app, limiter +from files.__main__ import app, limiter from pusher_push_notifications import PushNotifications site = environ.get("domain").strip() diff --git a/drama/routes/votes.py b/files/routes/votes.py similarity index 95% rename from drama/routes/votes.py rename to files/routes/votes.py index 59581ef52..2b9344755 100644 --- a/drama/routes/votes.py +++ b/files/routes/votes.py @@ -1,8 +1,8 @@ -from drama.helpers.wrappers import * -from drama.helpers.get import * -from drama.classes import * +from files.helpers.wrappers import * +from files.helpers.get import * +from files.classes import * from flask import * -from drama.__main__ import app +from files.__main__ import app @app.get("/votes") diff --git a/drama/static/index.js b/files/static/index.js similarity index 100% rename from drama/static/index.js rename to files/static/index.js diff --git a/drama/templates/2fa_modal.html b/files/templates/2fa_modal.html similarity index 100% rename from drama/templates/2fa_modal.html rename to files/templates/2fa_modal.html diff --git a/drama/templates/admin/admin_home.html b/files/templates/admin/admin_home.html similarity index 100% rename from drama/templates/admin/admin_home.html rename to files/templates/admin/admin_home.html diff --git a/drama/templates/admin/alt_votes.html b/files/templates/admin/alt_votes.html similarity index 100% rename from drama/templates/admin/alt_votes.html rename to files/templates/admin/alt_votes.html diff --git a/drama/templates/admin/app.html b/files/templates/admin/app.html similarity index 100% rename from drama/templates/admin/app.html rename to files/templates/admin/app.html diff --git a/drama/templates/admin/apps.html b/files/templates/admin/apps.html similarity index 100% rename from drama/templates/admin/apps.html rename to files/templates/admin/apps.html diff --git a/drama/templates/admin/badge_grant.html b/files/templates/admin/badge_grant.html similarity index 100% rename from drama/templates/admin/badge_grant.html rename to files/templates/admin/badge_grant.html diff --git a/drama/templates/admin/banned_domains.html b/files/templates/admin/banned_domains.html similarity index 100% rename from drama/templates/admin/banned_domains.html rename to files/templates/admin/banned_domains.html diff --git a/drama/templates/admin/content_stats.html b/files/templates/admin/content_stats.html similarity index 100% rename from drama/templates/admin/content_stats.html rename to files/templates/admin/content_stats.html diff --git a/drama/templates/admin/flagged_comments.html b/files/templates/admin/flagged_comments.html similarity index 100% rename from drama/templates/admin/flagged_comments.html rename to files/templates/admin/flagged_comments.html diff --git a/drama/templates/admin/flagged_posts.html b/files/templates/admin/flagged_posts.html similarity index 100% rename from drama/templates/admin/flagged_posts.html rename to files/templates/admin/flagged_posts.html diff --git a/drama/templates/admin/image_ban.html b/files/templates/admin/image_ban.html similarity index 100% rename from drama/templates/admin/image_ban.html rename to files/templates/admin/image_ban.html diff --git a/drama/templates/admin/image_posts.html b/files/templates/admin/image_posts.html similarity index 100% rename from drama/templates/admin/image_posts.html rename to files/templates/admin/image_posts.html diff --git a/drama/templates/admin/image_purge.html b/files/templates/admin/image_purge.html similarity index 100% rename from drama/templates/admin/image_purge.html rename to files/templates/admin/image_purge.html diff --git a/drama/templates/admin/new_users.html b/files/templates/admin/new_users.html similarity index 100% rename from drama/templates/admin/new_users.html rename to files/templates/admin/new_users.html diff --git a/drama/templates/admin/removed_posts.html b/files/templates/admin/removed_posts.html similarity index 100% rename from drama/templates/admin/removed_posts.html rename to files/templates/admin/removed_posts.html diff --git a/drama/templates/admin/user_award.html b/files/templates/admin/user_award.html similarity index 100% rename from drama/templates/admin/user_award.html rename to files/templates/admin/user_award.html diff --git a/drama/templates/api.html b/files/templates/api.html similarity index 100% rename from drama/templates/api.html rename to files/templates/api.html diff --git a/drama/templates/authforms.html b/files/templates/authforms.html similarity index 100% rename from drama/templates/authforms.html rename to files/templates/authforms.html diff --git a/drama/templates/award_modal.html b/files/templates/award_modal.html similarity index 100% rename from drama/templates/award_modal.html rename to files/templates/award_modal.html diff --git a/drama/templates/badges.html b/files/templates/badges.html similarity index 100% rename from drama/templates/badges.html rename to files/templates/badges.html diff --git a/drama/templates/badmins.html b/files/templates/badmins.html similarity index 100% rename from drama/templates/badmins.html rename to files/templates/badmins.html diff --git a/drama/templates/banned.html b/files/templates/banned.html similarity index 100% rename from drama/templates/banned.html rename to files/templates/banned.html diff --git a/drama/templates/blocks.html b/files/templates/blocks.html similarity index 100% rename from drama/templates/blocks.html rename to files/templates/blocks.html diff --git a/drama/templates/bootstrap.html b/files/templates/bootstrap.html similarity index 100% rename from drama/templates/bootstrap.html rename to files/templates/bootstrap.html diff --git a/drama/templates/changelog.html b/files/templates/changelog.html similarity index 100% rename from drama/templates/changelog.html rename to files/templates/changelog.html diff --git a/drama/templates/comment_failed.html b/files/templates/comment_failed.html similarity index 100% rename from drama/templates/comment_failed.html rename to files/templates/comment_failed.html diff --git a/drama/templates/comments.html b/files/templates/comments.html similarity index 100% rename from drama/templates/comments.html rename to files/templates/comments.html diff --git a/drama/templates/contact.html b/files/templates/contact.html similarity index 100% rename from drama/templates/contact.html rename to files/templates/contact.html diff --git a/drama/templates/default.html b/files/templates/default.html similarity index 100% rename from drama/templates/default.html rename to files/templates/default.html diff --git a/drama/templates/delete_comment_modal.html b/files/templates/delete_comment_modal.html similarity index 100% rename from drama/templates/delete_comment_modal.html rename to files/templates/delete_comment_modal.html diff --git a/drama/templates/delete_post_modal.html b/files/templates/delete_post_modal.html similarity index 100% rename from drama/templates/delete_post_modal.html rename to files/templates/delete_post_modal.html diff --git a/drama/templates/email/2fa_remove.html b/files/templates/email/2fa_remove.html similarity index 100% rename from drama/templates/email/2fa_remove.html rename to files/templates/email/2fa_remove.html diff --git a/drama/templates/email/default.html b/files/templates/email/default.html similarity index 100% rename from drama/templates/email/default.html rename to files/templates/email/default.html diff --git a/drama/templates/email/email_change.html b/files/templates/email/email_change.html similarity index 100% rename from drama/templates/email/email_change.html rename to files/templates/email/email_change.html diff --git a/drama/templates/email/email_verify.html b/files/templates/email/email_verify.html similarity index 100% rename from drama/templates/email/email_verify.html rename to files/templates/email/email_verify.html diff --git a/drama/templates/email/password_reset.html b/files/templates/email/password_reset.html similarity index 100% rename from drama/templates/email/password_reset.html rename to files/templates/email/password_reset.html diff --git a/drama/templates/emoji_modal.html b/files/templates/emoji_modal.html similarity index 100% rename from drama/templates/emoji_modal.html rename to files/templates/emoji_modal.html diff --git a/drama/templates/errors/400.html b/files/templates/errors/400.html similarity index 100% rename from drama/templates/errors/400.html rename to files/templates/errors/400.html diff --git a/drama/templates/errors/401.html b/files/templates/errors/401.html similarity index 100% rename from drama/templates/errors/401.html rename to files/templates/errors/401.html diff --git a/drama/templates/errors/403.html b/files/templates/errors/403.html similarity index 100% rename from drama/templates/errors/403.html rename to files/templates/errors/403.html diff --git a/drama/templates/errors/404.html b/files/templates/errors/404.html similarity index 100% rename from drama/templates/errors/404.html rename to files/templates/errors/404.html diff --git a/drama/templates/errors/405.html b/files/templates/errors/405.html similarity index 100% rename from drama/templates/errors/405.html rename to files/templates/errors/405.html diff --git a/drama/templates/errors/409.html b/files/templates/errors/409.html similarity index 100% rename from drama/templates/errors/409.html rename to files/templates/errors/409.html diff --git a/drama/templates/errors/410.html b/files/templates/errors/410.html similarity index 100% rename from drama/templates/errors/410.html rename to files/templates/errors/410.html diff --git a/drama/templates/errors/413.html b/files/templates/errors/413.html similarity index 100% rename from drama/templates/errors/413.html rename to files/templates/errors/413.html diff --git a/drama/templates/errors/418.html b/files/templates/errors/418.html similarity index 100% rename from drama/templates/errors/418.html rename to files/templates/errors/418.html diff --git a/drama/templates/errors/422.html b/files/templates/errors/422.html similarity index 100% rename from drama/templates/errors/422.html rename to files/templates/errors/422.html diff --git a/drama/templates/errors/429.html b/files/templates/errors/429.html similarity index 100% rename from drama/templates/errors/429.html rename to files/templates/errors/429.html diff --git a/drama/templates/errors/451.html b/files/templates/errors/451.html similarity index 100% rename from drama/templates/errors/451.html rename to files/templates/errors/451.html diff --git a/drama/templates/errors/500.html b/files/templates/errors/500.html similarity index 100% rename from drama/templates/errors/500.html rename to files/templates/errors/500.html diff --git a/drama/templates/errors/502.html b/files/templates/errors/502.html similarity index 100% rename from drama/templates/errors/502.html rename to files/templates/errors/502.html diff --git a/drama/templates/errors/503.html b/files/templates/errors/503.html similarity index 100% rename from drama/templates/errors/503.html rename to files/templates/errors/503.html diff --git a/drama/templates/errors/banaward.html b/files/templates/errors/banaward.html similarity index 100% rename from drama/templates/errors/banaward.html rename to files/templates/errors/banaward.html diff --git a/drama/templates/errors/default.html b/files/templates/errors/default.html similarity index 100% rename from drama/templates/errors/default.html rename to files/templates/errors/default.html diff --git a/drama/templates/errors/nsfw.html b/files/templates/errors/nsfw.html similarity index 100% rename from drama/templates/errors/nsfw.html rename to files/templates/errors/nsfw.html diff --git a/drama/templates/errors/patron.html b/files/templates/errors/patron.html similarity index 100% rename from drama/templates/errors/patron.html rename to files/templates/errors/patron.html diff --git a/drama/templates/expanded_image_modal.html b/files/templates/expanded_image_modal.html similarity index 100% rename from drama/templates/expanded_image_modal.html rename to files/templates/expanded_image_modal.html diff --git a/drama/templates/flag_comment_modal.html b/files/templates/flag_comment_modal.html similarity index 100% rename from drama/templates/flag_comment_modal.html rename to files/templates/flag_comment_modal.html diff --git a/drama/templates/flag_post_modal.html b/files/templates/flag_post_modal.html similarity index 100% rename from drama/templates/flag_post_modal.html rename to files/templates/flag_post_modal.html diff --git a/drama/templates/followers.html b/files/templates/followers.html similarity index 100% rename from drama/templates/followers.html rename to files/templates/followers.html diff --git a/drama/templates/forgot_password.html b/files/templates/forgot_password.html similarity index 100% rename from drama/templates/forgot_password.html rename to files/templates/forgot_password.html diff --git a/drama/templates/formatting.html b/files/templates/formatting.html similarity index 100% rename from drama/templates/formatting.html rename to files/templates/formatting.html diff --git a/drama/templates/gif_modal.html b/files/templates/gif_modal.html similarity index 100% rename from drama/templates/gif_modal.html rename to files/templates/gif_modal.html diff --git a/drama/templates/header.html b/files/templates/header.html similarity index 100% rename from drama/templates/header.html rename to files/templates/header.html diff --git a/drama/templates/home.html b/files/templates/home.html similarity index 100% rename from drama/templates/home.html rename to files/templates/home.html diff --git a/drama/templates/home_comments.html b/files/templates/home_comments.html similarity index 100% rename from drama/templates/home_comments.html rename to files/templates/home_comments.html diff --git a/drama/templates/index.html b/files/templates/index.html similarity index 100% rename from drama/templates/index.html rename to files/templates/index.html diff --git a/drama/templates/leaderboard.html b/files/templates/leaderboard.html similarity index 100% rename from drama/templates/leaderboard.html rename to files/templates/leaderboard.html diff --git a/drama/templates/log.html b/files/templates/log.html similarity index 100% rename from drama/templates/log.html rename to files/templates/log.html diff --git a/drama/templates/login.html b/files/templates/login.html similarity index 100% rename from drama/templates/login.html rename to files/templates/login.html diff --git a/drama/templates/login_2fa.html b/files/templates/login_2fa.html similarity index 100% rename from drama/templates/login_2fa.html rename to files/templates/login_2fa.html diff --git a/drama/templates/lost_2fa.html b/files/templates/lost_2fa.html similarity index 100% rename from drama/templates/lost_2fa.html rename to files/templates/lost_2fa.html diff --git a/drama/templates/message.html b/files/templates/message.html similarity index 100% rename from drama/templates/message.html rename to files/templates/message.html diff --git a/drama/templates/message_success.html b/files/templates/message_success.html similarity index 100% rename from drama/templates/message_success.html rename to files/templates/message_success.html diff --git a/drama/templates/mine.html b/files/templates/mine.html similarity index 100% rename from drama/templates/mine.html rename to files/templates/mine.html diff --git a/drama/templates/mobile_navigation_bar.html b/files/templates/mobile_navigation_bar.html similarity index 100% rename from drama/templates/mobile_navigation_bar.html rename to files/templates/mobile_navigation_bar.html diff --git a/drama/templates/notifications.html b/files/templates/notifications.html similarity index 100% rename from drama/templates/notifications.html rename to files/templates/notifications.html diff --git a/drama/templates/oauth.html b/files/templates/oauth.html similarity index 100% rename from drama/templates/oauth.html rename to files/templates/oauth.html diff --git a/drama/templates/patrons.html b/files/templates/patrons.html similarity index 100% rename from drama/templates/patrons.html rename to files/templates/patrons.html diff --git a/drama/templates/rentoids.html b/files/templates/rentoids.html similarity index 100% rename from drama/templates/rentoids.html rename to files/templates/rentoids.html diff --git a/drama/templates/reset_password.html b/files/templates/reset_password.html similarity index 100% rename from drama/templates/reset_password.html rename to files/templates/reset_password.html diff --git a/drama/templates/search.html b/files/templates/search.html similarity index 100% rename from drama/templates/search.html rename to files/templates/search.html diff --git a/drama/templates/search_comments.html b/files/templates/search_comments.html similarity index 100% rename from drama/templates/search_comments.html rename to files/templates/search_comments.html diff --git a/drama/templates/search_users.html b/files/templates/search_users.html similarity index 100% rename from drama/templates/search_users.html rename to files/templates/search_users.html diff --git a/drama/templates/seized.html b/files/templates/seized.html similarity index 100% rename from drama/templates/seized.html rename to files/templates/seized.html diff --git a/drama/templates/settings.html b/files/templates/settings.html similarity index 100% rename from drama/templates/settings.html rename to files/templates/settings.html diff --git a/drama/templates/settings2.html b/files/templates/settings2.html similarity index 100% rename from drama/templates/settings2.html rename to files/templates/settings2.html diff --git a/drama/templates/settings_apps.html b/files/templates/settings_apps.html similarity index 100% rename from drama/templates/settings_apps.html rename to files/templates/settings_apps.html diff --git a/drama/templates/settings_blocks.html b/files/templates/settings_blocks.html similarity index 100% rename from drama/templates/settings_blocks.html rename to files/templates/settings_blocks.html diff --git a/drama/templates/settings_css.html b/files/templates/settings_css.html similarity index 100% rename from drama/templates/settings_css.html rename to files/templates/settings_css.html diff --git a/drama/templates/settings_filters.html b/files/templates/settings_filters.html similarity index 100% rename from drama/templates/settings_filters.html rename to files/templates/settings_filters.html diff --git a/drama/templates/settings_profile.html b/files/templates/settings_profile.html similarity index 100% rename from drama/templates/settings_profile.html rename to files/templates/settings_profile.html diff --git a/drama/templates/settings_profilecss.html b/files/templates/settings_profilecss.html similarity index 100% rename from drama/templates/settings_profilecss.html rename to files/templates/settings_profilecss.html diff --git a/drama/templates/settings_security.html b/files/templates/settings_security.html similarity index 100% rename from drama/templates/settings_security.html rename to files/templates/settings_security.html diff --git a/drama/templates/sign_up.html b/files/templates/sign_up.html similarity index 100% rename from drama/templates/sign_up.html rename to files/templates/sign_up.html diff --git a/drama/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html similarity index 100% rename from drama/templates/sign_up_failed_ref.html rename to files/templates/sign_up_failed_ref.html diff --git a/drama/templates/site_embeds/instagram.html b/files/templates/site_embeds/instagram.html similarity index 100% rename from drama/templates/site_embeds/instagram.html rename to files/templates/site_embeds/instagram.html diff --git a/drama/templates/site_embeds/twitter.html b/files/templates/site_embeds/twitter.html similarity index 100% rename from drama/templates/site_embeds/twitter.html rename to files/templates/site_embeds/twitter.html diff --git a/drama/templates/site_embeds/twitterlight.html b/files/templates/site_embeds/twitterlight.html similarity index 100% rename from drama/templates/site_embeds/twitterlight.html rename to files/templates/site_embeds/twitterlight.html diff --git a/drama/templates/site_embeds/youtube.html b/files/templates/site_embeds/youtube.html similarity index 100% rename from drama/templates/site_embeds/youtube.html rename to files/templates/site_embeds/youtube.html diff --git a/drama/templates/submission.html b/files/templates/submission.html similarity index 100% rename from drama/templates/submission.html rename to files/templates/submission.html diff --git a/drama/templates/submission_banned.html b/files/templates/submission_banned.html similarity index 100% rename from drama/templates/submission_banned.html rename to files/templates/submission_banned.html diff --git a/drama/templates/submission_listing.html b/files/templates/submission_listing.html similarity index 100% rename from drama/templates/submission_listing.html rename to files/templates/submission_listing.html diff --git a/drama/templates/submit.html b/files/templates/submit.html similarity index 100% rename from drama/templates/submit.html rename to files/templates/submit.html diff --git a/drama/templates/user_listing.html b/files/templates/user_listing.html similarity index 100% rename from drama/templates/user_listing.html rename to files/templates/user_listing.html diff --git a/drama/templates/userpage.html b/files/templates/userpage.html similarity index 100% rename from drama/templates/userpage.html rename to files/templates/userpage.html diff --git a/drama/templates/userpage_blocked.html b/files/templates/userpage_blocked.html similarity index 100% rename from drama/templates/userpage_blocked.html rename to files/templates/userpage_blocked.html diff --git a/drama/templates/userpage_blocking.html b/files/templates/userpage_blocking.html similarity index 100% rename from drama/templates/userpage_blocking.html rename to files/templates/userpage_blocking.html diff --git a/drama/templates/userpage_comments.html b/files/templates/userpage_comments.html similarity index 100% rename from drama/templates/userpage_comments.html rename to files/templates/userpage_comments.html diff --git a/drama/templates/userpage_private.html b/files/templates/userpage_private.html similarity index 100% rename from drama/templates/userpage_private.html rename to files/templates/userpage_private.html diff --git a/drama/templates/userpage_reserved.html b/files/templates/userpage_reserved.html similarity index 100% rename from drama/templates/userpage_reserved.html rename to files/templates/userpage_reserved.html diff --git a/drama/templates/viewers.html b/files/templates/viewers.html similarity index 100% rename from drama/templates/viewers.html rename to files/templates/viewers.html diff --git a/drama/templates/votes.html b/files/templates/votes.html similarity index 100% rename from drama/templates/votes.html rename to files/templates/votes.html diff --git a/push.sh b/push.sh index b2b89d1bd..25c9cfdf0 100644 --- a/push.sh +++ b/push.sh @@ -4,12 +4,12 @@ git commit -m "sneed" git push apt install ruby-sass -sass ./drama/assets/style/midnight.scss ./drama/assets/style/midnight_ff66ac.css -sass ./drama/assets/style/dark.scss ./drama/assets/style/dark_ff66ac.css -sass ./drama/assets/style/light.scss ./drama/assets/style/light_ff66ac.css -sass ./drama/assets/style/coffee.scss ./drama/assets/style/coffee_ff66ac.css -sass ./drama/assets/style/tron.scss ./drama/assets/style/tron_ff66ac.css -sass ./drama/assets/style/4chan.scss ./drama/assets/style/4chan_ff66ac.css +sass ./files/assets/style/midnight.scss ./files/assets/style/midnight_ff66ac.css +sass ./files/assets/style/dark.scss ./files/assets/style/dark_ff66ac.css +sass ./files/assets/style/light.scss ./files/assets/style/light_ff66ac.css +sass ./files/assets/style/coffee.scss ./files/assets/style/coffee_ff66ac.css +sass ./files/assets/style/tron.scss ./files/assets/style/tron_ff66ac.css +sass ./files/assets/style/4chan.scss ./files/assets/style/4chan_ff66ac.css python ./compilecss.py python3 ./compilecss.py git add .