rename(547): the server is grimoire — package, image, DB defaults, backups
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / TypeScript typecheck (push) Successful in 56s
CI & Build / integration (push) Successful in 1m4s
CI & Build / Python tests (push) Successful in 1m55s
CI & Build / Build & push image (push) Successful in 44s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / TypeScript typecheck (push) Successful in 56s
CI & Build / integration (push) Successful in 1m4s
CI & Build / Python tests (push) Successful in 1m55s
CI & Build / Build & push image (push) Successful in 44s
Step 2 of the Scribe -> Grimoire rename. - src/scribe -> src/grimoire, and every import, patch target, module path, hypercorn entry point and `python -m grimoire.restore` with it; pyproject, uv.lock and the frontend package are named grimoire. - Image git.fabledsword.com/bvandeusen/fabledgrimoire; CI's Postgres service runs as grimoire / grimoire_test. - Compose files default the DB user, database and (prod) volume to grimoire, each overridable from .env, so an install created as Scribe keeps its data by setting POSTGRES_USER, POSTGRES_DB and PGDATA_VOLUME. - Backups are written as grimoire-<ts>.tar with format grimoire-backup-tar. Archives named scribe-* with the scribe-backup-tar manifest still restore and are still counted at the destination (folder and S3), with tests. - Exports, the MCP auth realm, the ASGI scope key and the persistent logger carry the new name. Kept on purpose: the secret-sealing key label stays "scribe.secrets.v1", because every stored secret was derived under it. Plugin identity (plugin name, hooks, env vars, .scribe marker, skills) is step 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,7 @@ from datetime import datetime, timezone
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
from scribe.services import backup_s3 as s3
|
||||
from grimoire.services import backup_s3 as s3
|
||||
|
||||
# AWS's example credentials and moment ("Signature Calculations for the
|
||||
# Authorization Header", Amazon S3 API reference).
|
||||
@@ -41,12 +41,12 @@ def test_a_changed_secret_changes_the_signature():
|
||||
assert _signature(a) != _signature(b)
|
||||
|
||||
|
||||
TARGET = s3.S3Target("http://archives:8081/s3", "scribe", KEY_ID, SECRET)
|
||||
TARGET = s3.S3Target("http://archives:8081/s3", "grimoire", KEY_ID, SECRET)
|
||||
|
||||
|
||||
def test_paths_are_path_style():
|
||||
assert TARGET.url("scribe-20261012T000000Z.tar") == "http://archives:8081/s3/scribe/scribe-20261012T000000Z.tar"
|
||||
assert TARGET.url() == "http://archives:8081/s3/scribe/"
|
||||
assert TARGET.url("grimoire-20261012T000000Z.tar") == "http://archives:8081/s3/grimoire/grimoire-20261012T000000Z.tar"
|
||||
assert TARGET.url() == "http://archives:8081/s3/grimoire/"
|
||||
|
||||
|
||||
def test_put_sends_the_file_signed(tmp_path):
|
||||
@@ -63,7 +63,7 @@ def test_put_sends_the_file_signed(tmp_path):
|
||||
|
||||
asyncio.run(s3.put_file(TARGET, "b.tar", f, transport=httpx.MockTransport(handler)))
|
||||
assert seen["method"] == "PUT"
|
||||
assert seen["url"] == "http://archives:8081/s3/scribe/b.tar"
|
||||
assert seen["url"] == "http://archives:8081/s3/grimoire/b.tar"
|
||||
assert seen["body"] == b"x" * 5000
|
||||
assert seen["sha"] == s3.file_sha256(f)
|
||||
assert seen["auth"].startswith("AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/")
|
||||
@@ -92,10 +92,10 @@ def test_unreachable_says_so(tmp_path):
|
||||
def test_list_reads_contents():
|
||||
xml = b"""<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
||||
<Name>scribe</Name><KeyCount>2</KeyCount>
|
||||
<Contents><Key>scribe-20261011T000000Z.tar</Key><Size>1200</Size>
|
||||
<Name>grimoire</Name><KeyCount>2</KeyCount>
|
||||
<Contents><Key>grimoire-20261011T000000Z.tar</Key><Size>1200</Size>
|
||||
<LastModified>2026-10-11T00:00:01.000Z</LastModified></Contents>
|
||||
<Contents><Key>scribe-20261012T000000Z.tar</Key><Size>1300</Size>
|
||||
<Contents><Key>grimoire-20261012T000000Z.tar</Key><Size>1300</Size>
|
||||
<LastModified>2026-10-12T00:00:01.000Z</LastModified></Contents>
|
||||
</ListBucketResult>"""
|
||||
seen = {}
|
||||
@@ -104,9 +104,9 @@ def test_list_reads_contents():
|
||||
seen["params"] = dict(request.url.params)
|
||||
return httpx.Response(200, content=xml)
|
||||
|
||||
got = asyncio.run(s3.list_objects(TARGET, "scribe-", transport=httpx.MockTransport(handler)))
|
||||
assert seen["params"] == {"list-type": "2", "max-keys": "1000", "prefix": "scribe-"}
|
||||
got = asyncio.run(s3.list_objects(TARGET, "grimoire-", transport=httpx.MockTransport(handler)))
|
||||
assert seen["params"] == {"list-type": "2", "max-keys": "1000", "prefix": "grimoire-"}
|
||||
assert got == [
|
||||
s3.StoredObject("scribe-20261011T000000Z.tar", 1200, "2026-10-11T00:00:01.000Z"),
|
||||
s3.StoredObject("scribe-20261012T000000Z.tar", 1300, "2026-10-12T00:00:01.000Z"),
|
||||
s3.StoredObject("grimoire-20261011T000000Z.tar", 1200, "2026-10-11T00:00:01.000Z"),
|
||||
s3.StoredObject("grimoire-20261012T000000Z.tar", 1300, "2026-10-12T00:00:01.000Z"),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user