forked from rDrama/rDrama
1
0
Fork 0

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

master
Aevann1 2022-02-05 13:56:10 +00:00
commit 873ea585d6
26 changed files with 150 additions and 76 deletions

View File

@ -32,8 +32,7 @@ services:
- BOT_DISABLE=0
- DEFAULT_TIME_FILTER=all
- DEFAULT_THEME=midnight
- DEFAULT_COLOR=ff66ac #YOU HAVE TO PICK ONE OF THOSE COLORS OR SHIT WILL BREAK: ff66ac, 805ad5, 62ca56, 38a169, 80ffff, 2a96f3, eb4963, ff0000, f39731, 30409f, 3e98a7, e4432d, 7b9ae4, ec72de, 7f8fa6, f8db58
- SLOGAN=Dude bussy lmao
- DEFAULT_COLOR=ff66ac
- GUMROAD_TOKEN=3435tdfsdudebussylmaoxxt43
- GUMROAD_LINK=https://marsey1.gumroad.com/l/tfcvri
- GUMROAD_ID=tfcvri

35
env.sh 100644
View File

@ -0,0 +1,35 @@
export DATABASE_URL="postgresql://postgres@localhost:5432"
export MASTER_KEY="3435tdfsdudebussylmaoxxt43"
export DOMAIN="localhost"
export SITE_NAME="Drama"
export GIPHY_KEY="3435tdfsdudebussylmaoxxt43"
export DISCORD_SERVER_ID="3435tdfsdudebussylmaoxxt43"
export DISCORD_CLIENT_ID="3435tdfsdudebussylmaoxxt43"
export DISCORD_CLIENT_SECRET="3435tdfsdudebussylmaoxxt43"
export DISCORD_BOT_TOKEN="3435tdfsdudebussylmaoxxt43"
export HCAPTCHA_SECRET="3435tdfsdudebussylmaoxxt43"
export YOUTUBE_KEY="3435tdfsdudebussylmaoxxt43"
export PUSHER_ID="3435tdfsdudebussylmaoxxt43"
export PUSHER_KEY="3435tdfsdudebussylmaoxxt43"
export IMGUR_KEY="3435tdfsdudebussylmaoxxt43"
export SPAM_SIMILARITY_THRESHOLD="0.5"
export SPAM_URL_SIMILARITY_THRESHOLD="0.1"
export SPAM_SIMILAR_COUNT_THRESHOLD="10"
export COMMENT_SPAM_SIMILAR_THRESHOLD="0.5"
export COMMENT_SPAM_COUNT_THRESHOLD="10"
export READ_ONLY="0"
export BOT_DISABLE="0"
export DEFAULT_TIME_FILTER="all"
export GUMROAD_TOKEN="3435tdfsdudebussylmaoxxt43"
export GUMROAD_LINK="https://marsey1.gumroad.com/l/tfcvri"
export GUMROAD_ID="tfcvri"
export CARD_VIEW="1"
export DISABLE_DOWNVOTES="0"
export DUES="0"
export DEFAULT_THEME="midnight"
export DEFAULT_COLOR="ff66ac"
export MAIL_USERNAME="blahblahblah@gmail.com"
export MAIL_PASSWORD="3435tdfsdudebussylmaoxxt43"
export DESCRIPTION="rdrama.net caters to drama in all forms such as: Real life, videos, photos, gossip, rumors, news sites, Reddit, and Beyond™. There isn't drama we won't touch, and we want it all!"
export CF_KEY="3435tdfsdudebussylmaoxxt43"
export CF_ZONE="3435tdfsdudebussylmaoxxt43"

View File

@ -1,6 +1,6 @@
import gevent.monkey
gevent.monkey.patch_all()
from os import environ
from os import environ, path
import secrets
from flask import *
from flask_caching import Cache
@ -17,6 +17,10 @@ from sys import stdout
import faulthandler
from json import loads
f = 'files/templates/sidebar_' + environ.get("SITE_NAME").strip() + '.html'
if not path.exists(f):
with open(f, 'w'): pass
app = Flask(__name__, template_folder='templates')
app.url_map.strict_slashes = False
app.jinja_env.cache = {}
@ -36,7 +40,6 @@ app.config['MAX_CONTENT_LENGTH'] = 8 * 1024 * 1024
app.config["SESSION_COOKIE_SECURE"] = True
app.config["SESSION_COOKIE_SAMESITE"] = "Lax"
app.config["PERMANENT_SESSION_LIFETIME"] = 60 * 60 * 24 * 365
app.config["SLOGAN"] = environ.get("SLOGAN", "").strip()
app.config["DEFAULT_COLOR"] = environ.get("DEFAULT_COLOR", "ff0000").strip()
app.config["DEFAULT_THEME"] = environ.get("DEFAULT_THEME", "midnight").strip()
app.config["FORCE_HTTPS"] = 1

View File

@ -169,10 +169,16 @@ class Comment(Base):
years = int(months / 12)
return f"{years}yr ago"
@property
@lazy
def score(self):
return self.upvotes - self.downvotes
if SITE_NAME == 'Too4You':
@property
@lazy
def score(self):
return self.upvotes
else:
@property
@lazy
def score(self):
return self.upvotes - self.downvotes
@property
@lazy

View File

@ -180,10 +180,16 @@ class Submission(Base):
return str(time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(self.edited_utc)))
@property
@lazy
def score(self):
return self.upvotes - self.downvotes
if SITE_NAME == 'Too4You':
@property
@lazy
def score(self):
return self.upvotes
else:
@property
@lazy
def score(self):
return self.upvotes - self.downvotes
@property
@lazy

View File

@ -19,7 +19,6 @@ import random
from os import environ, remove, path
defaulttheme = environ.get("DEFAULT_THEME", "midnight").strip()
defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip()
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip()
cardview = bool(int(environ.get("CARD_VIEW", 1)))
@ -33,13 +32,13 @@ class User(Base):
id = Column(Integer, primary_key=True)
username = Column(String)
namecolor = Column(String, default=defaultcolor)
namecolor = Column(String, default=DEFAULT_COLOR)
background = Column(String)
customtitle = Column(String)
customtitleplain = deferred(Column(String))
titlecolor = Column(String, default=defaultcolor)
titlecolor = Column(String, default=DEFAULT_COLOR)
theme = Column(String, default=defaulttheme)
themecolor = Column(String, default=defaultcolor)
themecolor = Column(String, default=DEFAULT_COLOR)
cardview = Column(Boolean, default=cardview)
song = Column(String)
highres = Column(String)
@ -431,7 +430,7 @@ class User(Base):
@lazy
def banner_url(self):
if self.bannerurl: return self.bannerurl
else: return f"{SITE_FULL}/static/assets/images/{SITE_NAME}/site_preview.webp?a=1008"
else: return f"{SITE_FULL}/static/assets/images/{SITE_NAME}/site_preview.webp?a=1009"
@property
@lazy

View File

@ -229,6 +229,8 @@ else:
PUSHER_ID = environ.get("PUSHER_ID", "").strip()
PUSHER_KEY = environ.get("PUSHER_KEY", "").strip()
DEFAULT_COLOR = environ.get("DEFAULT_COLOR", "fff").strip()
COLORS = {'ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58', DEFAULT_COLOR}
AWARDS = {
"snow": {
@ -564,5 +566,5 @@ FORTUNE_REPLIES = ('<b style="color:#6023f8">Your fortune: Allah Wills It</b>','
no_pass_phrase = """<p>Sorry whiteboy, we're gonna need to see some ID before you start throwin that word around like it's nothing.\n\nTake a 10 minute time-out and come back when you've learned your lesson and/or paid reparations (by purchasing a BIPOC Approved™ Rdrama NWord Pass© from the <a href="/shop">shop</a>) \n\n<em>This is an automated message; if you need help, you can message us <a href="/contact">here</a>.</em></p>"""
if SITE == 'rdrama.net': subs = ('2balkan4u','2middleeast4u')
if SITE == 'rdrama.net': subs = ('2balkan4you','2middleeast4you')
else: subs = ()

View File

@ -16,4 +16,4 @@ def post_embed(id, v):
@app.context_processor
def inject_constants():
return {"environ":environ, "SITE_NAME":SITE_NAME, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "config":app.config.get}
return {"environ":environ, "SITE_NAME":SITE_NAME, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "config":app.config.get, "DEFAULT_COLOR":DEFAULT_COLOR, "COLORS":COLORS}

View File

@ -72,10 +72,10 @@ def notifications(v):
Comment.is_banned == False,
Comment.deleted_utc == 0,
Comment.author_id != AUTOJANNY_ID,
).order_by(Notification.id.desc()).offset(25 * (page - 1)).limit(26).all()
).order_by(Notification.id.desc()).offset(50 * (page - 1)).limit(51).all()
next_exists = (len(notifications) > 25)
notifications = notifications[:25]
next_exists = (len(notifications) > 50)
notifications = notifications[:50]
cids = [x.comment_id for x in notifications]
comments = get_comments(cids, v=v, load_parent=True)

View File

@ -7,8 +7,6 @@ from files.__main__ import app, limiter, cache
from sqlalchemy.orm import joinedload
from os import environ
defaultcolor = environ.get("DEFAULT_COLOR").strip()
@app.get("/votes")
@limiter.limit("5/second;60/minute;200/hour;1000/day")
@auth_required
@ -104,7 +102,7 @@ def api_vote_post(post_id, new, v):
post.author.coins += 1
post.author.truecoins += 1
g.db.add(post.author)
real = new == -1 or (not v.agendaposter and not v.shadowbanned and (bool(v.profileurl) or bool(v.customtitle) or v.namecolor != defaultcolor))
real = new == -1 or (not v.agendaposter and not v.shadowbanned and (bool(v.profileurl) or bool(v.customtitle) or v.namecolor != DEFAULT_COLOR))
vote = Vote(user_id=v.id,
vote_type=new,
submission_id=post_id,
@ -167,7 +165,7 @@ def api_vote_comment(comment_id, new, v):
comment.author.coins += 1
comment.author.truecoins += 1
g.db.add(comment.author)
real = new == -1 or (not v.agendaposter and not v.shadowbanned and (bool(v.profileurl) or bool(v.customtitle) or v.namecolor != defaultcolor))
real = new == -1 or (not v.agendaposter and not v.shadowbanned and (bool(v.profileurl) or bool(v.customtitle) or v.namecolor != DEFAULT_COLOR))
vote = CommentVote(user_id=v.id,
vote_type=new,
comment_id=comment_id,

View File

@ -15,7 +15,7 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?a=107"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
{% if v.agendaposter %}
<style>
html {
@ -39,7 +39,7 @@
{% endif %}
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?a=107"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
{% endif %}
</head>

View File

@ -7,7 +7,7 @@
<script src="/static/assets/js/bootstrap.js?a=240"></script>
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?a=107">
<link rel="stylesheet" href="/static/assets/css/main.css?a=108">
<link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
{% if v.agendaposter %}
<style>
@ -32,13 +32,13 @@
{% endif %}
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?a=107"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
{% endif %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="thumbnail" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1008">
<meta name="thumbnail" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009">
<link rel="icon" type="image/png" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009">
{% block title %}
@ -47,9 +47,9 @@
<meta property="og:type" content="article" >
<meta property="og:title" content="{{SITE_NAME}}" >
<meta property="og:site_name" content="{{request.host}}" >
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1008" >
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
<meta property="og:url" content="{{SITE_FULL}}{{request.full_path}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('SLOGAN')}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}">
<meta property="og:author" name="author" content="@{{SITE_FULL}}/" >
<meta property="og:site_name" content="{{request.host}}" >
@ -57,8 +57,8 @@
<meta name="twitter:site" content="@{{SITE_FULL}}/">
<meta name="twitter:title" content="{{SITE_NAME}}" >
<meta name="twitter:creator" content="@{{SITE_FULL}}/">
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('SLOGAN')}}" >
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1008" >
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}" >
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
<meta name="twitter:url" content="{{SITE_FULL}}{{request.full_path}}" >
{% endblock %}
@ -231,7 +231,7 @@
{% else %}
<a href="/login">
<img class="banner" alt="site banner" src="/static/assets/images/{{SITE_NAME}}/cached.webp?a=1008" width="100%">
<img class="banner" alt="site banner" src="/static/assets/images/{{SITE_NAME}}/cached.webp?a=1009" width="100%">
</a>
{% endif %}
{% endif %}

View File

@ -86,7 +86,7 @@
</div>
</div>
<script data-cfasync="false" src="/static/assets/js/emoji_modal.js?a=240"></script>
<script data-cfasync="false" src="/static/assets/js/emoji_modal.js?a=241"></script>
<style>
a.emojitab {

View File

@ -1,21 +1,29 @@
<nav class="shadow shadow-md fixed-top">
{% if SITE_NAME == 'Drama' %}
<style>
body {padding-top: 90px !important}
</style>
<div id="srd" style="width: 100%; background-color: var(--primary); padding: 2px; text-align: center; font-weight: bold;white-space:nowrap">
<a style="color: white" class="text-small-mobile" href="https://reddit.com/r/SubredditDrama">💖🌈 welcome to rdrama.net: the official site for r/subredditdrama</a>
</div>
{% else %}
<style>
body {padding-top: 65px !important}
</style>
{% endif %}
<div class="navbar navbar-expand-md navbar-light" id="navbar">
<div class="container-fluid" style="padding:0;">
<div class="flex-grow-1">
<a href="/" class="navbar-brand mr-auto">
{% if True %}
{% if request.host == 'rdrama.net' %}
{% set icon = ('marseyblm','marseykween','marseydynamite','marseyblack','marseymyeisha','marseyetika','marseyobama','marseyblackcop','marseysosa','marseyblackface')|random() %}
<img alt="header icon" height=35 src="/static/assets/images/emojis/{{icon}}.webp?a=1008">
{% else %}
<img alt="header icon" width=32.32 height=25 src="/static/assets/images/{{SITE_NAME}}/headericon.webp?a=1009" style="object-fit: contain;">
{% endif %}
{% if request.host != 'pcmemes.net' %}
<img alt="logo" src="/static/assets/images/{{SITE_NAME}}/logo.webp?a=1008" height=20 width=77>
<img alt="logo" src="/static/assets/images/{{SITE_NAME}}/logo.webp?a=1010" height=20 width=77>
{% endif %}
</a>
</div>

View File

@ -6,7 +6,7 @@
{% block content %}
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?a=107"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
{% if v.agendaposter %}
<style>
html {
@ -30,7 +30,7 @@
{% endif %}
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?a=107"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
{% endif %}
<div class="row justify-content-around">

View File

@ -18,7 +18,7 @@
{% endblock %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?a=107">
<link rel="stylesheet" href="/static/assets/css/main.css?a=108">
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
</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="/static/assets/css/main.css?a=107"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
</head>

View File

@ -18,9 +18,9 @@
<meta property="og:type" content="article" >
<meta property="og:title" content="{{SITE_NAME}}" >
<meta property="og:site_name" content="{{request.host}}" >
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1008" >
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
<meta property="og:url" content="{{request.host}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('SLOGAN')}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}">
<meta property="og:author" name="author" content="@{{SITE_FULL}}/" >
<meta property="og:site_name" content="{{request.host}}" >
@ -28,13 +28,13 @@
<meta name="twitter:site" content="@{{SITE_FULL}}/">
<meta name="twitter:title" content="{{SITE_NAME}}" >
<meta name="twitter:creator" content="@{{SITE_FULL}}/">
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('SLOGAN')}}" >
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1008" >
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}" >
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
<meta name="twitter:url" content="{{request.host}}" >
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?a=107"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
{% if v.agendaposter %}
<style>
html {

View File

@ -12,15 +12,15 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="">
<meta name="thumbnail" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1008">
<meta name="thumbnail" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009">
<link rel="icon" type="image/png" href="/static/assets/images/{{SITE_NAME}}/icon.webp?a=1009">
<meta property="og:type" content="article" >
<meta property="og:title" content="{{SITE_NAME}}" >
<meta property="og:site_name" content="{{request.host}}" >
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1008" >
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
<meta property="og:url" content="{{SITE_FULL}}{{request.full_path}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('SLOGAN')}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}">
<meta property="og:author" name="author" content="{{SITE_FULL}}/" >
<meta property="og:site_name" content="{{request.host}}" >
@ -28,8 +28,8 @@
<meta name="twitter:site" content="{{SITE_FULL}}/">
<meta name="twitter:title" content="{{SITE_NAME}}" >
<meta name="twitter:creator" content="{{SITE_FULL}}/">
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('SLOGAN')}}" >
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1008" >
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}" >
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
<meta name="twitter:url" content="{{SITE_FULL}}{{request.full_path}}" >
@ -39,10 +39,10 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?a=107"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?a=107"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
{% endif %}
</head>

View File

@ -112,7 +112,7 @@
<form action="/settings/themecolor" id="themecolor-form" method="post" class="color-picker" style="line-height: 0">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
{% for themecolor in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58'] %}
{% for themecolor in COLORS %}
<input autocomplete="off" type="radio" name="themecolor" id="themecolor-{{themecolor}}" value="{{themecolor}}" {% if v.themecolor == themecolor %}checked{% endif %} onclick="document.getElementById('themecolor-form').submit()">
<label class="color-radio" for="themecolor-{{themecolor}}">
<span style="background-color: #{{themecolor}}">
@ -392,7 +392,7 @@
<form action="/settings/namecolor" id="color-form" method="post" class="color-picker" style="line-height: 0">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
{% for color in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58'] %}
{% for color in COLORS %}
<input autocomplete="off" type="radio" name="color" id="color-{{color}}" value="{{color}}" {% if v.namecolor == color %}checked{% endif %} onclick="document.getElementById('color-form').submit()">
<label class="color-radio" for="color-{{color}}">
<span style="background-color: #{{color}}">
@ -448,7 +448,7 @@
<form action="/settings/titlecolor" id="titlecolor-form" method="post" class="color-picker" style="line-height: 0">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
{% for titlecolor in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58'] %}
{% for titlecolor in COLORS %}
<input autocomplete="off" type="radio" name="titlecolor" id="titlecolor-{{titlecolor}}" value="{{titlecolor}}" {% if v.titlecolor == titlecolor %}checked{% endif %} onclick="document.getElementById('titlecolor-form').submit()">
<label class="color-radio" for="titlecolor-{{titlecolor}}">
<span style="background-color: #{{titlecolor}}">
@ -493,7 +493,7 @@
<form action="/settings/verifiedcolor" id="verifiedcolor-form" method="post" class="color-picker" style="line-height: 0">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
{% for verifiedcolor in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58'] %}
{% for verifiedcolor in COLORS %}
<input autocomplete="off" type="radio" name="verifiedcolor" id="verifiedcolor-{{verifiedcolor}}" value="{{verifiedcolor}}" {% if v.verifiedcolor == verifiedcolor %}checked{% endif %} onclick="document.getElementById('verifiedcolor-form').submit()">
<label class="color-radio" for="verifiedcolor-{{verifiedcolor}}">
<span style="background-color: #{{verifiedcolor}}">

View File

@ -14,9 +14,9 @@
<meta property="og:type" content="article" >
<meta property="og:title" content="{{SITE_NAME}}" >
<meta property="og:site_name" content="{{request.host}}" >
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1008" >
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
<meta property="og:url" content="{{request.host}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('SLOGAN')}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}">
<meta property="og:author" name="author" content="{{SITE_FULL}}/" >
<meta property="og:site_name" content="{{request.host}}" >
@ -24,14 +24,14 @@
<meta name="twitter:site" content="{{SITE_FULL}}/">
<meta name="twitter:title" content="{{SITE_NAME}}" >
<meta name="twitter:creator" content="{{SITE_FULL}}/">
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('SLOGAN')}}" >
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1008" >
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}" >
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
<meta name="twitter:url" content="{{request.host}}" >
<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="/static/assets/css/main.css?a=107"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
</head>

View File

@ -15,9 +15,9 @@
<meta property="og:type" content="article" >
<meta property="og:title" content="{{SITE_NAME}}" >
<meta property="og:site_name" content="{{request.host}}" >
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1008" >
<meta property="og:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
<meta property="og:url" content="{{request.host}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('SLOGAN')}}">
<meta property="og:description" name="description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}">
<meta property="og:author" name="author" content="{{SITE_FULL}}/" >
<meta property="og:site_name" content="{{request.host}}" >
@ -25,14 +25,14 @@
<meta name="twitter:site" content="{{SITE_FULL}}/">
<meta name="twitter:title" content="{{SITE_NAME}}" >
<meta name="twitter:creator" content="{{SITE_FULL}}/">
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('SLOGAN')}}" >
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1008" >
<meta name="twitter:description" content="{{SITE_NAME}} - {{config('DESCRIPTION')}}" >
<meta name="twitter:image" content="/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009" >
<meta name="twitter:url" content="{{request.host}}" >
<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="/static/assets/css/main.css?a=107"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
<link rel="stylesheet" href="/static/assets/css/main.css?a=108"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
</head>

View File

@ -221,7 +221,7 @@
<meta property="og:description" name="description" content="{{comment_info.plainbody(v)}}" >
<meta property="og:author" name="author" content="{{'@'+comment_info.author_name}}" >
<meta property="og:title" content="{{'@'+comment_info.author_name}} comments on {{p.plaintitle(v)}} - {{SITE_NAME}}" >
<meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp{% endif %}" >
<meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009{% endif %}" >
{% if p.is_video %}
<meta property="og:video" content="{{p.realurl(v)}}" >
{% endif %}
@ -233,7 +233,7 @@
<meta name="twitter:title" content="{{'@'+comment_info.author_name}} comments on {{p.plaintitle(v)}} - {{SITE_NAME}}" >
<meta name="twitter:creator" content="{{'@'+comment_info.author_name}}">
<meta name="twitter:description" content="{{comment_info.plainbody(v)}}" >
<meta name="twitter:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp{% endif %}" >
<meta name="twitter:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009{% endif %}" >
<meta name="twitter:url" content="{{p.permalink}}" >
{% else %}
@ -246,7 +246,7 @@
<meta property="og:description" name="description" content="{{p.plainbody(v)}}" >
{% if p.author %}<meta property="og:author" name="author" content="{{'@'+p.author_name}}" >{% endif %}
<meta property="og:title" content="{{p.plaintitle(v)}} - {{SITE_NAME}}" >
<meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp{% endif %}" >
<meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009{% endif %}" >
{% if p.url and p.is_video %}
<meta property="og:video" content="{{p.realurl(v)}}" >
{% endif %}
@ -258,7 +258,7 @@
<meta name="twitter:title" content="{{p.plaintitle(v)}} - {{SITE_NAME}}" >
{% if p.author %}<meta name="twitter:creator" content="{{'@'+p.author_name}}">{% endif %}
<meta name="twitter:description" content="{{p.plainbody(v)}}" >
<meta name="twitter:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb %}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp{% endif %}" >
<meta name="twitter:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb %}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/site_preview.webp?a=1009{% endif %}" >
<meta name="twitter:url" content="{{p.permalink}}" >
{% endif %}

View File

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

View File

@ -24,4 +24,4 @@ docker-compose up
3- That's it! Visit `localhost` in your browser.
4- Optional: to change the domain from "localhost" to something else and configure the site settings, as well as integrate it with the external services the website uses, please edit the variables in the docker-compose.yml file and then restart the docker container from inside the docker app.
4- Optional: to change the domain from "localhost" to something else and configure the site settings, as well as integrate it with the external services the website uses, please edit the variables in the `env` file and then restart the docker container.

18
ubuntu_setup 100644
View File

@ -0,0 +1,18 @@
cd /Drama
sudo apt update
sudo apt -y upgrade
sudo apt -y install postgresql postgresql-contrib
sudo apt -y install redis-server
cp pg_hba.conf /etc/postgresql/12/main/pg_hba.conf
sudo service postgresql restart
sudo psql -U postgres -f schema.sql postgres
sudo psql -U postgres -f seed-db.sql postgres
sudo apt -y install python3-pip
sudo pip3 install -r requirements.txt
sudo apt -y install gunicorn
sudo apt -y install ffmpeg
mkdir /songs
mkdir /images
cp ./env /env
. /env
sudo -E gunicorn files.__main__:app -k gevent -w 2 --reload -b 0.0.0.0:80:80 --max-requests 1000 --max-requests-jitter 500