filestash/server/plugin
Mickael 29db7d6934
fix (#799): s3 - versitygw bug
* fix (s3): bug on versitygw

the plugin would break on versitgw which on some version isn't sending
the size metadata, ending with a null pointer dereference.

I wasn't able to replicate this on my own but the bug report shows:

2025/01/10 04:35:47 http: panic serving 130.194.66.248:54701: runtime error: invalid memory address or nil pointer dereference
goroutine 5590 [running]:
net/http.(*conn).serve.func1()
        /usr/local/go/src/net/http/server.go:1947 +0xbe
panic({0x19c2740?, 0x535ece0?})
        /usr/local/go/src/runtime/panic.go:785 +0x132
github.com/mickael-kerjean/filestash/server/plugin/plg_backend_s3.S3Backend.Ls.func1(0xc000986bd0, 0xe0?)
        /home/server/plugin/plg_backend_s3/index.go:218 +0x18a
github.com/aws/aws-sdk-go/service/s3.(*S3).ListObjectsV2PagesWithContext(0xc0005b01a8, {0x46ae758, 0xc000f187e0}, 0xc0006649a0, 0xc0005d7270, {0x0, 0x0, 0x0})
        /home/vendor/github.com/aws/aws-sdk-go/service/s3/api.go:7654 +0x1ad
github.com/mickael-kerjean/filestash/server/plugin/plg_backend_s3.S3Backend.Ls({0xc0005b0178, 0xc00074cd80, 0xc000f188a0, {0x46ae758, 0xc000f187e0}, 0x32}, {0xc0008810f0?, 0x99?})
        /home/server/plugin/plg_backend_s3/index.go:202 +0x31a
github.com/mickael-kerjean/filestash/filestash-enterprise/plugins/utils.wrapper.Ls({{0x46b77c0, 0xc000f18ff0}, {0x5511fc0, 0x0, 0x0}}, {0xc0008810f0?, 0x165dc9a?})
        /home/filestash-enterprise/plugins/utils/authorisation.go:64 +0x94
github.com/mickael-kerjean/filestash/server/ctrl.FileLs(0xc000001d40, {0x46a8bc8, 0xc000f18810}, 0xc000227680)
        /home/server/ctrl/files.go:136 +0x7a2
github.com/mickael-kerjean/filestash/server/middleware.LoggedInOnly.func1(0xc000001d40?, {0x46a8bc8, 0xc000f18810}, 0x0?)
        /home/server/middleware/session.go:23 +0x2e
github.com/mickael-kerjean/filestash/server/middleware.SessionStart.func1(0xc000001d40, {0x46a8bc8, 0xc000f18810}, 0xc000227680)
        /home/server/middleware/session.go:77 +0x2e7
github.com/mickael-kerjean/filestash/server/middleware.WithPublicAPI.func1(0xc000001d40, {0x46a8bc8, 0xc000f18810}, 0xc000227680)
        /home/server/middleware/http.go:115 +0x3a7
github.com/mickael-kerjean/filestash/server/middleware.SecureOrigin.func1(0xc000001d40, {0x46a8bc8, 0xc000f18810}, 0xc000227680)
        /home/server/middleware/http.go:99 +0x4a2
github.com/mickael-kerjean/filestash/server/middleware.SecureHeaders.func1(0xc000001d40, {0x46a8bc8, 0xc000f18810}, 0xc000227680)
        /home/server/middleware/http.go:79 +0x28c
github.com/mickael-kerjean/filestash/server/middleware.ApiHeaders.func1(0xc000001d40, {0x46a8bc8, 0xc000f18810}, 0xc000227680)
        /home/server/middleware/http.go:22 +0x29d
github.com/mickael-kerjean/filestash/server.Build.NewMiddlewareChain.func18({0x46a8cb8, 0xc000904000}, 0xc000227680)
        /home/server/middleware/index.go:28 +0x17b
net/http.HandlerFunc.ServeHTTP(0xc000227540?, {0x46a8cb8?, 0xc000904000?}, 0x52f069?)
        /usr/local/go/src/net/http/server.go:2220 +0x29
github.com/gorilla/mux.(*Router).ServeHTTP(0xc000000480, {0x46a8cb8, 0xc000904000}, 0xc000227400)
        /home/vendor/github.com/gorilla/mux/mux.go:212 +0x1e2
net/http.serverHandler.ServeHTTP({0xc000c41d40?}, {0x46a8cb8?, 0xc000904000?}, 0x6?)
        /usr/local/go/src/net/http/server.go:3210 +0x8e
net/http.(*conn).serve(0xc00059d950, {0x46ae758, 0xc000832240})
        /usr/local/go/src/net/http/server.go:2092 +0x5d0
created by net/http.(*Server).Serve in goroutine 135
        /usr/local/go/src/net/http/server.go:3360 +0x485

* fix (s3): versitygw issue

* fix (uint64): size
2025-01-10 16:13:33 +11:00
..
plg_authenticate_admin feature (base): configurable base 2024-06-21 21:05:44 +10:00
plg_authenticate_htpasswd chore (banner): auth middleware banners 2024-12-10 00:42:06 +11:00
plg_authenticate_ldap chore (banner): auth middleware banners 2024-12-10 00:42:06 +11:00
plg_authenticate_local feature (plg_authenticate_local): local source of user 2024-12-06 18:28:33 +11:00
plg_authenticate_openid chore (banner): auth middleware banners 2024-12-10 00:42:06 +11:00
plg_authenticate_passthrough fix (cookie): sso cookie issue on safari 2024-09-07 01:57:31 +10:00
plg_authenticate_saml chore (banner): auth middleware banners 2024-12-10 00:42:06 +11:00
plg_authorisation_example maintain (ctx): pass app context as pointer 2022-08-30 17:27:23 +10:00
plg_backend_artifactory fix (plg_backend_artifactory): ls metadata fix 2023-03-21 22:28:41 +11:00
plg_backend_azure fix (typo): package name typo 2024-10-10 04:57:25 +11:00
plg_backend_backblaze chore (refactoring): cleanup old code 2024-03-13 00:37:44 +11:00
plg_backend_dav fix (compile): compile errors in existing plugins 2022-01-22 08:05:30 +11:00
plg_backend_dropbox feature (next): support for next in oauth2 backends 2022-01-15 17:28:48 +11:00
plg_backend_ftp chore (debt): cleanup tech debt 2024-03-19 07:54:49 +11:00
plg_backend_ftp_only feature (dynamic): make configuration dynamic 2024-03-13 00:18:24 +11:00
plg_backend_gdrive maintenance (plugin): move remaining backend to plugin mechanism 2021-12-22 22:53:06 +11:00
plg_backend_git chore (GenerateID): change signature for GenerateID 2024-04-15 22:18:16 +10:00
plg_backend_ldap chore (maintenance): dependency upgrade 2024-06-04 01:21:34 +10:00
plg_backend_local fix (plg_backend_local): issue with home calculation 2024-08-29 00:07:15 +10:00
plg_backend_mysql feature (dynamic): make configuration dynamic 2024-03-13 00:18:24 +11:00
plg_backend_nfs chore (plg_backend_nfs): make usefull function public 2024-05-29 00:50:55 +10:00
plg_backend_nfs4 fix (nfs4): broken nfs4 plugin 2024-04-03 21:50:26 +11:00
plg_backend_nop fix (panic): possible panic when used with full text search engine 2024-02-29 01:34:32 +11:00
plg_backend_s3 fix (#799): s3 - versitygw bug 2025-01-10 16:13:33 +11:00
plg_backend_samba fix (plg_backend_samba): host format issue 2024-06-06 08:36:44 +10:00
plg_backend_sftp fix (sftp): azure connection timeout 2024-09-20 22:55:54 +10:00
plg_backend_storj fix (storj): convention for folder 2022-12-21 00:25:37 +11:00
plg_backend_tmp fix (panic): possible panic in search using reflection 2024-02-26 01:36:46 +11:00
plg_backend_webdav fix (plg_plugin_webdav): IIS compat 2022-08-09 19:08:14 +10:00
plg_editor_onlyoffice fix (onlyoffice): canary office integration - #629 2024-11-14 14:24:23 +11:00
plg_editor_wopi feature (postMessage): iframe RPC via postMessage 2024-12-14 00:46:50 +11:00
plg_handler_console feature (dynamic): make configuration dynamic 2024-03-13 00:18:24 +11:00
plg_handler_syncthing feature (dynamic): make configuration dynamic 2024-03-13 00:18:24 +11:00
plg_image_ascii fix (plg_image_ascii): reasonable content type 2022-09-08 15:19:10 +10:00
plg_image_bimg feature (thumbnailer): add plugin type for thumbnail generation 2022-12-02 07:09:11 +11:00
plg_image_c fix (deadlock): thumbnail issue in plg_image_c 2024-12-22 03:06:48 +11:00
plg_image_golang feature (thumbnailer): add plugin type for thumbnail generation 2022-12-02 07:09:11 +11:00
plg_image_light feature (dynamic): make configuration dynamic 2024-03-13 00:18:24 +11:00
plg_image_transcode fix (not implemented): image preview for jpeg or png 2023-02-09 08:32:19 +11:00
plg_override_download feature (plugin): override plugin for download 2024-11-07 13:32:00 +11:00
plg_search_example documentation (plugin): add sample code for search plugin 2022-01-15 15:50:35 +11:00
plg_search_sqlitefts fix (panic): prevent panic in full text search plugin 2024-06-04 08:02:13 +10:00
plg_search_stateless feature (dynamic): make configuration dynamic 2024-03-13 00:18:24 +11:00
plg_security_scanner fix (typo): typo in scanner block logic 2024-04-02 20:05:44 +11:00
plg_security_svg chore (rewrite): improve user experience 2024-07-05 18:31:34 +10:00
plg_starter_http feature (base): configurable base 2024-06-21 21:05:44 +10:00
plg_starter_http2 feature (dynamic): make configuration dynamic 2024-03-13 00:18:24 +11:00
plg_starter_https feature (dynamic): make configuration dynamic 2024-03-13 00:18:24 +11:00
plg_starter_tor feature (dynamic): make configuration dynamic 2024-03-13 00:18:24 +11:00
plg_video_thumbnail fix (plg_video_thumbnail): error when backend doesn't support fileseek 2024-12-02 17:24:03 +11:00
plg_video_transcoder feature (thumbnail): video thumbnail plugin 2024-12-02 15:39:25 +11:00
index.go fix (wopi): wopi config (#785) 2024-12-12 16:07:34 +11:00