forked from rDrama/rDrama
1
0
Fork 0

fdMerge branch 'frost' of https://github.com/Aevann1/Drama into frost

master
Aevann1 2022-05-24 15:59:54 +00:00
commit 2e64b2b1db
15 changed files with 41 additions and 40 deletions

View File

@ -54,9 +54,8 @@ if SITE_NAME == 'rDrama':
"fag": "cute twink",
"pedophile": "libertarian",
"kill yourself": "keep yourself safe",
"n1gger": "BIPOC",
"nlgger": "BIPOC",
"nigger": "BIPOC",
"niglet": "BIPOClet",
"steve akins": "penny verity oaken",
"trannie": "πŸš‚πŸšƒπŸšƒ",
"tranny": "πŸš‚πŸšƒπŸšƒ",
@ -408,7 +407,7 @@ AWARDS = {
"description": "Makes flies swarm the post.",
"icon": "fas fa-poop",
"color": "text-black-50",
"price": 300
"price": 500
},
"fireflies": {
"kind": "fireflies",
@ -416,7 +415,7 @@ AWARDS = {
"description": "Makes fireflies swarm the post.",
"icon": "fas fa-sparkles",
"color": "text-warning",
"price": 300
"price": 500
},
"train": {
"kind": "train",
@ -424,7 +423,7 @@ AWARDS = {
"description": "Summons a train on the post.",
"icon": "fas fa-train",
"color": "text-pink",
"price": 300
"price": 500
},
"scooter": {
"kind": "scooter",
@ -432,7 +431,7 @@ AWARDS = {
"description": "Summons a scooter on the post.",
"icon": "fas fa-flag-usa",
"color": "text-muted",
"price": 300
"price": 500
},
"wholesome": {
"kind": "wholesome",
@ -440,7 +439,7 @@ AWARDS = {
"description": "Summons a wholesome marsey on the post.",
"icon": "fas fa-smile-beam",
"color": "text-yellow",
"price": 300
"price": 500
},
"firework": {
"kind": "firework",
@ -448,7 +447,7 @@ AWARDS = {
"description": "Summons fireworks on the post.",
"icon": "fas fa-bahai",
"color": "text-danger",
"price": 300
"price": 500
},
"confetti": {
"kind": "confetti",
@ -456,7 +455,7 @@ AWARDS = {
"description": "Summons confetti to fall on the post.",
"icon": "fas fa-party-horn",
"color": "text-yellow",
"price": 300
"price": 500
},
"ricardo": {
"kind": "ricardo",
@ -472,7 +471,7 @@ AWARDS = {
"description": "Tilts the post or comment",
"icon": "fas fa-car-tilt",
"color": "text-blue",
"price": 300
"price": 500
},
"glowie": {
"kind": "glowie",
@ -480,7 +479,7 @@ AWARDS = {
"description": "Indicates that the recipient can be seen when driving. Just run them over.",
"icon": "fas fa-user-secret",
"color": "text-green",
"price": 300
"price": 500
},
"rehab": {
"kind": "rehab",
@ -936,7 +935,7 @@ image_check_regex = re.compile(f'!\[\]\(((?!(https:\/\/([a-z0-9-]+\.)*({hosts})\
embed_fullmatch_regex = re.compile(f'https:\/\/([a-z0-9-]+\.)*({hosts})\/[\w:~,()\-.#&\/=?@%;+]*', flags=re.A)
video_sub_regex = re.compile(f'(<p>[^<]*)(https:\/\/([a-z0-9-]+\.)*({hosts})\/[\w:~,()\-.#&\/=?@%;+]*?\.(mp4|webm|mov))', flags=re.A)
audio_sub_regex = re.compile(f'(<p>[^<]*)(https:\/\/([a-z0-9-]+\.)*({hosts})\/[\w:~,()\-.#&\/=?@%;+]*?\.(mp3|wav|ogg|aac|m4a))', flags=re.A)
audio_sub_regex = re.compile(f'(<p>[^<]*)(https:\/\/([a-z0-9-]+\.)*({hosts})\/[\w:~,()\-.#&\/=?@%;+]*?\.(mp3|wav|ogg|aac|m4a|flac))', flags=re.A)
imgur_regex = re.compile('(https://i\.imgur\.com/([a-z0-9]+))\.(jpg|png|jpeg|webp)(?!<\/(code|pre|a)>)', flags=re.I|re.A)

View File

@ -10,7 +10,7 @@ from .const import *
def process_audio(file):
name = f'/audio/{time.time()}'.replace('.','') + '.mp3'
name = f'/audio/{time.time()}'.replace('.','') + '.' + file.filename.split('.')[-1]
file.save(name)
if SITE_NAME == 'WPD' or os.stat(name).st_size > 8 * 1024 * 1024:
@ -28,7 +28,7 @@ def process_video(file):
os.system(f'ffmpeg -y -loglevel warning -i {name} -map_metadata -1 -c:v copy -c:a copy {name}.mp4')
os.remove(name)
name += '.mp4'
name += '.' + file.filename.split('.')[-1]
size = os.stat(name).st_size
if SITE_NAME == 'WPD' or os.stat(name).st_size > 8 * 1024 * 1024:

View File

@ -473,7 +473,7 @@ def static_service(path):
@app.get("/static/images/<path>")
@limiter.exempt
def images(path):
resp = make_response(send_from_directory('/images', path.replace('.WEBP','.webp')))
resp = make_response(send_from_directory('/images', path))
resp.headers.remove("Cache-Control")
resp.headers.add("Cache-Control", "public, max-age=3153600")
resp.headers.remove("Content-Type")
@ -483,21 +483,17 @@ def images(path):
@app.get('/videos/<path>')
@limiter.exempt
def videos(path):
resp = make_response(send_from_directory('/videos', path.replace('.MP4','.mp4')))
resp = make_response(send_from_directory('/videos', path))
resp.headers.remove("Cache-Control")
resp.headers.add("Cache-Control", "public, max-age=3153600")
resp.headers.remove("Content-Type")
resp.headers.add("Content-Type", "video/mp4")
return resp
@app.get('/audio/<path>')
@limiter.exempt
def audio(path):
resp = make_response(send_from_directory('/audio', path.replace('.mp3','.mp3')))
resp = make_response(send_from_directory('/audio', path))
resp.headers.remove("Cache-Control")
resp.headers.add("Cache-Control", "public, max-age=3153600")
resp.headers.remove("Content-Type")
resp.headers.add("Content-Type", "audio/mpeg")
return resp
@app.get("/robots.txt")

View File

@ -15,7 +15,7 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
{% if v.agendaposter %}
<style>
@ -40,7 +40,7 @@
{% endif %}
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
{% endif %}

View File

@ -14,7 +14,7 @@
<title>Chat</title>
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
{% if v.css %}
<link rel="stylesheet" href="/@{{v.username}}/css">

View File

@ -8,7 +8,7 @@
<script src="/assets/js/shortcut handler.js?v=2"></script>
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=58">
<link rel="stylesheet" href="/assets/css/awards.css?v=6">
{% if v.agendaposter %}
@ -34,7 +34,7 @@
{% endif %}
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
<link rel="stylesheet" href="/assets/css/awards.css?v=6">
{% endif %}

View File

@ -6,7 +6,7 @@
{% block content %}
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
{% if v.agendaposter %}
<style>
@ -31,7 +31,7 @@
{% endif %}
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
{% endif %}

View File

@ -18,7 +18,7 @@
{% endblock %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
</head>

View File

@ -14,7 +14,7 @@
<title>2-Step Login - {{SITE_NAME}}</title>
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
</head>

View File

@ -34,7 +34,7 @@
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
{% if v.agendaposter %}
<style>

View File

@ -39,11 +39,11 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
{% endif %}
</head>

View File

@ -31,7 +31,7 @@
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %}</title>
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
</head>

View File

@ -32,7 +32,7 @@
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title>
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
</head>

View File

@ -26,7 +26,7 @@
{% block stylesheets %}
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=49">
{% if v.agendaposter %}
<style>
@ -51,7 +51,7 @@
{% endif %}
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/main.css?v=273">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=49">
{% endif %}
{% endblock %}

View File

@ -2,11 +2,17 @@ update-locale LANG=en_US.utf8
cd /rDrama
cp ./env /env
. /env
apt update
apt -y update
apt -y upgrade
apt -y install git postgresql postgresql-contrib redis-server python3-pip libenchant1c2a ffmpeg tmux nginx snapd ufw
cp pg_hba.conf /etc/postgresql/12/main/pg_hba.conf
apt -y install git redis-server python3-pip libenchant1c2a ffmpeg tmux nginx snapd ufw
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt -y update
apt -y install postgresql-14
cp pg_hba.conf /etc/postgresql/14/main/pg_hba.conf
service postgresql restart
# psql -U postgres -f schema.sql postgres
# psql -U postgres -f seed-db.sql postgres
pip3 install -r requirements.txt