dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 25fd3c06b1580fe9f0152f93263136d8117fd6f8
parent 0046c99ff578314f4d763325b6276ec0e9e0f168
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Tue, 31 Jan 2023 02:32:08 -0800

improve filedrop

Diffstat:
Mcmd/dkfupload/main.go | 2+-
Mpkg/web/handlers/data.go | 5+++--
Mpkg/web/handlers/handlers.go | 1+
Mpkg/web/public/views/pages/standalone/filedrop.gohtml | 7+++++++
4 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/cmd/dkfupload/main.go b/cmd/dkfupload/main.go @@ -55,7 +55,7 @@ func main() { chunkSizeUsage := "chunk size" chunkSizeDefaultValue := int64(2 << 20) // 2MB flag.DurationVar(&httpTimeout, "http-timeout", 2*time.Minute, "http timeout") - flag.StringVar(&filedropUUID, "filedrop-uuid", "", filedropUUIDUsage) + flag.StringVar(&filedropUUID, "uuid", "", filedropUUIDUsage) flag.StringVar(&filedropUUID, "u", "", filedropUUIDUsage) flag.StringVar(&fileName, "file", "", fileNameUsage) flag.StringVar(&fileName, "f", "", fileNameUsage) diff --git a/pkg/web/handlers/data.go b/pkg/web/handlers/data.go @@ -861,8 +861,9 @@ type publicProfileData struct { } type fileDropData struct { - Error string - Success string + Filedrop database.Filedrop + Error string + Success string } type stego1RoadChallengeData struct { diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go @@ -4260,6 +4260,7 @@ func FileDropHandler(c echo.Context) error { } var data fileDropData + data.Filedrop = filedrop if c.Request().Method == http.MethodGet { return c.Render(http.StatusOK, filedropTmplName, data) diff --git a/pkg/web/public/views/pages/standalone/filedrop.gohtml b/pkg/web/public/views/pages/standalone/filedrop.gohtml @@ -15,6 +15,13 @@ </div> <div class="card-body"> <form method="post" enctype="multipart/form-data"><input name="file" type="file" /><input type="submit" value="submit" /></form> + <p class="mt-3"> + For big files, you should consider running the custom dkf file uploader<br /> + <a href="http://yylovpz7taca7jfrub3wltxabzzjp34fngj5lpwl6eo47ekt5cxs6mid.onion/n0tr1v/dkforest/src/master/cmd/dkfupload/main.go">http://dkfgit.onion/n0tr1v/dkforest/src/master/cmd/dkfupload/main.go</a> + </p> + <p> + <code>./dkfupload --file /path/to/file.gz --uuid {{ .Data.Filedrop.UUID }}</code> + </p> </div> </div> {{ end }}