Giter Club home page Giter Club logo

haste-server's People

Contributors

abn avatar arpsmack avatar bridawson avatar grampajoe avatar gwemox avatar hawur avatar joeykrim avatar klasafgeijerstam avatar lidl avatar naftis avatar neandrake avatar nshontz avatar pangeacake avatar ribesg avatar seejohnrun avatar tfausak avatar wohlstand avatar zaeleus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

haste-server's Issues

Update redis key/value storage

Store the document in multiple parts using split key names:

"data.{key}" = "{base64 encoded gzipped file}"
"info.{key}" = "{stringified json object containing metadata about the file}"

This prevents having to store the document inside a stringified json object. In the future this would likely make streaming large objects directly to redis easier to implement. This also allows for potentially splitting really large files into multiple entries, a la

"data.0.{key}" = "..."
"data.1.{key}" = "..."

The downside is this means when requesting a file, two database entries have to be queried/pulled, however the keys used are predictable so they could potentially be pulled in a single query (assuming redis supports this).

When querying/storing a file remember to use transactions, even though node is single-threaded.

As part of this, we should also update the current gzipping process to only gzip if the file size is > some threshold. The zip + b64 inflates documents of really small size (probably only restrict non-gzipping to plaintext).

http://stackoverflow.com/questions/7844001/what-is-the-lower-threshold-to-not-perform-http-compression

From that it sounds like we should use deflate/inflate instead of gzip/gunzip for text files (I've not actually looked into the difference yet...), and probably set some threshold at around 256 bytes.

Implement URL shortcut feature

By recognizing that the data pasted is a single URL, you could redirect the user to that URL immediately. This would implement URL shortening!

Better paste key generation

Currently it just generates a bunch of random numbers. We should probably hash some form of the content or timestamp and then convert the hash into some legible key.

Keyboard shortcuts are mapped to default browser behaviors

The 'Raw' function is Ctrl/Cmd + Shift + R, which is typically a browser's 'refresh and clear cache' function. The 'Duplicate & Edit' is Ctrl/Cmd + D which is typically 'bookmark this page'.

We should come up with new shortcuts that aren't so typical to overwrite existing browser behavior.

Allow extensions on document URLs

Extensions act as a good indicator of file type, so we may either want to allow any extension to be added, or force some extension based on the content-type.

Self-host all js libraries

Right now the main application links to jquery via googleapi. The jquery library should be added to the repo and hosted by the haste server.

Dragging file onto page when not in edit mode won't accept the drop

I think this is because of how the body tag works. When in edit mode a textarea component is taking up the full dimension of the page. When not in edit mode the body tag is only the size of the text pasted.

Might be fixed with adding:

html {overflow-y:hidden; height: 100%;}
body {overflow-y:auto; height: 100%;}

File storage doesn't work

I got multiple problems trying to use file storage. Switched to redis and it works, but you may want to either fix it or remove the feature.
Nice work on this!

Need a way to select which syntax hilighting to use

Perhaps add a dropdown box at the top that allows you to select from the available syntax highlighting.

Maybe have a button next to it that allows you to save your choice so the next time the paste is viewed it uses the syntax highlighting you chose.

Log file is stored with content-type of application/octet-stream

Dropped a .log file and when redirected to the raw file, was prompted to download file rather than viewing the text. Probably just need better mime-type parsing on file upload.

We should probably also special-case drops of files that have a mime-type of text, instead of redirecting to the raw document, load it to be highlighted/parsed.

Refactor client-side application

The application.js code is a bit tedious to follow and doesn't feel like it's organized very well, especially since new features are continued to be added. This should be cleaned up for better viewing of different types of pastes.

Maybe allow editing

Making the pastes completely immutable kinda sucks. What if you paste something and realize there's a minor typo and want to fix it? You have to duplicate the entire thing and submit it as a new paste?

I guess if we were enforcing short lived pastes that probably wouldn't be a big deal. They would expire and get cleaned up in sort order. But if we want longer lived pastes, then editing seems like a necessity.

We should at least be able to configure whether or not editing is allowed.

Better downloads

Hi

File extension

For example, if you upload Minecraft.exe and then download it, you just get a file with the document key as name. It's not really convenient.

Same for images, would be nice to at least have the format :-)

Better understanding

When sharing a file that isn't text nor image, it would be nice to have a bigger, clearer "download" link.

Thanks.

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.