remotes/1693045480750635534/spooky-22
Aevann1 2022-01-19 10:42:38 +02:00
parent 947c1eaccf
commit c1ab1964e9
6 changed files with 10 additions and 10 deletions

View File

@ -474,7 +474,7 @@ def api_comment(v):
'notification': { 'notification': {
'title': f'New reply by @{c.author_name}', 'title': f'New reply by @{c.author_name}',
'body': notifbody, 'body': notifbody,
'deep_link': f'https://{site}/comment/{c.id}?context=9&read=true#context', 'deep_link': f'{request.host_url}comment/{c.id}?context=9&read=true#context',
'icon': f'{request.host_url}assets/images/{SITE_NAME}/icon.webp', 'icon': f'{request.host_url}assets/images/{SITE_NAME}/icon.webp',
} }
}, },

View File

@ -58,7 +58,7 @@ def discord_redirect(v):
'client_secret': CLIENT_SECRET, 'client_secret': CLIENT_SECRET,
'grant_type': 'authorization_code', 'grant_type': 'authorization_code',
'code': code, 'code': code,
'redirect_uri': f"https://{app.config['SERVER_NAME']}/discord_redirect", 'redirect_uri': f"{request.host_url}discord_redirect",
'scope': 'identify guilds.join' 'scope': 'identify guilds.join'
} }
headers={ headers={

View File

@ -53,7 +53,7 @@ def feeds_user(v=None, sort='hot', t='all'):
with tag("name"): with tag("name"):
text(post.author.username) text(post.author.username)
with tag("uri"): with tag("uri"):
text(f'https://{site}/@{post.author.username}') text(f'{request.host_url}@{post.author.username}')
doc.stag("link", href=full_link(post.permalink)) doc.stag("link", href=full_link(post.permalink))

View File

@ -366,7 +366,7 @@ def post_forgot():
if user: if user:
now = int(time.time()) now = int(time.time())
token = generate_hash(f"{user.id}+{now}+forgot+{user.login_nonce}") token = generate_hash(f"{user.id}+{now}+forgot+{user.login_nonce}")
url = f"https://{app.config['SERVER_NAME']}/reset?id={user.id}&time={now}&token={token}" url = f"{request.host_url}reset?id={user.id}&time={now}&token={token}"
send_mail(to_address=user.email, send_mail(to_address=user.email,
subject="Password Reset Request", subject="Password Reset Request",
@ -487,7 +487,7 @@ def request_2fa_disable():
valid=int(time.time()) valid=int(time.time())
token=generate_hash(f"{user.id}+{user.username}+disable2fa+{valid}+{user.mfa_secret}+{user.login_nonce}") token=generate_hash(f"{user.id}+{user.username}+disable2fa+{valid}+{user.mfa_secret}+{user.login_nonce}")
action_url=f"https://{app.config['SERVER_NAME']}/reset_2fa?id={user.id}&t={valid}&token={token}" action_url=f"{request.host_url}reset_2fa?id={user.id}&t={valid}&token={token}"
send_mail(to_address=user.email, send_mail(to_address=user.email,
subject="2FA Removal Request", subject="2FA Removal Request",

View File

@ -77,7 +77,7 @@ def publish(pid, v):
cache.delete_memoized(User.userpagelisting) cache.delete_memoized(User.userpagelisting)
if v.admin_level > 1 and ("[changelog]" in post.title or "(changelog)" in post.title): if v.admin_level > 1 and ("[changelog]" in post.title or "(changelog)" in post.title):
send_discord_message(f"https://{site}{post.permalink}") send_discord_message(f"{request.host_url}{post.permalink[1:]}")
cache.delete_memoized(changeloglist) cache.delete_memoized(changeloglist)
g.db.commit() g.db.commit()
@ -579,7 +579,7 @@ def thumbnail_thread(pid):
fetch_url = post.url fetch_url = post.url
if fetch_url.startswith('/'): fetch_url = f"https://{site}{fetch_url}" if fetch_url.startswith('/'): fetch_url = f"{request.host_url}{fetch_url[1:]}"
headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36"} headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36"}
@ -1053,7 +1053,7 @@ def submit_post(v):
rev = f"* [unddit.com](https://unddit.com/{rev})\n" rev = f"* [unddit.com](https://unddit.com/{rev})\n"
else: rev = '' else: rev = ''
newposturl = new_post.url newposturl = new_post.url
if newposturl.startswith('/'): newposturl = f"https://{site}{newposturl}" if newposturl.startswith('/'): newposturl = f"{request.host_url}{newposturl[1:]}"
body += f"Snapshots:\n\n{rev}* [archive.org](https://web.archive.org/{newposturl})\n* [archive.ph](https://archive.ph/?url={quote(newposturl)}&run=1) (click to archive)\n\n" body += f"Snapshots:\n\n{rev}* [archive.org](https://web.archive.org/{newposturl})\n* [archive.ph](https://archive.ph/?url={quote(newposturl)}&run=1) (click to archive)\n\n"
gevent.spawn(archiveorg, newposturl) gevent.spawn(archiveorg, newposturl)
@ -1105,7 +1105,7 @@ def submit_post(v):
cache.delete_memoized(frontlist) cache.delete_memoized(frontlist)
cache.delete_memoized(User.userpagelisting) cache.delete_memoized(User.userpagelisting)
if v.admin_level > 1 and ("[changelog]" in new_post.title or "(changelog)" in new_post.title) and not new_post.private: if v.admin_level > 1 and ("[changelog]" in new_post.title or "(changelog)" in new_post.title) and not new_post.private:
send_discord_message(f"https://{site}{new_post.permalink}") send_discord_message(f"{request.host_url}{new_post.permalink[1:]}")
cache.delete_memoized(changeloglist) cache.delete_memoized(changeloglist)
if v.id in (PIZZASHILL_ID, HIL_ID): if v.id in (PIZZASHILL_ID, HIL_ID):

View File

@ -543,7 +543,7 @@ def settings_security_post(v):
if new_email == v.email: if new_email == v.email:
return render_template("settings_security.html", v=v, error="That email is already yours!") return render_template("settings_security.html", v=v, error="That email is already yours!")
url = f"https://{app.config['SERVER_NAME']}/activate" url = f"{request.host_url}activate"
now = int(time.time()) now = int(time.time())