From 881fb5b5257287e4f176e79dcfb248c9816aa66b Mon Sep 17 00:00:00 2001 From: calumbell Date: Fri, 13 Feb 2026 11:50:37 +0000 Subject: [PATCH 1/6] removed /manifest from url, updated test cases to reflect rmvl --- api/tests/approved_files/TestAPIRoot.test_root.approved.json | 1 - api/urls.py | 1 - 2 files changed, 2 deletions(-) diff --git a/api/tests/approved_files/TestAPIRoot.test_root.approved.json b/api/tests/approved_files/TestAPIRoot.test_root.approved.json index 3b24c7b56..017051444 100644 --- a/api/tests/approved_files/TestAPIRoot.test_root.approved.json +++ b/api/tests/approved_files/TestAPIRoot.test_root.approved.json @@ -6,7 +6,6 @@ "documents": "http://localhost:8000/v2/documents/", "feats": "http://localhost:8000/v2/feats/", "magicitems": "http://localhost:8000/v1/magicitems/", - "manifest": "http://localhost:8000/v1/manifest/", "monsters": "http://localhost:8000/v1/monsters/", "planes": "http://localhost:8000/v1/planes/", "races": "http://localhost:8000/v1/races/", diff --git a/api/urls.py b/api/urls.py index 21e95e7fe..aad1b3dcd 100644 --- a/api/urls.py +++ b/api/urls.py @@ -6,7 +6,6 @@ from server.routers import DocumentedDefaultRouter router = DocumentedDefaultRouter() -router.register(r'manifest', views.ManifestViewSet) router.register(r'spells', views.SpellViewSet) router.register(r'spelllist',views.SpellListViewSet) router.register(r'monsters', views.MonsterViewSet) From 44b86a55c6c660fb0cde67f8af6c3cf43fd4fa22 Mon Sep 17 00:00:00 2001 From: calumbell Date: Fri, 13 Feb 2026 11:52:15 +0000 Subject: [PATCH 2/6] rmv'd ManifestViewSet --- api/views.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/api/views.py b/api/views.py index be51b2b10..946f6c66f 100644 --- a/api/views.py +++ b/api/views.py @@ -8,30 +8,6 @@ from api import serializers from api import filters - - -class ManifestViewSet(viewsets.ReadOnlyModelViewSet): - """ - list: API endpoint for returning a list of of manifests. - - For each data source file, there is a corresponding manifest containing an - MD5 hash of the data inside that file. When we update our data files, the - corresponding manifest's hash changes. If you host a service that - automatically downloads data from Open5e, you can periodically check - the manifests to determine whether your data is out of date. - - retrieve: API endpoint for returning a particular manifest. - - For each data source file, there is a corresponding manifest containing an - MD5 hash of the data inside that file. When we update our data files, the - corresponding manifest's hash changes. If you host a service that - automatically downloads data from Open5e, you can periodically check - the manifests to determine whether your data is out of date. - """ - queryset = models.Manifest.objects.all().order_by("pk") - serializer_class = serializers.ManifestSerializer - - @api_view() def get_version(_): """ From ae6b2b74d939ae543911e442878f57e8158f47f7 Mon Sep 17 00:00:00 2001 From: calumbell Date: Fri, 13 Feb 2026 11:53:30 +0000 Subject: [PATCH 3/6] removed ManifestSerializer --- api/serializers.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/api/serializers.py b/api/serializers.py index 9510e4fc8..887831ca5 100644 --- a/api/serializers.py +++ b/api/serializers.py @@ -4,12 +4,6 @@ from api import models from api import search_indexes - -class ManifestSerializer(serializers.ModelSerializer): - class Meta: - model = models.Manifest - fields = ('filename', 'type', 'hash', 'created_at') - class DynamicFieldsModelSerializer(serializers.ModelSerializer): def __init__(self, *args, **kwargs): From 44208404eb4785658c99b7a82d2b5ce1cc4c19fb Mon Sep 17 00:00:00 2001 From: calumbell Date: Fri, 13 Feb 2026 11:56:49 +0000 Subject: [PATCH 4/6] removed Manifest model --- api/migrations/0003_delete_manifest.py | 16 +++++++++++++++ api/models/__init__.py | 1 - api/models/models.py | 28 -------------------------- api/tests/test_api.py | 2 -- 4 files changed, 16 insertions(+), 31 deletions(-) create mode 100644 api/migrations/0003_delete_manifest.py diff --git a/api/migrations/0003_delete_manifest.py b/api/migrations/0003_delete_manifest.py new file mode 100644 index 000000000..cd800ff49 --- /dev/null +++ b/api/migrations/0003_delete_manifest.py @@ -0,0 +1,16 @@ +# Generated by Django 5.2.9 on 2026-02-13 11:54 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0002_document_v2_related_key'), + ] + + operations = [ + migrations.DeleteModel( + name='Manifest', + ), + ] diff --git a/api/models/__init__.py b/api/models/__init__.py index 61be33571..7b471cf0b 100644 --- a/api/models/__init__.py +++ b/api/models/__init__.py @@ -1,7 +1,6 @@ """ The initialization for models for open5e's api. """ -from .models import Manifest from .models import Document from .models import GameContent from .models import CharClass diff --git a/api/models/models.py b/api/models/models.py index e83b4280b..65f0c0814 100644 --- a/api/models/models.py +++ b/api/models/models.py @@ -7,34 +7,6 @@ from django.template.defaultfilters import slugify #from api_v2 import urls as urls_v2 -class Manifest(models.Model): - """A Manifest contains a hash based on the contents of a file. - - This is intended for folks who process and store content from our API. - When they download content, they also download the corresponding manifest. - Periodically, they check back in to see whether any manifests have changed. - If so, then they know to re-download that source. - """ - - filename = models.CharField( - max_length=255, - unique=True, - help_text='Input file name.') - type = models.CharField( - max_length=25, - help_text='Type of file (maps to a model).') - hash = models.CharField(max_length=255, - help_text='md5 hash of the file contents.') - created_at = models.DateTimeField( - auto_now_add=True, - help_text='Date that this object was added to the database.') - - @staticmethod - def plural_str() -> str: - """Return a string specifying the plural name of this model.""" - return "Manifests" - - class Document(models.Model): slug = models.CharField(max_length=255, unique=True, default=uuid.uuid1) # System Reference Document diff --git a/api/tests/test_api.py b/api/tests/test_api.py index b9661275c..1d8090a75 100644 --- a/api/tests/test_api.py +++ b/api/tests/test_api.py @@ -56,8 +56,6 @@ def test_feats(self): def test_magicitems(self): self._verify("/magicitems") - # /manifest is excluded because it's too volatile - def test_monsters(self): pass # This test is flaky, and fails on one machine, but passes on another. From ad9d3626896cd17253e178dbdcc14a5a52e519e5 Mon Sep 17 00:00:00 2001 From: calumbell Date: Fri, 13 Feb 2026 11:58:20 +0000 Subject: [PATCH 5/6] rmv'd manifest from v1 API schema --- docs/schema.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/schema.md b/docs/schema.md index 562678571..33bbe7b0b 100644 --- a/docs/schema.md +++ b/docs/schema.md @@ -16,14 +16,6 @@ erDiagram TEXT copyright } - api_manifest { - INTEGER id - VARCHAR filename - VARCHAR type - VARCHAR hash - DATETIME created_at - } - auth_group { INTEGER id VARCHAR name From 3eb0d7ec80839e7170360a457b7bd63481847684 Mon Sep 17 00:00:00 2001 From: calumbell Date: Sat, 14 Feb 2026 12:08:18 +0000 Subject: [PATCH 6/6] removed /version endpoint --- api/urls.py | 1 - server/version.py | 28 ---------------------------- 2 files changed, 29 deletions(-) delete mode 100644 server/version.py diff --git a/api/urls.py b/api/urls.py index aad1b3dcd..425ae81cc 100644 --- a/api/urls.py +++ b/api/urls.py @@ -23,6 +23,5 @@ urlpatterns = [ path('', include(router.urls)), #Consider removing this after a while. - path('version/', views.get_version, name="version"), path('v1/', include(router.urls)) ] \ No newline at end of file diff --git a/server/version.py b/server/version.py deleted file mode 100644 index c6aae67d8..000000000 --- a/server/version.py +++ /dev/null @@ -1,28 +0,0 @@ -import hashlib -import os -# This file is used to serve data to the /version endpoint of the API. -# For production (and staging) deploys, this file is overwritten at build time. - -def GetHashofDirs(directory): - """ - Hash directories for - Adapted from: https://stackoverflow.com/questions/24937495/how-can-i-calculate-a-hash-for-a-filesystem-directory-using-python - """ - - digest = hashlib.sha256() - if not os.path.exists(directory): - raise IOError - - for root, _, files in os.walk(directory): - for names in files: - filepath = os.path.join(root,names) - with open(filepath, 'rb') as file: - digest = hashlib.file_digest(file, "sha256") - - - return digest.hexdigest() - -DATA_V1_HASH = GetHashofDirs("./data/v1") -DATA_V2_HASH = GetHashofDirs("./data/v2") -API_V1_HASH = GetHashofDirs("./api") -API_V2_HASH = GetHashofDirs("./api_v2")