MagicLegend / dro.pm

Drop links, text and files for easy sharing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drop 'em - share files, links, text

The project now contains a web and android part. This README is mostly about the web part.

The website

This project's code is old and ugly but I uploaded it anyway because people were interested.

File info

  • res/ contains resources, currently only images.

  • frontpage.htm is the landing page, which calls methods in api/ (see api/.htaccess).

  • gotoUrl.php turns a short link into a download, redirect, text display or waiting page.

  • fileman.php handles file uploads. Should probably be in the api/ folder actually (todo).

  • jsdemo.htm is an old file to demo, in concept, how the site should work.

Setup

Setup the database from db.sql in MySQL or something and place these files in your htdocs (or docroot or wwwroot). You can configure the database credentials in api/dbconn.php.

Architecture

The frontpage allocates a URL. From that point onwards, loading that URL will display a loading page. As soon as you do anything, type a character, paste a link, etc., the loading page will turn into a text display or redirect. When uploading files, the loading page will turn into a download as soon as the upload finished.

Your time, currently 12 hours, goes in from the moment that the link was last changed. One could theoretically keep a link alive indefinitely (another design flaw but one that has not been exploited).

There is no rate limiting or anything of the sort, so it's also possible to exhaust the available URLs (they go up to 3 characters right now, filtering similar ones). When someone does that I'll have to implement it I guess - and give out some IP bans.

Finally one may try all URLs, scripted, to see what people are storing. This is another thing I might wnat to monitor for / rate limit in the future.

License

For anything in the web folder, EU copyright applies. You may use this code and run it locally for the sole purpose of contributing back to the project. Maybe this will one day go commercial (I really like the idea but don't have the time to expand it right now) so I don't want to just give it away without you at least having to rewrite it. So why do I publish it at all? Because I think we all benefit from being able to see the code (privacy and security wise), you are welcome to read the code and learn from it, and you can contribute your own features to dro.pm which I will happily host for you!

For anything in the android folder, see the android/dropm.luc/README.md file.

To do

There are many ideas I have for this project, but most are hard to place in the UI. The main feature I still want to integrate, is making longer links valid for a custom time period. The original idea was that validity could go up to forever with 7 characters or more, but I'm no longer sure that's a good idea. The main feature of this site is expiring old garbage and there are plenty of sites where you can generate life-long and custom URLs on a FCFS basis. The time limits would probably be something like between 2 seconds and 2 weeks.

Another idea includes a manager where you have one link behind which there is an overview of links, texts (pastes), and files, and people opening the link can pick from the menu what they want to open. An example case for this would be a classroom setting, where the teacher generates a link the first time s/he needs it and adds more resources to it later. Here, it would also be useful to give a store/load option, where the collective page can be downloaded. And, after downloading, maybe also load it back into a new link later, for example for the next session.

An API would also be neat. There sort-of already is one, but I'd like to formalize it and to make it better.

The client (that is, the website) currently does not warn you when your secret token has expired, i.e. when you can no longer manage your link. This happens when your link expired (for example because it was empty and you left the tab open for a few hours).

The Android app does not allow sharing text or URLs, and there should be a 'remove' button. It could have an overview of currently valid links and allow you to remove those. And it does not allow custom links yet.

It would also be cool to have better command line support, where the program remembers your last tokens and you don't have to copy/paste them from previous output. And upload progress.

Finally, I would like to transfer arbitrarily large files peer to peer. WebRTC or TCP hole punching, something fancy will have to be done for this, but people could transfer files without them having to be stored on the server, even encrypted. The drawback here is UX: telling people to leave the tab open and that the URL will expire as soon as they close it (and it becomes unavailable) is not very user friendly. The text should be clear and concise when this is the case. The user should, for small files, also be able to use the traditional method. Another UI challenge: how to give the user that option (it should probably be the default) without making everything more difficult when you do not want to have to answer ten questions in order to share something?

Feel free to work on any of this. Things like expanding Android app or checking whether a token is still valid are straightforward, but before you commit large chunks of your time to something like UI problems, be sure to bounce ideas off of me first! I want to keep the product useful for everyone and myself, and that means applying quality control.

About

Drop links, text and files for easy sharing


Languages

Language:PHP 43.2%Language:HTML 40.2%Language:Java 15.1%Language:TSQL 1.0%Language:Makefile 0.4%Language:Shell 0.0%