diff --git a/.gitignore b/.gitignore index db84b73..e018763 100644 --- a/.gitignore +++ b/.gitignore @@ -83,10 +83,6 @@ tools/.image-cache/ /docs/_build/ /docs/generated/ -# Local Omeka credentials, copied from deploy/omeka/.env.example. Not secret -# -- the service binds to localhost -- but machine-local all the same. -deploy/omeka/.env - # Cached OCR spans for the layout experiments -- regenerable by # tools/dump_layout_spans.py, and specific to the weights that produced them. evaluation/layout/spans/ diff --git a/CLAUDE.md b/CLAUDE.md index 34fd719..7cc3895 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -28,9 +28,11 @@ management (briefs, decisions, research) lives in the private | The evaluations | `evaluation//` | One subpackage per pipeline: its corpus, its harness, its results. `evaluation/ocr/` is the only one so far | | The tests | `tests//` | Likewise. `conftest.py` stays at `tests/` — it is shared fixture setup | | The site | `site/` | The Hugo documentation site — its own npm project, with `content/`, `layouts/` and `assets/` inside it | -| Deployments | `deploy/` | Compose stacks for things to develop against. `deploy/omeka/` is an Omeka S proof of concept | | The Pages Functions | `functions/` | Cloudflare Pages Functions proxying Plausible. At the repository root, not in `site/`, because Cloudflare resolves them against the Pages root directory | +The Omeka S demo, with its pinned local stack, lives in its own repository, +`tetrak-omeka`, which uses Tetrak as an installed package. + The distribution is named `tetrak`, not `tetrak-ocr` — it carries all three packages. The console script stays `tetrak-ocr`; `[project.scripts]` is independent of the distribution name. diff --git a/deploy/omeka/.env.example b/deploy/omeka/.env.example deleted file mode 100644 index ede30f5..0000000 --- a/deploy/omeka/.env.example +++ /dev/null @@ -1,7 +0,0 @@ -# Copy to .env before `docker compose up`. These are local proof-of-concept -# credentials for a service bound to 127.0.0.1 -- they are not secrets, and -# nothing here should ever be pointed at real collection material. -OMEKA_DB_NAME=omeka -OMEKA_DB_USER=omeka -OMEKA_DB_PASSWORD=omeka -OMEKA_DB_ROOT_PASSWORD=omeka-root diff --git a/deploy/omeka/Dockerfile b/deploy/omeka/Dockerfile deleted file mode 100644 index 37b3352..0000000 --- a/deploy/omeka/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -# Omeka S, built here rather than pulled. -# -# The Omeka project publishes no official image, and the community ones are -# either abandoned, amd64-only, or ignore environment configuration. Building -# from the official release zip on the official PHP image keeps this stable, -# multi-arch, and dependent on nobody else's registry. -# -# The release zip is pinned by version and checksum. To move to a new release, -# change both build args together; the build fails if they disagree. - -FROM php:8.2-apache - -ARG OMEKA_VERSION=4.1.1 -ARG OMEKA_SHA256=b53c9eeb5e8479c6991de3c47197abac59be577884e7224f92f87758f2f14f7f - -# pdo_mysql, mbstring, xml and fileinfo are what Omeka's composer.json requires; -# mbstring, xml and fileinfo already ship with the PHP image. ImageMagick is the -# thumbnailer Omeka finds on its own; without one, uploads get no derivatives. -RUN apt-get update \ - && apt-get install -y --no-install-recommends imagemagick unzip \ - && docker-php-ext-install pdo_mysql \ - && a2enmod rewrite \ - && rm -rf /var/lib/apt/lists/* - -RUN curl -fsSL -o /tmp/omeka.zip \ - "https://github.com/omeka/omeka-s/releases/download/v${OMEKA_VERSION}/omeka-s-${OMEKA_VERSION}.zip" \ - && echo "${OMEKA_SHA256} /tmp/omeka.zip" | sha256sum -c - \ - && unzip -q /tmp/omeka.zip -d /tmp \ - && rm -rf /var/www/html \ - && mv /tmp/omeka-s /var/www/html \ - && rm /tmp/omeka.zip \ - && chown -R www-data:www-data /var/www/html/files - -# Omeka ships a .htaccess that routes everything through index.php; Apache -# ignores it unless overrides are allowed. -RUN sed -i '//,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' \ - /etc/apache2/apache2.conf \ - && echo 'ServerName localhost' > /etc/apache2/conf-available/servername.conf \ - && a2enconf servername - -COPY docker-entrypoint.sh /usr/local/bin/omeka-entrypoint -RUN chmod +x /usr/local/bin/omeka-entrypoint - -ENTRYPOINT ["omeka-entrypoint"] -CMD ["apache2-foreground"] diff --git a/deploy/omeka/README.md b/deploy/omeka/README.md deleted file mode 100644 index 19c3fa3..0000000 --- a/deploy/omeka/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# Omeka S, locally - -A proof of concept: somewhere to see what transcripts look like once they are -in a collections system, and to develop `tetrak_publish` against something -real. It is not a deployment, and nothing here should be pointed at material -that matters. - -## Running it - -```bash -cd deploy/omeka -cp .env.example .env -docker compose up -d --build -open http://localhost:8080 -``` - -The first visit runs Omeka's installer, which asks for the admin email and -password to create. Those are yours and are not stored in this directory. - -```bash -docker compose down # stop, keep the data -docker compose down -v # stop, discard the data and start clean -``` - -## What it is - -Two services and two named volumes. Omeka S needs a MySQL-compatible database, -and MariaDB is what its own documentation assumes. - -Omeka has no official Docker image, and the community ones are abandoned, -amd64-only, or ignore environment configuration. So the `Dockerfile` here -builds one from the official release zip on `php:8.2-apache`, checking the zip -against a pinned SHA-256. `docker-entrypoint.sh` writes Omeka's -`config/database.ini` from the `OMEKA_DB_*` variables at start-up, so `.env` -stays the only place the credentials live. To upgrade Omeka, change -`OMEKA_VERSION` and `OMEKA_SHA256` in the `Dockerfile` together, bump the -image tag in `compose.yaml` to match, and rebuild. - -Both versions are pinned rather than tracking `latest`, so a proof of concept -somebody comes back to in three months still comes up. The database has a real -health check and the app waits on it, because Omeka's installer fails -confusingly against a database that is still starting. - -## Two deliberate choices - -**It binds to `127.0.0.1`, not to every interface.** There is a window between -`compose up` and finishing the installer where anyone who can reach the port -can claim the admin account. - -**The database credentials in `.env.example` are not secrets.** They are local -scaffolding for a service on localhost. `.env` is gitignored so a real one can -be kept without it being committed, but the honest position is that this stack -is not built to hold anything sensitive. - -## Where the code goes - -`src/tetrak_publish/` — destinations behind one interface, discovered from a -registry, following the pattern `src/tetrak_ocr/registry.py` established. -Publishing belongs to neither pipeline because both produce transcripts. diff --git a/deploy/omeka/compose.yaml b/deploy/omeka/compose.yaml deleted file mode 100644 index 3f024b9..0000000 --- a/deploy/omeka/compose.yaml +++ /dev/null @@ -1,61 +0,0 @@ -# Omeka S, as a local proof of concept for publishing transcripts. -# -# This is somewhere to try the idea, not a deployment. It binds to localhost, -# the credentials are in .env and are not secrets, and the volumes are named so -# `docker compose down -v` genuinely resets it. -# -# Versions are pinned rather than :latest, so a proof of concept somebody returns -# to in three months still comes up. Omeka S has no official image, so it is -# built from the release zip by the Dockerfile alongside. It needs a -# MySQL-compatible database; MariaDB is what its own documentation assumes. -# -# Usage: -# cp .env.example .env -# docker compose up -d --build -# open http://localhost:8080 # installer runs on first visit -# docker compose down # keeps data -# docker compose down -v # discards it - -services: - db: - image: mariadb:11.4 - restart: unless-stopped - environment: - MARIADB_DATABASE: ${OMEKA_DB_NAME} - MARIADB_USER: ${OMEKA_DB_USER} - MARIADB_PASSWORD: ${OMEKA_DB_PASSWORD} - MARIADB_ROOT_PASSWORD: ${OMEKA_DB_ROOT_PASSWORD} - volumes: - - db-data:/var/lib/mysql - # Omeka's installer fails confusingly against a database that is still - # starting, so the app waits for a real health check rather than for the - # container merely existing. - healthcheck: - test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] - interval: 5s - timeout: 5s - retries: 20 - - omeka: - build: . - image: tetrak/omeka-s:4.1.1 - restart: unless-stopped - depends_on: - db: - condition: service_healthy - environment: - OMEKA_DB_HOST: db - OMEKA_DB_NAME: ${OMEKA_DB_NAME} - OMEKA_DB_USER: ${OMEKA_DB_USER} - OMEKA_DB_PASSWORD: ${OMEKA_DB_PASSWORD} - # Bound to localhost rather than published on every interface: this has a - # first-run installer that sets the admin password, and it should not be - # reachable from the network before somebody has been through it. - ports: - - "127.0.0.1:8080:80" - volumes: - - omeka-files:/var/www/html/files - -volumes: - db-data: - omeka-files: diff --git a/deploy/omeka/docker-entrypoint.sh b/deploy/omeka/docker-entrypoint.sh deleted file mode 100644 index dff6042..0000000 --- a/deploy/omeka/docker-entrypoint.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# Write Omeka's database.ini from the environment, then hand over to Apache. -# -# Omeka reads its connection settings only from config/database.ini. Rendering -# it at start-up keeps .env the single place the credentials live, rather than -# repeating them in a mounted file. -set -eu - -: "${OMEKA_DB_HOST:?OMEKA_DB_HOST is not set}" -: "${OMEKA_DB_NAME:?OMEKA_DB_NAME is not set -- copy .env.example to .env}" -: "${OMEKA_DB_USER:?OMEKA_DB_USER is not set -- copy .env.example to .env}" -: "${OMEKA_DB_PASSWORD:?OMEKA_DB_PASSWORD is not set -- copy .env.example to .env}" - -cat > /var/www/html/config/database.ini <