{"id":39375700,"url":"https://github.com/sagarc03/stowry","last_synced_at":"2026-02-14T02:05:32.368Z","repository":{"id":333078018,"uuid":"1114784296","full_name":"sagarc03/stowry","owner":"sagarc03","description":"Lightweight object storage with AWS Signature V4 authentication support and pluggable  metadata backends (SQLite, PostgreSQL)","archived":false,"fork":false,"pushed_at":"2026-01-18T05:45:10.000Z","size":466,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-18T13:40:41.268Z","etag":null,"topics":["aws-signature-v4","blob-storage","cli","docker","file-storage","go","golang","object-storage","postgresql","presigned-urls","s3","self-hosted","sqlite"],"latest_commit_sha":null,"homepage":"https://stowry.dev","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sagarc03.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-11T22:04:50.000Z","updated_at":"2026-01-17T10:52:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sagarc03/stowry","commit_stats":null,"previous_names":["sagarc03/stowry"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sagarc03/stowry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagarc03%2Fstowry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagarc03%2Fstowry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagarc03%2Fstowry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagarc03%2Fstowry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sagarc03","download_url":"https://codeload.github.com/sagarc03/stowry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagarc03%2Fstowry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28627386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-signature-v4","blob-storage","cli","docker","file-storage","go","golang","object-storage","postgresql","presigned-urls","s3","self-hosted","sqlite"],"created_at":"2026-01-18T02:55:33.825Z","updated_at":"2026-02-14T02:05:32.362Z","avatar_url":"https://github.com/sagarc03.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Stowry\n\n[![CI](https://github.com/sagarc03/stowry/actions/workflows/ci.yaml/badge.svg)](https://github.com/sagarc03/stowry/actions/workflows/ci.yaml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/sagarc03/stowry)](https://goreportcard.com/report/github.com/sagarc03/stowry)\n\nA lightweight, self-hosted object storage server with AWS Signature V4 authentication.\n\n**Use cases**: Local development, self-hosting, static site hosting, SPA deployment, simple file storage.\n\n## Features\n\n- **AWS Sig V4 authentication** - Uses AWS Signature V4 presigned URLs (not S3-compatible API)\n- **Three server modes** - Object storage API, static file server, or SPA host\n- **Minimal dependencies** - Single binary, SQLite (3.24+) or PostgreSQL for metadata\n- **Soft deletion** - Files are recoverable until cleanup runs\n- **Atomic writes** - No partial or corrupted files\n- **Pluggable storage** - Filesystem now, S3/GCS ready interface\n\n## Quick Start\n\n```bash\n# Using Docker\ndocker run -p 5708:5708 -v ./data:/data ghcr.io/sagarc03/stowry:latest\n\n# Using binary\n./stowry serve\n```\n\nServer starts at `http://localhost:5708`\n\n## Client SDKs\n\nGenerate presigned URLs to interact with Stowry:\n\n| Language   | Package                                              | Install                                 |\n|------------|------------------------------------------------------|-----------------------------------------|\n| Go         | [stowry-go](https://github.com/sagarc03/stowry-go)   | `go get github.com/sagarc03/stowry-go`  |\n| Python     | [stowrypy](https://pypi.org/project/stowrypy/)       | `pip install stowrypy`                  |\n| JavaScript | [stowryjs](https://www.npmjs.com/package/stowryjs)   | `npm install stowryjs`                  |\n\nAWS SDKs (boto3, aws-sdk-go-v2, @aws-sdk/client-s3) also work for generating presigned URLs.\n\nSee [examples](examples) for usage.\n\n## Client CLI\n\nFor command-line access without writing code:\n\n```bash\n# Install\ngo install github.com/sagarc03/stowry/cmd/stowry-cli@latest\n\n# Configure\nexport STOWRY_SERVER=http://localhost:5708\nexport STOWRY_ACCESS_KEY=your-access-key\nexport STOWRY_SECRET_KEY=your-secret-key\n\n# Upload (uses local path as remote path)\nstowry-cli upload ./images/photo.jpg\n\n# Upload with explicit remote path\nstowry-cli upload ./file.txt custom/path.txt\n\n# Download\nstowry-cli download images/photo.jpg\n\n# List (store mode only)\nstowry-cli list --prefix images/\n\n# Delete\nstowry-cli delete images/photo.jpg\n```\n\nSee [Client CLI Reference](https://stowry.dev/client-cli) for full documentation.\n\n## Installation\n\n### Docker\n\n```bash\ndocker pull ghcr.io/sagarc03/stowry:latest\n\n# With persistent storage\ndocker run -d \\\n  --name stowry \\\n  -p 5708:5708 \\\n  -v ./data:/data \\\n  -v ./stowry.db:/stowry.db \\\n  ghcr.io/sagarc03/stowry:latest\n```\n\n### Binary\n\nDownload from [Releases](https://github.com/sagarc03/stowry/releases):\n\n```bash\n# Linux\ncurl -LO https://github.com/sagarc03/stowry/releases/latest/download/stowry_linux_amd64.tar.gz\ntar xzf stowry_linux_amd64.tar.gz\n./stowry serve\n\n# macOS\ncurl -LO https://github.com/sagarc03/stowry/releases/latest/download/stowry_darwin_arm64.tar.gz\ntar xzf stowry_darwin_arm64.tar.gz\n./stowry serve\n```\n\n### From Source\n\n```bash\ngo install github.com/sagarc03/stowry/cmd/stowry@latest\n```\n\n## CLI Commands\n\n```bash\n# Start the server\nstowry serve [--port 5708] [--mode store|static|spa]\n\n# Import files into storage\nstowry add [--dest prefix/] [--recursive] \u003cfile1\u003e [file2] ...\n\n# Remove files from storage (soft-delete)\nstowry remove [--prefix] \u003cpath1\u003e [path2] ...\n\n# Initialize metadata from existing files\nstowry init [--storage ./data]\n\n# Clean up soft-deleted files\nstowry cleanup [--limit 100]\n```\n\n### Global Flags\n\n| Flag        | Env Var                | Default       | Description         |\n|-------------|------------------------|---------------|---------------------|\n| `--config`  | -                      | `config.yaml` | Config file path    |\n| `--db-type` | `STOWRY_DATABASE_TYPE` | `sqlite`      | Database type       |\n| `--db-dsn`  | `STOWRY_DATABASE_DSN`  | `stowry.db`   | Database connection |\n| `--storage` | `STOWRY_STORAGE_PATH`  | `./data`      | Storage directory   |\n\n## Configuration\n\nCreate `config.yaml`:\n\n```yaml\nserver:\n  port: 5708\n  mode: store  # store | static | spa\n  max_upload_size: 0  # Maximum upload size in bytes (0 = unlimited)\n  error_document: \"\"  # Custom 404 page path for static mode (default: built-in HTML)\n\nservice:\n  cleanup_timeout: 30  # Cleanup operation timeout in seconds\n\ndatabase:\n  type: sqlite      # sqlite | postgres\n  dsn: stowry.db    # file path or connection string\n  tables:\n    meta_data: stowry_metadata\n\nstorage:\n  path: ./data\n\nauth:\n  read: public   # public | private\n  write: public  # public | private\n  aws:\n    region: us-east-1\n    service: s3\n  keys:\n    inline:\n      - access_key: YOUR_ACCESS_KEY\n        secret_key: YOUR_SECRET_KEY\n    # file: /path/to/keys.json\n\nlog:\n  level: info  # debug | info | warn | error\n```\n\n\u003e **Note:** In `static` and `spa` modes, auth settings are ignored — all access is public. The `max_upload_size` setting only applies in `store` mode.\n\nEnvironment variables use `STOWRY_` prefix: `STOWRY_SERVER_PORT=8080`\n\n## API\n\n\u003e **Note:** Upload (PUT) and Delete are only available in `store` mode. Static and SPA modes return `405 Method Not Allowed`.\n\n### Upload\n\n```bash\ncurl -X PUT http://localhost:5708/path/to/file.txt \\\n  -H \"Content-Type: text/plain\" \\\n  -d \"Hello, World!\"\n```\n\n### Download\n\n```bash\ncurl http://localhost:5708/path/to/file.txt\n```\n\n### Head (Metadata Only)\n\n```bash\ncurl -I http://localhost:5708/path/to/file.txt\n```\n\nReturns `Content-Type`, `Content-Length`, `ETag`, and `Last-Modified` headers without the file body. Supports `If-None-Match` and `If-Modified-Since` conditional headers.\n\n### Delete\n\n```bash\ncurl -X DELETE http://localhost:5708/path/to/file.txt\n```\n\n### List Objects\n\n```bash\ncurl \"http://localhost:5708/?prefix=path/\u0026limit=100\"\n```\n\nResponse:\n\n```json\n{\n  \"items\": [\n    {\n      \"path\": \"path/to/file.txt\",\n      \"content_type\": \"text/plain\",\n      \"etag\": \"abc123...\",\n      \"file_size_bytes\": 13,\n      \"created_at\": \"2024-01-15T10:00:00Z\",\n      \"updated_at\": \"2024-01-15T10:00:00Z\"\n    }\n  ],\n  \"next_cursor\": \"...\"\n}\n```\n\n### Authentication\n\nWhen `auth.read` or `auth.write` is set to `private`, requests require AWS Signature V4 presigned URL parameters.\n\n#### Generating Keys\n\nAccess keys and secret keys are arbitrary strings. Generate them with:\n\n```bash\n# Access key (20 chars)\nopenssl rand -hex 10 | tr '[:lower:]' '[:upper:]'\n\n# Secret key (40 chars)\nopenssl rand -hex 20\n```\n\nOr use any password generator.\n\n#### Presigned URL Format\n\n```text\n?X-Amz-Algorithm=AWS4-HMAC-SHA256\n\u0026X-Amz-Credential=ACCESS_KEY/20240115/us-east-1/s3/aws4_request\n\u0026X-Amz-Date=20240115T100000Z\n\u0026X-Amz-Expires=3600\n\u0026X-Amz-SignedHeaders=host\n\u0026X-Amz-Signature=...\n```\n\nYou can use S3 SDKs to generate presigned URL signatures, but note that Stowry's API is not S3-compatible.\n\n## Server Modes\n\n### Store (default)\n\nObject storage API with full CRUD. Returns 404 for missing paths.\n\n### Static\n\nRead-only static file server with S3+CloudFront-style path resolution (public access):\n\n- `/about` → `about` (exact) → `about.html` → `about/index.html`\n- `/docs/` → `docs/index.html`\n- `/` → `index.html`\n- Missing paths return an HTML 404 page (configurable via `error_document`)\n\nUse `stowry add` or store mode to populate content.\n\n### SPA\n\nRead-only Single Page Application host (public access). Returns `/index.html` for all 404s, enabling client-side routing.\n\nUse `stowry add` or store mode to populate content.\n\n## Kubernetes\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: stowry\nspec:\n  selector:\n    matchLabels:\n      app: stowry\n  template:\n    metadata:\n      labels:\n        app: stowry\n    spec:\n      securityContext:\n        runAsUser: 65532\n        runAsGroup: 65532\n        fsGroup: 65532\n      containers:\n        - name: stowry\n          image: ghcr.io/sagarc03/stowry:latest\n          ports:\n            - containerPort: 5708\n          volumeMounts:\n            - name: data\n              mountPath: /data\n      volumes:\n        - name: data\n          persistentVolumeClaim:\n            claimName: stowry-data\n```\n\n## Development\n\nThis project uses [Task](https://taskfile.dev/) as a task runner.\n\n```bash\n# Install Task (macOS)\nbrew install go-task\n\n# List available tasks\ntask --list\n\n# Run tests\ntask test\n\n# Run linter\ntask lint\n\n# Build binary\ntask build\n\n# Run all checks (fmt, lint, test)\ntask check\n\n# Run examples\ntask examples:stowry   # Start server\ntask examples:go-aws   # Run Go AWS example\n```\n\n## Contributing\n\nContributions are welcome! Please follow these steps:\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Run tests and linter (`task check`)\n5. Commit your changes (`git commit -m 'Add amazing feature'`)\n6. Push to the branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n### Guidelines\n\n- Follow existing code style\n- Add tests for new features\n- Update documentation as needed\n- Keep commits focused and atomic\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagarc03%2Fstowry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsagarc03%2Fstowry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagarc03%2Fstowry/lists"}