2020-03-24 15:35:00 +03:00
|
|
|
# tube
|
2019-06-30 01:33:28 +03:00
|
|
|
|
2020-03-23 09:57:34 +03:00
|
|
|
`tube` is a Youtube-like (_without censorship and features you don't need!_)
|
|
|
|
Video Sharing App written in Go which also supports automatic transcoding to
|
2020-03-23 15:44:42 +03:00
|
|
|
MP4 H.265 AAC, multiple collections and RSS feed.
|
2020-03-23 09:57:34 +03:00
|
|
|
|
|
|
|
## Features
|
2019-06-30 01:33:28 +03:00
|
|
|
|
|
|
|
- Easy to add videos (just move a file into the folder)
|
2020-03-23 09:57:34 +03:00
|
|
|
- Easy to upload videos (just use the builtin uploader and automatic transcoder!)
|
|
|
|
- Builtin ffmpeg-based Transcoder that automatically converts your uploaded content to MP4 H.264 / AAC
|
|
|
|
- Builtin automatic thumbnail generator
|
2019-06-30 01:33:28 +03:00
|
|
|
- No database (video info pulled from file metadata)
|
2020-03-23 09:57:34 +03:00
|
|
|
- No JavaScript (the player UI is entirely HTML, except for the uploader which degrades!))
|
2019-06-30 01:33:28 +03:00
|
|
|
- Easy to customize CSS and HTML template
|
2019-07-04 05:30:20 +03:00
|
|
|
- Automatically generates RSS feed (at `/feed.xml`)
|
2019-06-30 01:33:28 +03:00
|
|
|
- Clean, simple, familiar UI
|
|
|
|
|
2020-03-25 02:35:29 +03:00
|
|
|
### Screenshots
|
|
|
|
|
2020-03-25 02:51:56 +03:00
|
|
|
![screenshot-1](screenshot-1.png?raw=true "Main Screen and Video Player")
|
|
|
|
![screenshot-2](screenshot-2.png?raw=true "Video Upload Screen")
|
2020-03-25 02:35:29 +03:00
|
|
|
|
2020-03-23 09:57:34 +03:00
|
|
|
## Getting Started
|
2019-06-30 01:33:28 +03:00
|
|
|
|
2020-04-01 17:05:23 +03:00
|
|
|
### Using Homebrew
|
|
|
|
|
|
|
|
```#!sh
|
|
|
|
$ brew tap prologic/tube
|
|
|
|
$ brew install tube
|
|
|
|
$ tube
|
|
|
|
```
|
|
|
|
|
|
|
|
Open http://127.0.0.1:8000/ in your Browser!
|
|
|
|
|
2020-03-29 02:39:55 +03:00
|
|
|
### Using a Binary
|
|
|
|
|
|
|
|
1. Go grab the latest binary from the
|
2021-07-13 01:34:56 +03:00
|
|
|
[Releases](https://git.mills.io/prologic/tube/releases) page for your
|
2020-03-29 02:39:55 +03:00
|
|
|
platform / operating system.
|
|
|
|
2. Extract the archive.
|
|
|
|
3. Run `./tube`
|
|
|
|
|
|
|
|
Open http://127.0.0.1:8000/ in your Browser!
|
|
|
|
|
|
|
|
### Using Docker
|
|
|
|
|
|
|
|
```#!sh
|
|
|
|
$ docker pull prologic/tube
|
|
|
|
$ docker run -p 8000:8000 -v /path/to/data:/data
|
|
|
|
```
|
|
|
|
|
|
|
|
Open http://DOCKER_MACHINE_IP:8000/ in your Browser!
|
|
|
|
|
|
|
|
Where `DOCKER_MACHINE_IP` is the IP Address of your Docker Node.
|
|
|
|
|
2020-03-23 09:57:34 +03:00
|
|
|
### From Source
|
2019-06-30 01:33:28 +03:00
|
|
|
|
2020-03-23 09:57:34 +03:00
|
|
|
```#!sh
|
2021-07-13 01:34:56 +03:00
|
|
|
$ git clone https://git.mills.io/prologic/tube
|
2020-03-23 09:57:34 +03:00
|
|
|
$ cd tube
|
|
|
|
$ make
|
|
|
|
$ ./tube
|
|
|
|
```
|
2019-08-08 15:14:26 +03:00
|
|
|
|
2020-03-23 09:57:34 +03:00
|
|
|
Open http://127.0.0.1:8000/ in your Browser!
|
2019-08-08 15:14:26 +03:00
|
|
|
|
2020-03-29 02:39:55 +03:00
|
|
|
### A Production Deployment
|
2019-06-30 01:33:28 +03:00
|
|
|
|
2020-03-29 02:39:55 +03:00
|
|
|
A Production Deployment can be found at https://tube.mills.io/ -- This is run
|
|
|
|
and managed via a Docker Swarm cluster with a Docker-Compose / Stack very
|
|
|
|
similiar to the one you can find in the repo: [docker-compose.yml](docker-compose.yml)
|
|
|
|
|
2020-03-29 02:41:22 +03:00
|
|
|
Beyond this a "Production Deployment" is out-of-scope at this time for the
|
2020-03-29 02:39:55 +03:00
|
|
|
documentation being provided here. Please don't hesitate to file an
|
2021-07-13 01:34:56 +03:00
|
|
|
[Issue](https://git.mills.io/prologic/tube/issues/new) however for ask for help
|
2020-03-29 02:39:55 +03:00
|
|
|
or advice or contact the author directly!
|
2020-03-23 09:51:03 +03:00
|
|
|
|
2020-04-06 02:11:23 +03:00
|
|
|
## Configuration
|
|
|
|
|
2021-01-04 06:45:22 +03:00
|
|
|
`tube` can be configured to suit your particular needs and comes by default with
|
2020-04-06 02:11:23 +03:00
|
|
|
a sensbile set of defaults. There is also a default configuration at the
|
2021-07-13 02:50:21 +03:00
|
|
|
top-level [config.json](config.json) that you can use as a start point and
|
2020-04-06 02:11:23 +03:00
|
|
|
modify to suite your needs.
|
|
|
|
|
|
|
|
To Run `tube` with a provided configuration just pass the `-c /path/to/config`
|
|
|
|
option; for example:
|
|
|
|
|
|
|
|
```#!sh
|
|
|
|
$ tube -c config.json
|
|
|
|
```
|
|
|
|
|
|
|
|
Everything in the configuration is optional as the builtin defaults are used
|
|
|
|
if you do not supply anything, omit some sections or values or the configuration
|
2021-07-13 02:50:21 +03:00
|
|
|
is invalid. Refer to the [default config.json](config.json) for the builtin
|
2020-04-06 02:11:23 +03:00
|
|
|
defaults (_this files matches the builtin defaults_).
|
|
|
|
|
|
|
|
Here are some documentation on key configuration items:
|
|
|
|
|
|
|
|
### Library Options and Upload / Video Paths(s)
|
|
|
|
|
|
|
|
```#!json
|
|
|
|
{
|
|
|
|
"library": [
|
|
|
|
{
|
|
|
|
"path": "videos",
|
|
|
|
"prefix": ""
|
|
|
|
}
|
|
|
|
],
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Set `path` to the value of the path where you want to store videos and where
|
|
|
|
`tube` will look for new videos.
|
|
|
|
|
|
|
|
### Server Options / Upload Path and Max Upload Size
|
|
|
|
|
|
|
|
```#!json
|
|
|
|
{
|
|
|
|
"server": {
|
|
|
|
"host": "0.0.0.0",
|
|
|
|
"port": 8000,
|
|
|
|
"store_path": "tube.db",
|
|
|
|
"upload_path": "uploads",
|
|
|
|
"max_upload_size": 104857600
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
- Set `host` to the interface you wish to bind to. If you want to only bind
|
|
|
|
your local machine (_ie: localhost_) set this to `127.0.0.1`.
|
|
|
|
- Set `port` to any port you wish to bind the listening socket of the server
|
|
|
|
to. It doesn't matter what it is as long as there it doesn't collide with
|
|
|
|
a port already in use on your system.
|
|
|
|
- Set `store_path` to a directory where `tube` will store statistics on videos
|
|
|
|
viewed.
|
|
|
|
- Set `upload_path` to a directory that you wish to use as a temporary working
|
|
|
|
space for `tube` to store uploaded videos and process them. This can be a
|
|
|
|
tmpfs file system for example for faster I/O.
|
|
|
|
- Set `max_upload_size` to the maximum number of bytes you wish to impose on
|
|
|
|
uploaded and imported videos. Upload(s)/Import(s) that exceed this size will
|
|
|
|
by denied by the server. This is a saftey measure so as to not DoS the
|
|
|
|
Tube server instance. Set it to a sensible value you see fit.
|
|
|
|
|
|
|
|
### Thumbnailer / Transcoder Timeouts
|
|
|
|
|
|
|
|
```#!json
|
|
|
|
{
|
|
|
|
"thumbnailer": {
|
|
|
|
"timeout": 60
|
|
|
|
},
|
|
|
|
"transcoder": {
|
|
|
|
"timeout": 300,
|
|
|
|
"sizes": null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
- Set `timeout` to the no. of seconds to permit for thumbnail generation and
|
|
|
|
video transcoding. This value has to be large enough for thumbnail generation
|
|
|
|
and transcoding to take place depending on the `max_upload_size` permitted.
|
|
|
|
These values also depend on the underlying performance of the machine Tube
|
|
|
|
runs on. Use sensible values for your `max_upload_size` + system performance.
|
|
|
|
This is a safety measure to ensure background processed do not run away
|
|
|
|
and/or hog system resources. The thumbnailer and transcoder processes will
|
|
|
|
be killed if their execution time exceeds these values.
|
|
|
|
|
|
|
|
- Set `sizes` to an map of `size` => `suffix` that you wish to support for
|
|
|
|
transcoding videos to lower quality on Upload/Import. This is especially
|
|
|
|
useful for serving up videos to users that have poor bandwidth or where
|
|
|
|
data charges are high for them. The following is a valid map:
|
|
|
|
|
|
|
|
```#!json
|
|
|
|
{
|
|
|
|
"transcoder": {
|
|
|
|
"sizes": {
|
|
|
|
"hd720": "720p",
|
|
|
|
"hd480": "480p",
|
|
|
|
"nhd": "360p",
|
|
|
|
"film": "240p"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-04-06 11:31:54 +03:00
|
|
|
```
|
2020-04-06 02:11:23 +03:00
|
|
|
|
|
|
|
### Feed (RSS) Configuration
|
|
|
|
|
|
|
|
```#!json
|
|
|
|
{
|
|
|
|
"feed": {
|
|
|
|
"external_url": "",
|
|
|
|
"title": "Feed Title",
|
|
|
|
"link": "http://your-url.example/about",
|
|
|
|
"description": "Feed Description",
|
|
|
|
"author": {
|
|
|
|
"name": "Author Name",
|
|
|
|
"email": "author@somewhere.example"
|
|
|
|
},
|
|
|
|
"copyright": "Copyright Text"
|
|
|
|
}
|
|
|
|
}
|
2020-04-06 11:31:54 +03:00
|
|
|
```
|
2020-04-06 02:11:23 +03:00
|
|
|
|
|
|
|
- Fill these values out as you see fit. If you are familiar with RSS
|
|
|
|
these should be straight forward :)
|
|
|
|
|
2021-06-08 16:22:14 +03:00
|
|
|
### Content Proprietary Notices Configuration
|
|
|
|
|
|
|
|
{
|
|
|
|
"copyright": {
|
|
|
|
"content": "All Content herein Public Domain and User Contributed."
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-25 04:38:08 +03:00
|
|
|
## Stargazers over time
|
|
|
|
|
|
|
|
[![Stargazers over time](https://starcharts.herokuapp.com/prologic/tube.svg)](https://starcharts.herokuapp.com/prologic/tube)
|
|
|
|
|
|
|
|
## Support
|
|
|
|
|
|
|
|
Support the ongoing development of Tube!
|
|
|
|
|
|
|
|
**Sponser**
|
|
|
|
|
|
|
|
- Become a [Sponsor](https://www.patreon.com/prologic)
|
|
|
|
|
|
|
|
## Contributors
|
|
|
|
|
|
|
|
Thank you to all those that have contributed to this project, battle-tested it,
|
|
|
|
used it in their own projects or products, fixed bugs, improved performance
|
|
|
|
and even fix tiny typos in documentation! Thank you and keep contributing!
|
|
|
|
|
2021-07-13 02:50:21 +03:00
|
|
|
You can find an [AUTHORS](AUTHORS) file where we keep a list of contributors
|
2020-03-25 04:38:08 +03:00
|
|
|
to the project. If you contriibute a PR please consider adding your name there.
|
2021-07-13 01:34:56 +03:00
|
|
|
There is also Github's own [Contributors](https://git.mills.io/prologic/tube/graphs/contributors) statistics.
|
2020-03-25 04:38:08 +03:00
|
|
|
|
|
|
|
[![](https://sourcerer.io/fame/prologic/prologic/tube/images/0)](https://sourcerer.io/fame/prologic/prologic/tube/links/0)
|
|
|
|
[![](https://sourcerer.io/fame/prologic/prologic/tube/images/1)](https://sourcerer.io/fame/prologic/prologic/tube/links/1)
|
|
|
|
[![](https://sourcerer.io/fame/prologic/prologic/tube/images/2)](https://sourcerer.io/fame/prologic/prologic/tube/links/2)
|
|
|
|
[![](https://sourcerer.io/fame/prologic/prologic/tube/images/3)](https://sourcerer.io/fame/prologic/prologic/tube/links/3)
|
|
|
|
|
2020-03-23 09:51:03 +03:00
|
|
|
## License
|
|
|
|
|
2021-07-13 02:50:21 +03:00
|
|
|
tube source code is available under the MIT [License](LICENSE).
|
2020-03-23 09:51:03 +03:00
|
|
|
|
|
|
|
Previously based off of [tube](https://github.com/wybiral/tube) by [davy wybiral
|
2021-07-13 02:50:21 +03:00
|
|
|
](https://github.com/wybiral). (See [LICENSE.old](LICENSE.old))
|