π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
move refactor
Neeraj Guptab9b239c2074c
diff --git a/server/cmd/museum/main.go b/server/cmd/museum/main.goindex 7070b8af61..45a37be1e2 100644--- a/server/cmd/museum/main.go+++ b/server/cmd/museum/main.go@@ -6,6 +6,7 @@ import (b64 "encoding/base64""fmt""github.com/ente-io/museum/pkg/controller/collections"+ "github.com/ente-io/museum/pkg/repo/public""net/http""os""os/signal"@@ -176,7 +177,7 @@ func main() {fileDataRepo := &fileDataRepo.Repository{DB: db, ObjectCleanupRepo: objectCleanupRepo}familyRepo := &repo.FamilyRepository{DB: db}trashRepo := &repo.TrashRepository{DB: db, ObjectRepo: objectRepo, FileRepo: fileRepo, QueueRepo: queueRepo}- publicCollectionRepo := repo.NewPublicCollectionRepository(db, viper.GetString("apps.public-albums"))+ publicCollectionRepo := public.NewPublicCollectionRepository(db, viper.GetString("apps.public-albums"))collectionRepo := &repo.CollectionRepository{DB: db, FileRepo: fileRepo, PublicCollectionRepo: publicCollectionRepo,TrashRepo: trashRepo, SecretEncryptionKey: secretEncryptionKeyBytes, QueueRepo: queueRepo, LatencyLogger: latencyLogger}pushRepo := &repo.PushTokenRepository{DB: db}@@ -898,7 +899,7 @@ func setupAndStartBackgroundJobs(objectCleanupController.StartClearingOrphanObjects()}-func setupAndStartCrons(userAuthRepo *repo.UserAuthRepository, publicCollectionRepo *repo.PublicCollectionRepository,+func setupAndStartCrons(userAuthRepo *repo.UserAuthRepository, publicCollectionRepo *public.PublicCollectionRepository,twoFactorRepo *repo.TwoFactorRepository, passkeysRepo *passkey.Repository, fileController *controller.FileController,taskRepo *repo.TaskLockRepository, emailNotificationCtrl *email.EmailNotificationController,trashController *controller.TrashController, pushController *controller.PushController,diff --git a/server/migrations/99_single_file_url.down.sql b/server/migrations/99_single_file_url.down.sqlindex 30e2211701..f2955333c7 100644--- a/server/migrations/99_single_file_url.down.sql+++ b/server/migrations/99_single_file_url.down.sql@@ -9,6 +9,7 @@ DROP INDEX IF EXISTS unique_report_public_collection_id_ip_ua;DROP INDEX IF EXISTS unique_report_public_file_id_ip_ua;ALTER TABLE public_abuse_report DROP CONSTRAINT IF EXISTS fk_public_abuse_report_file_token_id;+ALTER TABLE public_abuse_report DROP CONSTRAINT IF EXISTS unique_report_public_file_id_ip_ua;ALTER TABLE public_abuse_report DROP COLUMN IF EXISTS file_share_id;diff --git a/server/pkg/controller/public_collection.go b/server/pkg/controller/public_collection.goindex 022a08812e..7f51a46330 100644--- a/server/pkg/controller/public_collection.go+++ b/server/pkg/controller/public_collection.go@@ -4,6 +4,7 @@ import ("context""errors""fmt"+ "github.com/ente-io/museum/pkg/repo/public""github.com/ente-io/museum/ente"enteJWT "github.com/ente-io/museum/ente/jwt"@@ -53,7 +54,7 @@ const (type PublicCollectionController struct {FileController *FileControllerEmailNotificationCtrl *emailCtrl.EmailNotificationController- PublicCollectionRepo *repo.PublicCollectionRepository+ PublicCollectionRepo *public.PublicCollectionRepositoryCollectionRepo *repo.CollectionRepositoryUserRepo *repo.UserRepositoryJwtSecret []bytediff --git a/server/pkg/middleware/access_token.go b/server/pkg/middleware/access_token.goindex 702af77db8..05ba354580 100644--- a/server/pkg/middleware/access_token.go+++ b/server/pkg/middleware/access_token.go@@ -5,6 +5,7 @@ import ("context""crypto/sha256""fmt"+ "github.com/ente-io/museum/pkg/repo/public""net/http""github.com/ente-io/museum/ente"@@ -26,7 +27,7 @@ var whitelistedCollectionShareIDs = []int64{111}// AccessTokenMiddleware intercepts and authenticates incoming requeststype AccessTokenMiddleware struct {- PublicCollectionRepo *repo.PublicCollectionRepository+ PublicCollectionRepo *public.PublicCollectionRepositoryPublicCollectionCtrl *controller.PublicCollectionControllerCollectionRepo *repo.CollectionRepositoryCache *cache.Cachediff --git a/server/pkg/repo/collection.go b/server/pkg/repo/collection.goindex 3f9af70268..40acc98b8a 100644--- a/server/pkg/repo/collection.go+++ b/server/pkg/repo/collection.go@@ -4,6 +4,7 @@ import ("context""database/sql""fmt"+ "github.com/ente-io/museum/pkg/repo/public""strconv"t "time"@@ -24,7 +25,7 @@ import (type CollectionRepository struct {DB *sql.DBFileRepo *FileRepository- PublicCollectionRepo *PublicCollectionRepository+ PublicCollectionRepo *public.PublicCollectionRepositoryTrashRepo *TrashRepositorySecretEncryptionKey []byteQueueRepo *QueueRepositorydiff --git a/server/pkg/repo/public_collection.go b/server/pkg/repo/public/public_collection.gosimilarity index 99%rename from server/pkg/repo/public_collection.gorename to server/pkg/repo/public/public_collection.goindex f5ae8f2d72..600c213c11 100644--- a/server/pkg/repo/public_collection.go+++ b/server/pkg/repo/public/public_collection.go@@ -1,4 +1,4 @@-package repo+package publicimport ("context"