chore(storage): remove MinIO dependency and clean up #133
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Remove the MinIO SDK dependency and all MinIO-specific code after the filesystem migration is verified in production.
Context
Once all files have been migrated to the filesystem backend (#130) and the new upload/download flows are working (#129), the MinIO code becomes dead weight. This cleanup issue should only be executed after production verification.
Prerequisites — verify before starting
storage_backend = 'minio'rows remaining initem_filesorrevisionstablesstorage.backend: "filesystem"in productionRequirements
1. Remove MinIO Go SDK
Remove from
go.mod:And transitive dependencies that are only needed by MinIO:
Run
go mod tidyto clean up.2. Remove MinIO implementation
internal/storage/storage.go(the MinIOStoragestruct and all its methods:Connect,Put,Get,GetVersion,Delete,Ping,Bucket,PresignPut,Copy)internal/storage/interface.go(FileStoreinterface) andinternal/storage/filesystem.goFileKey()andThumbnailKey()standalone helpers if still usedConfigstruct fields specific to MinIO (Endpoint,AccessKey,SecretKey,Bucket,UseSSL,Region) frominternal/config/config.go— or deprecate them3. Remove MinIO from Docker Compose
deployments/docker-compose.yaml: Removeminioservice andminio_datavolumedeployments/docker-compose.allinone.yaml: Removeminioservice andminio_datavolumeSILO_MINIO_ENDPOINT,SILO_MINIO_ACCESS_KEY,SILO_MINIO_SECRET_KEYenv vars from silo service definitionsdeployments/config.dev.yamlto remove MinIO config4. Remove MinIO environment variable handling
In
internal/config/config.go, theLoad()function has env var overrides:Remove these.
5. Simplify startup wiring
In
cmd/silod/main.go(lines 68-86), the storage initialization currently:cfg.Storage.Endpointis non-emptystorage.Connect()to create MinIO clientReplace with:
cfg.Storage.Backend(orcfg.Storage.Filesystem.Root)storage.NewFilesystemStore(root)6. Remove presigned upload endpoint
If not already removed in #129:
HandlePresignUploadhandler frominternal/api/file_handlers.goPOST /api/uploads/presignroute frominternal/api/routes.goweb/src/hooks/useFileUpload.tsif fully replaced7. Remove migration script
Archive or remove
cmd/silod/migrate.go(orcmd/silo-migrate/) — no longer needed after migration is complete.8. Remove
storage_backendcolumns (optional)If all rows are
'filesystem', thestorage_backendandfile_storage_backendcolumns are unnecessary. Consider a migration to drop them, or leave them as a safety net.9. Clean up config example
Update
config.example.yamlto show only filesystem config (remove MinIO example or move to comments).Files to modify/delete
internal/storage/storage.go— delete (MinIO implementation)internal/config/config.go— remove MinIO config fields and env varscmd/silod/main.go— simplify storage initinternal/api/file_handlers.go— removeHandlePresignUploadinternal/api/routes.go— remove presign routedeployments/docker-compose.yaml— remove MinIO servicedeployments/docker-compose.allinone.yaml— remove MinIO servicedeployments/config.dev.yaml— remove MinIO configconfig.example.yaml— simplifygo.mod,go.sum— remove MinIO SDKweb/src/hooks/useFileUpload.ts— remove presigned upload codecmd/silod/migrate.go— archive/removeAcceptance criteria
go build ./...passes with no MinIO referencesgo mod tidyshows no MinIO packagesSILO_MINIO_*env vars referenced anywherePriority
P2 — execute only after production migration is verified
Depends on
Part of
Storage Migration: MinIO → PostgreSQL + Filesystem