mirror of https://github.com/jointakahe/takahe
Compare commits
4 Commits
57ec90ee24
...
f44b16aebb
Author | SHA1 | Date |
---|---|---|
Osma Ahvenlampi | f44b16aebb | |
Andrew Godwin | 7c34ac78ed | |
Osma Ahvenlampi | 85ee2692f1 | |
Osma Ahvenlampi | 05ec6cbe74 |
|
@ -71,6 +71,7 @@ class Account(Schema):
|
|||
bot: bool
|
||||
group: bool
|
||||
discoverable: bool
|
||||
indexable: bool
|
||||
moved: Union[None, bool, "Account"]
|
||||
suspended: bool = False
|
||||
limited: bool = False
|
||||
|
|
|
@ -559,6 +559,7 @@ schemas = {
|
|||
"@context": {
|
||||
"toot": "http://joinmastodon.org/ns#",
|
||||
"discoverable": "toot:discoverable",
|
||||
"indexable": "toot:indexable",
|
||||
"devices": "toot:devices",
|
||||
"featured": "toot:featured",
|
||||
"featuredTags": "toot:featuredTags",
|
||||
|
|
|
@ -172,3 +172,37 @@ We use `HTMX <https://htmx.org/>`_ for dynamically loading content, and
|
|||
`Hyperscript <https://hyperscript.org/>`_ for most interactions rather than raw
|
||||
JavaScript. If you can accomplish what you need with these tools, please use them
|
||||
rather than adding JS.
|
||||
|
||||
|
||||
Cutting a release
|
||||
-----------------
|
||||
|
||||
In order to make a release of Takahē, follow these steps:
|
||||
|
||||
* Create or update the release document (in ``/docs/releases``) for the
|
||||
release; major versions get their own document, minor releases get a
|
||||
subheading in the document for their major release.
|
||||
|
||||
* Go through the git commit history since the last release in order to write
|
||||
a reasonable summary of features.
|
||||
|
||||
* Be sure to include the little paragraphs at the end about contributing and
|
||||
the docker tag, and an Upgrade Notes section that at minimum mentions
|
||||
migrations and if they're normal or weird (even if there aren't any, it's
|
||||
nice to call that out).
|
||||
|
||||
* If it's a new doc, make sure you include it in ``docs/releases/index.rst``!
|
||||
|
||||
* Update the version number in ``/takahe/__init__.py``
|
||||
|
||||
* Update the version number in ``README.md``
|
||||
|
||||
* Make a commit containing these changes called ``Releasing 1.23.45``.
|
||||
|
||||
* Tag that commit with a tag in the format ``1.23.45``.
|
||||
|
||||
* Wait for the GitHub Actions to run and publish the docker images (around 20
|
||||
minutes as the ARM build is a bit slow)
|
||||
|
||||
* Post on the official account announcing the relase and linking to the
|
||||
now-published release notes.
|
||||
|
|
|
@ -35,3 +35,20 @@ In additions, there's many bugfixes and minor changes, including:
|
|||
* Perform some basic domain validity
|
||||
* Correctly reject more operations when the identity is deleted
|
||||
* Post edit fanouts for likers/boosters
|
||||
|
||||
|
||||
If you'd like to help with code, design, or other areas, see
|
||||
:doc:`/contributing` to see how to get in touch.
|
||||
|
||||
You can download images from `Docker Hub <https://hub.docker.com/r/jointakahe/takahe>`_,
|
||||
or use the image name ``jointakahe/takahe:0.11``.
|
||||
|
||||
|
||||
Upgrade Notes
|
||||
-------------
|
||||
|
||||
Migrations
|
||||
~~~~~~~~~~
|
||||
|
||||
There are new database migrations; they are backwards-compatible and should
|
||||
not present any major database load.
|
||||
|
|
|
@ -1 +1 @@
|
|||
__version__ = "0.10.1"
|
||||
__version__ = "0.11.0"
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
{% include "forms/_field.html" with field=form.domain %}
|
||||
{% include "forms/_field.html" with field=form.name %}
|
||||
{% include "forms/_field.html" with field=form.discoverable %}
|
||||
{% include "forms/_field.html" with field=form.indexable %}
|
||||
</fieldset>
|
||||
<div class="buttons">
|
||||
<button>Create</button>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
<fieldset>
|
||||
<legend>Privacy</legend>
|
||||
{% include "forms/_field.html" with field=form.discoverable %}
|
||||
{% include "forms/_field.html" with field=form.indexable %}
|
||||
{% include "forms/_field.html" with field=form.visible_follows %}
|
||||
{% include "forms/_field.html" with field=form.search_enabled %}
|
||||
</fieldset>
|
||||
|
|
|
@ -204,6 +204,8 @@ def test_fetch_actor(httpx_mock, config_system):
|
|||
assert identity.image_uri == "https://example.com/image.jpg"
|
||||
assert identity.summary == "<p>A test user</p>"
|
||||
assert "ts-a-faaaake" in identity.public_key
|
||||
# convention is that indexability should be opt-in
|
||||
assert not identity.indexable
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
# Generated by Django 4.2.3 on 2023-11-16 13:03
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("users", "0022_follow_request"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="identity",
|
||||
name="indexable",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
|
@ -233,6 +233,7 @@ class Identity(StatorModel):
|
|||
summary = models.TextField(blank=True, null=True)
|
||||
manually_approves_followers = models.BooleanField(blank=True, null=True)
|
||||
discoverable = models.BooleanField(default=True)
|
||||
indexable = models.BooleanField(default=False)
|
||||
|
||||
profile_uri = models.CharField(max_length=500, blank=True, null=True)
|
||||
inbox_uri = models.CharField(max_length=500, blank=True, null=True)
|
||||
|
@ -597,6 +598,7 @@ class Identity(StatorModel):
|
|||
"published": self.created.strftime("%Y-%m-%dT%H:%M:%SZ"),
|
||||
"url": self.absolute_profile_uri(),
|
||||
"toot:discoverable": self.discoverable,
|
||||
"toot:indexable": self.indexable,
|
||||
}
|
||||
if self.name:
|
||||
response["name"] = self.name
|
||||
|
@ -958,6 +960,7 @@ class Identity(StatorModel):
|
|||
self.icon_uri = get_first_image_url(document.get("icon", None))
|
||||
self.image_uri = get_first_image_url(document.get("image", None))
|
||||
self.discoverable = document.get("toot:discoverable", True)
|
||||
self.indexable = document.get("toot:indexable", False)
|
||||
# Profile links/metadata
|
||||
self.metadata = []
|
||||
for attachment in get_list(document, "attachment"):
|
||||
|
@ -1095,6 +1098,7 @@ class Identity(StatorModel):
|
|||
"bot": self.actor_type.lower() in ["service", "application"],
|
||||
"group": self.actor_type.lower() == "group",
|
||||
"discoverable": self.discoverable,
|
||||
"indexable": self.indexable,
|
||||
"suspended": False,
|
||||
"limited": False,
|
||||
"created_at": format_ld_date(
|
||||
|
|
|
@ -38,6 +38,7 @@ class IdentityService:
|
|||
domain: Domain,
|
||||
name: str,
|
||||
discoverable: bool = True,
|
||||
indexable: bool = False,
|
||||
) -> Identity:
|
||||
identity = Identity.objects.create(
|
||||
actor_uri=f"https://{domain.uri_domain}/@{username}@{domain.domain}/",
|
||||
|
@ -46,6 +47,7 @@ class IdentityService:
|
|||
name=name,
|
||||
local=True,
|
||||
discoverable=discoverable,
|
||||
indexable=indexable,
|
||||
)
|
||||
identity.users.add(user)
|
||||
identity.generate_keypair()
|
||||
|
|
|
@ -313,6 +313,14 @@ class CreateIdentity(FormView):
|
|||
),
|
||||
required=False,
|
||||
)
|
||||
indexable = forms.BooleanField(
|
||||
help_text="Should this user's activities be indexable on other servers.",
|
||||
initial=False,
|
||||
widget=forms.Select(
|
||||
choices=[(True, "Indexable"), (False, "Not Indexable")]
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
|
||||
def __init__(self, user, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
@ -385,6 +393,7 @@ class CreateIdentity(FormView):
|
|||
domain=domain_instance,
|
||||
name=form.cleaned_data["name"],
|
||||
discoverable=form.cleaned_data["discoverable"],
|
||||
indexable=form.cleaned_data["indexable"],
|
||||
)
|
||||
self.request.session["identity_id"] = identity.id
|
||||
return redirect(identity.urls.view)
|
||||
|
|
|
@ -43,6 +43,13 @@ class ProfilePage(FormView):
|
|||
),
|
||||
required=False,
|
||||
)
|
||||
indexable = forms.BooleanField(
|
||||
help_text="Opt-in to be indexed for search on other servers.\n(Disabling this does not guarantee third-party servers won't index your posts without permission)",
|
||||
widget=forms.Select(
|
||||
choices=[(True, "Indexable"), (False, "Not Indexable")]
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
visible_follows = forms.BooleanField(
|
||||
help_text="Whether or not to show your following and follower counts in your profile",
|
||||
widget=forms.Select(choices=[(True, "Visible"), (False, "Hidden")]),
|
||||
|
@ -93,6 +100,7 @@ class ProfilePage(FormView):
|
|||
"icon": self.identity.icon and self.identity.icon.url,
|
||||
"image": self.identity.image and self.identity.image.url,
|
||||
"discoverable": self.identity.discoverable,
|
||||
"indexable": self.identity.indexable,
|
||||
"visible_follows": self.identity.config_identity.visible_follows,
|
||||
"metadata": self.identity.metadata or [],
|
||||
"search_enabled": self.identity.config_identity.search_enabled,
|
||||
|
@ -104,6 +112,7 @@ class ProfilePage(FormView):
|
|||
service = IdentityService(self.identity)
|
||||
self.identity.name = form.cleaned_data["name"]
|
||||
self.identity.discoverable = form.cleaned_data["discoverable"]
|
||||
self.identity.indexable = form.cleaned_data["indexable"]
|
||||
service.set_summary(form.cleaned_data["summary"])
|
||||
# Resize images
|
||||
icon = form.cleaned_data.get("icon")
|
||||
|
|
Loading…
Reference in New Issue