diff --git a/.gitignore b/.gitignore index e50db4f..949a6fc 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ build/ dist/ static examples/ -chapeau/chapeau/local_config.py +kepi/kepi/local_config.py diff --git a/MANIFEST.in b/MANIFEST.in index 0c4d2fc..c03ca66 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include LICENSE.txt include README.md -recursive-include chapeau *.py -recursive-include chapeau *.xml -recursive-include chapeau *.html +recursive-include kepi *.py +recursive-include kepi *.xml +recursive-include kepi *.html diff --git a/README.md b/README.md index 80ae07f..476ea77 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -chapeau +kepi ==== -chapeau is an ActivityPub daemon. +kepi is an ActivityPub daemon. [ActivityPub](https://www.w3.org/TR/activitypub/) is a standard protocol for integrating social media across Internet sites. @@ -11,14 +11,14 @@ might reply to it, and someone else might "like" it. Someone else again might "follow" you, in order to get notifications when you post anything else. -chapeau runs in the background on your server, distributing your messages +kepi runs in the background on your server, distributing your messages to other sites, and receiving their responses. * [Installation guide](docs/installation.md) -* [Source](https://gitlab.com/marnanel/chapeau/) +* [Source](https://gitlab.com/marnanel/kepi/) If you'd like to contribute, there's lots to do. Find something on the -[bug tracker](https://gitlab.com/marnanel/chapeau/issues?label_name%5B%5D=newbie) +[bug tracker](https://gitlab.com/marnanel/kepi/issues?label_name%5B%5D=newbie) and dive in. If you'd like a gentler learning curve, look for -[bugs marked "newbie"](https://gitlab.com/marnanel/chapeau/issues?label_name%5B%5D=newbie) +[bugs marked "newbie"](https://gitlab.com/marnanel/kepi/issues?label_name%5B%5D=newbie) diff --git a/chapeau/__init__.py b/kepi/__init__.py similarity index 87% rename from chapeau/__init__.py rename to kepi/__init__.py index c889a7d..7a45d85 100644 --- a/chapeau/__init__.py +++ b/kepi/__init__.py @@ -1,4 +1,4 @@ -__title__ = 'chapeau' +__title__ = 'kepi' __version__ = '0.4.0' VERSION = __version__ __author__ = 'Marnanel Thurman' diff --git a/chapeau/bowler_pub/__init__.py b/kepi/bowler_pub/__init__.py similarity index 100% rename from chapeau/bowler_pub/__init__.py rename to kepi/bowler_pub/__init__.py diff --git a/chapeau/bowler_pub/admin.py b/kepi/bowler_pub/admin.py similarity index 85% rename from chapeau/bowler_pub/admin.py rename to kepi/bowler_pub/admin.py index 2468390..90c1f44 100644 --- a/chapeau/bowler_pub/admin.py +++ b/kepi/bowler_pub/admin.py @@ -1,6 +1,6 @@ # admin.py # -# Part of chapeau, an ActivityPub daemon. +# Part of kepi, an ActivityPub daemon. # Copyright (c) 2018-2019 Marnanel Thurman. # Licensed under the GNU Public License v2. @@ -11,9 +11,9 @@ with bowler_pub's models. from django.contrib import admin from polymorphic.admin import * -from chapeau.bowler_pub.models import * -from chapeau.bowler_pub.validation import IncomingMessage -import chapeau.bowler_pub.forms as bowler_pub_forms +from kepi.bowler_pub.models import * +from kepi.bowler_pub.validation import IncomingMessage +import kepi.bowler_pub.forms as bowler_pub_forms ################################### diff --git a/chapeau/bowler_pub/command_line.py b/kepi/bowler_pub/command_line.py similarity index 97% rename from chapeau/bowler_pub/command_line.py rename to kepi/bowler_pub/command_line.py index 5f2c397..46c6824 100644 --- a/chapeau/bowler_pub/command_line.py +++ b/kepi/bowler_pub/command_line.py @@ -1,4 +1,4 @@ -import chapeau.bowler_pub.settings +import kepi.bowler_pub.settings from django.core.management import get_commands, call_command from django.core.management.base import CommandError from django.conf import settings diff --git a/chapeau/bowler_pub/create.py b/kepi/bowler_pub/create.py similarity index 93% rename from chapeau/bowler_pub/create.py rename to kepi/bowler_pub/create.py index 3c4ac0f..bc37b5e 100644 --- a/chapeau/bowler_pub/create.py +++ b/kepi/bowler_pub/create.py @@ -1,6 +1,6 @@ # create.py # -# Part of chapeau, an ActivityPub daemon and library. +# Part of kepi, an ActivityPub daemon and library. # Copyright (c) 2018-2019 Marnanel Thurman. # Licensed under the GNU Public License v2. @@ -8,12 +8,12 @@ This module contains create(), which creates objects. """ -from chapeau.bowler_pub.models import * +from kepi.bowler_pub.models import * import django.db.utils import logging import json -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') def _fix_value_type(v): if type(v) in [str, int, bool]: @@ -59,8 +59,8 @@ def create( Don't confuse create() with objects of type Create! """ - from chapeau.bowler_pub.delivery import deliver - from chapeau.bowler_pub.models.activity import AcActivity + from kepi.bowler_pub.delivery import deliver + from kepi.bowler_pub.models.activity import AcActivity if value is None: value = {} @@ -96,7 +96,7 @@ def create( class_name = 'Ac'+value['type'] try: - import chapeau.bowler_pub.models as bowler_pub_models + import kepi.bowler_pub.models as bowler_pub_models cls = getattr(locals()['bowler_pub_models'], class_name) except AttributeError: logger.warn("There's no type called %s", diff --git a/chapeau/bowler_pub/crypto.py b/kepi/bowler_pub/crypto.py similarity index 97% rename from chapeau/bowler_pub/crypto.py rename to kepi/bowler_pub/crypto.py index 737e080..9f8ef57 100644 --- a/chapeau/bowler_pub/crypto.py +++ b/kepi/bowler_pub/crypto.py @@ -1,6 +1,6 @@ # crypto.py # -# Part of chapeau, an ActivityPub daemon. +# Part of kepi, an ActivityPub daemon. # Copyright (c) 2018-2019 Marnanel Thurman. # Licensed under the GNU Public License v2. diff --git a/chapeau/bowler_pub/delivery.py b/kepi/bowler_pub/delivery.py similarity index 96% rename from chapeau/bowler_pub/delivery.py rename to kepi/bowler_pub/delivery.py index 3462516..7eca83b 100644 --- a/chapeau/bowler_pub/delivery.py +++ b/kepi/bowler_pub/delivery.py @@ -1,6 +1,6 @@ # delivery.py # -# Part of chapeau, an ActivityPub daemon. +# Part of kepi, an ActivityPub daemon. # Copyright (c) 2018-2019 Marnanel Thurman. # Licensed under the GNU Public License v2. @@ -11,8 +11,8 @@ to their audiences. from __future__ import absolute_import, unicode_literals from celery import shared_task -from chapeau.bowler_pub.find import find, find_local, is_local -import chapeau.bowler_pub.models +from kepi.bowler_pub.find import find, find_local, is_local +import kepi.bowler_pub.models from httpsig.verify import HeaderVerifier from urllib.parse import urlparse from django.http.request import HttpRequest @@ -28,7 +28,7 @@ import httpsig from collections.abc import Iterable from . import PUBLIC_IDS -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') def _rfc822_datetime(when=None): """ @@ -55,7 +55,7 @@ def _find_local_actor(activity_form): the "attributedTo" field. """ - from chapeau.bowler_pub.models.acobject import AcObject + from kepi.bowler_pub.models.acobject import AcObject parts = None for fieldname in ['actor', 'attributedTo']: @@ -216,8 +216,8 @@ def _activity_form_to_outgoing_string(activity_form): an HTTP response. """ - from chapeau.bowler_pub import ATSIGN_CONTEXT - from chapeau.bowler_pub.utils import as_json + from kepi.bowler_pub import ATSIGN_CONTEXT + from kepi.bowler_pub.utils import as_json format_for_delivery = activity_form.copy() for blind_field in ['bto', 'bcc']: @@ -414,8 +414,8 @@ def deliver( """ try: - activity = chapeau.bowler_pub.models.AcActivity.objects.get(id=activity_id) - except chapeau.bowler_pub.models.AcActivity.DoesNotExist: + activity = kepi.bowler_pub.models.AcActivity.objects.get(id=activity_id) + except kepi.bowler_pub.models.AcActivity.DoesNotExist: logger.warn("Can't deliver activity %s because it doesn't exist", activity_id) return None diff --git a/chapeau/bowler_pub/find.py b/kepi/bowler_pub/find.py similarity index 96% rename from chapeau/bowler_pub/find.py rename to kepi/bowler_pub/find.py index afc15d2..11fcc79 100644 --- a/chapeau/bowler_pub/find.py +++ b/kepi/bowler_pub/find.py @@ -1,6 +1,6 @@ # find.py # -# Part of chapeau, an ActivityPub daemon. +# Part of kepi, an ActivityPub daemon. # Copyright (c) 2018-2019 Marnanel Thurman. # Licensed under the GNU Public License v2. @@ -15,13 +15,13 @@ from django.conf import settings import django.urls from urllib.parse import urlparse from django.http.request import HttpRequest -from chapeau.bowler_pub.create import create +from kepi.bowler_pub.create import create from django.utils import timezone -from chapeau.bowler_pub.utils import is_short_id +from kepi.bowler_pub.utils import is_short_id import json import mimeparse -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') class Fetch(models.Model): @@ -145,7 +145,7 @@ def find_remote(url, its stated audiences. This is usually not what you want. """ - from chapeau.bowler_pub.models.acobject import AcObject + from kepi.bowler_pub.models.acobject import AcObject logger.debug('%s: find remote', url) @@ -279,7 +279,7 @@ def _short_id_lookup(number): """ - from chapeau.bowler_pub.models import AcObject + from kepi.bowler_pub.models import AcObject try: result = AcObject.objects.get( diff --git a/chapeau/bowler_pub/fixtures/kepi1.json b/kepi/bowler_pub/fixtures/kepi1.json similarity index 100% rename from chapeau/bowler_pub/fixtures/kepi1.json rename to kepi/bowler_pub/fixtures/kepi1.json diff --git a/chapeau/bowler_pub/forms.py b/kepi/bowler_pub/forms.py similarity index 83% rename from chapeau/bowler_pub/forms.py rename to kepi/bowler_pub/forms.py index 2763486..3478ba7 100644 --- a/chapeau/bowler_pub/forms.py +++ b/kepi/bowler_pub/forms.py @@ -1,6 +1,6 @@ # forms.py # -# Part of chapeau, an ActivityPub daemon. +# Part of kepi, an ActivityPub daemon. # Copyright (c) 2018-2019 Marnanel Thurman. # Licensed under the GNU Public License v2. @@ -10,7 +10,7 @@ the admin interface. It's not very elaborate yet. """ from django import forms -import chapeau.bowler_pub.models as bowler_pub_models +import kepi.bowler_pub.models as bowler_pub_models class NoteAdminForm(forms.ModelForm): diff --git a/chapeau/bowler_pub/management/__init__.py b/kepi/bowler_pub/management/__init__.py similarity index 96% rename from chapeau/bowler_pub/management/__init__.py rename to kepi/bowler_pub/management/__init__.py index 9aba9b2..79185fd 100644 --- a/chapeau/bowler_pub/management/__init__.py +++ b/kepi/bowler_pub/management/__init__.py @@ -1,5 +1,5 @@ from django.core.management.base import BaseCommand, CommandError -from chapeau.bowler_pub.models import * +from kepi.bowler_pub.models import * from django.conf import settings import logging import os @@ -7,7 +7,7 @@ import re ENVIRON_USER = 'KEPI_USER' -logger = logging.Logger('chapeau') +logger = logging.Logger('kepi') class KepiCommand(BaseCommand): diff --git a/chapeau/bowler_pub/management/commands/__init__.py b/kepi/bowler_pub/management/commands/__init__.py similarity index 100% rename from chapeau/bowler_pub/management/commands/__init__.py rename to kepi/bowler_pub/management/commands/__init__.py diff --git a/chapeau/bowler_pub/management/commands/kepi-delete.py b/kepi/bowler_pub/management/commands/kepi-delete.py similarity index 91% rename from chapeau/bowler_pub/management/commands/kepi-delete.py rename to kepi/bowler_pub/management/commands/kepi-delete.py index 72f4bf4..d47fd24 100644 --- a/chapeau/bowler_pub/management/commands/kepi-delete.py +++ b/kepi/bowler_pub/management/commands/kepi-delete.py @@ -1,13 +1,13 @@ from django.core.management.base import BaseCommand, CommandError from django.conf import settings -from chapeau.bowler_pub.models import * -from chapeau.bowler_pub.create import create -from chapeau.bowler_pub.management import KepiCommand, objects_by_keywords +from kepi.bowler_pub.models import * +from kepi.bowler_pub.create import create +from kepi.bowler_pub.management import KepiCommand, objects_by_keywords import os import logging import json -logger = logging.Logger('chapeau') +logger = logging.Logger('kepi') class Command(KepiCommand): diff --git a/chapeau/bowler_pub/management/commands/kepi-follow.py b/kepi/bowler_pub/management/commands/kepi-follow.py similarity index 80% rename from chapeau/bowler_pub/management/commands/kepi-follow.py rename to kepi/bowler_pub/management/commands/kepi-follow.py index 548b78b..529ec5f 100644 --- a/chapeau/bowler_pub/management/commands/kepi-follow.py +++ b/kepi/bowler_pub/management/commands/kepi-follow.py @@ -1,12 +1,12 @@ from django.core.management.base import BaseCommand, CommandError from django.conf import settings -from chapeau.bowler_pub.models import * -from chapeau.bowler_pub.create import create -from chapeau.bowler_pub.management import KepiCommand +from kepi.bowler_pub.models import * +from kepi.bowler_pub.create import create +from kepi.bowler_pub.management import KepiCommand import os import logging -logger = logging.Logger('chapeau') +logger = logging.Logger('kepi') class Command(KepiCommand): diff --git a/chapeau/bowler_pub/management/commands/kepi-list.py b/kepi/bowler_pub/management/commands/kepi-list.py similarity index 83% rename from chapeau/bowler_pub/management/commands/kepi-list.py rename to kepi/bowler_pub/management/commands/kepi-list.py index fa84a0f..b1fc2db 100644 --- a/chapeau/bowler_pub/management/commands/kepi-list.py +++ b/kepi/bowler_pub/management/commands/kepi-list.py @@ -1,12 +1,12 @@ from django.core.management.base import BaseCommand, CommandError from django.conf import settings -from chapeau.bowler_pub.models import * -from chapeau.bowler_pub.create import create -from chapeau.bowler_pub.management import KepiCommand +from kepi.bowler_pub.models import * +from kepi.bowler_pub.create import create +from kepi.bowler_pub.management import KepiCommand import os import logging -logger = logging.Logger('chapeau') +logger = logging.Logger('kepi') class Command(KepiCommand): diff --git a/chapeau/bowler_pub/management/commands/kepi-new.py b/kepi/bowler_pub/management/commands/kepi-new.py similarity index 93% rename from chapeau/bowler_pub/management/commands/kepi-new.py rename to kepi/bowler_pub/management/commands/kepi-new.py index 67dbbb2..5c4463b 100644 --- a/chapeau/bowler_pub/management/commands/kepi-new.py +++ b/kepi/bowler_pub/management/commands/kepi-new.py @@ -1,8 +1,8 @@ -from chapeau.bowler_pub.create import create -from chapeau.bowler_pub.management import KepiCommand +from kepi.bowler_pub.create import create +from kepi.bowler_pub.management import KepiCommand import logging -logger = logging.Logger('chapeau') +logger = logging.Logger('kepi') class Command(KepiCommand): diff --git a/chapeau/bowler_pub/management/commands/kepi-post.py b/kepi/bowler_pub/management/commands/kepi-post.py similarity index 91% rename from chapeau/bowler_pub/management/commands/kepi-post.py rename to kepi/bowler_pub/management/commands/kepi-post.py index 751dcb0..1b01ec3 100644 --- a/chapeau/bowler_pub/management/commands/kepi-post.py +++ b/kepi/bowler_pub/management/commands/kepi-post.py @@ -1,12 +1,12 @@ from django.core.management.base import BaseCommand, CommandError from django.conf import settings -from chapeau.bowler_pub.models import * -from chapeau.bowler_pub.create import create -from chapeau.bowler_pub.management import KepiCommand +from kepi.bowler_pub.models import * +from kepi.bowler_pub.create import create +from kepi.bowler_pub.management import KepiCommand import os import logging -logger = logging.Logger('chapeau') +logger = logging.Logger('kepi') class Command(KepiCommand): diff --git a/chapeau/bowler_pub/management/commands/kepi-show.py b/kepi/bowler_pub/management/commands/kepi-show.py similarity index 94% rename from chapeau/bowler_pub/management/commands/kepi-show.py rename to kepi/bowler_pub/management/commands/kepi-show.py index 40d91cc..aa5a6cf 100644 --- a/chapeau/bowler_pub/management/commands/kepi-show.py +++ b/kepi/bowler_pub/management/commands/kepi-show.py @@ -1,13 +1,13 @@ from django.core.management.base import BaseCommand, CommandError from django.conf import settings -from chapeau.bowler_pub.models import * -from chapeau.bowler_pub.create import create -from chapeau.bowler_pub.management import KepiCommand, objects_by_keywords +from kepi.bowler_pub.models import * +from kepi.bowler_pub.create import create +from kepi.bowler_pub.management import KepiCommand, objects_by_keywords from collections import abc import os import logging -logger = logging.Logger('chapeau') +logger = logging.Logger('kepi') class Command(KepiCommand): @@ -128,7 +128,7 @@ class Command(KepiCommand): def _show_json(self, thing, *args, **options): - from chapeau.bowler_pub.utils import as_json + from kepi.bowler_pub.utils import as_json print(as_json(thing.activity_form)) diff --git a/chapeau/bowler_pub/management/commands/kepi-users.py b/kepi/bowler_pub/management/commands/kepi-users.py similarity index 91% rename from chapeau/bowler_pub/management/commands/kepi-users.py rename to kepi/bowler_pub/management/commands/kepi-users.py index 522d585..f20993b 100644 --- a/chapeau/bowler_pub/management/commands/kepi-users.py +++ b/kepi/bowler_pub/management/commands/kepi-users.py @@ -1,12 +1,12 @@ from django.core.management.base import BaseCommand, CommandError from django.conf import settings -from chapeau.bowler_pub.models import * -from chapeau.bowler_pub.create import create -from chapeau.bowler_pub.management import KepiCommand +from kepi.bowler_pub.models import * +from kepi.bowler_pub.create import create +from kepi.bowler_pub.management import KepiCommand import os import logging -logger = logging.Logger('chapeau') +logger = logging.Logger('kepi') class Command(KepiCommand): diff --git a/chapeau/bowler_pub/middleware.py b/kepi/bowler_pub/middleware.py similarity index 95% rename from chapeau/bowler_pub/middleware.py rename to kepi/bowler_pub/middleware.py index 90eba5f..42ef2b0 100644 --- a/chapeau/bowler_pub/middleware.py +++ b/kepi/bowler_pub/middleware.py @@ -1,6 +1,6 @@ # middleware.py # -# Part of chapeau, an ActivityPub daemon. +# Part of kepi, an ActivityPub daemon. # Copyright (c) 2018-2019 Marnanel Thurman. # Licensed under the GNU Public License v2. diff --git a/chapeau/bowler_pub/migrations/0001_initial.py b/kepi/bowler_pub/migrations/0001_initial.py similarity index 100% rename from chapeau/bowler_pub/migrations/0001_initial.py rename to kepi/bowler_pub/migrations/0001_initial.py diff --git a/chapeau/bowler_pub/migrations/0002_acitem_serial.py b/kepi/bowler_pub/migrations/0002_acitem_serial.py similarity index 100% rename from chapeau/bowler_pub/migrations/0002_acitem_serial.py rename to kepi/bowler_pub/migrations/0002_acitem_serial.py diff --git a/chapeau/bowler_pub/migrations/0003_auto_20191116_1539.py b/kepi/bowler_pub/migrations/0003_auto_20191116_1539.py similarity index 100% rename from chapeau/bowler_pub/migrations/0003_auto_20191116_1539.py rename to kepi/bowler_pub/migrations/0003_auto_20191116_1539.py diff --git a/chapeau/bowler_pub/migrations/__init__.py b/kepi/bowler_pub/migrations/__init__.py similarity index 100% rename from chapeau/bowler_pub/migrations/__init__.py rename to kepi/bowler_pub/migrations/__init__.py diff --git a/chapeau/bowler_pub/models/README.md b/kepi/bowler_pub/models/README.md similarity index 100% rename from chapeau/bowler_pub/models/README.md rename to kepi/bowler_pub/models/README.md diff --git a/chapeau/bowler_pub/models/__init__.py b/kepi/bowler_pub/models/__init__.py similarity index 100% rename from chapeau/bowler_pub/models/__init__.py rename to kepi/bowler_pub/models/__init__.py diff --git a/chapeau/bowler_pub/models/acobject.py b/kepi/bowler_pub/models/acobject.py similarity index 94% rename from chapeau/bowler_pub/models/acobject.py rename to kepi/bowler_pub/models/acobject.py index 4e45e14..ee77ae7 100644 --- a/chapeau/bowler_pub/models/acobject.py +++ b/kepi/bowler_pub/models/acobject.py @@ -3,18 +3,18 @@ from django.conf import settings from django.utils import timezone from polymorphic.models import PolymorphicModel from polymorphic.managers import PolymorphicManager -from chapeau.bowler_pub.models.audience import Audience, AUDIENCE_FIELD_NAMES -from chapeau.bowler_pub.models.thingfield import ThingField -from chapeau.bowler_pub.models.mention import Mention -from chapeau.bowler_pub.utils import configured_path, uri_to_url +from kepi.bowler_pub.models.audience import Audience, AUDIENCE_FIELD_NAMES +from kepi.bowler_pub.models.thingfield import ThingField +from kepi.bowler_pub.models.mention import Mention +from kepi.bowler_pub.utils import configured_path, uri_to_url from .. import URL_REGEXP, SERIAL_NUMBER_REGEXP -import chapeau.bowler_pub.side_effects as side_effects +import kepi.bowler_pub.side_effects as side_effects import logging import random import warnings import re -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') ###################### @@ -152,7 +152,7 @@ class AcObject(PolymorphicModel): @property def activity_form(self): - from chapeau.bowler_pub.utils import short_id_to_url + from kepi.bowler_pub.utils import short_id_to_url result = { 'id': self.url, @@ -189,7 +189,7 @@ class AcObject(PolymorphicModel): def __getitem__(self, name): - from chapeau.bowler_pub.find import find + from kepi.bowler_pub.find import find name_parts = name.split('__') name = name_parts.pop(0) @@ -265,7 +265,7 @@ class AcObject(PolymorphicModel): ) else: - from chapeau.bowler_pub.utils import as_json + from kepi.bowler_pub.utils import as_json if self.pk is None: # See above @@ -304,8 +304,8 @@ class AcObject(PolymorphicModel): def run_side_effects(self): - from chapeau.bowler_pub.find import find - from chapeau.bowler_pub.delivery import deliver + from kepi.bowler_pub.find import find + from kepi.bowler_pub.delivery import deliver f_type = self.f_type.lower() @@ -410,7 +410,7 @@ class AcObject(PolymorphicModel): find() would ignore these. """ - from chapeau.bowler_pub.find import find + from kepi.bowler_pub.find import find logger.debug(' -- finding object with url %s', url) result = find(url, diff --git a/chapeau/bowler_pub/models/activity.py b/kepi/bowler_pub/models/activity.py similarity index 93% rename from chapeau/bowler_pub/models/activity.py rename to kepi/bowler_pub/models/activity.py index caef180..979b036 100644 --- a/chapeau/bowler_pub/models/activity.py +++ b/kepi/bowler_pub/models/activity.py @@ -2,7 +2,7 @@ from django.db import models from . import acobject import logging -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') ###################### @@ -23,8 +23,8 @@ class AcActivity(acobject.AcObject): def go_into_outbox_if_local(self): - from chapeau.bowler_pub.models.collection import Collection - from chapeau.bowler_pub.find import find + from kepi.bowler_pub.models.collection import Collection + from kepi.bowler_pub.find import find if not self.is_local: return diff --git a/chapeau/bowler_pub/models/actor.py b/kepi/bowler_pub/models/actor.py similarity index 97% rename from chapeau/bowler_pub/models/actor.py rename to kepi/bowler_pub/models/actor.py index ddd4333..d55b965 100644 --- a/chapeau/bowler_pub/models/actor.py +++ b/kepi/bowler_pub/models/actor.py @@ -1,12 +1,12 @@ from django.db import models from django.conf import settings from . import acobject, following, collection -import chapeau.bowler_pub.crypto as crypto -from chapeau.bowler_pub.utils import configured_url, uri_to_url +import kepi.bowler_pub.crypto as crypto +from kepi.bowler_pub.utils import configured_url, uri_to_url import logging import re -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') LIST_NAMES = [ 'inbox', 'outbox', 'followers', 'following', @@ -122,7 +122,7 @@ class AcActor(acobject.AcObject): elif name=='publicKey': - from chapeau.bowler_pub.utils import as_json + from kepi.bowler_pub.utils import as_json self.publicKey = as_json(value, indent=None) diff --git a/chapeau/bowler_pub/models/audience.py b/kepi/bowler_pub/models/audience.py similarity index 98% rename from chapeau/bowler_pub/models/audience.py rename to kepi/bowler_pub/models/audience.py index f42ef2e..bccc271 100644 --- a/chapeau/bowler_pub/models/audience.py +++ b/kepi/bowler_pub/models/audience.py @@ -3,7 +3,7 @@ from collections import defaultdict from .. import PUBLIC_IDS import logging -logger = logging.getLogger('chapeau') +logger = logging.getLogger('kepi') FIELD_AUDIENCE = 0x01 # literally "audience" FIELD_TO = 0x02 diff --git a/chapeau/bowler_pub/models/collection.py b/kepi/bowler_pub/models/collection.py similarity index 98% rename from chapeau/bowler_pub/models/collection.py rename to kepi/bowler_pub/models/collection.py index 9d938dc..8e5b59f 100644 --- a/chapeau/bowler_pub/models/collection.py +++ b/kepi/bowler_pub/models/collection.py @@ -3,7 +3,7 @@ from django.conf import settings from .acobject import AcObject import logging -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') class Collection(models.Model): diff --git a/chapeau/bowler_pub/models/following.py b/kepi/bowler_pub/models/following.py similarity index 96% rename from chapeau/bowler_pub/models/following.py rename to kepi/bowler_pub/models/following.py index 876b255..a03f424 100644 --- a/chapeau/bowler_pub/models/following.py +++ b/kepi/bowler_pub/models/following.py @@ -1,8 +1,8 @@ from django.db import models -from chapeau.bowler_pub.utils import short_id_to_url +from kepi.bowler_pub.utils import short_id_to_url import logging -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') class Following(models.Model): diff --git a/chapeau/bowler_pub/models/item.py b/kepi/bowler_pub/models/item.py similarity index 97% rename from chapeau/bowler_pub/models/item.py rename to kepi/bowler_pub/models/item.py index 8abbe78..69b1341 100644 --- a/chapeau/bowler_pub/models/item.py +++ b/kepi/bowler_pub/models/item.py @@ -5,7 +5,7 @@ from django.conf import settings import logging import random -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') ###################### @@ -122,7 +122,7 @@ class AcItem(acobject.AcObject): @property def thread(self): - from chapeau.bowler_pub.find import find + from kepi.bowler_pub.find import find if hasattr(self, '_thread'): return self._thread @@ -190,7 +190,7 @@ class AcItem(acobject.AcObject): in which case this property will be None. You can still find the name of the actor in f_attributedTo. """ - from chapeau.bowler_pub.find import find + from kepi.bowler_pub.find import find return find(self.f_attributedTo, local_only=True) @@ -200,7 +200,7 @@ class AcItem(acobject.AcObject): @property def mentions(self): - from chapeau.bowler_pub.models.mention import Mention + from kepi.bowler_pub.models.mention import Mention logger.info('Finding Mentions for %s', self) return [x.to_actor for x in diff --git a/chapeau/bowler_pub/models/mention.py b/kepi/bowler_pub/models/mention.py similarity index 96% rename from chapeau/bowler_pub/models/mention.py rename to kepi/bowler_pub/models/mention.py index 218326a..2b9350c 100644 --- a/chapeau/bowler_pub/models/mention.py +++ b/kepi/bowler_pub/models/mention.py @@ -1,7 +1,7 @@ from django.db import models import logging -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') ###################### diff --git a/chapeau/bowler_pub/models/thingfield.py b/kepi/bowler_pub/models/thingfield.py similarity index 97% rename from chapeau/bowler_pub/models/thingfield.py rename to kepi/bowler_pub/models/thingfield.py index 38d33cb..1b253ab 100644 --- a/chapeau/bowler_pub/models/thingfield.py +++ b/kepi/bowler_pub/models/thingfield.py @@ -2,7 +2,7 @@ from django.db import models import logging import json -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') class ThingField(models.Model): diff --git a/chapeau/bowler_pub/side_effects.py b/kepi/bowler_pub/side_effects.py similarity index 92% rename from chapeau/bowler_pub/side_effects.py rename to kepi/bowler_pub/side_effects.py index 3568d85..6edeb26 100644 --- a/chapeau/bowler_pub/side_effects.py +++ b/kepi/bowler_pub/side_effects.py @@ -1,6 +1,6 @@ # side_effects.py # -# Part of chapeau, an ActivityPub daemon. +# Part of kepi, an ActivityPub daemon. # Copyright (c) 2018-2019 Marnanel Thurman. # Licensed under the GNU Public License v2. @@ -13,14 +13,14 @@ the new activity as a parameter. import logging from django.conf import settings -from chapeau.bowler_pub.find import find, is_local -from chapeau.bowler_pub.delivery import deliver +from kepi.bowler_pub.find import find, is_local +from kepi.bowler_pub.delivery import deliver -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') def accept(activity): - from chapeau.bowler_pub.models.following import Following + from kepi.bowler_pub.models.following import Following obj = activity['object__obj'] @@ -40,8 +40,8 @@ def accept(activity): def follow(activity): - from chapeau.bowler_pub.models.following import Following - from chapeau.bowler_pub.create import create + from kepi.bowler_pub.models.following import Following + from kepi.bowler_pub.create import create if not is_local(activity['object']): logger.info('Following a remote user has no local side-effects.') @@ -72,7 +72,7 @@ def follow(activity): def reject(activity): - from chapeau.bowler_pub.models.following import Following + from kepi.bowler_pub.models.following import Following obj = activity['object__obj'] @@ -92,9 +92,9 @@ def reject(activity): def create(activity): - import chapeau.bowler_pub.models as bowler_pub_models - from chapeau.bowler_pub.create import create as bowler_pub_create - from chapeau.bowler_pub.models.audience import AUDIENCE_FIELD_KEYS + import kepi.bowler_pub.models as bowler_pub_models + from kepi.bowler_pub.create import create as bowler_pub_create + from kepi.bowler_pub.models.audience import AUDIENCE_FIELD_KEYS raw_material = activity['object'].copy() @@ -147,7 +147,7 @@ def create(activity): def it_is_relevant(something, activity): - from chapeau.bowler_pub.models import Audience + from kepi.bowler_pub.models import Audience logger.debug('Checking whether the new object is relevant to us.') diff --git a/chapeau/bowler_pub/static/defaults/avatar_0.jpg b/kepi/bowler_pub/static/defaults/avatar_0.jpg similarity index 100% rename from chapeau/bowler_pub/static/defaults/avatar_0.jpg rename to kepi/bowler_pub/static/defaults/avatar_0.jpg diff --git a/chapeau/bowler_pub/static/defaults/avatar_1.jpg b/kepi/bowler_pub/static/defaults/avatar_1.jpg similarity index 100% rename from chapeau/bowler_pub/static/defaults/avatar_1.jpg rename to kepi/bowler_pub/static/defaults/avatar_1.jpg diff --git a/chapeau/bowler_pub/static/defaults/avatar_2.jpg b/kepi/bowler_pub/static/defaults/avatar_2.jpg similarity index 100% rename from chapeau/bowler_pub/static/defaults/avatar_2.jpg rename to kepi/bowler_pub/static/defaults/avatar_2.jpg diff --git a/chapeau/bowler_pub/static/defaults/avatar_3.jpg b/kepi/bowler_pub/static/defaults/avatar_3.jpg similarity index 100% rename from chapeau/bowler_pub/static/defaults/avatar_3.jpg rename to kepi/bowler_pub/static/defaults/avatar_3.jpg diff --git a/chapeau/bowler_pub/static/defaults/avatar_4.jpg b/kepi/bowler_pub/static/defaults/avatar_4.jpg similarity index 100% rename from chapeau/bowler_pub/static/defaults/avatar_4.jpg rename to kepi/bowler_pub/static/defaults/avatar_4.jpg diff --git a/chapeau/bowler_pub/static/defaults/avatar_5.jpg b/kepi/bowler_pub/static/defaults/avatar_5.jpg similarity index 100% rename from chapeau/bowler_pub/static/defaults/avatar_5.jpg rename to kepi/bowler_pub/static/defaults/avatar_5.jpg diff --git a/chapeau/bowler_pub/static/defaults/avatar_6.jpg b/kepi/bowler_pub/static/defaults/avatar_6.jpg similarity index 100% rename from chapeau/bowler_pub/static/defaults/avatar_6.jpg rename to kepi/bowler_pub/static/defaults/avatar_6.jpg diff --git a/chapeau/bowler_pub/static/defaults/avatar_7.jpg b/kepi/bowler_pub/static/defaults/avatar_7.jpg similarity index 100% rename from chapeau/bowler_pub/static/defaults/avatar_7.jpg rename to kepi/bowler_pub/static/defaults/avatar_7.jpg diff --git a/chapeau/bowler_pub/static/defaults/avatar_8.jpg b/kepi/bowler_pub/static/defaults/avatar_8.jpg similarity index 100% rename from chapeau/bowler_pub/static/defaults/avatar_8.jpg rename to kepi/bowler_pub/static/defaults/avatar_8.jpg diff --git a/chapeau/bowler_pub/static/defaults/avatar_9.jpg b/kepi/bowler_pub/static/defaults/avatar_9.jpg similarity index 100% rename from chapeau/bowler_pub/static/defaults/avatar_9.jpg rename to kepi/bowler_pub/static/defaults/avatar_9.jpg diff --git a/chapeau/bowler_pub/static/defaults/avatar_fullsize.jpg b/kepi/bowler_pub/static/defaults/avatar_fullsize.jpg similarity index 100% rename from chapeau/bowler_pub/static/defaults/avatar_fullsize.jpg rename to kepi/bowler_pub/static/defaults/avatar_fullsize.jpg diff --git a/chapeau/bowler_pub/static/defaults/header.jpg b/kepi/bowler_pub/static/defaults/header.jpg similarity index 100% rename from chapeau/bowler_pub/static/defaults/header.jpg rename to kepi/bowler_pub/static/defaults/header.jpg diff --git a/chapeau/bowler_pub/static/testing/alice.jpg b/kepi/bowler_pub/static/testing/alice.jpg similarity index 100% rename from chapeau/bowler_pub/static/testing/alice.jpg rename to kepi/bowler_pub/static/testing/alice.jpg diff --git a/chapeau/bowler_pub/static/testing/bob.jpg b/kepi/bowler_pub/static/testing/bob.jpg similarity index 100% rename from chapeau/bowler_pub/static/testing/bob.jpg rename to kepi/bowler_pub/static/testing/bob.jpg diff --git a/chapeau/bowler_pub/static/testing/carol.jpg b/kepi/bowler_pub/static/testing/carol.jpg similarity index 100% rename from chapeau/bowler_pub/static/testing/carol.jpg rename to kepi/bowler_pub/static/testing/carol.jpg diff --git a/chapeau/bowler_pub/templates/host-meta.xml b/kepi/bowler_pub/templates/host-meta.xml similarity index 100% rename from chapeau/bowler_pub/templates/host-meta.xml rename to kepi/bowler_pub/templates/host-meta.xml diff --git a/chapeau/bowler_pub/tests/__init__.py b/kepi/bowler_pub/tests/__init__.py similarity index 95% rename from chapeau/bowler_pub/tests/__init__.py rename to kepi/bowler_pub/tests/__init__.py index d0631df..709fe15 100644 --- a/chapeau/bowler_pub/tests/__init__.py +++ b/kepi/bowler_pub/tests/__init__.py @@ -1,7 +1,7 @@ -from chapeau.bowler_pub.create import create -from chapeau.bowler_pub.validation import IncomingMessage, validate -from chapeau.bowler_pub.models import AcObject, AcActor -from chapeau.bowler_pub.utils import as_json, uri_to_url, configured_url +from kepi.bowler_pub.create import create +from kepi.bowler_pub.validation import IncomingMessage, validate +from kepi.bowler_pub.models import AcObject, AcActor +from kepi.bowler_pub.utils import as_json, uri_to_url, configured_url from django.conf import settings import django.test import httpretty @@ -33,10 +33,10 @@ PUBLIC = "https://www.w3.org/ns/activitystreams#Public" CONTEXT_URL = "https://www.w3.org/ns/activitystreams" -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') def create_local_person(name='jemima', - load_default_keys_from='chapeau/bowler_pub/tests/keys/keys-0003.json', + load_default_keys_from='kepi/bowler_pub/tests/keys/keys-0003.json', **kwargs): if 'publicKey' or 'privateKey' not in kwargs: @@ -363,7 +363,7 @@ def remote_user(url, name, def remote_object_is_recorded(url): - from chapeau.bowler_pub.models import AcObject + from kepi.bowler_pub.models import AcObject try: result = AcObject.objects.get(id=url) diff --git a/chapeau/bowler_pub/tests/keys/instances.pem b/kepi/bowler_pub/tests/keys/instances.pem similarity index 100% rename from chapeau/bowler_pub/tests/keys/instances.pem rename to kepi/bowler_pub/tests/keys/instances.pem diff --git a/chapeau/bowler_pub/tests/keys/keys-0000.json b/kepi/bowler_pub/tests/keys/keys-0000.json similarity index 100% rename from chapeau/bowler_pub/tests/keys/keys-0000.json rename to kepi/bowler_pub/tests/keys/keys-0000.json diff --git a/chapeau/bowler_pub/tests/keys/keys-0001.json b/kepi/bowler_pub/tests/keys/keys-0001.json similarity index 100% rename from chapeau/bowler_pub/tests/keys/keys-0001.json rename to kepi/bowler_pub/tests/keys/keys-0001.json diff --git a/chapeau/bowler_pub/tests/keys/keys-0002.json b/kepi/bowler_pub/tests/keys/keys-0002.json similarity index 100% rename from chapeau/bowler_pub/tests/keys/keys-0002.json rename to kepi/bowler_pub/tests/keys/keys-0002.json diff --git a/chapeau/bowler_pub/tests/keys/keys-0003.json b/kepi/bowler_pub/tests/keys/keys-0003.json similarity index 100% rename from chapeau/bowler_pub/tests/keys/keys-0003.json rename to kepi/bowler_pub/tests/keys/keys-0003.json diff --git a/chapeau/bowler_pub/tests/keys/marnanel.pem b/kepi/bowler_pub/tests/keys/marnanel.pem similarity index 100% rename from chapeau/bowler_pub/tests/keys/marnanel.pem rename to kepi/bowler_pub/tests/keys/marnanel.pem diff --git a/chapeau/bowler_pub/tests/manage/__init__.py b/kepi/bowler_pub/tests/manage/__init__.py similarity index 100% rename from chapeau/bowler_pub/tests/manage/__init__.py rename to kepi/bowler_pub/tests/manage/__init__.py diff --git a/chapeau/bowler_pub/tests/manage/test_kepi_post.py b/kepi/bowler_pub/tests/manage/test_kepi_post.py similarity index 98% rename from chapeau/bowler_pub/tests/manage/test_kepi_post.py rename to kepi/bowler_pub/tests/manage/test_kepi_post.py index d3bcc1b..25fbbcc 100644 --- a/chapeau/bowler_pub/tests/manage/test_kepi_post.py +++ b/kepi/bowler_pub/tests/manage/test_kepi_post.py @@ -1,7 +1,7 @@ from io import StringIO from django.test import TestCase from django.core.management import call_command -from chapeau.bowler_pub.models import * +from kepi.bowler_pub.models import * from .. import create_local_person class KepiPostTest(TestCase): diff --git a/chapeau/bowler_pub/tests/manage/test_kepi_users.py b/kepi/bowler_pub/tests/manage/test_kepi_users.py similarity index 100% rename from chapeau/bowler_pub/tests/manage/test_kepi_users.py rename to kepi/bowler_pub/tests/manage/test_kepi_users.py diff --git a/chapeau/bowler_pub/tests/mastodon/README.md b/kepi/bowler_pub/tests/mastodon/README.md similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/README.md rename to kepi/bowler_pub/tests/mastodon/README.md diff --git a/chapeau/bowler_pub/tests/mastodon/__init__.py b/kepi/bowler_pub/tests/mastodon/__init__.py similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/__init__.py rename to kepi/bowler_pub/tests/mastodon/__init__.py diff --git a/chapeau/bowler_pub/tests/mastodon/accept_spec.rb b/kepi/bowler_pub/tests/mastodon/accept_spec.rb similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/accept_spec.rb rename to kepi/bowler_pub/tests/mastodon/accept_spec.rb diff --git a/chapeau/bowler_pub/tests/mastodon/add_spec.rb b/kepi/bowler_pub/tests/mastodon/add_spec.rb similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/add_spec.rb rename to kepi/bowler_pub/tests/mastodon/add_spec.rb diff --git a/chapeau/bowler_pub/tests/mastodon/announce_spec.rb b/kepi/bowler_pub/tests/mastodon/announce_spec.rb similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/announce_spec.rb rename to kepi/bowler_pub/tests/mastodon/announce_spec.rb diff --git a/chapeau/bowler_pub/tests/mastodon/block_spec.rb b/kepi/bowler_pub/tests/mastodon/block_spec.rb similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/block_spec.rb rename to kepi/bowler_pub/tests/mastodon/block_spec.rb diff --git a/chapeau/bowler_pub/tests/mastodon/create_spec.rb b/kepi/bowler_pub/tests/mastodon/create_spec.rb similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/create_spec.rb rename to kepi/bowler_pub/tests/mastodon/create_spec.rb diff --git a/chapeau/bowler_pub/tests/mastodon/delete_spec.rb b/kepi/bowler_pub/tests/mastodon/delete_spec.rb similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/delete_spec.rb rename to kepi/bowler_pub/tests/mastodon/delete_spec.rb diff --git a/chapeau/bowler_pub/tests/mastodon/flag_spec.rb b/kepi/bowler_pub/tests/mastodon/flag_spec.rb similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/flag_spec.rb rename to kepi/bowler_pub/tests/mastodon/flag_spec.rb diff --git a/chapeau/bowler_pub/tests/mastodon/follow_spec.rb b/kepi/bowler_pub/tests/mastodon/follow_spec.rb similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/follow_spec.rb rename to kepi/bowler_pub/tests/mastodon/follow_spec.rb diff --git a/chapeau/bowler_pub/tests/mastodon/like_spec.rb b/kepi/bowler_pub/tests/mastodon/like_spec.rb similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/like_spec.rb rename to kepi/bowler_pub/tests/mastodon/like_spec.rb diff --git a/chapeau/bowler_pub/tests/mastodon/move_spec.rb b/kepi/bowler_pub/tests/mastodon/move_spec.rb similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/move_spec.rb rename to kepi/bowler_pub/tests/mastodon/move_spec.rb diff --git a/chapeau/bowler_pub/tests/mastodon/reject_spec.rb b/kepi/bowler_pub/tests/mastodon/reject_spec.rb similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/reject_spec.rb rename to kepi/bowler_pub/tests/mastodon/reject_spec.rb diff --git a/chapeau/bowler_pub/tests/mastodon/remove_spec.rb b/kepi/bowler_pub/tests/mastodon/remove_spec.rb similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/remove_spec.rb rename to kepi/bowler_pub/tests/mastodon/remove_spec.rb diff --git a/chapeau/bowler_pub/tests/mastodon/test_create.py b/kepi/bowler_pub/tests/mastodon/test_create.py similarity index 96% rename from chapeau/bowler_pub/tests/mastodon/test_create.py rename to kepi/bowler_pub/tests/mastodon/test_create.py index c48a7b0..051887b 100644 --- a/chapeau/bowler_pub/tests/mastodon/test_create.py +++ b/kepi/bowler_pub/tests/mastodon/test_create.py @@ -1,9 +1,9 @@ from django.test import TestCase -from chapeau.bowler_pub.tests import create_local_note, create_local_person -from chapeau.bowler_pub.create import create -from chapeau.bowler_pub.models.audience import Audience, AUDIENCE_FIELD_NAMES -from chapeau.bowler_pub.models.mention import Mention -from chapeau.bowler_pub.models.item import AcItem +from kepi.bowler_pub.tests import create_local_note, create_local_person +from kepi.bowler_pub.create import create +from kepi.bowler_pub.models.audience import Audience, AUDIENCE_FIELD_NAMES +from kepi.bowler_pub.models.mention import Mention +from kepi.bowler_pub.models.item import AcItem from .. import create_local_person import logging import json @@ -12,7 +12,7 @@ from django.conf import settings REMOTE_ALICE = 'https://somewhere.example.com/users/alice' LOCAL_FRED = 'https://testserver/users/fred' -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') class TestCreate(TestCase): @@ -306,7 +306,7 @@ class TestCreate(TestCase): def test_when_sender_is_followed_by_local_users(self): - from chapeau.bowler_pub.models.following import Following + from kepi.bowler_pub.models.following import Following local_user = create_local_person() diff --git a/chapeau/bowler_pub/tests/mastodon/test_like.py b/kepi/bowler_pub/tests/mastodon/test_like.py similarity index 86% rename from chapeau/bowler_pub/tests/mastodon/test_like.py rename to kepi/bowler_pub/tests/mastodon/test_like.py index 93e2406..5c40412 100644 --- a/chapeau/bowler_pub/tests/mastodon/test_like.py +++ b/kepi/bowler_pub/tests/mastodon/test_like.py @@ -1,6 +1,6 @@ -from chapeau.bowler_pub.tests import create_local_note, create_local_person +from kepi.bowler_pub.tests import create_local_note, create_local_person from unittest import skip -from chapeau.bowler_pub.create import create +from kepi.bowler_pub.create import create from django.test import TestCase class TestLike(TestCase): diff --git a/chapeau/bowler_pub/tests/mastodon/test_update.py b/kepi/bowler_pub/tests/mastodon/test_update.py similarity index 79% rename from chapeau/bowler_pub/tests/mastodon/test_update.py rename to kepi/bowler_pub/tests/mastodon/test_update.py index f53a060..2923cc4 100644 --- a/chapeau/bowler_pub/tests/mastodon/test_update.py +++ b/kepi/bowler_pub/tests/mastodon/test_update.py @@ -1,15 +1,15 @@ from django.test import TestCase -from chapeau.bowler_pub.tests import create_local_note, create_local_person +from kepi.bowler_pub.tests import create_local_note, create_local_person from unittest import skip -from chapeau.bowler_pub.create import create -from chapeau.bowler_pub.models import * +from kepi.bowler_pub.create import create +from kepi.bowler_pub.models import * import logging SENDER_ID = 'https://example.com/actor' SENDER_DOMAIN = 'example.com' SENDER_FOLLOWERS = 'https://example.com/followers' -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') # XXX Why does this only test updating of profiles? # XXX I thought we should update items as well. diff --git a/chapeau/bowler_pub/tests/mastodon/undo_spec.rb b/kepi/bowler_pub/tests/mastodon/undo_spec.rb similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/undo_spec.rb rename to kepi/bowler_pub/tests/mastodon/undo_spec.rb diff --git a/chapeau/bowler_pub/tests/mastodon/update_spec.rb b/kepi/bowler_pub/tests/mastodon/update_spec.rb similarity index 100% rename from chapeau/bowler_pub/tests/mastodon/update_spec.rb rename to kepi/bowler_pub/tests/mastodon/update_spec.rb diff --git a/chapeau/bowler_pub/tests/test_activity.py b/kepi/bowler_pub/tests/test_activity.py similarity index 92% rename from chapeau/bowler_pub/tests/test_activity.py rename to kepi/bowler_pub/tests/test_activity.py index c53d2bb..665c73c 100644 --- a/chapeau/bowler_pub/tests/test_activity.py +++ b/kepi/bowler_pub/tests/test_activity.py @@ -1,17 +1,17 @@ # test_activity.py # -# Part of chapeau, an ActivityPub daemon. +# Part of kepi, an ActivityPub daemon. # Copyright (c) 2018-2019 Marnanel Thurman. # Licensed under the GNU Public License v2. from django.test import TestCase -from chapeau.bowler_pub.models import AcObject, AcActivity -from chapeau.bowler_pub.create import create +from kepi.bowler_pub.models import AcObject, AcActivity +from kepi.bowler_pub.create import create from unittest import skip from . import remote_object_is_recorded, create_local_person import logging -logger = logging.Logger(name='chapeau') +logger = logging.Logger(name='kepi') REMOTE_ID_1 = 'https://users.example.com/activity/1' REMOTE_ID_2 = 'https://users.example.com/item/2' @@ -39,7 +39,7 @@ class TestAcObject(TestCase): def test_remote_no_id(self): - from chapeau.bowler_pub.models import AcObject + from kepi.bowler_pub.models import AcObject create( f_type = "Create", diff --git a/chapeau/bowler_pub/tests/test_audience.py b/kepi/bowler_pub/tests/test_audience.py similarity index 97% rename from chapeau/bowler_pub/tests/test_audience.py rename to kepi/bowler_pub/tests/test_audience.py index 2605b8a..3c44bf4 100644 --- a/chapeau/bowler_pub/tests/test_audience.py +++ b/kepi/bowler_pub/tests/test_audience.py @@ -1,6 +1,6 @@ from django.test import TestCase -from chapeau.bowler_pub.models import Audience -from chapeau.bowler_pub.create import create +from kepi.bowler_pub.models import Audience +from kepi.bowler_pub.create import create from . import create_local_person, REMOTE_FRED, REMOTE_JIM class TestAudience(TestCase): diff --git a/chapeau/bowler_pub/tests/test_collection.py b/kepi/bowler_pub/tests/test_collection.py similarity index 97% rename from chapeau/bowler_pub/tests/test_collection.py rename to kepi/bowler_pub/tests/test_collection.py index 4f28921..1e714fb 100644 --- a/chapeau/bowler_pub/tests/test_collection.py +++ b/kepi/bowler_pub/tests/test_collection.py @@ -1,14 +1,14 @@ from django.test import TestCase, Client from unittest import skip -from chapeau.bowler_pub.models import * +from kepi.bowler_pub.models import * import datetime import json -from chapeau.bowler_pub.find import find -from chapeau.bowler_pub.utils import as_json +from kepi.bowler_pub.find import find +from kepi.bowler_pub.utils import as_json from . import * import logging -logger = logging.Logger('chapeau') +logger = logging.Logger('kepi') EXAMPLE_SERVER = 'http://testserver' JSON_TYPE = 'application/activity+json; charset=utf-8' diff --git a/chapeau/bowler_pub/tests/test_deliver.py b/kepi/bowler_pub/tests/test_deliver.py similarity index 92% rename from chapeau/bowler_pub/tests/test_deliver.py rename to kepi/bowler_pub/tests/test_deliver.py index 6cf1806..36f7106 100644 --- a/chapeau/bowler_pub/tests/test_deliver.py +++ b/kepi/bowler_pub/tests/test_deliver.py @@ -1,6 +1,6 @@ # test_deliver.py # -# Part of chapeau, an ActivityPub daemon. +# Part of kepi, an ActivityPub daemon. # Copyright (c) 2018-2019 Marnanel Thurman. # Licensed under the GNU Public License v2. @@ -9,10 +9,10 @@ from django.test import TestCase, Client from django.conf import settings -from chapeau.bowler_pub.delivery import deliver -from chapeau.bowler_pub.create import create -from chapeau.bowler_pub.models import AcObject -import chapeau.bowler_pub.views as bowler_pub_views +from kepi.bowler_pub.delivery import deliver +from kepi.bowler_pub.create import create +from kepi.bowler_pub.models import AcObject +import kepi.bowler_pub.views as bowler_pub_views from unittest.mock import Mock, patch from . import * import logging @@ -24,7 +24,7 @@ import requests # FIXME test caching # FIXME test invalid keys -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') REMOTE_PATH_NAMES = { '/users/fred/inbox': 'fred', @@ -38,7 +38,7 @@ class TestDelivery(TestCase): def _set_up_remote_user_mocks(self): - keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('kepi/bowler_pub/tests/keys/keys-0001.json', 'r')) create_remote_person( url = REMOTE_FRED, @@ -86,7 +86,7 @@ class TestDelivery(TestCase): def _set_up_local_user_mocks(self): - keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0002.json', 'r')) + keys = json.load(open('kepi/bowler_pub/tests/keys/keys-0002.json', 'r')) # I know these aren't mocks. This is just for consistency. create_local_person(name='alice', diff --git a/chapeau/bowler_pub/tests/test_find.py b/kepi/bowler_pub/tests/test_find.py similarity index 92% rename from chapeau/bowler_pub/tests/test_find.py rename to kepi/bowler_pub/tests/test_find.py index 197426b..55397c4 100644 --- a/chapeau/bowler_pub/tests/test_find.py +++ b/kepi/bowler_pub/tests/test_find.py @@ -1,14 +1,14 @@ from django.test import TestCase -from chapeau.bowler_pub.find import find -from chapeau.bowler_pub.create import create +from kepi.bowler_pub.find import find +from kepi.bowler_pub.create import create from django.conf import settings from . import * import httpretty import json import logging -from chapeau.bowler_pub.utils import as_json +from kepi.bowler_pub.utils import as_json -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') REMOTE_URL = 'https://remote.example.net/fnord' diff --git a/chapeau/bowler_pub/tests/test_headers.py b/kepi/bowler_pub/tests/test_headers.py similarity index 100% rename from chapeau/bowler_pub/tests/test_headers.py rename to kepi/bowler_pub/tests/test_headers.py diff --git a/chapeau/bowler_pub/tests/test_host_meta.py b/kepi/bowler_pub/tests/test_host_meta.py similarity index 95% rename from chapeau/bowler_pub/tests/test_host_meta.py rename to kepi/bowler_pub/tests/test_host_meta.py index cecb4e2..001cb33 100644 --- a/chapeau/bowler_pub/tests/test_host_meta.py +++ b/kepi/bowler_pub/tests/test_host_meta.py @@ -6,7 +6,7 @@ import json HOST_META_URL = 'https://altair.example.com/.well-known/host-meta' HOST_META_MIME_TYPE = 'application/xrd+xml' -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') class TestHostMeta(TestCase): diff --git a/chapeau/bowler_pub/tests/test_hostinfo.py b/kepi/bowler_pub/tests/test_hostinfo.py similarity index 95% rename from chapeau/bowler_pub/tests/test_hostinfo.py rename to kepi/bowler_pub/tests/test_hostinfo.py index cecb4e2..001cb33 100644 --- a/chapeau/bowler_pub/tests/test_hostinfo.py +++ b/kepi/bowler_pub/tests/test_hostinfo.py @@ -6,7 +6,7 @@ import json HOST_META_URL = 'https://altair.example.com/.well-known/host-meta' HOST_META_MIME_TYPE = 'application/xrd+xml' -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') class TestHostMeta(TestCase): diff --git a/chapeau/bowler_pub/tests/test_nodeinfo.py b/kepi/bowler_pub/tests/test_nodeinfo.py similarity index 96% rename from chapeau/bowler_pub/tests/test_nodeinfo.py rename to kepi/bowler_pub/tests/test_nodeinfo.py index df1b20f..7f3efd3 100644 --- a/chapeau/bowler_pub/tests/test_nodeinfo.py +++ b/kepi/bowler_pub/tests/test_nodeinfo.py @@ -7,7 +7,7 @@ NODEINFO_PART_1_URL = 'http://testserver/.well-known/nodeinfo' NODEINFO_PART_2_URL = 'http://testserver/nodeinfo.json' MIME_TYPE = 'application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#' -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') class TestNodeinfo(TestCase): @@ -69,7 +69,7 @@ class TestNodeinfo(TestCase): self.assertEqual( response['software']['name'], - 'chapeau', + 'kepi', ) self.assertIn( diff --git a/chapeau/bowler_pub/tests/test_polymorph.py b/kepi/bowler_pub/tests/test_polymorph.py similarity index 85% rename from chapeau/bowler_pub/tests/test_polymorph.py rename to kepi/bowler_pub/tests/test_polymorph.py index faef6a3..1ea26c4 100644 --- a/chapeau/bowler_pub/tests/test_polymorph.py +++ b/kepi/bowler_pub/tests/test_polymorph.py @@ -1,10 +1,10 @@ from django.test import TestCase from unittest import skip -from chapeau.bowler_pub.create import create -from chapeau.bowler_pub.models import * +from kepi.bowler_pub.create import create +from kepi.bowler_pub.models import * import logging -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') class TestPolymorph(TestCase): diff --git a/chapeau/bowler_pub/tests/test_read_from_outbox.py b/kepi/bowler_pub/tests/test_read_from_outbox.py similarity index 97% rename from chapeau/bowler_pub/tests/test_read_from_outbox.py rename to kepi/bowler_pub/tests/test_read_from_outbox.py index b3e6346..fa14deb 100644 --- a/chapeau/bowler_pub/tests/test_read_from_outbox.py +++ b/kepi/bowler_pub/tests/test_read_from_outbox.py @@ -1,6 +1,6 @@ from django.conf import settings from django.test import TestCase, Client -from chapeau.bowler_pub.create import create +from kepi.bowler_pub.create import create from . import create_local_person import httpretty import logging @@ -12,7 +12,7 @@ OUTBOX_PATH = '/users/alice/outbox' MIME_TYPE = 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') VICTORIA_WOOD = { "type": "Create", @@ -126,7 +126,7 @@ class TestOutbox(TestCase): what): if not hasattr(self, '_example_user'): - keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('kepi/bowler_pub/tests/keys/keys-0001.json', 'r')) alice = create_local_person( name='alice', diff --git a/chapeau/bowler_pub/tests/test_send_to_inbox.py b/kepi/bowler_pub/tests/test_send_to_inbox.py similarity index 90% rename from chapeau/bowler_pub/tests/test_send_to_inbox.py rename to kepi/bowler_pub/tests/test_send_to_inbox.py index 882519a..f0ba688 100644 --- a/chapeau/bowler_pub/tests/test_send_to_inbox.py +++ b/kepi/bowler_pub/tests/test_send_to_inbox.py @@ -1,11 +1,11 @@ from django.test import TestCase from unittest import skip -from chapeau.bowler_pub.tests import * -from chapeau.bowler_pub.create import create -from chapeau.bowler_pub.models.audience import Audience, AUDIENCE_FIELD_NAMES -from chapeau.bowler_pub.models.mention import Mention -from chapeau.bowler_pub.models.item import AcItem -from chapeau.bowler_pub.models.following import Following +from kepi.bowler_pub.tests import * +from kepi.bowler_pub.create import create +from kepi.bowler_pub.models.audience import Audience, AUDIENCE_FIELD_NAMES +from kepi.bowler_pub.models.mention import Mention +from kepi.bowler_pub.models.item import AcItem +from kepi.bowler_pub.models.following import Following from django.test import Client from urllib.parse import urlparse import httpretty @@ -43,7 +43,7 @@ OBJECT_FORM = { MIME_TYPE = 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' INVALID_UTF8 = b"\xa0\xa1" -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') class TestInbox2(TestCase): @@ -65,7 +65,7 @@ class TestInbox2(TestCase): ] if recipientKeys is None: - recipientKeys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) + recipientKeys = json.load(open('kepi/bowler_pub/tests/keys/keys-0001.json', 'r')) if recipient is None: recipient = create_local_person( @@ -75,7 +75,7 @@ class TestInbox2(TestCase): ) if senderKeys is None: - senderKeys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0002.json', 'r')) + senderKeys = json.load(open('kepi/bowler_pub/tests/keys/keys-0002.json', 'r')) if sender is None: sender = create_remote_person( @@ -163,7 +163,7 @@ class TestInbox2(TestCase): @httpretty.activate def test_sole_inbox(self): - recipientKeys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) + recipientKeys = json.load(open('kepi/bowler_pub/tests/keys/keys-0001.json', 'r')) recipient = create_local_person( name = 'alice', publicKey = recipientKeys['public'], @@ -192,7 +192,7 @@ class TestInbox2(TestCase): @httpretty.activate def test_shared_inbox(self): - recipientKeys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) + recipientKeys = json.load(open('kepi/bowler_pub/tests/keys/keys-0001.json', 'r')) recipient = create_local_person( name = 'alice', publicKey = recipientKeys['public'], diff --git a/chapeau/bowler_pub/tests/test_send_to_outbox.py b/kepi/bowler_pub/tests/test_send_to_outbox.py similarity index 92% rename from chapeau/bowler_pub/tests/test_send_to_outbox.py rename to kepi/bowler_pub/tests/test_send_to_outbox.py index ff1b0b2..0bb6340 100644 --- a/chapeau/bowler_pub/tests/test_send_to_outbox.py +++ b/kepi/bowler_pub/tests/test_send_to_outbox.py @@ -1,12 +1,12 @@ from django.test import TestCase from unittest import skip -from chapeau.bowler_pub.tests import * -from chapeau.bowler_pub.create import create -from chapeau.bowler_pub.models.audience import Audience, AUDIENCE_FIELD_NAMES -from chapeau.bowler_pub.models.mention import Mention -from chapeau.bowler_pub.models.item import AcItem -from chapeau.bowler_pub.models.acobject import AcObject -from chapeau.bowler_pub.models.activity import AcActivity +from kepi.bowler_pub.tests import * +from kepi.bowler_pub.create import create +from kepi.bowler_pub.models.audience import Audience, AUDIENCE_FIELD_NAMES +from kepi.bowler_pub.models.mention import Mention +from kepi.bowler_pub.models.item import AcItem +from kepi.bowler_pub.models.acobject import AcObject +from kepi.bowler_pub.models.activity import AcActivity from django.test import Client from urllib.parse import urlparse import httpretty @@ -44,7 +44,7 @@ CREATE_FORM = { 'object': OBJECT_FORM, } -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') class TestOutbox(TestCase): @@ -63,7 +63,7 @@ class TestOutbox(TestCase): ): if keys is None: - keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('kepi/bowler_pub/tests/keys/keys-0001.json', 'r')) if sender is None: sender = create_local_person( @@ -163,7 +163,7 @@ class TestOutbox(TestCase): def test_post_by_remote_interloper(self): - keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0002.json', 'r')) + keys = json.load(open('kepi/bowler_pub/tests/keys/keys-0002.json', 'r')) sender = create_remote_person( url = REMOTE_DAVE_ID, @@ -190,8 +190,8 @@ class TestOutbox(TestCase): def test_post_by_local_interloper(self): - keys1 = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) - keys2 = json.load(open('chapeau/bowler_pub/tests/keys/keys-0002.json', 'r')) + keys1 = json.load(open('kepi/bowler_pub/tests/keys/keys-0001.json', 'r')) + keys2 = json.load(open('kepi/bowler_pub/tests/keys/keys-0002.json', 'r')) create_local_person( name = 'alice', @@ -344,7 +344,7 @@ class TestOutbox(TestCase): c = Client() - keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('kepi/bowler_pub/tests/keys/keys-0001.json', 'r')) alice = create_local_person( name = 'alice', diff --git a/chapeau/bowler_pub/tests/test_validation.py b/kepi/bowler_pub/tests/test_validation.py similarity index 89% rename from chapeau/bowler_pub/tests/test_validation.py rename to kepi/bowler_pub/tests/test_validation.py index 98771ad..37e52fb 100644 --- a/chapeau/bowler_pub/tests/test_validation.py +++ b/kepi/bowler_pub/tests/test_validation.py @@ -1,6 +1,6 @@ from django.test import TestCase, Client -from chapeau.bowler_pub.validation import IncomingMessage, validate -from chapeau.bowler_pub.models import AcObject +from kepi.bowler_pub.validation import IncomingMessage, validate +from kepi.bowler_pub.models import AcObject from unittest import skip import httpretty from . import * @@ -13,7 +13,7 @@ import json # FIXME test caching # FIXME test invalid keys -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') ACTIVITY_ID = "https://example.com/04b065f8-81c4-408e-bec3-9fb1f7c06408" INBOX_HOST = 'europa.example.com' @@ -37,7 +37,7 @@ class TestValidationTasks(TestCase): @httpretty.activate def test_local_lookup(self): - keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('kepi/bowler_pub/tests/keys/keys-0001.json', 'r')) alice = create_local_person( name = 'alice', @@ -67,7 +67,7 @@ class TestValidationTasks(TestCase): @httpretty.activate def test_remote_user_known(self): - keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('kepi/bowler_pub/tests/keys/keys-0001.json', 'r')) fetched = { 'fred': False, } @@ -108,8 +108,8 @@ class TestValidationTasks(TestCase): @httpretty.activate def test_remote_user_spoofed(self): - keys1 = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) - keys2 = json.load(open('chapeau/bowler_pub/tests/keys/keys-0002.json', 'r')) + keys1 = json.load(open('kepi/bowler_pub/tests/keys/keys-0001.json', 'r')) + keys2 = json.load(open('kepi/bowler_pub/tests/keys/keys-0002.json', 'r')) fetched = { 'fred': False, @@ -153,7 +153,7 @@ class TestValidationTasks(TestCase): @httpretty.activate def test_remote_user_gone(self): - keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('kepi/bowler_pub/tests/keys/keys-0001.json', 'r')) fetched = { 'fred': False, } @@ -190,7 +190,7 @@ class TestValidationTasks(TestCase): @httpretty.activate def test_remote_user_unknown(self): - keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('kepi/bowler_pub/tests/keys/keys-0001.json', 'r')) fetched = { 'fred': False, } diff --git a/chapeau/bowler_pub/tests/test_views.py b/kepi/bowler_pub/tests/test_views.py similarity index 98% rename from chapeau/bowler_pub/tests/test_views.py rename to kepi/bowler_pub/tests/test_views.py index 42b51b8..037be51 100644 --- a/chapeau/bowler_pub/tests/test_views.py +++ b/kepi/bowler_pub/tests/test_views.py @@ -3,7 +3,7 @@ from . import * import logging import json -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') ALICE_SUMMARY = 'Remember Alice? It\'s a song about Alice.' diff --git a/chapeau/bowler_pub/tests/test_webfinger.py b/kepi/bowler_pub/tests/test_webfinger.py similarity index 95% rename from chapeau/bowler_pub/tests/test_webfinger.py rename to kepi/bowler_pub/tests/test_webfinger.py index 36cc04d..2dba6a6 100644 --- a/chapeau/bowler_pub/tests/test_webfinger.py +++ b/kepi/bowler_pub/tests/test_webfinger.py @@ -8,12 +8,12 @@ WEBFINGER_BASE_URL = 'https://altair.example.com/.well-known/webfinger' WEBFINGER_URL = WEBFINGER_BASE_URL + '?resource={}' WEBFINGER_MIME_TYPE = 'application/jrd+json; charset=utf-8' -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') class TestWebfinger(TestCase): def setUp(self): - keys = json.load(open('chapeau/bowler_pub/tests/keys/keys-0001.json', 'r')) + keys = json.load(open('kepi/bowler_pub/tests/keys/keys-0001.json', 'r')) create_local_person( name='alice', diff --git a/chapeau/bowler_pub/tests/verify-examples.py b/kepi/bowler_pub/tests/verify-examples.py similarity index 100% rename from chapeau/bowler_pub/tests/verify-examples.py rename to kepi/bowler_pub/tests/verify-examples.py diff --git a/chapeau/bowler_pub/urls.py b/kepi/bowler_pub/urls.py similarity index 96% rename from chapeau/bowler_pub/urls.py rename to kepi/bowler_pub/urls.py index 1450f6c..790255a 100644 --- a/chapeau/bowler_pub/urls.py +++ b/kepi/bowler_pub/urls.py @@ -9,7 +9,7 @@ These are URL patterns, to include from your app's urls.py. """ from django.urls import path, re_path -import chapeau.bowler_pub.views as bowler_pub_views +import kepi.bowler_pub.views as bowler_pub_views urlpatterns = [ re_path('^(?P[0-9a-z]{8})$', bowler_pub_views.ThingView.as_view()), diff --git a/chapeau/bowler_pub/utils.py b/kepi/bowler_pub/utils.py similarity index 100% rename from chapeau/bowler_pub/utils.py rename to kepi/bowler_pub/utils.py diff --git a/chapeau/bowler_pub/validation.py b/kepi/bowler_pub/validation.py similarity index 97% rename from chapeau/bowler_pub/validation.py rename to kepi/bowler_pub/validation.py index 662071e..9660115 100644 --- a/chapeau/bowler_pub/validation.py +++ b/kepi/bowler_pub/validation.py @@ -1,6 +1,6 @@ # validation.py # -# Part of chapeau, an ActivityPub daemon. +# Part of kepi, an ActivityPub daemon. # Copyright (c) 2018-2019 Marnanel Thurman. # Licensed under the GNU Public License v2. @@ -20,7 +20,7 @@ from urllib.parse import urlparse import django.core.exceptions from httpsig.verify import HeaderVerifier -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') class IncomingMessage(models.Model): @@ -156,9 +156,9 @@ def _run_validation( that was generated by validate(). """ - from chapeau.bowler_pub.delivery import deliver - from chapeau.bowler_pub.create import create - from chapeau.bowler_pub.find import find + from kepi.bowler_pub.delivery import deliver + from kepi.bowler_pub.create import create + from kepi.bowler_pub.find import find logger.info('%s: begin validation', message_id) diff --git a/chapeau/bowler_pub/views/README.md b/kepi/bowler_pub/views/README.md similarity index 100% rename from chapeau/bowler_pub/views/README.md rename to kepi/bowler_pub/views/README.md diff --git a/chapeau/bowler_pub/views/__init__.py b/kepi/bowler_pub/views/__init__.py similarity index 100% rename from chapeau/bowler_pub/views/__init__.py rename to kepi/bowler_pub/views/__init__.py diff --git a/chapeau/bowler_pub/views/activitypub.py b/kepi/bowler_pub/views/activitypub.py similarity index 96% rename from chapeau/bowler_pub/views/activitypub.py rename to kepi/bowler_pub/views/activitypub.py index f3d8f05..3f7beee 100644 --- a/chapeau/bowler_pub/views/activitypub.py +++ b/kepi/bowler_pub/views/activitypub.py @@ -1,6 +1,6 @@ # views/activitypub.py # -# Part of chapeau, an ActivityPub daemon. +# Part of kepi, an ActivityPub daemon. # Copyright (c) 2018-2019 Marnanel Thurman. # Licensed under the GNU Public License v2. @@ -13,24 +13,24 @@ Everything ends up here if it doesn't have a particular place to go. """ -from chapeau.bowler_pub import ATSIGN_CONTEXT -import chapeau.bowler_pub.validation -from chapeau.bowler_pub.find import find, is_local -from chapeau.bowler_pub.utils import configured_url, short_id_to_url, uri_to_url +from kepi.bowler_pub import ATSIGN_CONTEXT +import kepi.bowler_pub.validation +from kepi.bowler_pub.find import find, is_local +from kepi.bowler_pub.utils import configured_url, short_id_to_url, uri_to_url from django.shortcuts import render, get_object_or_404 import django.views from django.http import HttpResponse, JsonResponse, Http404 from django.contrib.auth.decorators import login_required from django.core.exceptions import ValidationError from django.conf import settings -from chapeau.bowler_pub.models import * -from chapeau.bowler_pub.validation import validate +from kepi.bowler_pub.models import * +from kepi.bowler_pub.validation import validate from collections.abc import Iterable import logging import urllib.parse import json -logger = logging.getLogger(name='chapeau') +logger = logging.getLogger(name='kepi') PAGE_LENGTH = 50 PAGE_FIELD = 'page' @@ -337,7 +337,7 @@ class ActorView(ThingView): def activity_store(self, request, *args, **kwargs): - from chapeau.bowler_pub.models.collection import Collection + from kepi.bowler_pub.models.collection import Collection user = AcActor.objects.get( id='@'+kwargs['username'], @@ -468,7 +468,7 @@ class UserCollectionView(KepiView): listname, *args, **kwargs): - from chapeau.bowler_pub.models.collection import Collection, CollectionMember + from kepi.bowler_pub.models.collection import Collection, CollectionMember logger.debug('Finding user %s\'s %s collection', username, listname) @@ -500,7 +500,7 @@ class UserCollectionView(KepiView): listname, *args, **kwargs): - from chapeau.bowler_pub.models.collection import Collection, CollectionMember + from kepi.bowler_pub.models.collection import Collection, CollectionMember logger.debug('Finding user %s\'s %s collection', username, listname) @@ -572,7 +572,7 @@ class InboxView(UserCollectionView): def activity_store(self, request, username=None, *args, **kwargs): - from chapeau.bowler_pub.delivery import deliver + from kepi.bowler_pub.delivery import deliver if username is None: logger.info(' -- storing into the shared inbox') diff --git a/chapeau/bowler_pub/views/host_meta.py b/kepi/bowler_pub/views/host_meta.py similarity index 90% rename from chapeau/bowler_pub/views/host_meta.py rename to kepi/bowler_pub/views/host_meta.py index e98cf64..98c2274 100644 --- a/chapeau/bowler_pub/views/host_meta.py +++ b/kepi/bowler_pub/views/host_meta.py @@ -1,6 +1,6 @@ # views/host_meta.py # -# Part of chapeau, an ActivityPub daemon. +# Part of kepi, an ActivityPub daemon. # Copyright (c) 2018-2019 Marnanel Thurman. # Licensed under the GNU Public License v2. @@ -14,7 +14,7 @@ import django.views from django.shortcuts import render import logging -logger = logging.Logger('chapeau') +logger = logging.Logger('kepi') class HostMeta(django.views.View): diff --git a/chapeau/bowler_pub/views/nodeinfo.py b/kepi/bowler_pub/views/nodeinfo.py similarity index 93% rename from chapeau/bowler_pub/views/nodeinfo.py rename to kepi/bowler_pub/views/nodeinfo.py index d2294c5..588db03 100644 --- a/chapeau/bowler_pub/views/nodeinfo.py +++ b/kepi/bowler_pub/views/nodeinfo.py @@ -1,6 +1,6 @@ # views/nodeinfo.py # -# Part of chapeau, an ActivityPub daemon. +# Part of kepi, an ActivityPub daemon. # Copyright (c) 2018-2019 Marnanel Thurman. # Licensed under the GNU Public License v2. @@ -14,12 +14,12 @@ import django.views from django.conf import settings from django.shortcuts import render from django.http import HttpResponse -from chapeau import __version__ +from kepi import __version__ import logging import re -from chapeau.bowler_pub.utils import as_json +from kepi.bowler_pub.utils import as_json -logger = logging.Logger('chapeau') +logger = logging.Logger('kepi') class NodeinfoPart1(django.views.View): """ @@ -60,7 +60,7 @@ class NodeinfoPart2(django.views.View): result = { "version": "2.0", "software" : { - "name": "chapeau", + "name": "kepi", "version": __version__, }, "protocols": ['activitypub'], diff --git a/chapeau/bowler_pub/views/webfinger.py b/kepi/bowler_pub/views/webfinger.py similarity index 96% rename from chapeau/bowler_pub/views/webfinger.py rename to kepi/bowler_pub/views/webfinger.py index 042439d..aee1aad 100644 --- a/chapeau/bowler_pub/views/webfinger.py +++ b/kepi/bowler_pub/views/webfinger.py @@ -13,14 +13,14 @@ for the full details. import django.views from django.conf import settings from django.shortcuts import render -from chapeau.bowler_pub.models.actor import AcActor +from kepi.bowler_pub.models.actor import AcActor from django.http import HttpResponse import logging import re import json -from chapeau.bowler_pub.utils import as_json, configured_url +from kepi.bowler_pub.utils import as_json, configured_url -logger = logging.Logger('chapeau') +logger = logging.Logger('kepi') class Webfinger(django.views.View): """ diff --git a/chapeau/chapeau/__init__.py b/kepi/kepi/__init__.py similarity index 100% rename from chapeau/chapeau/__init__.py rename to kepi/kepi/__init__.py diff --git a/chapeau/chapeau/settings.py b/kepi/kepi/settings.py similarity index 92% rename from chapeau/chapeau/settings.py rename to kepi/kepi/settings.py index d2613f8..3eaf070 100644 --- a/chapeau/chapeau/settings.py +++ b/kepi/kepi/settings.py @@ -3,12 +3,12 @@ import djcelery import logging djcelery.setup_loader() -logger = logging.Logger(name='chapeau') +logger = logging.Logger(name='kepi') # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -ROOT_URLCONF = 'chapeau.chapeau.urls' +ROOT_URLCONF = 'kepi.kepi.urls' TEMPLATES = [ { @@ -26,7 +26,7 @@ TEMPLATES = [ }, ] -WSGI_APPLICATION = 'chapeau.chapeau.wsgi.application' +WSGI_APPLICATION = 'kepi.kepi.wsgi.application' # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'cmfy8%_q^u#bix$_4bq!p^8eq@=46bb*a7ztmg4i)l8jo(kl%^' @@ -55,7 +55,7 @@ KEPI = { 'TOMBSTONES': True, - 'INSTANCE_NAME': 'chapeau server', + 'INSTANCE_NAME': 'kepi server', 'INSTANCE_DESCRIPTION': 'this is a test server', 'CONTACT_ACCOUNT': 'marnanel', 'CONTACT_EMAIL': 'marnanel@example.com', @@ -90,15 +90,15 @@ INSTALLED_APPS = ( 'django_fields', 'polymorphic', - 'chapeau.bowler_pub', - 'chapeau.trilby_api', + 'kepi.bowler_pub', + 'kepi.trilby_api', ) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'chapeau.sqlite3'), + 'NAME': os.path.join(BASE_DIR, 'kepi.sqlite3'), } } @@ -129,7 +129,7 @@ LOGGING = { }, }, 'loggers': { - 'chapeau': { + 'kepi': { 'handlers': ['console'], 'level': 'DEBUG', }, @@ -204,4 +204,4 @@ AUTH_USER_MODEL = 'trilby_api.TrilbyUser' try: from .local_config import * except ModuleNotFoundError: - logger.warn("chapeau's local_config.py not found! Running with default settings") + logger.warn("kepi's local_config.py not found! Running with default settings") diff --git a/chapeau/chapeau/urls.py b/kepi/kepi/urls.py similarity index 76% rename from chapeau/chapeau/urls.py rename to kepi/kepi/urls.py index 5fbc28d..5646b57 100644 --- a/chapeau/chapeau/urls.py +++ b/kepi/kepi/urls.py @@ -3,9 +3,9 @@ from django.urls import path, re_path, include from django.conf.urls.static import static from django.contrib.auth import views as auth_views import oauth2_provider.views as oauth2_views -import chapeau.bowler_pub.urls -import chapeau.trilby_api.urls -from chapeau.trilby_api.views import fix_oauth2_redirects +import kepi.bowler_pub.urls +import kepi.trilby_api.urls +from kepi.trilby_api.views import fix_oauth2_redirects from . import settings ################################## @@ -29,10 +29,10 @@ urlpatterns = [ path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'), path('oauth/', include((oauth2_endpoint_views, 'oauth2_provider'), namespace="oauth2_provider")), - # chapeau's own stuff - # path('', chapeau.tophat_ui.views.FrontPageView.as_view()), # or something - path(r'', include(chapeau.bowler_pub.urls)), - path(r'', include(chapeau.trilby_api.urls)), + # kepi's own stuff + # path('', kepi.tophat_ui.views.FrontPageView.as_view()), # or something + path(r'', include(kepi.bowler_pub.urls)), + path(r'', include(kepi.trilby_api.urls)), ] if settings.DEBUG: diff --git a/chapeau/chapeau/wsgi.py b/kepi/kepi/wsgi.py similarity index 56% rename from chapeau/chapeau/wsgi.py rename to kepi/kepi/wsgi.py index a95df53..cc9fcd1 100644 --- a/chapeau/chapeau/wsgi.py +++ b/kepi/kepi/wsgi.py @@ -2,6 +2,6 @@ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'chapeau.chapeau.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kepi.kepi.settings') application = get_wsgi_application() diff --git a/chapeau/trilby_api/__init__.py b/kepi/trilby_api/__init__.py similarity index 100% rename from chapeau/trilby_api/__init__.py rename to kepi/trilby_api/__init__.py diff --git a/chapeau/trilby_api/admin.py b/kepi/trilby_api/admin.py similarity index 87% rename from chapeau/trilby_api/admin.py rename to kepi/trilby_api/admin.py index 79b2fcc..a5de835 100644 --- a/chapeau/trilby_api/admin.py +++ b/kepi/trilby_api/admin.py @@ -1,9 +1,9 @@ from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.forms import UserChangeForm, UserCreationForm -import chapeau.trilby_api.forms as trilby_forms -import chapeau.trilby_api.models as trilby_models -from chapeau.bowler_pub.create import create +import kepi.trilby_api.forms as trilby_forms +import kepi.trilby_api.models as trilby_models +from kepi.bowler_pub.create import create @admin.register(trilby_models.TrilbyUser) class TrilbyUserAdmin(UserAdmin): diff --git a/chapeau/trilby_api/apps.py b/kepi/trilby_api/apps.py similarity index 100% rename from chapeau/trilby_api/apps.py rename to kepi/trilby_api/apps.py diff --git a/chapeau/trilby_api/crypto.py b/kepi/trilby_api/crypto.py similarity index 100% rename from chapeau/trilby_api/crypto.py rename to kepi/trilby_api/crypto.py diff --git a/chapeau/trilby_api/dump.sh b/kepi/trilby_api/dump.sh similarity index 100% rename from chapeau/trilby_api/dump.sh rename to kepi/trilby_api/dump.sh diff --git a/chapeau/trilby_api/fixtures/alicebobcarol.json b/kepi/trilby_api/fixtures/alicebobcarol.json similarity index 100% rename from chapeau/trilby_api/fixtures/alicebobcarol.json rename to kepi/trilby_api/fixtures/alicebobcarol.json diff --git a/chapeau/trilby_api/fixtures/dump-keys.py b/kepi/trilby_api/fixtures/dump-keys.py similarity index 100% rename from chapeau/trilby_api/fixtures/dump-keys.py rename to kepi/trilby_api/fixtures/dump-keys.py diff --git a/chapeau/trilby_api/forms.py b/kepi/trilby_api/forms.py similarity index 100% rename from chapeau/trilby_api/forms.py rename to kepi/trilby_api/forms.py diff --git a/chapeau/trilby_api/migrations/0001_initial.py b/kepi/trilby_api/migrations/0001_initial.py similarity index 100% rename from chapeau/trilby_api/migrations/0001_initial.py rename to kepi/trilby_api/migrations/0001_initial.py diff --git a/chapeau/trilby_api/migrations/0002_auto_20191009_1737.py b/kepi/trilby_api/migrations/0002_auto_20191009_1737.py similarity index 100% rename from chapeau/trilby_api/migrations/0002_auto_20191009_1737.py rename to kepi/trilby_api/migrations/0002_auto_20191009_1737.py diff --git a/chapeau/trilby_api/migrations/0003_auto_20191013_1835.py b/kepi/trilby_api/migrations/0003_auto_20191013_1835.py similarity index 100% rename from chapeau/trilby_api/migrations/0003_auto_20191013_1835.py rename to kepi/trilby_api/migrations/0003_auto_20191013_1835.py diff --git a/chapeau/trilby_api/migrations/0004_auto_20191013_1836.py b/kepi/trilby_api/migrations/0004_auto_20191013_1836.py similarity index 100% rename from chapeau/trilby_api/migrations/0004_auto_20191013_1836.py rename to kepi/trilby_api/migrations/0004_auto_20191013_1836.py diff --git a/chapeau/trilby_api/migrations/0005_auto_20191013_1838.py b/kepi/trilby_api/migrations/0005_auto_20191013_1838.py similarity index 100% rename from chapeau/trilby_api/migrations/0005_auto_20191013_1838.py rename to kepi/trilby_api/migrations/0005_auto_20191013_1838.py diff --git a/chapeau/trilby_api/migrations/__init__.py b/kepi/trilby_api/migrations/__init__.py similarity index 100% rename from chapeau/trilby_api/migrations/__init__.py rename to kepi/trilby_api/migrations/__init__.py diff --git a/chapeau/trilby_api/models.py b/kepi/trilby_api/models.py similarity index 75% rename from chapeau/trilby_api/models.py rename to kepi/trilby_api/models.py index 764c09c..c1a8e94 100644 --- a/chapeau/trilby_api/models.py +++ b/kepi/trilby_api/models.py @@ -2,10 +2,10 @@ from django.db import models from django.db.models.signals import post_init from django.dispatch import receiver from django.contrib.auth.models import AbstractUser -from chapeau.bowler_pub.models import AcPerson -from chapeau.bowler_pub.create import create +from kepi.bowler_pub.models import AcPerson +from kepi.bowler_pub.create import create from django.conf import settings -import chapeau.trilby_api.models +import kepi.trilby_api.models class TrilbyUser(AbstractUser): diff --git a/chapeau/trilby_api/serializers.py b/kepi/trilby_api/serializers.py similarity index 97% rename from chapeau/trilby_api/serializers.py rename to kepi/trilby_api/serializers.py index a68ae4b..c7ebc85 100644 --- a/chapeau/trilby_api/serializers.py +++ b/kepi/trilby_api/serializers.py @@ -1,6 +1,6 @@ from rest_framework import serializers -from chapeau.bowler_pub.models import AcItem, AcActor -from chapeau.bowler_pub.create import create as bowler_pub_create +from kepi.bowler_pub.models import AcItem, AcActor +from kepi.bowler_pub.create import create as bowler_pub_create from oauth2_provider.models import Application ######################################### diff --git a/chapeau/trilby_api/templates/account.atom.xml b/kepi/trilby_api/templates/account.atom.xml similarity index 100% rename from chapeau/trilby_api/templates/account.atom.xml rename to kepi/trilby_api/templates/account.atom.xml diff --git a/chapeau/trilby_api/templates/host-meta.xml b/kepi/trilby_api/templates/host-meta.xml similarity index 100% rename from chapeau/trilby_api/templates/host-meta.xml rename to kepi/trilby_api/templates/host-meta.xml diff --git a/chapeau/trilby_api/templates/registration/login.html b/kepi/trilby_api/templates/registration/login.html similarity index 67% rename from chapeau/trilby_api/templates/registration/login.html rename to kepi/trilby_api/templates/registration/login.html index 750a173..3dac378 100644 --- a/chapeau/trilby_api/templates/registration/login.html +++ b/kepi/trilby_api/templates/registration/login.html @@ -1,7 +1,7 @@ -chapeau login +kepi login -

chapeau 👒 development login

+

kepi 👒 development login

{% csrf_token %} diff --git a/chapeau/trilby_api/tests/__init__.py b/kepi/trilby_api/tests/__init__.py similarity index 80% rename from chapeau/trilby_api/tests/__init__.py rename to kepi/trilby_api/tests/__init__.py index a4ccf4b..b47eb93 100644 --- a/chapeau/trilby_api/tests/__init__.py +++ b/kepi/trilby_api/tests/__init__.py @@ -1,11 +1,11 @@ -from chapeau.trilby_api.models import TrilbyUser +from kepi.trilby_api.models import TrilbyUser PUBLIC = "https://www.w3.org/ns/activitystreams#Public" def create_local_trilbyuser(name='jemima'): - from chapeau.bowler_pub.tests import create_local_person - from chapeau.trilby_api.models import TrilbyUser + from kepi.bowler_pub.tests import create_local_person + from kepi.trilby_api.models import TrilbyUser person = create_local_person(name=name) @@ -19,7 +19,7 @@ def create_local_trilbyuser(name='jemima'): def create_local_status(content, posted_by): - from chapeau.bowler_pub.create import create + from kepi.bowler_pub.create import create if isinstance(posted_by, TrilbyUser): posted_by = posted_by.actor diff --git a/chapeau/trilby_api/tests/test_integration.py b/kepi/trilby_api/tests/test_integration.py similarity index 97% rename from chapeau/trilby_api/tests/test_integration.py rename to kepi/trilby_api/tests/test_integration.py index bf131fc..7b53a86 100644 --- a/chapeau/trilby_api/tests/test_integration.py +++ b/kepi/trilby_api/tests/test_integration.py @@ -1,7 +1,7 @@ from django.test import TestCase from rest_framework.test import APIClient, force_authenticate -from chapeau.trilby_api.views import * -from chapeau.trilby_api.tests import * +from kepi.trilby_api.views import * +from kepi.trilby_api.tests import * from django.conf import settings class TestIntegration(TestCase): diff --git a/chapeau/trilby_api/tests/test_rest.py b/kepi/trilby_api/tests/test_rest.py similarity index 99% rename from chapeau/trilby_api/tests/test_rest.py rename to kepi/trilby_api/tests/test_rest.py index e09aa7c..47de0c5 100644 --- a/chapeau/trilby_api/tests/test_rest.py +++ b/kepi/trilby_api/tests/test_rest.py @@ -1,7 +1,7 @@ from django.test import TestCase from rest_framework.test import force_authenticate, APIClient, APIRequestFactory -from chapeau.trilby_api.views import * -from chapeau.trilby_api.tests import * +from kepi.trilby_api.views import * +from kepi.trilby_api.tests import * from django.conf import settings from unittest import skip import json diff --git a/chapeau/trilby_api/urls.py b/kepi/trilby_api/urls.py similarity index 100% rename from chapeau/trilby_api/urls.py rename to kepi/trilby_api/urls.py diff --git a/chapeau/trilby_api/views.py b/kepi/trilby_api/views.py similarity index 97% rename from chapeau/trilby_api/views.py rename to kepi/trilby_api/views.py index 325634f..dae1941 100644 --- a/chapeau/trilby_api/views.py +++ b/kepi/trilby_api/views.py @@ -15,12 +15,12 @@ from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.renderers import JSONRenderer import logging -import chapeau.bowler_pub.models as bowler_pub_models -from chapeau.bowler_pub.create import create as bowler_pub_create +import kepi.bowler_pub.models as bowler_pub_models +from kepi.bowler_pub.create import create as bowler_pub_create import json import re -logger = logging.Logger(name='chapeau') +logger = logging.Logger(name='kepi') ########################### @@ -45,7 +45,7 @@ class Instance(View): def fix_oauth2_redirects(): """ - Called from chapeau.chapeau.urls to fix a silly oversight + Called from kepi.kepi.urls to fix a silly oversight in oauth2_provider. This isn't elegant. oauth2_provider.http.OAuth2ResponseRedirect checks the diff --git a/manage.py b/manage.py index 29ed17d..53dfbf4 100755 --- a/manage.py +++ b/manage.py @@ -4,7 +4,7 @@ import os import sys def main(): - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'chapeau.chapeau.settings') + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kepi.kepi.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: diff --git a/request-test.py b/request-test.py deleted file mode 100644 index 7df2f8c..0000000 --- a/request-test.py +++ /dev/null @@ -1,41 +0,0 @@ -import requests -from requests_http_signature import HTTPSignatureAuth - -saved_headers = {'HTTP_SIGNATURE': 'keyId="https://queer.party/users/marnanel#main-key",algorithm="rsa-sha256",headers="(request-target) user-agent host date accept-encoding digest content-type",signature="XGp7GgotKiWOjAZnCscq4/8ZtmjDP1oGM5Ud9Xt3wFsvyE/XuZvq+MfInEGu1PN6PkxWaE6BYEr4L3Id/kBOL5JFpJvXT9A5nkGx0vyACHw876QQerswq0HfHGt3bDqbPlzsVPDReFSxfYSyAh0VRFR7wDBveDV7xjw66KqxqF5tcwFS9jARwuSU2Cu5nsQ/xlkY8tIZ+9JsdX/rZoV7ZMzK+2kU3HH6Qmuy4TN2f0d8ko34B7nWwKZEzCArhakbep2ajpbyYbqQd0g/Ew12HRk3ZSl+CX2K9ZJnKQw3eKG2ivAaizK5C5uG0uzfGcMmI/KgzbV2USjeguVI+o+jFg=="', 'mod_wsgi.listener_host': '', 'mod_wsgi.request_handler': 'wsgi-script', 'mod_wsgi.path_info': '/users/fred/inbox', 'HTTP_HOST': 'unchapeau-dev.marnanel.org', 'HTTP_CONNECTION': 'close', 'mod_wsgi.application_group': 'unchapeau-dev.marnanel.org|', 'mod_wsgi.script_reloading': '1', 'mod_wsgi.callable_object': 'application', 'wsgi.multithread': True, 'wsgi.url_scheme': 'https', 'mod_wsgi.daemon_restarts': '0', 'SSL_TLS_SNI': 'unchapeau-dev.marnanel.org', 'SERVER_ADMIN': 'webmaster@localhost', 'PATH_INFO': '/users/fred/inbox', 'SERVER_SOFTWARE': 'Apache/2.4.25 (Debian)', 'mod_wsgi.handler_script': '', 'SCRIPT_NAME': '', 'SERVER_SIGNATURE': '
Apache/2.4.25 (Debian) Server at unchapeau-dev.marnanel.org Port 443
\n', 'wsgi.multiprocess': True, 'REQUEST_SCHEME': 'https', 'mod_wsgi.total_requests': 3, 'SERVER_PROTOCOL': 'HTTP/1.1', 'HTTP_DATE': 'Mon, 03 Sep 2018 19:26:07 GMT', 'wsgi.input_terminated': True, 'mod_wsgi.thread_requests': 1, 'SERVER_NAME': 'unchapeau-dev.marnanel.org', 'mod_wsgi.connection_id': 'r4FRg4QcX1E', 'HTTP_USER_AGENT': 'http.rb/3.2.0 (Mastodon/2.4.5; +https://queer.party/)', 'SERVER_PORT': '443', 'wsgi.version': (1, 0), 'HTTP_ACCEPT_ENCODING': 'gzip', 'PATH_TRANSLATED': '/home/marnanel/proj/un_chapeau/un_chapeau/wsgi.py/users/fred/inbox', 'SERVER_ADDR': '172.20.177.129', 'mod_wsgi.daemon_start': '1536002767374653', 'REMOTE_PORT': '12026', 'mod_wsgi.thread_id': 2, 'CONTENT_TYPE': 'application/activity+json; charset=utf-8', 'DOCUMENT_ROOT': '/var/www/html/uc-fail/', 'QUERY_STRING': '', 'CONTEXT_DOCUMENT_ROOT': '/var/www/html/uc-fail/', 'REQUEST_METHOD': 'POST', 'mod_wsgi.request_id': 'dcVSg4QcX1E', 'HTTP_DIGEST': 'SHA-256=w6LDahS+63b4VwYoWGdfBW1hO28A5lXwC0cNZLRd4hg=', 'mod_wsgi.script_start': '1536002767375121', 'mod_wsgi.daemon_connects': '1', 'SCRIPT_FILENAME': '/home/marnanel/proj/un_chapeau/un_chapeau/wsgi.py', 'mod_wsgi.queue_start': '1536002767374150', 'CONTENT_LENGTH': '1280', 'mod_wsgi.ignore_activity': '0', 'REMOTE_ADDR': '51.15.146.0', 'GATEWAY_INTERFACE': 'CGI/1.1', 'mod_wsgi.script_name': '', 'mod_wsgi.listener_port': '443', 'mod_wsgi.version': (4, 6, 4), 'mod_wsgi.process_group': 'un_chapeau_test', 'CONTEXT_PREFIX': '', 'apache.version': (2, 4, 25), 'REQUEST_URI': '/users/fred/inbox', 'wsgi.run_once': False, 'mod_wsgi.enable_sendfile': '0'} - -saved_body = {"@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1",{"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","sensitive":"as:sensitive","movedTo":"as:movedTo","Hashtag":"as:Hashtag","ostatus":"http://ostatus.org#","atomUri":"ostatus:atomUri","inReplyToAtomUri":"ostatus:inReplyToAtomUri","conversation":"ostatus:conversation","toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","focalPoint":{"@container":"@list","@id":"toot:focalPoint"},"featured":"toot:featured","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value"}],"id":"https://queer.party/49ebb121-e105-492f-9140-6ea0dcfcfb8a","type":"Follow","actor":"https://queer.party/users/marnanel","object":"https://unchapeau-dev.marnanel.org/users/fred/user","signature":{"type":"RsaSignature2017","creator":"https://queer.party/users/marnanel#main-key","created":"2018-09-03T19:26:03Z","signatureValue":"eJepWWsHmd4qgtIvRq6bp0KcJZoi1UukyvrrxyrMKNkMOzy1MiwpKA1Se0KaswI9VeHtHpLsv0ueiAkUKrIu652iPBC8BVfeSUa4JGhqoYp/fNuSZM9X8Y9TnC9vT1Pl68kVpfqOBXxFqf7FRro8KUl8591DLJ93eXhtF9t2qoSh2m+vw3jrG/SnLKBsoboqNF02xs59ABVlF3Gy7fNXFBbjnupA5y3vrb6kDT8FAHTlccCfGASGiIPYjQ0AlvG6/vPQB65jZrL8km1EAAfX15G+ilInunMPEh9/D0DQ/OItb4mQL4inC1cUzIa4GZl8hv1BDDv49AgK+pW5SShZzw=="}} - -def key_resolver(key_id, algorithm): - return b"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr0urC5s1NwqMoArz5/Ln\nzS6/ICKNUkYlE8OxlVDJXIpfjNDFQtln/Qc2JM4yw8IKOyBwV6JFl78InKUHP6Dd\n55I8QcrsLa1BIUgu1yu7oJBMkDUXmsOKwvIkAJI5x0a/L/yHsD1jgqtSkrrD7SDt\nVSvYwiKnusi9oUNLHiaufhXv8/qpdkmcjjZrM4VbhYSgiobvzH5nR2JTBcM69uaG\nFUCrbhx5aHmZUf0vIxeKoJtfwNibFQ+OWil47bXjLcWJbw1X9SBRkjvwWm+1Ihpw\n0c8FeuViBSS15dXFSCxATaOLiFUYMl810ctcIhNn799F59ymgNVNS76Af3xJNWiM\nOQIDAQAB\n-----END PUBLIC KEY-----\n" - -def process_header_name(s): - if s.upper().startswith('HTTP_'): - s = s[5:] - return s.replace('_','-').lower() - -class CaseInsensitiveDict(dict): - def __setitem__(self, key, value): - super().__setitem__(key.lower(), value) - - def __getitem__(self, key): - return super().__getitem__(key.lower()) - - def __contains__(self, key): - return super().__contains__(key.lower()) - -headers = CaseInsensitiveDict([(process_header_name(f),v) for (f,v) in saved_headers.items()]) - - -headers['Authorization'] = 'Signature '+headers['Signature'] - -request = requests.Request( - method = "POST", - url = "https://unchapeau-dev.marnanel.org/users/fred/inbox", - headers = headers, - json = saved_body, - ) - -HTTPSignatureAuth.verify(request, key_resolver=key_resolver) - - - diff --git a/setup.py b/setup.py index 2e5b5de..f1b0140 100644 --- a/setup.py +++ b/setup.py @@ -15,19 +15,19 @@ def get_version(package): init_py = open(os.path.join(package, '__init__.py')).read() return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1) -version = get_version('chapeau') +version = get_version('kepi') setup( - name='chapeau', + name='kepi', version=version, - url='https://gitlab.com/marnanel/chapeau/', + url='https://gitlab.com/marnanel/kepi/', license='GPL-2', description='ActivityPub social media daemon', long_description=README, long_description_content_type='text/markdown', author='Marnanel Thurman', author_email='marnanel@thurman.org.uk', - packages=['chapeau'], + packages=['kepi'], include_package_data=True, install_requires=[], python_requires=">=3.0", @@ -39,7 +39,7 @@ setup( ], entry_points = { 'console_scripts': [ - 'chapeau=chapeau.kepi.command_line:main', + 'kepi=kepi.kepi.command_line:main', ], }, )