mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-05 00:39:38 +03:00
[PR #1080] [MERGED] feat: add support for S3 storage backend #1042
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?
📋 Pull Request Information
Original PR: https://github.com/pocket-id/pocket-id/pull/1080
Author: @stonith404
Created: 11/7/2025
Status: ✅ Merged
Merged: 11/10/2025
Merged by: @stonith404
Base:
main← Head:feat/s3-storage-backend📝 Commits (10+)
e1b04e1feat: add support for S3 storage backend03604e8add missing directories if they don't existb8ec0bfadd e2e test environment for s3d2a27e5fix incorrect root path handling3d9d6fdadapt unit testsdb2fd47Merge branch 'main' into feat/s3-storage-backendd9fa66cUpdate backend/internal/service/app_images_service.go9317774Update backend/internal/service/oidc_service.go355eb9cadd missing contextsec0cc49clear temporary files from atomic writes📊 Changes
28 files changed (+1080 additions, -612 deletions)
View changed files
📝
.github/workflows/e2e-tests.yml(+33 -3)📝
backend/go.mod(+18 -4)📝
backend/go.sum(+53 -231)📝
backend/internal/bootstrap/app_images_bootstrap.go(+45 -29)📝
backend/internal/bootstrap/bootstrap.go(+27 -2)📝
backend/internal/bootstrap/e2etest_router_bootstrap.go(+1 -1)📝
backend/internal/bootstrap/scheduler_bootstrap.go(+1 -1)📝
backend/internal/bootstrap/services_bootstrap.go(+7 -4)📝
backend/internal/common/env_config.go(+31 -24)📝
backend/internal/common/env_config_test.go(+38 -0)📝
backend/internal/controller/app_images_controller.go(+8 -7)📝
backend/internal/controller/oidc_controller.go(+3 -2)📝
backend/internal/controller/user_controller.go(+4 -4)📝
backend/internal/job/file_cleanup_job.go(+54 -21)📝
backend/internal/service/app_images_service.go(+32 -17)📝
backend/internal/service/app_images_service_test.go(+58 -32)📝
backend/internal/service/e2etest_service.go(+17 -9)📝
backend/internal/service/ldap_service.go(+1 -1)📝
backend/internal/service/oidc_service.go(+47 -36)📝
backend/internal/service/user_service.go(+29 -49)...and 8 more files
📄 Description
This PR adds S3 support, which was the final step needed to run Pocket ID in a serverless environment. The implementation is done with a
FileStorageinterface. Based on the configured environment variables Pocket ID chooses between the filesystem or S3 implementation.A nice advantage of the new file handling is that we can reduce the risk of path traversal attacks because
filesystemStorageusesos.OpenRootwhich only allows file system access in the defined directory which isUPLOAD_PATH.Closes #497
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.