forked from MarseyWorld/MarseyWorld
Merge branch 'master' into mistletoe
commit
6ab5d0eeff
|
@ -10,7 +10,7 @@ services:
|
|||
- DATABASE_URL=postgresql://postgres@postgres:5432
|
||||
- MASTER_KEY=XuxGqp5NyygJrM24b5gt3YgyvFVGdQnwVDwLzLwpu3eQwY
|
||||
- REDIS_URL=redis://redis
|
||||
- DOMAIN=127.0.0.1
|
||||
- DOMAIN=0.0.0.0
|
||||
- SITE_NAME=Drama
|
||||
- GIPHY_KEY=3435tdfsdudebussylmaoxxt43
|
||||
- FORCE_HTTPS=0
|
||||
|
|
4
env
4
env
|
@ -1,6 +1,6 @@
|
|||
export DATABASE_URL="postgresql://postgres@127.0.0.1:5432"
|
||||
export DATABASE_URL="postgresql://postgres@0.0.0.0:5432"
|
||||
export MASTER_KEY="XuxGqp5NyygJrM24b5gt3YgyvFVGdQnwVDwLzLwpu3eQwY"
|
||||
export DOMAIN="127.0.0.1"
|
||||
export DOMAIN="0.0.0.0"
|
||||
export SITE_NAME="Drama"
|
||||
export GIPHY_KEY="3435tdfsdudebussylmaoxxt43"
|
||||
export FORCE_HTTPS="0"
|
||||
|
|
|
@ -43,7 +43,7 @@ app.config["SESSION_REFRESH_EACH_REQUEST"] = True
|
|||
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"] = int(environ.get("FORCE_HTTPS", 1)) if ("127.0.0.1" not in app.config["SERVER_NAME"] and "127.0.0.1" not in app.config["SERVER_NAME"]) else 0
|
||||
app.config["FORCE_HTTPS"] = int(environ.get("FORCE_HTTPS", 1)) if ("0.0.0.0" not in app.config["SERVER_NAME"] and "0.0.0.0" not in app.config["SERVER_NAME"]) else 0
|
||||
app.config["UserAgent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36"
|
||||
app.config["HCAPTCHA_SITEKEY"] = environ.get("HCAPTCHA_SITEKEY","").strip()
|
||||
app.config["HCAPTCHA_SECRET"] = environ.get("HCAPTCHA_SECRET","").strip()
|
||||
|
@ -62,14 +62,14 @@ app.config["RATELIMIT_DEFAULTS_EXEMPT_WHEN"]=lambda:False
|
|||
app.config["RATELIMIT_HEADERS_ENABLED"]=True
|
||||
app.config["CACHE_TYPE"] = "filesystem"
|
||||
app.config["CACHE_DIR"] = "cache"
|
||||
app.config["RATELIMIT_STORAGE_URL"] = environ.get("REDIS_URL", "redis://127.0.0.1")
|
||||
app.config["RATELIMIT_STORAGE_URL"] = environ.get("REDIS_URL", "redis://0.0.0.0")
|
||||
app.config['MAIL_SERVER'] = 'smtp.gmail.com'
|
||||
app.config['MAIL_PORT'] = 587
|
||||
app.config['MAIL_USE_TLS'] = True
|
||||
app.config['MAIL_USERNAME'] = environ.get("MAIL_USERNAME", "").strip()
|
||||
app.config['MAIL_PASSWORD'] = environ.get("MAIL_PASSWORD", "").strip()
|
||||
|
||||
r=redis.Redis(host=environ.get("REDIS_URL", "redis://127.0.0.1"), decode_responses=True, ssl_cert_reqs=None)
|
||||
r=redis.Redis(host=environ.get("REDIS_URL", "redis://0.0.0.0"), decode_responses=True, ssl_cert_reqs=None)
|
||||
|
||||
limiter = Limiter(
|
||||
app,
|
||||
|
@ -111,7 +111,7 @@ def before_request():
|
|||
session.permanent = True
|
||||
if not session.get("session_id"): session["session_id"] = secrets.token_hex(16)
|
||||
|
||||
if app.config["FORCE_HTTPS"] and request.url.startswith("http://") and "127.0.0.1" not in app.config["SERVER_NAME"]:
|
||||
if app.config["FORCE_HTTPS"] and request.url.startswith("http://") and "0.0.0.0" not in app.config["SERVER_NAME"]:
|
||||
url = request.url.replace("http://", "https://", 1)
|
||||
return redirect(url, code=301)
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ class Badge(Base):
|
|||
badge_id = Column(Integer)
|
||||
description = Column(String)
|
||||
url = Column(String)
|
||||
user = relationship("User", viewonly=True)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Badge(user_id={self.user_id}, badge_id={self.badge_id})>"
|
||||
|
|
|
@ -92,7 +92,9 @@ class ModAction(Base):
|
|||
@lazy
|
||||
def target_link(self):
|
||||
if self.target_user: return f'<a href="{self.target_user.url}">{self.target_user.username}</a>'
|
||||
elif self.target_post: return f'<a href="{self.target_post.permalink}">{self.target_post.title.replace("<","").replace(">","")}</a>'
|
||||
elif self.target_post:
|
||||
if self.target_post.club: return f'<a href="{self.target_post.permalink}">{cc.upper()} ONLY</a>'
|
||||
return f'<a href="{self.target_post.permalink}">{self.target_post.title.replace("<","").replace(">","")}</a>'
|
||||
elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}">comment</a>'
|
||||
|
||||
@property
|
||||
|
|
|
@ -180,7 +180,7 @@ PUSHER_INSTANCE_ID = '02ddcc80-b8db-42be-9022-44c546b4dce6'
|
|||
PUSHER_KEY = environ.get("PUSHER_KEY", "").strip()
|
||||
|
||||
single_words = "|".join([slur.lower() for slur in SLURS.keys()])
|
||||
SLUR_REGEX = re.compile(rf"(?i)(?<=\s|>)({single_words})(?=[\s<,.]|s[\s<,.])")
|
||||
SLUR_REGEX = re.compile(rf"(?i)((?<=\s|>)|^)(nigger)((?=[\s<,.]|s[\s<,.])|$)")
|
||||
|
||||
def sub_matcher(match: re.Match) -> str:
|
||||
return SLURS[match.group(0).lower()]
|
||||
|
@ -749,3 +749,6 @@ TROLLTITLES = [
|
|||
"Pretty sure this is @{username}'s Reddit account",
|
||||
"Hey jannies can you please ban @{username}",
|
||||
]
|
||||
|
||||
BUG_THREAD = 18459
|
||||
EMOJI_THREAD = 22479
|
|
@ -819,7 +819,7 @@ def ban_user(user_id, v):
|
|||
post = get_post(post)
|
||||
post.bannedfor = True
|
||||
g.db.add(post)
|
||||
elif reason.startswith("/comment/"):
|
||||
elif reason.startswith("/comment/"):
|
||||
comment = int(reason.split("/comment/")[1].split(None, 1)[0])
|
||||
comment = get_comment(comment)
|
||||
comment.bannedfor = True
|
||||
|
|
|
@ -195,7 +195,7 @@ def api_comment(v):
|
|||
|
||||
body += f"\n\n![]({url})"
|
||||
|
||||
if v.agendaposter:
|
||||
if v.agendaposter and not v.marseyawarded:
|
||||
for k, l in AJ_REPLACEMENTS.items(): body = body.replace(k, l)
|
||||
body = body.replace('I ', f'@{v.username} ')
|
||||
body = censor_slurs2(body).upper().replace(' ME ', f' @{v.username} ')
|
||||
|
@ -649,7 +649,7 @@ def edit_comment(cid, v):
|
|||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE):
|
||||
if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})')
|
||||
|
||||
if v.agendaposter:
|
||||
if v.agendaposter and not v.marseyawarded:
|
||||
for k, l in AJ_REPLACEMENTS.items(): body = body.replace(k, l)
|
||||
body = body.replace('I ', f'@{v.username} ')
|
||||
body = censor_slurs2(body).upper().replace(' ME ', f' @{v.username} ')
|
||||
|
|
|
@ -65,8 +65,10 @@ def publish(pid, v):
|
|||
user = g.db.query(User).filter_by(username=username).first()
|
||||
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
||||
|
||||
if request.host == 'rdrama.net':
|
||||
if request.host in ['rdrama.net','pcmemes.net']:
|
||||
if ('aevan' in f'{post.body_html}{post.title}'.lower() or 'avean' in f'{post.body_html}{post.title}'.lower()) and 1 not in notify_users: notify_users.add(1)
|
||||
|
||||
if request.host == 'rdrama.net':
|
||||
if ('joan' in f'{post.body_html}{post.title}'.lower() or 'pewkie' in f'{post.body_html}{post.title}'.lower()) and 28 not in notify_users: notify_users.add(28)
|
||||
if 'carp' in f'{post.body_html}{post.title}'.lower() and 995 not in notify_users:
|
||||
notify_users.add(995)
|
||||
|
@ -112,9 +114,11 @@ def post_id(pid, anything=None, v=None):
|
|||
try: pid = int(pid)
|
||||
except Exception as e: pass
|
||||
|
||||
if v: defaultsortingcomments = v.defaultsortingcomments
|
||||
if request.host == 'rdrama.net' and pid in [BUG_THREAD, EMOJI_THREAD]: defaultsortingcomments = 'new'
|
||||
elif v: defaultsortingcomments = v.defaultsortingcomments
|
||||
else: defaultsortingcomments = "top"
|
||||
sort=request.values.get("sort", defaultsortingcomments)
|
||||
|
||||
sort = request.values.get("sort", defaultsortingcomments)
|
||||
|
||||
try: pid = int(pid)
|
||||
except:
|
||||
|
@ -125,6 +129,7 @@ def post_id(pid, anything=None, v=None):
|
|||
|
||||
if post.club and not (v and v.paid_dues) or post.private and not (v and (v.id == post.author_id or v.admin_level > 1)): abort(403)
|
||||
|
||||
|
||||
if v:
|
||||
votes = g.db.query(CommentVote).filter_by(user_id=v.id).subquery()
|
||||
|
||||
|
@ -196,6 +201,8 @@ def post_id(pid, anything=None, v=None):
|
|||
|
||||
post.replies = comments.filter(Comment.is_pinned != None).all() + comments.filter(Comment.level == 1, Comment.is_pinned == None).all()
|
||||
|
||||
if request.host == 'rdrama.net' and pid in [BUG_THREAD, EMOJI_THREAD] and not request.values.get("sort"): post.replies = post.replies[:10]
|
||||
|
||||
post.views += 1
|
||||
g.db.add(post)
|
||||
if isinstance(session.get('over_18', 0), dict): session["over_18"] = 0
|
||||
|
@ -249,7 +256,7 @@ def edit_post(pid, v):
|
|||
elif len(body) > 140: return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
if title != p.title:
|
||||
if v.agendaposter:
|
||||
if v.agendaposter and not v.marseyawarded:
|
||||
for k, l in AJ_REPLACEMENTS.items(): title = title.replace(k, l)
|
||||
title = title.replace('I ', f'@{v.username} ')
|
||||
title = censor_slurs2(title).upper().replace(' ME ', f' @{v.username} ')
|
||||
|
@ -263,7 +270,7 @@ def edit_post(pid, v):
|
|||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE):
|
||||
if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})')
|
||||
|
||||
if v.agendaposter:
|
||||
if v.agendaposter and not v.marseyawarded:
|
||||
for k, l in AJ_REPLACEMENTS.items(): body = body.replace(k, l)
|
||||
body = body.replace('I ', f'@{v.username} ')
|
||||
body = censor_slurs2(body).upper().replace(' ME ', f' @{v.username} ')
|
||||
|
@ -363,8 +370,10 @@ def edit_post(pid, v):
|
|||
|
||||
message = f"@{v.username} has mentioned you: http://{site}{p.permalink}"
|
||||
|
||||
if request.host == 'rdrama.net':
|
||||
if request.host in ['rdrama.net','pcmemes.net']:
|
||||
if ('aevan' in f'{body_html}{title}'.lower() or 'avean' in f'{body_html}{title}'.lower()) and 1 not in notify_users: notify_users.add(1)
|
||||
|
||||
if request.host == 'rdrama.net':
|
||||
if ('joan' in f'{body_html}{title}'.lower() or 'pewkie' in f'{body_html}{title}'.lower()) and 28 not in notify_users: notify_users.add(28)
|
||||
if 'carp' in f'{body_html}{title}'.lower() and 995 not in notify_users:
|
||||
notify_users.add(995)
|
||||
|
@ -546,7 +555,7 @@ def submit_post(v):
|
|||
title = request.values.get("title", "").strip()
|
||||
url = request.values.get("url", "").strip()
|
||||
|
||||
if v.agendaposter:
|
||||
if v.agendaposter and not v.marseyawarded:
|
||||
for k, l in AJ_REPLACEMENTS.items(): title = title.replace(k, l)
|
||||
title = title.replace('I ', f'@{v.username} ')
|
||||
title = censor_slurs2(title).upper().replace(' ME ', f' @{v.username} ')
|
||||
|
@ -730,7 +739,7 @@ def submit_post(v):
|
|||
options.append(i.group(1))
|
||||
body = body.replace(i.group(0), "")
|
||||
|
||||
if v.agendaposter:
|
||||
if v.agendaposter and not v.marseyawarded:
|
||||
for k, l in AJ_REPLACEMENTS.items(): body = body.replace(k, l)
|
||||
body = body.replace('I ', f'@{v.username} ')
|
||||
body = censor_slurs2(body).upper().replace(' ME ', f' @{v.username} ')
|
||||
|
@ -843,8 +852,10 @@ def submit_post(v):
|
|||
user = g.db.query(User).filter_by(username=username).first()
|
||||
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
|
||||
|
||||
if request.host == 'rdrama.net':
|
||||
if request.host in ['rdrama.net','pcmemes.net']:
|
||||
if ('aevan' in f'{body_html}{title}'.lower() or 'avean' in f'{body_html}{title}'.lower()) and 1 not in notify_users: notify_users.add(1)
|
||||
|
||||
if request.host == 'rdrama.net':
|
||||
if ('joan' in f'{body_html}{title}'.lower() or 'pewkie' in f'{body_html}{title}'.lower()) and 28 not in notify_users: notify_users.add(28)
|
||||
if 'carp' in f'{body_html}{title}'.lower() and 995 not in notify_users:
|
||||
notify_users.add(995)
|
||||
|
|
|
@ -308,6 +308,7 @@ def unsubscribe(v, post_id):
|
|||
@app.get("/report_bugs")
|
||||
@auth_required
|
||||
def reportbugs(v):
|
||||
if request.host == 'rdrama.net': return redirect('https://rdrama.net/post/18459')
|
||||
return render_template("reportbugs.html", v=v)
|
||||
|
||||
@app.post("/@<username>/message")
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<tr>
|
||||
<td><i class="{{a['icon']}} {{a['color']}}" style="font-size: 30px"></i></td>
|
||||
<td style="font-weight: bold">{{a['title']}}</td>
|
||||
<td><input type="number" class="form-control" name="{{a['kind']}}" value="0" max="10" placeholder="Enter amount..." ></td>
|
||||
<td><input type="number" class="form-control" name="{{a['kind']}}" value="0" min="0" max="10" placeholder="Enter amount..." ></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<p>In the <a href="/settings/apps">apps tab of Drama settings</a>, fill in and submit the form to request an access token. You will need:</p>
|
||||
<ul>
|
||||
<li>an application name</li>
|
||||
<li>a Redirect URI. May not use HTTP unless using 127.0.0.1 (use HTTPS instead).</li>
|
||||
<li>a Redirect URI. May not use HTTP unless using 0.0.0.0 (use HTTPS instead).</li>
|
||||
<li>a brief description of what your bot is intended to do</li>
|
||||
</ul>
|
||||
<p>Don't worry too much about accuracy; you will be able to change all of these later.</p>
|
||||
|
@ -54,7 +54,7 @@
|
|||
<p>In the <a href="/settings/apps">apps tab of Drama settings</a>, fill in and submit the form to request new API keys. You will need:</p>
|
||||
<ul>
|
||||
<li>an application name</li>
|
||||
<li>a Redirect URI. May not use HTTP unless using 127.0.0.1 (use HTTPS instead).</li>
|
||||
<li>a Redirect URI. May not use HTTP unless using 0.0.0.0 (use HTTPS instead).</li>
|
||||
<li>a brief description of what your application is intended to do</li>
|
||||
</ul>
|
||||
<p>Don't worry too much about accuracy; you will be able to change all of these later.</p>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=120">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=123"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=122">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=122">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=123"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=122">
|
||||
{% endif %}
|
||||
|
||||
</head>
|
||||
|
|
|
@ -133,10 +133,12 @@
|
|||
|
||||
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="https://github.com/Aevann1/Drama"><i class="fab fa-github fa-fw text-left mr-3"></i>Source code</a>
|
||||
|
||||
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="/report_bugs"><i class="fas fa-bug fa-fw text-left mr-3"></i>Report bugs or suggestions</a>
|
||||
{% if request.host in ['rdrama.net', 'pcmemes.net'] %}
|
||||
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="/report_bugs"><i class="fas fa-bug fa-fw text-left mr-3"></i>Report bugs or suggestions</a>
|
||||
{% endif %}
|
||||
|
||||
{% if 'pcm' not in request.host %}
|
||||
<a class="nav-item nav-link" href="/discord"><i class="fab fa-discord fa-fw mr-3"></i>Discord</a>
|
||||
<a class="dropdown-item" href="/discord"><i class="fab fa-discord fa-fw text-left mr-3"></i>Discord</a>
|
||||
{% endif %}
|
||||
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="{{'GUMROAD_LINK' | app_config}}"><i class="fas fa-dollar-sign fa-fw text-left mr-3"></i>Donate</a>
|
||||
{% if 'rama' in request.host %}<a class="dropdown-item" href="/archives"><i class="fas fa-book fa-fw text-left mr-3"></i>Archives</a>{% endif %}
|
||||
|
@ -193,7 +195,9 @@
|
|||
|
||||
<a class="nav-item nav-link" rel="nofollow noopener noreferrer" href="https://github.com/Aevann1/Drama"><i class="fab fa-github fa-fw mr-3"></i>Source code</a>
|
||||
|
||||
<a class="nav-item nav-link" rel="nofollow noopener noreferrer" href="/report_bugs"><i class="fas fa-bug fa-fw mr-3"></i>Report bugs or suggestions</a>
|
||||
{% if request.host in ['rdrama.net', 'pcmemes.net'] %}
|
||||
<a class="nav-item nav-link" rel="nofollow noopener noreferrer" href="/report_bugs"><i class="fas fa-bug fa-fw mr-3"></i>Report bugs or suggestions</a>
|
||||
{% endif %}
|
||||
|
||||
{% if 'pcm' not in request.host %}
|
||||
<a class="nav-item nav-link" href="/discord"><i class="fab fa-discord fa-fw mr-3"></i>Discord</a>
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=120">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=123"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=122">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=122">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=123"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=122">
|
||||
{% endif %}
|
||||
|
||||
<div class="row justify-content-around">
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<title>2-Step Login - {{'SITE_NAME' | app_config}}</title>
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=123"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=122">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -40,10 +40,10 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=123"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=122">
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=123"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=122">
|
||||
{% endif %}
|
||||
|
||||
<link href="/assets/css/fa.css?v=52" rel="stylesheet">
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=123"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=122">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=123"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=122">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -31,12 +31,12 @@
|
|||
{% block stylesheets %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=118">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=120">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=123"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=122">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=122">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=120">
|
||||
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=118">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=123">
|
||||
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=122">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@
|
|||
<div>
|
||||
<a rel="nofollow noopener noreferrer" href="{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}"><img loading="lazy" src="{{u.profile_url}}" class="profile-pic profile-pic-100 mb-5"></a>
|
||||
</div>
|
||||
<div class="ml-3 w-100">
|
||||
<div id="profilestuff" class="ml-3 w-100">
|
||||
{% if u.is_suspended %}
|
||||
<h5 style="color:#ff66ac;">BANNED USER{% if u.ban_reason %}:
|
||||
{% if u.ban_reason_link %}<a href="{{ u.ban_reason_link }}"><i class="fas fa-link"></i>{% endif %}
|
||||
|
@ -255,7 +255,7 @@
|
|||
|
||||
<form class="d-none profile-toggleable" id="message" action="/@{{u.username}}/message" method="post">
|
||||
<pre></pre>
|
||||
<textarea id="input-message" form="message" name="message" rows="3" maxlength="1000" class="form-control" required></textarea>
|
||||
<textarea id="input-message" form="message" name="message" rows="3" maxlength="1000" class="form-control b2" required></textarea>
|
||||
<pre></pre>
|
||||
<pre class="btn btn-secondary format d-inline-block m-0 fas fa-bold" aria-hidden="true" onclick="makeBold('input-message')" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Bold"></pre>
|
||||
|
||||
|
|
|
@ -34,11 +34,11 @@ local all postgres trust
|
|||
# "local" is for Unix domain socket connections only
|
||||
local all all trust
|
||||
# IPv4 local connections:
|
||||
host all all 127.0.0.1/32 trust
|
||||
host all all 0.0.0.0/32 trust
|
||||
# IPv6 local connections:
|
||||
host all all ::1/128 trust
|
||||
# Allow replication connections from 127.0.0.1, by a user with the
|
||||
# Allow replication connections from 0.0.0.0, by a user with the
|
||||
# replication privilege.
|
||||
local replication all trust
|
||||
host replication all 127.0.0.1/32 trust
|
||||
host replication all 0.0.0.0/32 trust
|
||||
host replication all ::1/128 trust
|
|
@ -22,9 +22,9 @@ git clone https://github.com/Aevann1/Drama/
|
|||
docker-compose up
|
||||
```
|
||||
|
||||
4- That's it! Visit `127.0.0.1` in your browser.
|
||||
4- That's it! Visit `0.0.0.0` in your browser.
|
||||
|
||||
5- Optional: to change the domain from "127.0.0.1" 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.
|
||||
5- Optional: to change the domain from "0.0.0.0" 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.
|
||||
|
||||
---
|
||||
|
||||
|
@ -48,10 +48,10 @@ cd /drama
|
|||
source setup
|
||||
```
|
||||
|
||||
4- That's it. Visit `127.0.0.1` in your browser.
|
||||
4- That's it. Visit `0.0.0.0` in your browser.
|
||||
|
||||
|
||||
5- Optional: to change the domain from "127.0.0.1" to something else and configure the site settings, as well as integrate it with the external services the website uses, please run this command and edit the variables:
|
||||
5- Optional: to change the domain from "0.0.0.0" to something else and configure the site settings, as well as integrate it with the external services the website uses, please run this command and edit the variables:
|
||||
|
||||
```
|
||||
nano /env
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
# Examples:
|
||||
#
|
||||
# bind 192.168.1.100 10.0.0.1
|
||||
# bind 127.0.0.1 ::1
|
||||
# bind 0.0.0.0 ::1
|
||||
#
|
||||
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
|
||||
# internet, binding to all the interfaces is dangerous and will expose the
|
||||
|
@ -66,7 +66,7 @@
|
|||
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
|
||||
# JUST COMMENT THE FOLLOWING LINE.
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
bind 127.0.0.1 ::1
|
||||
bind 0.0.0.0 ::1
|
||||
|
||||
# Protected mode is a layer of security protection, in order to avoid that
|
||||
# Redis instances left open on the internet are accessed and exploited.
|
||||
|
@ -78,7 +78,7 @@ bind 127.0.0.1 ::1
|
|||
# 2) No password is configured.
|
||||
#
|
||||
# The server only accepts connections from clients connecting from the
|
||||
# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
|
||||
# IPv4 and IPv6 loopback addresses 0.0.0.0 and ::1, and from Unix domain
|
||||
# sockets.
|
||||
#
|
||||
# By default protected mode is enabled. You should disable it only if
|
||||
|
|
2
restart
2
restart
|
@ -1,3 +1,3 @@
|
|||
source /env
|
||||
killall gunicorn
|
||||
gunicorn files.__main__:app -k gevent -w 2 --reload -b 127.0.0.1:80 --max-requests 1000 --max-requests-jitter 500
|
||||
gunicorn files.__main__:app -k gevent -w 2 --reload -b 0.0.0.0:80 --max-requests 1000 --max-requests-jitter 500
|
18
schema.sql
18
schema.sql
|
@ -127,19 +127,6 @@ CREATE SEQUENCE public.award_relationships_id_seq
|
|||
ALTER SEQUENCE public.award_relationships_id_seq OWNED BY public.award_relationships.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: badge_list_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public.badge_list_id_seq
|
||||
AS integer
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: badges; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -735,7 +722,6 @@ CREATE TABLE public.users (
|
|||
coins integer,
|
||||
agendaposter boolean,
|
||||
agendaposter_expires_utc integer DEFAULT 0,
|
||||
resized boolean,
|
||||
suicide_utc integer,
|
||||
post_count integer,
|
||||
comment_count integer,
|
||||
|
@ -774,7 +760,8 @@ CREATE TABLE public.users (
|
|||
alt boolean,
|
||||
longpost integer,
|
||||
unblockable boolean,
|
||||
teddit boolean
|
||||
teddit boolean,
|
||||
bird integer
|
||||
);
|
||||
|
||||
|
||||
|
@ -878,7 +865,6 @@ ALTER TABLE ONLY public.alts ALTER COLUMN id SET DEFAULT nextval('public.alts_id
|
|||
ALTER TABLE ONLY public.award_relationships ALTER COLUMN id SET DEFAULT nextval('public.award_relationships_id_seq'::regclass);
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Name: badges id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
|
2
setup
2
setup
|
@ -15,4 +15,4 @@ mkdir /songs
|
|||
mkdir /images
|
||||
cp ./env /env
|
||||
. /env
|
||||
gunicorn files.__main__:app -k gevent -w 2 --reload -b 127.0.0.1:80 --max-requests 1000 --max-requests-jitter 500
|
||||
gunicorn files.__main__:app -k gevent -w 2 --reload -b 0.0.0.0:80 --max-requests 1000 --max-requests-jitter 500
|
|
@ -5,7 +5,7 @@ logfile=/tmp/supervisord.log
|
|||
|
||||
[program:service]
|
||||
directory=/service
|
||||
command=gunicorn files.__main__:app -k gevent -w 2 --reload -b 127.0.0.1:80 --max-requests 1000 --max-requests-jitter 500
|
||||
command=gunicorn files.__main__:app -k gevent -w 2 --reload -b 0.0.0.0:80 --max-requests 1000 --max-requests-jitter 500
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
|
|
Loading…
Reference in New Issue