From c81f57767c6194d39ccde6c7c5552c7128f6c9a7 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Mon, 13 Jun 2022 20:24:17 +0400 Subject: [PATCH] Pre-generated templates. --- web/error404.jade.go | 27 +++++++++++++++++++++++++++ web/index.jade.go | 42 ++++++++++++++++++++++++++++++++++++++++++ web/nospace.jade.go | 27 +++++++++++++++++++++++++++ web/uploaded.jade.go | 30 ++++++++++++++++++++++++++++++ 4 files changed, 126 insertions(+) create mode 100644 web/error404.jade.go create mode 100644 web/index.jade.go create mode 100644 web/nospace.jade.go create mode 100644 web/uploaded.jade.go diff --git a/web/error404.jade.go b/web/error404.jade.go new file mode 100644 index 0000000..b53f098 --- /dev/null +++ b/web/error404.jade.go @@ -0,0 +1,27 @@ +// Code generated by "jade.go"; DO NOT EDIT. + +package web + +import ( + "io" +) + +const ( + error404__0 = `Arav's dwelling / Upload

404

404

Nod Found xD
` +) + +func Error404(mainSite string, wr io.Writer) { + buffer := &WriterAsBuffer{wr} + + buffer.WriteString(error404__0) + WriteEscString(mainSite, buffer) + buffer.WriteString(error404__1) + +} diff --git a/web/index.jade.go b/web/index.jade.go new file mode 100644 index 0000000..f50aced --- /dev/null +++ b/web/index.jade.go @@ -0,0 +1,42 @@ +// 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, fileMaxSize, storageCapacity, storageUsed, keepForHours int, storageUsedStr, storageCapacityStr, storageAvailableStr string, wr io.Writer) { + buffer := &WriterAsBuffer{wr} + + buffer.WriteString(index__0) + WriteEscString(mainSite, buffer) + buffer.WriteString(index__1) + WriteInt(int64(fileMaxSize), buffer) + buffer.WriteString(index__2) + WriteInt(int64(keepForHours), buffer) + buffer.WriteString(index__3) + WriteEscString(storageUsedStr, buffer) + buffer.WriteString(index__4) + WriteInt(int64(storageUsed), buffer) + buffer.WriteString(index__5) + WriteInt(int64(storageCapacity), buffer) + buffer.WriteString(index__6) + WriteEscString(storageCapacityStr, buffer) + buffer.WriteString(index__7) + WriteEscString(storageAvailableStr, buffer) + buffer.WriteString(index__8) + +} diff --git a/web/nospace.jade.go b/web/nospace.jade.go new file mode 100644 index 0000000..5df0070 --- /dev/null +++ b/web/nospace.jade.go @@ -0,0 +1,27 @@ +// Code generated by "jade.go"; DO NOT EDIT. + +package web + +import ( + "io" +) + +const ( + nospace__0 = `Arav's dwelling / Upload

:(

Not enough space left

` +) + +func ErrorNoSpace(mainSite string, wr io.Writer) { + buffer := &WriterAsBuffer{wr} + + buffer.WriteString(nospace__0) + WriteEscString(mainSite, buffer) + buffer.WriteString(nospace__1) + +} diff --git a/web/uploaded.jade.go b/web/uploaded.jade.go new file mode 100644 index 0000000..ced84a2 --- /dev/null +++ b/web/uploaded.jade.go @@ -0,0 +1,30 @@ +// Code generated by "jade.go"; DO NOT EDIT. + +package web + +import ( + "io" +) + +const ( + uploaded__0 = `Arav's dwelling / Upload

Upload

Your link

` + uploaded__3 = `
It will be available for next ` + 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(uploaded__1) + WriteEscString(downloadLink, buffer) + buffer.WriteString(uploaded__2) + WriteEscString(downloadLink, buffer) + buffer.WriteString(uploaded__3) + WriteInt(int64(keepForHours), buffer) + buffer.WriteString(uploaded__4) + +}