# DocHub Storage (Garage) S3-compatible object storage for DocHub, deployed independently from the app stack in `docker-compose.yml` at the repo root, using [Garage](https://garagehq.deuxfleurs.fr/) — a fully open source (AGPL) object store purpose-built for self-hosting. `backend/app/garage_client.py` talks to it over the standard S3 API via `boto3`. Single-node setup, matching this project's learning/small-team scope (`replication_factor = 1` in `garage.toml` — no data redundancy across nodes, since there's only one node). ## First-time setup ```bash cd storage docker compose up -d ./init-garage.sh docker compose exec garage /garage key info dochub-backend ``` The last command prints an access key ID and secret key. Set those as `GARAGE_ACCESS_KEY` / `GARAGE_SECRET_KEY` for the DocHub backend. ## Connecting the backend From the repo root, when running `docker compose up` there: ```bash GARAGE_ENDPOINT=:3900 \ GARAGE_ACCESS_KEY= \ GARAGE_SECRET_KEY= \ docker compose up -d ``` Garage's S3 API listens on port `3900`.