Commit Graph

70 Commits

Author SHA1 Message Date
Gunwant Jain
1950e89cbc fly.toml: using mapped env variables is a PITA on TOML
Until I find a way to do it, the demo instance would have a form upload
size limit.

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-24 13:58:11 +05:30
Gunwant Jain
ab99405c89 Showcase the demo version
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-21 13:38:06 +05:30
Gunwant Jain
fa9a97ce9c Add automated Fly.io deployments
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-21 12:36:36 +05:30
Gunwant Jain
54aa737661 bin: v2.0.0
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-20 16:52:21 +05:30
Gunwant Jain
78e3319d66 buildci: save compute time by singling pre-build steps
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-20 05:32:52 +05:30
Gunwant Jain
a6709a1307 buildci: generalise for all push events and PRs
This means that tags are included now

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-20 05:21:25 +05:30
Gunwant Jain
3968796a49 github: add buildci and its helper script
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-20 04:46:02 +05:30
Gunwant Jain
689db9548a src: cargo clippy and fmt the project
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-20 03:50:38 +05:30
Gunwant Jain
3ed972e672 github: add docker ci
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-19 23:13:17 +05:30
Gunwant Jain
8e23ec4c97 readme: add gifs
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-19 18:52:10 +05:30
Gunwant Jain
edc247b558 Templates: fix the content type of templates
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>
2022-01-19 16:33:57 +05:30
Gunwant Jain
a11321c251 readme: major overhaul
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-19 02:11:23 +05:30
Gunwant Jain
3a541aed23 Templates: embed the templates in-binary
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>
2022-01-19 01:58:11 +05:30
Gunwant Jain
78b4213c62 cargo-fmt the src
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-18 16:18:52 +05:30
Gunwant Jain
ce001c6a79 Args: implement upload arg
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-18 15:48:21 +05:30
Gunwant Jain
6961ed59b4 main: Add arguments and the respective parsing
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-18 15:47:54 +05:30
Gunwant Jain
f35bad75e5 pretty: embed the theme in-binary
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-18 13:13:45 +05:30
Gunwant Jain
892e84348d static_files: embed files in-binary
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-18 12:16:07 +05:30
Gunwant Jain
e91393f63c cli client: update and move to contrib
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-18 10:21:32 +05:30
Gunwant Jain
e17a5f7cdb Docker, Cargo: Add multi-arch builds for arm64, x86_64
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>
2022-01-18 10:07:26 +05:30
Gunwant Jain
33583b71d4 cargo update, fmt and add rust_embed crate
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-16 23:11:38 +05:30
Gunwant Jain
0359a8ef52 docker: Use multi-stage docker builds
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-16 22:04:05 +05:30
Gunwant Jain
449f0c38a9 PrettyPaste: Add Fork and New button
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-16 14:24:10 +05:30
Gunwant Jain
372bbf28d3 Use Iosevka instead of Fira Code
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2022-01-16 09:52:00 +05:30
Gunwant Jain
53d96865ad UI: Use a spacier layout
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-12-26 21:01:56 +05:30
Gunwant Jain
3e10267caf Add visual cue for uploading files
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>
2021-12-26 09:58:58 +05:30
Gunwant Jain
cca3a8bec9 refactor code and add dragover visual cue
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-12-26 08:41:44 +05:30
Gunwant Jain
a9dc9452fc index: increase drag area to the entire form
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-07-13 21:58:04 +05:30
Gunwant Jain
04c992e8b3 client: write a simple client for the pastebin
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-07-13 21:23:34 +05:30
Gunwant Jain
cb8e210acb dockerfile: shaving off old bits; use rust stable now
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>
2021-07-13 04:28:48 +05:30
Gunwant Jain
80c6809414 pretty: remove dead code
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-07-13 04:28:27 +05:30
Gunwant Jain
c6262e9e87 add static files
we have a favicon now :')

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-07-13 03:49:11 +05:30
Gunwant Jain
1175a57539 index: Add select for choosing languages when pasting
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-07-13 01:39:47 +05:30
Gunwant Jain
fbc92b669d index: drag & drop redirects to the syntax highlighted pages
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-07-11 15:50:04 +05:30
Gunwant Jain
9c5a3af128 refactor: bring in the modules
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-07-11 03:07:50 +05:30
Gunwant Jain
8a3b29a0ef templates/index: update the description
Give a quick rundown of how to use the pastebin

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-07-08 21:57:59 +05:30
Gunwant Jain
7726a0e0ee templates, main: copy and paste images
Make use of the Clipboard API. Also vivi dis is for you

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-07-08 20:27:42 +05:30
Gunwant Jain
0cd0d24549 templates: add drag and drop func, use ayu dark
Use a more man-like description

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-07-08 18:51:20 +05:30
Gunwant Jain
e77c1a57e4 cleaned up code, using &str instead of RawStr
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-07-08 18:48:19 +05:30
Gunwant Jain
78d046afbd main: add more routes for pretty pasting
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>
2021-07-08 18:48:01 +05:30
Gunwant Jain
150bade1e5 css: change placeholder and made the UI generally tighter
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>
2021-06-19 08:07:25 +05:30
Gunwant Jain
1f84fd28b9 implement drag and drop
As a consquence of better UX, '/' post handler will now redirect instead
of returning a String.

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-06-19 06:49:43 +05:30
Gunwant Jain
8ddca50c55 base.html: re-add scroll bars
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>
2021-05-15 14:29:02 +05:30
Gunwant Jain
2e4b929fb5 cargo fix the project
Make use of clippy and rustfmt

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-01-21 16:34:59 +05:30
Gunwant Jain
5cb34d6770 license: lgpl license
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-01-11 20:41:14 +05:30
Gunwant Jain
594f89385b templates: fix cascaded scrolling, add more aez
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-01-09 08:05:53 +05:30
Gunwant Jain
5d45bf8ebf base.html: format file
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-01-07 05:02:57 +05:30
Gunwant Jain
651f3d8157 pretty_retrieve: use match_filname to match MIME
fixes pastes which had JSON, Bash, etc. content.

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-01-06 10:00:49 +05:30
Gunwant Jain
d3106f3fce index.html: add a frontend for pastes
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>
2021-01-06 07:08:36 +05:30
Gunwant Jain
e6f048c281 dockerignore: add dockerignore
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
2021-01-06 06:16:05 +05:30