remotes/1693045480750635534/spooky-22
Aevann1 2021-11-26 21:28:55 +02:00
parent 90aa7e3630
commit aeea97941c
22 changed files with 141 additions and 199 deletions

View File

@ -10,7 +10,7 @@ services:
- DATABASE_URL=postgresql://postgres@postgres:5432
- MASTER_KEY=XuxGqp5NyygJrM24b5gt3YgyvFVGdQnwVDwLzLwpu3eQwY
- REDIS_URL=redis://redis
- DOMAIN=0.0.0.0
- DOMAIN=localhost
- SITE_NAME=Drama
- GIPHY_KEY=3435tdfsdudebussylmaoxxt43
- FORCE_HTTPS=0

4
env
View File

@ -1,6 +1,6 @@
export DATABASE_URL="postgresql://postgres@0.0.0.0:5432"
export DATABASE_URL="postgresql://postgres@localhost:5432"
export MASTER_KEY="XuxGqp5NyygJrM24b5gt3YgyvFVGdQnwVDwLzLwpu3eQwY"
export DOMAIN="0.0.0.0"
export DOMAIN="localhost"
export SITE_NAME="Drama"
export GIPHY_KEY="3435tdfsdudebussylmaoxxt43"
export FORCE_HTTPS="0"

View File

@ -42,7 +42,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 ("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["FORCE_HTTPS"] = int(environ.get("FORCE_HTTPS", 1)) if ("localhost" not in app.config["SERVER_NAME"] and "localhost" 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()
@ -61,14 +61,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://0.0.0.0")
app.config["RATELIMIT_STORAGE_URL"] = environ.get("REDIS_URL", "redis://localhost")
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://0.0.0.0"), decode_responses=True, ssl_cert_reqs=None)
r=redis.Redis(host=environ.get("REDIS_URL", "redis://localhost"), decode_responses=True, ssl_cert_reqs=None)
limiter = Limiter(
app,
@ -103,7 +103,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 "0.0.0.0" not in app.config["SERVER_NAME"]:
if app.config["FORCE_HTTPS"] and request.url.startswith("http://") and "localhost" not in app.config["SERVER_NAME"]:
url = request.url.replace("http://", "https://", 1)
return redirect(url, code=301)

View File

@ -27,7 +27,7 @@ class Comment(Base):
edited_utc = Column(Integer, default=0)
is_banned = Column(Boolean, default=False)
removed_by = Column(Integer)
bannedfor = Column(Boolean)
bannedfor = Column(Boolean, default=False)
distinguish_level = Column(Integer, default=0)
deleted_utc = Column(Integer, default=0)
is_approved = Column(Integer, default=0)

View File

@ -163,16 +163,6 @@ ACTIONTYPES={
"icon": "fa-user-slash",
"color": "bg-muted",
},
"club_allow":{
"str":'allowed user {self.target_link} into the {cc}',
"icon":"fa-user-slash",
"color": "bg-danger",
},
"club_ban":{
"str":'disallowed user {self.target_link} from the {cc}',
"icon": "fa-user-slash",
"color": "bg-muted",
},
"nuke_user":{
"str":'removed all content of {self.target_link}',
"icon":"fa-user-slash",
@ -253,16 +243,6 @@ ACTIONTYPES={
"icon":"fa-feather-alt",
"color": "bg-muted",
},
"club":{
"str": 'marked post {self.target_link} as club-only',
"icon":"fa-eye-slash",
"color": "bg-danger",
},
"unclub":{
"str": 'unmarked post {self.target_link} as club-only',
"icon":"fa-eye",
"color": "bg-muted",
},
"ban_comment":{
"str": 'removed {self.target_link}',
"icon":"fa-comment",

View File

@ -28,7 +28,7 @@ class Submission(Base):
thumburl = Column(String)
is_banned = Column(Boolean, default=False)
removed_by = Column(Integer)
bannedfor = Column(Boolean)
bannedfor = Column(Boolean, default=False)
views = Column(Integer, default=0)
deleted_utc = Column(Integer, default=0)
distinguish_level = Column(Integer, default=0)

View File

@ -51,7 +51,7 @@ class User(Base):
verifiedcolor = Column(String)
marseyawarded = Column(Integer)
longpost = Column(Integer)
unblockable = Column(Boolean)
unblockable = Column(Boolean, default=False)
bird = Column(Integer)
email = deferred(Column(String))
css = deferred(Column(String))
@ -81,12 +81,12 @@ class User(Base):
newtab = Column(Boolean, default=False)
newtabexternal = Column(Boolean, default=True)
oldreddit = Column(Boolean, default=True)
teddit = Column(Boolean)
nitter = Column(Boolean)
mute = Column(Boolean)
unmutable = Column(Boolean)
eye = Column(Boolean)
alt = Column(Boolean)
teddit = Column(Boolean, default=False)
nitter = Column(Boolean, default=False)
mute = Column(Boolean, default=False)
unmutable = Column(Boolean, default=False)
eye = Column(Boolean, default=False)
alt = Column(Boolean, default=False)
frontsize = Column(Integer, default=25)
controversial = Column(Boolean, default=False)
bio = deferred(Column(String))
@ -94,7 +94,7 @@ class User(Base):
sig = deferred(Column(String))
sig_html = Column(String)
fp = Column(String)
sigs_disabled = Column(Boolean)
sigs_disabled = Column(Boolean, default=False)
friends = deferred(Column(String))
friends_html = deferred(Column(String))
enemies = deferred(Column(String))

View File

@ -97,14 +97,6 @@ def club_allow(v, username):
x.club_banned = False
g.db.add(x)
ma=ModAction(
kind="club_allow",
user_id=v.id,
target_user_id=u.id,
)
g.db.add(ma)
g.db.commit()
return {"message": f"@{username} has been allowed into the {cc}!"}
@ -127,13 +119,6 @@ def club_ban(v, username):
u.club_allowed = False
g.db.add(x)
ma=ModAction(
kind="club_ban",
user_id=v.id,
target_user_id=u.id,
)
g.db.add(ma)
g.db.commit()
return {"message": f"@{username} has been kicked from the {cc}. Deserved."}
@ -164,30 +149,30 @@ def remove_admin(v, username):
return {"message": "Admin removed!"}
@app.post("/@<username>/make_fake_admin")
@app.post("/@<username>/make_meme_admin")
@limiter.limit("1/second")
@admin_level_required(2)
def make_fake_admin(v, username):
def make_meme_admin(v, username):
if 'pcm' in request.host or (SITE_NAME == 'Drama' and v.admin_level > 2) or ('rama' not in request.host and 'pcm' not in request.host):
user = get_user(username)
if not user: abort(404)
user.admin_level = 1
g.db.add(user)
g.db.commit()
return {"message": "User has been made fake admin!"}
return {"message": "User has been made meme admin!"}
@app.post("/@<username>/remove_fake_admin")
@app.post("/@<username>/remove_meme_admin")
@limiter.limit("1/second")
@admin_level_required(2)
def remove_fake_admin(v, username):
def remove_meme_admin(v, username):
if 'pcm' in request.host or (SITE_NAME == 'Drama' and v.admin_level > 2) or ('rama' not in request.host and 'pcm' not in request.host):
user = get_user(username)
if not user: abort(404)
user.admin_level = 0
g.db.add(user)
g.db.commit()
return {"message": "Fake admin removed!"}
return {"message": "Meme admin removed!"}
@app.post("/admin/monthly")

View File

@ -853,8 +853,7 @@ def settings_block_user(v):
g.db.commit()
if v.admin_level == 1: return {"message": f"@{user.username} banned!"}
else: return {"message": f"@{user.username} blocked."}
return {"message": f"@{user.username} blocked."}
@app.post("/settings/unblock")
@ -878,8 +877,6 @@ def settings_unblock_user(v):
g.db.commit()
if v.admin_level == 1: return {"message": f"@{user.username} unbanned!"}
return {"message": f"@{user.username} unblocked."}

View File

@ -173,7 +173,7 @@ def log(v):
actions = g.db.query(ModAction)
if not (v and v.admin_level > 1):
actions = actions.filter(ModAction.kind.notin_(["shadowban","unshadowban","club","unclub","club_allow","club_ban","check"]))
actions = actions.filter(ModAction.kind.notin_(["shadowban","unshadowban","check"]))
if admin_id: actions = actions.filter_by(user_id=admin_id)
if kind: actions = actions.filter_by(kind=kind)

View File

@ -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 0.0.0.0 (use HTTPS instead).</li>
<li>a Redirect URI. May not use HTTP unless using localhost (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 0.0.0.0 (use HTTPS instead).</li>
<li>a Redirect URI. May not use HTTP unless using localhost (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>

View File

@ -773,7 +773,7 @@
}
.popover {
max-width: 100%;
max-width: 80%;
box-shadow: 0 1rem 3rem rgba(0, 0, 0, .175);
border-color: #dadada;
}

View File

@ -392,11 +392,6 @@
<button id="unmark2-{{p.id}}" class="{% if not p.over_18 %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-danger" onclick="post_toast2('/toggle_post_nsfw/{{p.id}}','mark2-{{p.id}}','unmark2-{{p.id}}')" data-bs-dismiss="modal"><i class="far fa-eye-evil text-center text-danger mr-3"></i>Unmark +18</button>
{% endif %}
{% if not v.id==p.author_id and v.admin_level == 1 %}
<button id="sex-user-{{p.id}}" class="list-inline-item{% if p.is_blocking %} d-none{% endif %} text-danger" href="javascript:void(0)" onclick="post_toast2('/settings/block?username={{p.author.username}}','sex-user-{{p.id}}','unsex-user-{{p.id}}')" data-bs-dismiss="modal"><i class="fas fa-user-slash text-danger"></i>Ban user</button>
<button id="unsex-user-{{p.id}}" class="list-inline-item{% if not p.is_blocking %} d-none{% endif %} text-success" href="javascript:void(0)" onclick="post_toast2('/settings/unblock?username={{p.author.username}}','sex-user-{{p.id}}','unsex-user-{{p.id}}')" data-bs-dismiss="modal"><i class="fas fa-user-slash text-success"></i>Unban user</button>
{% endif %}
{% if v and v.admin_level > 1 and v.id!=p.author_id %}
<button id="ban2-{{p.id}}" data-bs-dismiss="modal" data-bs-toggle="modal" data-bs-target="#banModal" onclick="banModal('/post/{{p.id}}', '{{ p.author.id }}', '{{p.author.username}}')" class="{% if p.author.is_suspended %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-danger text-left" href="javascript:void(0)"><i class="fas fa-user-minus mr-3"></i>Ban user</button>
<button id="unban2-{{p.id}}" class="{% if not p.author.is_suspended %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-success text-left" href="javascript:void(0)" onclick="post_toast2('/unban_user/{{p.author_id}}','ban2-{{p.id}}','unban2-{{p.id}}')" data-bs-dismiss="modal"><i class="fas fa-user-minus mr-3"></i>Unban user</button>
@ -686,11 +681,6 @@
<a id="block-{{p.id}}" class="text-danger blockuser list-inline-item {% if p.is_blocking %} d-none{% endif %}" href="javascript:void(0)" onclick="document.getElementById('block-{{p.id}}').classList.toggle('d-none');document.getElementById('prompt-{{p.id}}').classList.toggle('d-none');"><i class="fas fa-eye-slash text-danger"></i>Block user</a>
{% endif %}
{% if not v.id==p.author_id and v.admin_level == 1 %}
<a id="sex-user-{{p.id}}" class="list-inline-item{% if p.is_blocking %} d-none{% endif %} text-danger" href="javascript:void(0)" onclick="post_toast2('/settings/block?username={{p.author.username}}','sex-user-{{p.id}}','unsex-user-{{p.id}}')"><i class="fas fa-user-slash text-danger"></i>Ban user</a>
<a id="unsex-user-{{p.id}}" class="list-inline-item{% if not p.is_blocking %} d-none{% endif %} text-success" href="javascript:void(0)" onclick="post_toast2('/settings/unblock?username={{p.author.username}}','sex-user-{{p.id}}','unsex-user-{{p.id}}')"><i class="fas fa-user-slash text-success"></i>Unban user</a>
{% endif %}
{% if v.admin_level > 1 and v.id!=p.author_id %}
<a id="ban-{{p.id}}" class="{% if p.author.is_suspended %}d-none{% endif %} list-inline-item text-danger" href="javascript:void(0)" data-bs-toggle="modal" data-bs-target="#banModal" onclick="banModal('/post/{{p.id}}', '{{ p.author.id }}', '{{p.author.username}}')"><i class="fas fa-user-slash text-danger fa-fw"></i>Ban user</a>
<a id="unban-{{p.id}}" class="{% if not p.author.is_suspended %}d-none{% endif %} list-inline-item text-danger" id="unexile2-user-{{p.id}}" href="javascript:void(0)" onclick="post_toast2('/unban_user/{{p.author_id}}','ban-{{p.id}}','unban-{{p.id}}')"><i class="fas fa-user-slash"></i>Unban user</a>

View File

@ -484,11 +484,6 @@
<button id="unmark2-{{p.id}}" class="{% if not p.over_18 %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-danger" onclick="post_toast2('/toggle_post_nsfw/{{p.id}}','mark2-{{p.id}}','unmark2-{{p.id}}')" data-bs-dismiss="modal"><i class="far fa-eye-evil text-center text-danger mr-3"></i>Unmark +18</button>
{% endif %}
{% if not v.id==p.author_id and v.admin_level == 1 %}
<button id="sex-user-{{p.id}}" class="list-inline-item{% if p.is_blocking %} d-none{% endif %} text-danger" href="javascript:void(0)" onclick="post_toast2('/settings/block?username={{p.author.username}}','sex-user-{{p.id}}','unsex-user-{{p.id}}')" data-bs-dismiss="modal"><i class="fas fa-user-slash text-danger"></i>Ban user</button>
<button id="unsex-user-{{p.id}}" class="list-inline-item{% if not p.is_blocking %} d-none{% endif %} text-success" href="javascript:void(0)" onclick="post_toast2('/settings/unblock?username={{p.author.username}}','sex-user-{{p.id}}','unsex-user-{{p.id}}')" data-bs-dismiss="modal"><i class="fas fa-user-slash text-success"></i>Unban user</button>
{% endif %}
{% if v and v.admin_level > 1 and v.id!=p.author_id %}
<button id="ban2-{{p.id}}" data-bs-dismiss="modal" data-bs-toggle="modal" data-bs-target="#banModal" onclick="banModal('/post/{{p.id}}', '{{ p.author.id }}', '{{p.author.username}}')" class="{% if p.author.is_suspended %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-danger text-left" href="javascript:void(0)"><i class="fas fa-user-minus mr-3"></i>Ban user</button>
<button id="unban2-{{p.id}}" class="{% if not p.author.is_suspended %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-success text-left" href="javascript:void(0)" onclick="post_toast2('/unban_user/{{p.author_id}}','ban2-{{p.id}}','unban2-{{p.id}}')" data-bs-dismiss="modal"><i class="fas fa-user-minus mr-3"></i>Unban user</button>
@ -616,7 +611,7 @@
<style>
.popover {
max-width: 100%;
max-width: 80%;
box-shadow: 0 1rem 3rem rgba(0, 0, 0, .175);
border-color: #dadada;
}

View File

@ -137,13 +137,13 @@
</span>
{% endif %}
{% if u.verified %}<span><i class="fas fa-badge-check align-middle ml-1" style="color:{% if u.verifiedcolor %}#{{u.verifiedcolor}}{% else %}#1DA1F2{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="{{u.verified}}"></i></span>{% endif %}
{% if u.admin_level > 1 or (u.admin_level == 1 and (not v or v.admin_level < 2)) %}
{% if u.admin_level > 1 or (u.admin_level == 1 and not(v and v.admin_level > 1)) %}
<span>
<i class="fas fa-broom text-admin align-middle ml-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Admin"></i>
</span>
{% elif u.admin_level == 1 %}
{% elif u.admin_level == 1 and v and v.admin_level > 1 %}
<span>
<i class="fas fa-broom align-middle ml-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Fake Admin"></i>
<i class="fas fa-broom align-middle ml-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Meme Admin"></i>
</span>
{% endif %}
{% if v and v.has_follower(u) %}
@ -245,8 +245,8 @@
<a id="admin" class="{% if u.admin_level %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/make_admin','admin','unadmin')">Make admin</a>
<a id="unadmin" class="{% if not u.admin_level %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/remove_admin','admin','unadmin')">Remove admin</a>
<a id="fakeadmin" class="{% if u.admin_level == 1%}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/make_fake_admin','fakeadmin','unfakeadmin')">Make fake admin</a>
<a id="unfakeadmin" class="{% if u.admin_level != 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/remove_fake_admin','fakeadmin','unfakeadmin')">Remove fake admin</a>
<a id="memeadmin" class="{% if u.admin_level == 1%}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/make_meme_admin','memeadmin','unmemeadmin')">Make meme admin</a>
<a id="unmemeadmin" class="{% if u.admin_level != 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/remove_meme_admin','memeadmin','unmemeadmin')">Remove meme admin</a>
{% if u.admin_level > 1 %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/revert_actions')">Revert admin actions</a>
@ -436,13 +436,13 @@
<i class="fad fa-user-tag text-info align-middle ml-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Original Username: @{{u.original_username}}"></i>
</span>
{% endif %}
{% if u.admin_level > 1 or (u.admin_level == 1 and (not v or v.admin_level < 2)) %}
{% if u.admin_level > 1 or (u.admin_level == 1 and not(v and v.admin_level > 1)) %}
<span>
<i class="fas fa-broom text-admin align-middle ml-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Admin"></i>
</span>
{% elif u.admin_level == 1 %}
{% elif u.admin_level == 1 and v and v.admin_level > 1 %}
<span>
<i class="fas fa-broom align-middle ml-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Fake Admin"></i>
<i class="fas fa-broom align-middle ml-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Meme Admin"></i>
</span>
{% endif %}
{% if v and v.has_follower(u) and not v.is_nofollow %}
@ -527,8 +527,8 @@
<a id="admin2" class="{% if u.admin_level %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/make_admin','admin2','unadmin2')">Make admin</a>
<a id="unadmin2" class="{% if not u.admin_level %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/remove_admin','admin2','unadmin2')">Remove admin</a>
<a id="fakeadmin2" class="{% if u.admin_level == 1%}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/make_fake_admin','fakeadmin2','unfakeadmin2')">Make fake admin</a>
<a id="unfakeadmin2" class="{% if u.admin_level != 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/remove_fake_admin','fakeadmin2','unfakeadmin2')">Remove fake admin</a>
<a id="memeadmin2" class="{% if u.admin_level == 1%}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/make_meme_admin','memeadmin2','unmemeadmin2')">Make meme admin</a>
<a id="unmemeadmin2" class="{% if u.admin_level != 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/remove_meme_admin','memeadmin2','unmemeadmin2')">Remove meme admin</a>
{% if u.admin_level > 1 %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/revert_actions')">Revert admin actions</a>

View File

@ -38,15 +38,10 @@
<div class="text-center py-7 py-md-8">
<span class="fa-stack fa-2x text-muted mb-4">
<i class="fas fa-square text-danger opacity-25 fa-stack-2x"></i>
{% if v.admin_level == 1 %}<i class="fas text-danger fa-gavel fa-stack-1x text-lg"></i>{% else %}<i class="fas text-danger fa-user-cog fa-stack-1x text-lg"></i>{% endif %}
<i class="fas text-danger fa-user-cog fa-stack-1x text-lg"></i>
</span>
{% if v.admin_level == 1 %}
<h2 class="h5">@{{u.username}} is banned</h2>
<p class="text-muted">This account has been suspended.</p>
{% else %}
<h2 class="h5">You are blocking @{{u.username}}.</h2>
<p class="text-muted">So we aren't going to show you their profile.</p>
{% endif %}
</div>
</div>
</div>

View File

@ -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 0.0.0.0/32 trust
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from 0.0.0.0, by a user with the
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all trust
host replication all 0.0.0.0/32 trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust

View File

@ -22,9 +22,9 @@ git clone https://github.com/Aevann1/Drama/
docker-compose up
```
4- That's it! Visit `0.0.0.0` in your browser.
4- That's it! Visit `localhost` in your browser.
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.
5- 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.
---
@ -48,10 +48,10 @@ cd /drama
source setup
```
4- That's it. Visit `0.0.0.0` in your browser.
4- That's it. Visit `localhost` in your browser.
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:
5- 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 run this command and edit the variables:
```
nano /env

View File

@ -53,7 +53,7 @@
# Examples:
#
# bind 192.168.1.100 10.0.0.1
# bind 0.0.0.0 ::1
# bind 127.0.0.1 ::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 0.0.0.0 ::1
bind 127.0.0.1 ::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 0.0.0.0 ::1
# 2) No password is configured.
#
# The server only accepts connections from clients connecting from the
# IPv4 and IPv6 loopback addresses 0.0.0.0 and ::1, and from Unix domain
# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
# sockets.
#
# By default protected mode is enabled. You should disable it only if
@ -694,7 +694,7 @@ replica-lazy-flush no
# If the AOF is enabled on startup Redis will load the AOF, that is the file
# with the better durability guarantees.
#
# Please check https://redis.io/topics/persistence for more information.
# Please check http://redis.io/topics/persistence for more information.
appendonly no
@ -721,7 +721,7 @@ appendfilename "appendonly.aof"
# everysec.
#
# More details please check the following article:
# https://antirez.com/post/redis-persistence-demystified.html
# http://antirez.com/post/redis-persistence-demystified.html
#
# If unsure, use "everysec".
@ -933,7 +933,7 @@ lua-time-limit 5000
# cluster-replica-no-failover no
# In order to setup your cluster make sure to read the documentation
# available at https://redis.io web site.
# available at http://redis.io web site.
########################## CLUSTER DOCKER/NAT support ########################
@ -1016,7 +1016,7 @@ latency-monitor-threshold 0
############################# EVENT NOTIFICATION ##############################
# Redis can notify Pub/Sub clients about events happening in the key space.
# This feature is documented at https://redis.io/topics/notifications
# This feature is documented at http://redis.io/topics/notifications
#
# For instance if keyspace events notification is enabled, and a client
# performs a DEL operation on key "foo" stored in the Database 0, two

View File

@ -1,3 +1,3 @@
source /env
killall gunicorn
gunicorn files.__main__:app -k gevent -w 2 --reload -b 0.0.0.0:80 --max-requests 1000 --max-requests-jitter 500
gunicorn files.__main__:app -k gevent -w 2 --reload -b localhost:80 --max-requests 1000 --max-requests-jitter 500

2
setup
View File

@ -15,4 +15,4 @@ mkdir /songs
mkdir /images
cp ./env /env
. /env
gunicorn files.__main__:app -k gevent -w 2 --reload -b 0.0.0.0:80 --max-requests 1000 --max-requests-jitter 500
gunicorn files.__main__:app -k gevent -w 2 --reload -b localhost:80 --max-requests 1000 --max-requests-jitter 500

View File

@ -5,7 +5,7 @@ logfile=/tmp/supervisord.log
[program:service]
directory=/service
command=gunicorn files.__main__:app -k gevent -w 2 --reload -b 0.0.0.0:80 --max-requests 1000 --max-requests-jitter 500
command=gunicorn files.__main__:app -k gevent -w 2 --reload -b localhost:80 --max-requests 1000 --max-requests-jitter 500
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr