Merge branch 'v2' into indieweb-merge-part2

This commit is contained in:
Thomas Sileo 2022-11-18 20:36:58 +01:00
commit 066f5ec900
7 changed files with 11 additions and 3 deletions

View file

@ -12,6 +12,7 @@ from sqlalchemy.orm import joinedload
from app import activitypub as ap from app import activitypub as ap
from app import media from app import media
from app.config import BASE_URL
from app.database import AsyncSession from app.database import AsyncSession
from app.utils.datetime import as_utc from app.utils.datetime import as_utc
from app.utils.datetime import now from app.utils.datetime import now
@ -111,14 +112,14 @@ class Actor:
if self.icon_url: if self.icon_url:
return media.proxied_media_url(self.icon_url) return media.proxied_media_url(self.icon_url)
else: else:
return "/static/nopic.png" return BASE_URL + "/static/nopic.png"
@property @property
def resized_icon_url(self) -> str: def resized_icon_url(self) -> str:
if self.icon_url: if self.icon_url:
return media.resized_media_url(self.icon_url, 50) return media.resized_media_url(self.icon_url, 50)
else: else:
return "/static/nopic.png" return BASE_URL + "/static/nopic.png"
@property @property
def tags(self) -> list[ap.RawObject]: def tags(self) -> list[ap.RawObject]:

View file

@ -257,5 +257,5 @@ def verify_csrf_token(
return None return None
def hmac_sha256(): def hmac_sha256() -> hmac.HMAC:
return hmac.new(CONFIG.secret.encode(), digestmod=hashlib.sha256) return hmac.new(CONFIG.secret.encode(), digestmod=hashlib.sha256)

View file

@ -3,6 +3,7 @@
{% block head %} {% block head %}
<title>{{ local_actor.display_name }}'s followers</title> <title>{{ local_actor.display_name }}'s followers</title>
<meta name="robots" content="noindex, nofollow">
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View file

@ -3,6 +3,7 @@
{% block head %} {% block head %}
<title>{{ local_actor.display_name }}'s follows</title> <title>{{ local_actor.display_name }}'s follows</title>
<meta name="robots" content="noindex, nofollow">
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View file

@ -1,5 +1,8 @@
{%- import "utils.html" as utils with context -%} {%- import "utils.html" as utils with context -%}
{% extends "layout.html" %} {% extends "layout.html" %}
{% block head %}
<meta name="robots" content="noindex, nofollow">
{% endblock %}
{% block main_tag %} class="main-flex"{% endblock %} {% block main_tag %} class="main-flex"{% endblock %}
{% block content %} {% block content %}
<div class="centered"> <div class="centered">

View file

@ -3,6 +3,7 @@
{% block head %} {% block head %}
<title>Remote follow {{ local_actor.display_name }}</title> <title>Remote follow {{ local_actor.display_name }}</title>
<meta name="robots" content="noindex, nofollow">
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View file

@ -3,6 +3,7 @@
{% block head %} {% block head %}
<title>Interact from your instance</title> <title>Interact from your instance</title>
<meta name="robots" content="noindex, nofollow">
{% endblock %} {% endblock %}
{% block content %} {% block content %}