Giter Site home page Giter Site logo

wantguns / bin Goto Github PK

View Code? Open in Web Editor NEW
185.0 4.0 18.0 9.13 MB

highly opinionated, minimal pastebin

Home Page: https://basedbin.fly.dev

License: GNU Lesser General Public License v3.0

Dockerfile 2.75% Rust 62.70% Shell 1.79% CSS 13.76% JavaScript 19.00%
pastebin file-upload rust self-hosted rocket

bin's Issues

Provide Cache-Control headers

Currently, the paste content, as well as JS and CSS content, isn't sent along with a Cache-Control header; ideally, we should provide the following:

  • max-age=[large number] to make sure clients don't have to constantly re-request pastes, CSS, and JS, which change never or rarely. Perhaps a value of 1 week or so, 604800s.
  • stale-while-revalidate=[smaller number] to allow clients to re-use cached, stale content until they can revalidate that it hasn't changed. Perhaps a value of 1 day or so, 86400s.

Additionally, only for raw pastes, we should include the immutable directive so that browsers do not attempt to refresh the contents of the pastes, which are immutable and don't change.

Provide Last-Modified headers (or Etag)

We should provide a Last-Modified header which pulls its value from the paste file modification time (for pastes) or from the binary's compilation date (for CSS, JS, etc). This would allow CDN caches to revalidate simply by checking the Last-Modified date without actually transferring the body of the paste - especially good for images or large files accessed periodically.

Alternately we could provide an Etag header pulling from the current Git commit hash for CSS and JS, and from a cryptographic digest of the paste file for pastes.

feature request: tabulation key support

Hi,

Would it be possible to enhance the web client to support the key 'tab' to indent code?
At the time of writing, it selects the adress bar on my browser.

Light mode, other configs

This looks nice.

A couple of questions (or requests if not presently possible).

  1. Any chance of a "light mode" (dark mode is bad for my eyes).
  2. Can you turn off binary pastes (or does setting -b, --binary-upload-limit <BINARY_UPLOAD_LIMIT> to 0 work?
  3. Any way to not display the text when you first visit the page (at least on your demo site)?

Not deployed yet as the dark mode is a big issue for me (as visually handicapped).

Thanks.

CORS header 'Access-Control-Allow-Origin' missing

Hello, I have a problem.
I want to get use the API to get some data I uploaded inside JavaScript but the problem is that there's no 'Access-Control-Allow-Origin' header and my browser will throw an error.

bug: /client not available

Hello,

I just installed bin and I like it so far :D. I noticed an incoherence : the man-like page tells that you can download the client at /client, but I get the message Unable to find entity 'client' (try https://basedbin.fly.dev/client).

I installed bin with docker(-compose).

For now I just copied/pasted the client in the upload directory.

It's hard to find the wanted file type in the list

When I do a paste, and want to select the file type, the ordering of the list is not intuitive: the first 10 entries or so are a mystery to me, then the rest looks like it's sorted by the extension, but that extension is never shown.

So we end up looking for a bash highlighting near the "B", but no, it's near the "S" words, between SCSS and... "Highlight non-printable".

I would suggest to either:

  • show the extension first, so that the sorting is obvious
  • provide a search field (there is already a space between "Paste" and the list, maybe it could fit there?)
  • if only the alias is shown, actually sort by the alias string (so Bourne would be in the Bs)

Also, not related but nice-to-have, applying the selected highlight to the current text would be, well, nice.

Password Authentication?

Hi,

I just installed this Bin via docker and I just love the functionality and gui. Is it possible to add some form of authentication? I want to run this exposed to the internet, but since my server is at home I don't want anyone to be able to paste and share. My ideal use case is: I want to share a piece of text picture, so I open my URL, put in a password, and get a sharing link. The receiver of the share link should be able to access it without a password.
That makes me unable to use authentication via nginx or similar since you would also need a pw just to open the link.

Thanks you!

Doesn't accept client description

Hi,
I am using portainer and pulled the latest bin. I must say that I am pretty new to docker, so it might just be me: I can't get the exchange of the placeholder to work.

Out of desperation (I really don't know what I am doing), I tried adding the --client-desc flag and put another env-variable without the bin_ prefix:
bin
Still the greeting page is unchanged.
Any help would be appreciated.

(also: your docker compose example show port 6163 instead of 6162)

Using a different webroot for bin

I want to host the bin from myurl.com/bin, and am using caddy as a reverse proxy. The upload page loads fine while the html is fine, the js and css are requested from /assets/... instead of /bin/assets/..., but the upload form (and all other links) route as if / was the webroot. This breaks the website unless hosted on a different domain (bin.myurl.com) or on a different port.

No "raw" link

Hi,

Yesterday I sent a diff paste to a friend, with syntax highlighting; the url was something like example.com/p/SF37PK.diff . However he wanted to download the raw text, and found no obvious way of doing that...
After a while he found out that the raw version can be accessed by stripping the file extension from the URL link.

Would it be possible to add a simple "Raw" button, that links to the same URL without the extension? It looks quite straightforward.

Feature request: File uploads from mobile

I've been using bin as a personal imgur replacement, so I'm uploading mostly images and videos. It works great in a desktop browser, but I haven't figured out how to upload from my (Android) phone, because the mobile browsers I use don't support copy/paste for media files. Would it be possible to have some sort of upload mechanism for mobile?

Missing builds for v2.3.0

Hi !

I see there is new release v2.3.0 since August 18th; however I can't see any binary attached to this release, only the source code.
Would it be possible to attach them please? I'm mainly interested in the aarch64 build.

And thanks for the great work!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.