Lot 3 (1/4) : racine S3, backend du Store (catalogue + objets minio-go)

Arborescence dans s3_nodes, contenus sous des clés o/<id> figées au dépôt,
corbeille dans s3_trash, configuration admin dans s3_config. Délégations
S3 dans List/Stat/Open/Put/Mkdir/Move/Copy/Delete/Walk/corbeille,
miniatures, partages, tags, recherche (noms et tags). Pas d'historique.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LNfwm4pfYR9C914C2EeiuB
This commit is contained in:
claude BotandClaude Opus 5.5 committed 2026-11-20 18:01:01 +01:00
1 parent 235916157a
commit 7c1f49cb5c
13 files changed
+379 -29

No files matched your search

+5 -5
View File
@@ -208,7 +208,7 @@ func (s *Store) editShares(edit func(map[string]shareDisk) (bool, error)) error
func (s *Store) toShare(key []byte, id string, d shareDisk) Share {
sh := Share{ID: id, Token: id + "." + sign(key, id), Path: d.Path, Created: d.Created, Expires: d.Expires,
Protected: d.Password != "", Downloads: d.Downloads, pw: d.Password}
if fi, err := os.Stat(absOf(s, d.Path)); err == nil {
if _, fi, err := s.lstat(d.Path); err == nil {
sh.IsDir = fi.IsDir()
}
return sh
@@ -219,15 +219,15 @@ const MaxPasswordLen = 200
// CreateShare crée un lien de partage d'un fichier ou d'un dossier.
func (s *Store) CreateShare(rel string, o ShareOptions) (Share, error) {
c, abs, err := s.resolve(rel)
c, err := Clean(rel)
if err != nil {
return Share{}, err
}
if c == "" {
return Share{}, ErrInvalidPath
}
if fi, err := os.Lstat(abs); err != nil {
return Share{}, mapErr(err)
if _, fi, err := s.lstat(c); err != nil {
return Share{}, err
} else if !fi.IsDir() && !fi.Mode().IsRegular() {
return Share{}, ErrNotFound
}
@@ -266,7 +266,7 @@ func (s *Store) Shares(rel string) ([]Share, error) {
c := ""
if rel != "" {
var err error
if c, _, err = s.resolve(rel); err != nil {
if c, err = Clean(rel); err != nil {
return nil, err
}
}