diff --git a/go_cloud/internal/http/routes.go b/go_cloud/internal/http/routes.go index df884f6..a0ea677 100644 --- a/go_cloud/internal/http/routes.go +++ b/go_cloud/internal/http/routes.go @@ -3848,7 +3848,7 @@ func getUserProfileHandler(w http.ResponseWriter, r *http.Request, db *database. // If avatar exists, return the backend URL instead of the internal WebDAV URL if user.AvatarURL != nil && *user.AvatarURL != "" { - user.AvatarURL = &[]string{fmt.Sprintf("/user/avatar?v=%d", time.Now().Unix())}[0] + user.AvatarURL = &[]string{fmt.Sprintf("https://go.b0esche.cloud/user/avatar?v=%d", time.Now().Unix())}[0] } w.Header().Set("Content-Type", "application/json") @@ -4048,7 +4048,7 @@ func uploadUserAvatarHandler(w http.ResponseWriter, r *http.Request, db *databas // Get public URL - for now, construct it manually since Nextcloud doesn't provide direct public URLs // In a real setup, you'd configure Nextcloud to serve public URLs or use a CDN - publicURL := fmt.Sprintf("/user/avatar?v=%d", time.Now().Unix()) + publicURL := fmt.Sprintf("https://go.b0esche.cloud/user/avatar?v=%d", time.Now().Unix()) webdavURL := fmt.Sprintf("%s/%s", client.BaseURL, avatarPath) // Update user profile with avatar URL diff --git a/go_cloud/internal/storage/webdav.go b/go_cloud/internal/storage/webdav.go index 0166f2e..d7133e7 100644 --- a/go_cloud/internal/storage/webdav.go +++ b/go_cloud/internal/storage/webdav.go @@ -42,7 +42,7 @@ func NewWebDAVClient(cfg *config.Config) *WebDAVClient { user: cfg.NextcloudUser, pass: cfg.NextcloudPass, basePrefix: strings.TrimRight(base, "/"), - httpClient: &http.Client{Timeout: 30 * time.Second}, + httpClient: &http.Client{Timeout: 60 * time.Second}, } } @@ -91,11 +91,9 @@ func (c *WebDAVClient) Upload(ctx context.Context, remotePath string, r io.Reade if c == nil { return fmt.Errorf("no webdav client configured") } - // Ensure parent collections (skip for hidden avatar folders to avoid MKCOL timeouts) - if !strings.HasPrefix(remotePath, ".avatars") { - if err := c.ensureParent(ctx, remotePath); err != nil { - return err - } + // Ensure parent collections + if err := c.ensureParent(ctx, remotePath); err != nil { + return err } // Construct URL // remotePath might be like /orgs//file.txt; ensure it joins to basePrefix