contented/README.md

163 lines
7.3 KiB
Markdown
Raw Permalink Normal View History

2018-10-06 00:49:20 +00:00
# contented
2017-10-06 07:22:55 +00:00
2018-10-06 00:49:20 +00:00
[![](doc/image1.thumb.png)](doc/image1.png)
2017-10-06 07:22:55 +00:00
2018-10-06 00:49:20 +00:00
A file / image / paste upload server with a focus on embedding.
2017-10-08 02:32:38 +00:00
2018-10-06 00:49:20 +00:00
You can use contented as a standalone upload server, or you can use the SDK to embed its upload widget into another website.
2018-06-09 06:12:50 +00:00
The name is a pun on "content" and the -d suffix for server daemons.
2018-10-06 00:49:20 +00:00
## Features
2017-10-06 07:22:55 +00:00
2023-05-19 07:39:58 +00:00
- Use local disk or S3-backed storage
2017-10-15 05:59:00 +00:00
- Drag and drop upload
2017-10-08 02:32:38 +00:00
- Multiple files upload
- Pastebin upload
2018-10-06 00:49:20 +00:00
- Custom drawing upload ([via drawingboard.js](https://github.com/Leimi/drawingboard.js))
2017-10-15 06:50:48 +00:00
- Ctrl-V upload
2023-05-19 07:39:58 +00:00
- Galleries and nested galleries
2017-10-08 03:42:30 +00:00
- SDK-oriented design for embedding, including CORS support
2017-10-08 02:35:13 +00:00
- Mobile friendly HTML interface
2017-10-08 02:32:38 +00:00
- Preserves uploaded filename and content-type metadata
- Hash verification (SHA512/256)
2017-10-08 02:35:13 +00:00
- Detect duplicate upload content and reuse storage
2023-05-19 07:39:58 +00:00
- Options to limit the upload filesize, upload bandwidth, and maximum source filesize for thumbnailing
2018-10-06 00:49:20 +00:00
- Short URLs (using [Hashids](http://hashids.org) algorithm)
2017-11-18 00:34:49 +00:00
- Image thumbnailing
2023-05-19 07:39:58 +00:00
- Optional multi-tenant binary (`contented-multi`)
2017-10-08 02:32:38 +00:00
2018-10-06 00:49:20 +00:00
## Usage (Server)
2017-10-08 02:32:38 +00:00
2018-10-06 00:49:20 +00:00
```
Usage of contented:
-concurrentthumbs int
Simultaneous thumbnail generation (default 16)
2017-10-08 02:32:38 +00:00
-data string
Directory for stored content (default ".")
2017-10-08 02:32:38 +00:00
-db string
Path for metadata database (default "contented.db")
2017-11-18 01:29:02 +00:00
-diskFilesWorldReadable
Save files as 0644 instead of 0600
2017-10-15 06:16:26 +00:00
-enableHomepage
Enable homepage (disable for embedded use only) (default true)
-enableUpload
Enable uploads (disable for read-only mode) (default true)
2017-10-08 02:32:38 +00:00
-listen string
2017-11-18 01:29:02 +00:00
IP/Port to bind server (default "127.0.0.1:80")
2017-10-08 02:32:38 +00:00
-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")
2017-10-15 06:12:25 +00:00
-trustXForwardedFor
Trust X-Forwarded-For reverse proxy headers
2018-10-06 00:49:20 +00:00
```
2017-10-08 02:32:38 +00:00
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).
2018-10-06 00:49:20 +00:00
## Usage (HTTP)
2017-10-08 03:18:52 +00:00
The server responds on the following URLs:
2018-10-06 00:49:20 +00:00
URL |Method |Description
2018-10-06 01:04:13 +00:00
---------------------|-------|---
2018-10-06 00:49:20 +00:00
`/get/{ID}` |`GET` |Download item content
`/p/{ID}` |`GET` |Preview item content (HTML)
`/p/{ID}-{ID}-...` |`GET` |Preview multiple item content (HTML)
2018-10-06 00:49:20 +00:00
`/info/{ID}` |`GET` |Get item content metadata (JSON)
`/thumb/{Type}/{ID}` |`GET` |Get item thumbnail image (JPEG). "Type" should match `[sbtmlh]`.
2018-10-06 00:49:20 +00:00
`/about` |`GET` |Get server metadata (JSON)
2017-10-08 03:18:52 +00:00
2018-10-06 00:49:20 +00:00
## Usage (Embedding for web)
2017-10-08 02:32:38 +00:00
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:
2017-10-08 02:32:38 +00:00
2018-10-06 00:49:20 +00:00
```html
<script type="text/javascript" src="SERVER_ADDR/sdk.js"></script>
contented.init("#target");
2018-10-06 00:49:20 +00:00
```
2017-10-08 03:42:30 +00:00
You can optionally supply additional ordered parameters to `contented.init`:
1. A callback, that will be passed an array of file IDs of any uploaded items
2. A callback, that will be called if the SDK widget is closed
2018-10-06 00:49:20 +00:00
## Changelog
2017-10-08 03:42:30 +00:00
2023-05-20 02:33:21 +00:00
2023-05-20: 1.5.1
- Improve support for albums with no images, and for albums with missing interior images
2023-05-19 07:17:04 +00:00
2023-05-19: 1.5.0
- Feature: Support S3-backed storage
- Feature: New `contented-multi` binary to host multiple server configurations from a single process
- Enhancement: Better client-side caching for thumbnails
- Option to cap source filesize for thumbnailing (default 20MiB)
2023-05-17 07:27:32 +00:00
2023-05-17: 1.4.0
- BREAKING: Remove support for some old web browsers (require jQuery 3, ES6 template literals, Promises, Canvas.toBlob)
- Feature: Initial album support with custom titles
- Feature: Support readonly mode
- Enhancement: Use lazy-loading for large image galleries
- Enhancement: Better tab titles on preview pages
- Fix an issue with continuing server-side thumbnailing work even if the http client has gone away
- Fix an issue with not warning on colliding hashIDs
- Internal: Refactor the SDK's initialization phase
- Internal: Update bolt library dependency
2020-07-25 01:17:02 +00:00
2020-07-25: 1.3.1
- Fix an issue with dependencies causing failure to compile in Modules mode
2020-07-25 00:35:26 +00:00
2020-07-25: 1.3.0
2018-09-09 07:03:29 +00:00
- Feature: Option to limit concurrent thumbnail generation
- Enhancement: Set charset=UTF-8 when serving user-submitted text/plain content
2020-07-25 00:35:26 +00:00
- Fix an issue with large memory usage for multipart file uploads
2018-09-09 07:03:29 +00:00
2018-06-09 06:10:54 +00:00
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
- [⬇️ contented-1.2.1-win32.7z](https://git.ivysaur.me/attachments/88dea4f7-e314-4325-a957-096dcf8cdecc) *(1.51 MiB)*
- [⬇️ contented-1.2.1-src.zip](https://git.ivysaur.me/attachments/6fd2b963-3be4-48a6-a5bf-6f273bcaea24) *(1.49 MiB)*
- [⬇️ contented-1.2.1-linux64.tar.gz](https://git.ivysaur.me/attachments/c536f764-0250-4d67-886a-4797946e1124) *(2.21 MiB)*
2018-06-09 06:10:54 +00:00
2017-11-18 01:29:02 +00:00
2017-11-18: 1.2.0
2017-11-18 00:34:49 +00:00
- Feature: Thumbnail support
2017-11-18 01:29:02 +00:00
- Feature: File preview page
- Feature: Album mode (via URL `/p/{file1}-{file2}-...`)
- Feature: New `-diskFilesWorldReadable` option to save files with `0644` mode
- [⬇️ contented-1.2.0-win32.7z](https://git.ivysaur.me/attachments/f3453b62-b2a7-4e77-9b04-44c99dec35ba) *(1.36 MiB)*
- [⬇️ contented-1.2.0-src.zip](https://git.ivysaur.me/attachments/a6c1ecfb-fd6a-44b5-9dc8-aea7c439d1e6) *(178.94 KiB)*
- [⬇️ contented-1.2.0-linux64.tar.gz](https://git.ivysaur.me/attachments/6234754b-af17-4a72-8b66-56a5db21c7c7) *(2.03 MiB)*
2017-11-18 00:34:49 +00:00
2017-10-15 06:51:36 +00:00
2017-10-15: 1.1.0
2017-10-15 05:59:00 +00:00
- Feature: Drawing mode
2017-10-15 06:50:48 +00:00
- Feature: Ctrl+V image upload
2017-10-15 06:16:26 +00:00
- Feature: Option to trust X-Forwarded-For headers when using a reverse proxy
2017-10-15 05:59:00 +00:00
- Feature: Add `getDownloadURL`, `getInfoJSONURL`, `getPreviewURL` SDK methods
2017-10-15 06:16:26 +00:00
- Feature: Option to disable uploading via the homepage
- Feature: Add button to repeat when uploading from homepage
2017-10-15 05:59:00 +00:00
- 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](https://git.ivysaur.me/attachments/bfb0a7fe-bf95-4d0e-933b-8137bc8071a4) *(1.11 MiB)*
- [⬇️ contented-1.1.0-src.zip](https://git.ivysaur.me/attachments/67401341-724f-4ea2-b9c7-44d08ab9d38a) *(142.82 KiB)*
- [⬇️ contented-1.1.0-linux64.tar.gz](https://git.ivysaur.me/attachments/a13752dd-5228-4830-b61d-0f7cc568b2ae) *(1.67 MiB)*
2017-10-15 05:59:00 +00:00
2017-10-08 04:12:56 +00:00
2017-10-08: 1.0.1
- Fix an issue with CORS preflight requests
- Fix an issue with index URLs
- [⬇️ contented-1.0.1-win32.7z](https://git.ivysaur.me/attachments/a873d510-da09-4797-95e9-ffcad690a77b) *(1.10 MiB)*
- [⬇️ contented-1.0.1-src.zip](https://git.ivysaur.me/attachments/43ac17d6-b6f1-4da7-98e9-b8af6fb5551a) *(109.08 KiB)*
- [⬇️ contented-1.0.1-linux64.tar.gz](https://git.ivysaur.me/attachments/34d74bed-db3f-4cef-a76f-266f0b9e6017) *(1.65 MiB)*
2017-10-08 04:12:56 +00:00
2017-10-08 03:42:30 +00:00
2017-10-08: 1.0.0
- Initial public release
2017-10-15 05:59:00 +00:00
- Include jQuery 1.12.4 (MIT license)
- [⬇️ contented-1.0.0-win32.7z](https://git.ivysaur.me/attachments/4ef132cf-dac8-4bcf-9da7-14ca1366e815) *(1.10 MiB)*
- [⬇️ contented-1.0.0-src.zip](https://git.ivysaur.me/attachments/74d77b3f-557b-44bf-9645-7b3b25ab17c1) *(102.45 KiB)*
- [⬇️ contented-1.0.0-linux64.tar.gz](https://git.ivysaur.me/attachments/1c28a913-686b-44cf-b63d-db22968a93b6) *(1.65 MiB)*