From 7a8b7964ecca9f5d78f6f5cf913a9b2508769b25 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Tue, 14 Jun 2022 18:45:23 +0400 Subject: [PATCH] I modified templates to include a base.jade, and to alter blocks defined in a base with block append. But jade behave that that blocks are actually being appended to theirs places, but they are also being included to the end of a file. So, I had to manually modify resulted .jade.go files. --- web/templates/base.jade | 1 - web/templates/error404.jade | 10 +++--- web/templates/index.jade | 68 ++++++++++++++++++------------------- web/templates/nospace.jade | 10 +++--- web/templates/uploaded.jade | 22 ++++++------ 5 files changed, 57 insertions(+), 54 deletions(-) diff --git a/web/templates/base.jade b/web/templates/base.jade index f0aa2a4..fcd49a7 100644 --- a/web/templates/base.jade +++ b/web/templates/base.jade @@ -18,7 +18,6 @@ html(lang="en") nav a(href=mainSite title="Arav's dwelling") Back to main website block header - h1 Upload block body footer | 2022 Arav <#[a(href="mailto:me@arav.top") me@arav.top]> \ No newline at end of file diff --git a/web/templates/error404.jade b/web/templates/error404.jade index 00e1850..dab1c9b 100644 --- a/web/templates/error404.jade +++ b/web/templates/error404.jade @@ -1,6 +1,8 @@ :go:func Error404(mainSite string) -include base/top.jade +include base.jade + +block append head style(type="text/css"). #error { font-size: 3.5rem; @@ -9,11 +11,11 @@ include base/top.jade margin: 6rem 0; } #error h1 { font-size: 8rem; } -include base/body.header.jade + +block append header h1 404 +block append body section#error h1 404 | Nod Found xD - -include base/body.footer.jade diff --git a/web/templates/index.jade b/web/templates/index.jade index 7e7988a..630aaa5 100644 --- a/web/templates/index.jade +++ b/web/templates/index.jade @@ -1,38 +1,38 @@ :go:func Index(mainSite string, storageCapacity, storageUsed int64, keepForHours int, fileMaxSize, storageUsedStr, storageCapacityStr, storageAvailableStr string) -include base/top.jade -include base/body.header.jade - h1 Upload +include base.jade -section#rules.center - h2 Rules - ul - li Max. file size is #{fileMaxSize}. - li It will be kept for #{keepForHours} hours. - li Anything you upload should comply with Russian Federation's law. Generally speaking, anything illegal, like CP, extremist literature etc., is forbidden. -section#used-space.center - h2 Free space - div - span #{storageUsedStr} - progress(value=storageUsed max=storageCapacity) - span #{storageCapacityStr} - div - | #{storageAvailableStr} -section#upload.center - h2 Upload - form(action="/" method="POST" enctype="multipart/form-data") - input(type="file" name="file" multiple=false) - button(type="submit") Upload -section - p.center You can use cURL to upload a file: #[code curl -F 'file=@somefile.ext' https://upload.arav.top] - p.center Over I2P: #[code curl --proxy 127.0.0.1:4444 -F 'file=@somefile.ext' http://upload.arav.i2p] - p.center A resulted link looks like this: #[code /f/base64rawURL(sha256)/filename.ext]. - p.center filename.ext is mandatory. It is a name the file will be retrieved with. -section - h2 Privacy statements - p I WILL cooperate with law enforcements and provide them with logs, guess I shouldn't clarify why. Abuses should be sent to #[a(href="mailto:admin@arav.top") admin@arav.top]. - p 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. - p Each download also being logged and include: access time, IP-address, name of a file it was requested with, download name*, User-Agent. - p *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. +block append header + h1 Upload -include base/body.footer.jade \ No newline at end of file +block body + section#rules.center + h2 Rules + ul + li Max. file size is #{fileMaxSize}. + li It will be kept for #{keepForHours} hours. + li Anything you upload should comply with Russian Federation's law. Generally speaking, anything illegal, like CP, extremist literature etc., is forbidden. + section#used-space.center + h2 Free space + div + span #{storageUsedStr} + progress(value=storageUsed max=storageCapacity) + span #{storageCapacityStr} + div + | #{storageAvailableStr} + section#upload.center + h2 Upload + form(action="/" method="POST" enctype="multipart/form-data") + input(type="file" name="file" multiple=false) + button(type="submit") Upload + section + p.center You can use cURL to upload a file: #[code curl -F 'file=@somefile.ext' https://upload.arav.top] + p.center Over I2P: #[code curl --proxy 127.0.0.1:4444 -F 'file=@somefile.ext' http://upload.arav.i2p] + p.center A resulted link looks like this: #[code /f/base64rawURL(sha256)/filename.ext]. + p.center filename.ext is mandatory. It is a name the file will be retrieved with. + section + h2 Privacy statements + p I WILL cooperate with law enforcements and provide them with logs, guess I shouldn't clarify why. Abuses should be sent to #[a(href="mailto:admin@arav.top") admin@arav.top]. + p 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. + p Each download also being logged and include: access time, IP-address, name of a file it was requested with, download name*, User-Agent. + p *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. \ No newline at end of file diff --git a/web/templates/nospace.jade b/web/templates/nospace.jade index 12a0f3d..bb1e8b7 100644 --- a/web/templates/nospace.jade +++ b/web/templates/nospace.jade @@ -1,6 +1,8 @@ :go:func ErrorNoSpace(mainSite string) -include base/top.jade +include base.jade + +block append head style(type="text/css"). #error { font-size: 3.5rem; @@ -9,10 +11,10 @@ include base/top.jade margin: 6rem 0; } #error h1 { font-size: 6rem; } -include base/body.header.jade + +block append header h1 :( +block append body section#error h1 Not enough space left - -include base/body.footer.jade diff --git a/web/templates/uploaded.jade b/web/templates/uploaded.jade index 1c8c4cd..ca24ca0 100644 --- a/web/templates/uploaded.jade +++ b/web/templates/uploaded.jade @@ -1,15 +1,15 @@ :go:func Uploaded(mainSite, downloadLink string, keepForHours int) -include base/top.jade -include base/body.header.jade +include base.jade + +block append header h1 Upload -section#file - h2 Your link - center - a(href=downloadLink) #{downloadLink} - center It will be available for next #{keepForHours} hours. - center - a(href="/") Back to index page - -include base/body.footer.jade +block append body + section#file + h2 Your link + center + a(href=downloadLink) #{downloadLink} + center It will be available for next #{keepForHours} hours. + center + a(href="/") Back to index page