A file / image / paste upload server with a focus on embedding. https://code.ivysaur.me/contented/
Go to file
2018-09-09 18:41:37 +12:00
_dist doc: move README to top-level, for web viewing 2018-07-21 13:38:46 +12:00
cmd/contented thumbs: allow configuring limit on simultanous thumbs (default 16) 2018-09-09 18:41:37 +12:00
static index: replace our custom result listing page with an album preview 2017-11-18 14:11:40 +13:00
vendor vendor: update thumbnail from 1.0.0 -> master 2018-06-09 18:09:49 +12:00
.hgignore hgignore 2017-10-08 16:43:44 +13:00
.hgtags Added tag v1.2.1 for changeset 7c3807929e7a 2018-06-09 18:11:39 +12:00
download.go serve text/plain content with charset=utf-8 header 2018-09-09 18:33:33 +12:00
Gopkg.lock vendor: update thumbnail from 1.0.0 -> master 2018-06-09 18:09:49 +12:00
Gopkg.toml vendor: update thumbnail from 1.0.0 -> master 2018-06-09 18:09:49 +12:00
Makefile bump version to 1.2.2 2018-06-09 18:13:22 +12:00
Metadata.go compatibility fixes for hashids library 2018-06-09 18:10:49 +12:00
preview.go fix typo in previous 2018-06-04 18:28:50 +12:00
README.md doc: move README to top-level, for web viewing 2018-07-21 13:38:46 +12:00
Server.go thumbs: allow configuring limit on simultanous thumbs (default 16) 2018-09-09 18:41:37 +12:00
staticResources.go staticResources: rebuild 2017-11-18 14:11:44 +13:00
thumb.go thumbs: allow configuring limit on simultanous thumbs (default 16) 2018-09-09 18:41:37 +12:00
upload.go add diskFilesWorldReadable option to control 0644/0600 choice for new files 2017-11-18 14:15:31 +13:00

A file / image / paste upload server with a focus on embedding.

Written in Go

You can use contented as a standalone upload server, or you can use the SDK to embed its upload widget into another website.

[go-get]code.ivysaur.me/contented git https://git.ivysaur.me/code.ivysaur.me/contented.git[/go-get]

=FEATURES=

  • Drag and drop upload
  • Multiple files upload
  • Pastebin upload
  • Custom drawing upload ([url=https://github.com/Leimi/drawingboard.js]via[/url])
  • Ctrl-V upload
  • SDK-oriented design for embedding, including CORS support
  • Mobile friendly HTML interface
  • Preserves uploaded filename and content-type metadata
  • Hash verification (SHA512/256)
  • Detect duplicate upload content and reuse storage
  • Options to limit the upload filesize and the upload bandwidth
  • Short URLs (using [url=http://hashids.org]Hashids[/url] algorithm)
  • Image thumbnailing

=USAGE (SERVER)=

Usage of contented: -data string Directory for stored content (default "") -db string Path for metadata database (default "contented.db") -diskFilesWorldReadable Save files as 0644 instead of 0600 -enableHomepage Enable homepage (disable for embedded use only) (default true) -listen string IP/Port to bind server (default "127.0.0.1:80") -max int Maximum size of uploaded files in MiB (set zero for unlimited) (default 8) -speed int Maximum upload speed in bytes/sec (set zero for unlimited) -title string Title used in web interface (default "contented") -trustXForwardedFor Trust X-Forwarded-For reverse proxy headers

If you are hosting behind a reverse proxy, remember to set its post body size parameter appropriately (e.g. client_max_body_size for nginx).

=USAGE (HTTP)=

The server responds on the following URLs:

  • /get/{ID}: Download item content
  • /info/{ID}: Get item content metadata (JSON)
  • /thumb/{Type}/{ID}: Get item thumbnail image
  • /about: Get server metadata (JSON)

=USAGE (EMBEDDING FOR WEB)=

Your webpage should load the SDK from the contented server, then call the contented.init function to display the upload widget over the top of an existing DOM element. Your callback will be passed an array of file IDs of any uploaded items.

<script type="text/javascript" src="SERVER_ADDR/sdk.js"></script> contented.init("#target", function(/* String[] */ items) {});

=CHANGELOG=

2018-06-09: 1.2.1

  • Feature: Add OpenGraph tags on preview pages, for rich metadata in chat applications
  • Update thumbnailing library to improve quality
  • Use dep for vendoring

2017-11-18: 1.2.0

  • Feature: Thumbnail support
  • Feature: File preview page
  • Feature: Album mode (via URL /p/{file1}-{file2}-...)
  • Feature: New -diskFilesWorldReadable option to save files with 0644 mode

2017-10-15: 1.1.0

  • Feature: Drawing mode
  • Feature: Ctrl+V image upload
  • Feature: Option to trust X-Forwarded-For headers when using a reverse proxy
  • Feature: Add getDownloadURL, getInfoJSONURL, getPreviewURL SDK methods
  • Feature: Option to disable uploading via the homepage
  • Feature: Add button to repeat when uploading from homepage
  • Enhancement: Automatically load library dependencies
  • Enhancement: Display homepage widget using the full screen size
  • Include drawingboard.js 0.4.6 (MIT license)
  • Fix a cosmetic issue with javascript console output
  • Fix a cosmetic issue with error messages if an upload failed

2017-10-08: 1.0.1

  • Fix an issue with CORS preflight requests
  • Fix an issue with index URLs

2017-10-08: 1.0.0

  • Initial public release
  • Include jQuery 1.12.4 (MIT license)