A file / image / paste upload server with a focus on embedding. https://code.ivysaur.me/contented/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
mappu ccc1f73e52 doc: update README for 1.3.1 8 months ago
cmd/contented thumbs: allow configuring limit on simultanous thumbs (default 16) 2 years ago
doc doc: move marketing images to /doc/ subdir 2 years ago
static index: replace our custom result listing page with an album preview 3 years ago
.gitignore vcs: migrate hgignore->gitignore 2 years ago
Makefile hg2git: fix source tarball generation in Makefile 2 years ago
Metadata.go compatibility fixes for hashids library 2 years ago
README.md doc: update README for 1.3.1 8 months ago
Server.go thumbs: allow configuring limit on simultanous thumbs (default 16) 2 years ago
download.go serve text/plain content with charset=utf-8 header 2 years ago
go.mod vendor: update package versions (fixes FTBFS) 8 months ago
go.sum vendor: update package versions (fixes FTBFS) 8 months ago
preview.go fix typo in previous 2 years ago
staticResources.go staticResources: rebuild 3 years ago
thumb.go thumbs: allow configuring limit on simultanous thumbs (default 16) 2 years ago
upload.go upload: buffer MIME parsing on disk, not in memory 8 months ago

README.md

contented

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

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

Features

  • Drag and drop upload
  • Multiple files upload
  • Pastebin upload
  • Custom drawing upload (via drawingboard.js)
  • 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 Hashids 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
  -concurrentthumbs
        Simultaneous thumbnail generation (default 16)

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:

URL Method Description
/get/{ID} GET Download item content
/info/{ID} GET Get item content metadata (JSON)
/thumb/{Type}/{ID} GET Get item thumbnail image
/about GET 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

2020-07-25: 1.3.1

  • Fix an issue with dependencies causing failure to compile in Modules mode

2020-07-25: 1.3.0

  • Feature: Option to limit concurrent thumbnail generation
  • Enhancement: Set charset=UTF-8 when serving user-submitted text/plain content
  • Fix an issue with large memory usage for multipart file uploads

2018-06-09: 1.2.1

2017-11-18: 1.2.0

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
  • ⬇️ contented-1.1.0-win32.7z (1.11 MiB)
  • ⬇️ contented-1.1.0-src.zip (142.82 KiB)
  • ⬇️ contented-1.1.0-linux64.tar.gz (1.67 MiB)

2017-10-08: 1.0.1

2017-10-08: 1.0.0