From a5ee7c2604169234027a9666b596c0d9bc188d14 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Tue, 14 Jun 2022 18:47:11 +0400 Subject: [PATCH] I removed repeats from them and changed extention to not suddenly overwrite them. --- ...{error404.jade.go => error404.jade.mod.go} | 11 ++--- web/index.jade.go | 42 ------------------- web/index.jade.mod.go | 42 +++++++++++++++++++ web/{nospace.jade.go => nospace.jade.mod.go} | 10 +++-- ...{uploaded.jade.go => uploaded.jade.mod.go} | 17 ++++---- 5 files changed, 63 insertions(+), 59 deletions(-) rename web/{error404.jade.go => error404.jade.mod.go} (61%) delete mode 100644 web/index.jade.go create mode 100644 web/index.jade.mod.go rename web/{nospace.jade.go => nospace.jade.mod.go} (61%) rename web/{uploaded.jade.go => uploaded.jade.mod.go} (63%) diff --git a/web/error404.jade.go b/web/error404.jade.mod.go similarity index 61% rename from web/error404.jade.go rename to web/error404.jade.mod.go index b53f098..86cd246 100644 --- a/web/error404.jade.go +++ b/web/error404.jade.mod.go @@ -3,25 +3,26 @@ package web import ( + "html" "io" ) const ( - error404__0 = `Arav's dwelling / Upload

404

404

Nod Found xD
` + #error h1 { font-size: 8rem; } +
` ) func Error404(mainSite string, wr io.Writer) { buffer := &WriterAsBuffer{wr} buffer.WriteString(error404__0) - WriteEscString(mainSite, buffer) + buffer.WriteString(html.EscapeString(mainSite)) buffer.WriteString(error404__1) - } diff --git a/web/index.jade.go b/web/index.jade.go deleted file mode 100644 index 04bebb8..0000000 --- a/web/index.jade.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by "jade.go"; DO NOT EDIT. - -package web - -import ( - "io" -) - -const ( - index__0 = `Arav's dwelling / Upload

Upload

Rules

Free space

` - index__4 = `` - index__7 = `
` - index__8 = `

Upload

You can use cURL to upload a file: curl -F 'file=@somefile.ext' https://upload.arav.top

Over I2P: curl --proxy 127.0.0.1:4444 -F 'file=@somefile.ext' http://upload.arav.i2p

A resulted link looks like this: /f/base64rawURL(sha256)/filename.ext.

filename.ext is mandatory. It is a name the file will be retrieved with.

Privacy statements

I WILL cooperate with law enforcements and provide them with logs, guess I shouldn't clarify why. Abuses should be sent to admin@arav.top.

Upload logs include: access time, IP-address, name of a file it was uploaded with, a SHA-256 hash of the file, download name*, size of the file in bytes, User-Agent.

Each download also being logged and include: access time, IP-address, name of a file it was requested with, download name*, User-Agent.

*Download name is a salted SHA-256 hash of the file encoded using base64 raw URL encoding. The hash is being salted to make useless any attempt of bruteforcing.

` -) - -func Index(mainSite string, storageCapacity, storageUsed int64, keepForHours int, fileMaxSize, storageUsedStr, storageCapacityStr, storageAvailableStr string, wr io.Writer) { - buffer := &WriterAsBuffer{wr} - - buffer.WriteString(index__0) - WriteEscString(mainSite, buffer) - buffer.WriteString(index__1) - WriteEscString(fileMaxSize, buffer) - buffer.WriteString(index__2) - WriteInt(int64(keepForHours), buffer) - buffer.WriteString(index__3) - WriteEscString(storageUsedStr, buffer) - buffer.WriteString(index__4) - WriteInt(storageUsed, buffer) - buffer.WriteString(index__5) - WriteInt(storageCapacity, buffer) - buffer.WriteString(index__6) - WriteEscString(storageCapacityStr, buffer) - buffer.WriteString(index__7) - WriteEscString(storageAvailableStr, buffer) - buffer.WriteString(index__8) - -} diff --git a/web/index.jade.mod.go b/web/index.jade.mod.go new file mode 100644 index 0000000..844c690 --- /dev/null +++ b/web/index.jade.mod.go @@ -0,0 +1,42 @@ +// Code generated by "jade.go"; DO NOT EDIT. + +package web + +import ( + "html" + "io" + "strconv" +) + +const ( + index__0 = `Arav's dwelling / Upload

Rules

Free space

` + index__4 = `` + index__7 = `
` + index__8 = `

Upload

You can use cURL to upload a file: curl -F 'file=@somefile.ext' https://upload.arav.top

Over I2P: curl --proxy 127.0.0.1:4444 -F 'file=@somefile.ext' http://upload.arav.i2p

A resulted link looks like this: /f/base64rawURL(sha256)/filename.ext.

filename.ext is mandatory. It is a name the file will be retrieved with.

Privacy statements

I WILL cooperate with law enforcements and provide them with logs, guess I shouldn't clarify why. Abuses should be sent to admin@arav.top.

Upload logs include: access time, IP-address, name of a file it was uploaded with, a SHA-256 hash of the file, download name*, size of the file in bytes, User-Agent.

Each download also being logged and include: access time, IP-address, name of a file it was requested with, download name*, User-Agent.

*Download name is a salted SHA-256 hash of the file encoded using base64 raw URL encoding. The hash is being salted to make useless any attempt of bruteforcing.

` +) + +func Index(mainSite string, storageCapacity, storageUsed int64, keepForHours int, fileMaxSize, storageUsedStr, storageCapacityStr, storageAvailableStr string, wr io.Writer) { + buffer := &WriterAsBuffer{wr} + + buffer.WriteString(index__0) + buffer.WriteString(html.EscapeString(mainSite)) + buffer.WriteString(index__1) + buffer.WriteString(html.EscapeString(fileMaxSize)) + buffer.WriteString(index__2) + buffer.WriteString(html.EscapeString(strconv.FormatInt(int64(keepForHours), 10))) + buffer.WriteString(index__3) + buffer.WriteString(html.EscapeString(storageUsedStr)) + buffer.WriteString(index__4) + buffer.WriteString(html.EscapeString(strconv.FormatInt(storageUsed, 10))) + buffer.WriteString(index__5) + buffer.WriteString(html.EscapeString(strconv.FormatInt(storageCapacity, 10))) + buffer.WriteString(index__6) + buffer.WriteString(html.EscapeString(storageCapacityStr)) + buffer.WriteString(index__7) + buffer.WriteString(html.EscapeString(storageAvailableStr)) +} diff --git a/web/nospace.jade.go b/web/nospace.jade.mod.go similarity index 61% rename from web/nospace.jade.go rename to web/nospace.jade.mod.go index 5df0070..ef4ca70 100644 --- a/web/nospace.jade.go +++ b/web/nospace.jade.mod.go @@ -3,25 +3,27 @@ package web import ( + "html" "io" ) const ( - nospace__0 = `Arav's dwelling / Upload

:(

Not enough space left

` + #error h1 { font-size: 6rem; } +
` ) func ErrorNoSpace(mainSite string, wr io.Writer) { buffer := &WriterAsBuffer{wr} buffer.WriteString(nospace__0) - WriteEscString(mainSite, buffer) + buffer.WriteString(html.EscapeString(mainSite)) buffer.WriteString(nospace__1) } diff --git a/web/uploaded.jade.go b/web/uploaded.jade.mod.go similarity index 63% rename from web/uploaded.jade.go rename to web/uploaded.jade.mod.go index ced84a2..dd16bfe 100644 --- a/web/uploaded.jade.go +++ b/web/uploaded.jade.mod.go @@ -3,28 +3,29 @@ package web import ( + "html" "io" + "strconv" ) const ( - uploaded__0 = `Arav's dwelling / Upload

Upload

Your link

Arav's dwelling / Upload

Your link

` uploaded__3 = `
It will be available for next ` - uploaded__4 = ` hours.
Back to index page
` + uploaded__4 = ` hours.
Back to index page
` ) func Uploaded(mainSite, downloadLink string, keepForHours int, wr io.Writer) { buffer := &WriterAsBuffer{wr} buffer.WriteString(uploaded__0) - WriteEscString(mainSite, buffer) + buffer.WriteString(html.EscapeString(mainSite)) buffer.WriteString(uploaded__1) - WriteEscString(downloadLink, buffer) + buffer.WriteString(html.EscapeString(downloadLink)) buffer.WriteString(uploaded__2) - WriteEscString(downloadLink, buffer) + buffer.WriteString(html.EscapeString(downloadLink)) buffer.WriteString(uploaded__3) - WriteInt(int64(keepForHours), buffer) + buffer.WriteString(html.EscapeString(strconv.FormatInt(int64(keepForHours), 10))) buffer.WriteString(uploaded__4) - }