Templating is weird af in Rocket. Look into 3a541ae for more.
The content-type of the rendering is determined by the extension of the
template name.
But renaming these templates would break building the project for
development because it finds a phony template there. So the trick is to
default the `template_dir` to `args.upload` because it should never
interfere and will be always present.
This also fixes the hax in Dockerfile by making it the default.
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
Rocket's templating is not exactly friendly when it comes to embedding
in-binary. Rocket's template fairing requires a `template_dir` directory
pointing to the directory containing templates.
A quick workaround to this would be to have custom fairings with
`template_dir` merged with the value `.`
But in bare-metal scenarios like what docker's scratch image mimics, we
don't exactly have a '.' file, so instead for this very project, I have
to point the `template_dir` to the `upload` folder, which is created by
`bin` on execution. Checkout the Dockerfile for more info
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
Builds static binaries instead to be runnable from scratch. This eases
the build process, as we don't have to depend on docker's buildx.
Now images for both arm64 and x86_64 can be built on x86_64 platform
alone.
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
Unfortunately, since fetch API does not support getting progress while
perfoming uploads, we cannot have a more dynamic cue
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
Building multi-layered containers gave weird 500 errors. I think they
were permission based but don't have the time to look into it.
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
cleaned up code and added a route for signifying code language
explicitly at `/p/<filename>.<ext>`
Also async-ified the server after upgrading Rocket to 0.5-rc1
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
Also I have encouraged the user to change their monospace font
accordingly for the best personal satisfaction.
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
My only grief with scroll bars was not even with scroll bars, but FF's
shitty contrast breaking scroll bars in dark backgrounds. Fortunately
that has been settled for in the latest beta.
Also I was missing using a scrollbar on the pastebin :p
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
a simple, minimalistic frontend for pasting texts the objectively easy
way for those not comfortable with CLI.
Signed-off-by: Gunwant Jain <mail@wantguns.dev>