Skip to content

Commit a6c319f

Browse files
authored
Update README (#73)
Commits: * Markdown Lint Stuff * Outline how I want the README to be structured * Change svg out for png * Check-in * Readme just needs some badges now * Add badges * Diagnose failing tests * Hmmm * Make the config dir after loading settings * Remove /config * Remove debug echo * Go version badge
1 parent bb6affe commit a6c319f

24 files changed

+680
-66
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ A clear and concise description of what the bug is.
1212

1313
**To Reproduce**
1414
Steps to reproduce the behavior:
15+
1516
1. Go to '...'
1617
2. Click on '....'
1718
3. Scroll down to '....'
@@ -24,16 +25,18 @@ A clear and concise description of what you expected to happen.
2425
If applicable, add screenshots to help explain your problem.
2526

2627
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser (if applicable) [e.g. chrome, safari]
29-
- Controller Version [e.g. 0.1.0]
30-
- Runner Version (If applicable) [e.g. 0.1.0]
28+
29+
- OS: [e.g. iOS]
30+
- Browser (if applicable) [e.g. chrome, safari]
31+
- Controller Version [e.g. 0.1.0]
32+
- Runner Version (If applicable) [e.g. 0.1.0]
3133

3234
**Smartphone (please complete the following information):**
33-
- Device: [e.g. iPhone6]
34-
- OS: [e.g. iOS8.1]
35-
- Browser [e.g. stock browser, safari]
36-
- Version [e.g. 22]
35+
36+
- Device: [e.g. iPhone6]
37+
- OS: [e.g. iOS8.1]
38+
- Browser [e.g. stock browser, safari]
39+
- Version [e.g. 22]
3740

3841
**Additional context**
3942
Add any other context about the problem here.

.markdownlint.jsonc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"MD013": false,
3+
"MD033": false,
4+
"MD041": false
5+
}

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"cSpell.words": [
33
"encodarr",
4+
"mediainfo",
45
"ncodarr",
56
"popen",
67
"pymediainfo"

CODE_OF_CONDUCT.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ the community.
116116

117117
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118118
version 2.0, available at
119-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
119+
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
120120

121121
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122122
enforcement ladder](https://github.com/mozilla/diversity).
123123

124124
[homepage]: https://www.contributor-covenant.org
125125

126126
For answers to common questions about this code of conduct, see the FAQ at
127-
https://www.contributor-covenant.org/faq. Translations are available at
128-
https://www.contributor-covenant.org/translations.
127+
[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are available at
128+
[https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ When a Git tag is pushed to the repo, special actions are ran that deploy the co
5050

5151
## Code of Conduct
5252

53-
This project holds all contributors, maintainers, and participants to the standards outlined by the Contributor Covenant, a copy of which can be found in [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
53+
This project holds all maintainers, contributors, and participants to the standards outlined by the Contributor Covenant, a copy of which can be found in [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).

README.md

+150-22
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,171 @@
1-
# Encodarr
1+
<p align="center">
2+
<img src="images/Encodarr-Text-Logo.png" height="175"/>
3+
</p>
24

3-
Docker-based webapp for encoding video files to the HEVC \(H.265\) standard.
5+
[![https://img.shields.io/badge/license-MPL--2.0-blue](https://img.shields.io/badge/license-MPL--2.0-blue)](https://github.com/BrenekH/encodarr/blob/master/LICENSE)
6+
![GitHub all releases](https://img.shields.io/github/downloads/brenekh/encodarr/total?label=github%20downloads)
7+
![Docker Pulls](https://img.shields.io/docker/pulls/brenekh/encodarr-controller?label=controller%20docker%20pulls)
8+
![Docker Pulls](https://img.shields.io/docker/pulls/brenekh/encodarr-runner?label=runner%20docker%20pulls)
9+
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/brenekh/encodarr-controller/latest?label=controller%20image%20size)
10+
![Docker Image Size (tag)](https://img.shields.io/docker/image-size/brenekh/encodarr-runner/latest?label=runner%20image%20size)
11+
![GitHub go.mod Go version (subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/brenekh/encodarr?filename=controller%2Fgo.mod)
12+
[![Controller CI/CD](https://github.com/BrenekH/encodarr/actions/workflows/controller.yaml/badge.svg)](https://github.com/BrenekH/encodarr/actions/workflows/controller.yaml)
13+
[![Runner CI/CD](https://github.com/BrenekH/encodarr/actions/workflows/runner.yaml/badge.svg)](https://github.com/BrenekH/encodarr/actions/workflows/runner.yaml)
414

5-
## Docker Compose
15+
## What is Encodarr?
616

7-
Recommended `docker-compose.yaml` \(Assumes the docker image was built with the tag `brenekh/encodarr:latest`\)
17+
Encodarr is a self-hosted web application that encodes video files to a target format using distributed computing.
818

9-
```yaml
19+
## Why use Encodarr?
20+
<!-- TODO: Why use Encodarr? (other than easy to setup) -->
21+
22+
### Easy to Setup
23+
24+
Encodarr bypasses the need to share media across the network by instead transmitting the file to be operated on to the Runners.
25+
This means that Encodarr is much easier to setup than other solutions.
26+
27+
## Dependencies
28+
29+
The container images come with the dependencies installed, so if you go that route, all you need is [Docker](https://docs.docker.com/get-docker/).
30+
31+
If you are not using containers, you will need [mediainfo](https://mediaarea.net/en/MediaInfo/Download) and [FFmpeg](https://ffmpeg.org/download.html) in the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) variable.
32+
33+
## Installing
34+
35+
Container images are available from Docker Hub([Controller](https://hub.docker.com/r/brenekh/encodarr-controller), [Runner](https://hub.docker.com/repository/docker/brenekh/encodarr-runner)) and the GitHub Container Registry([Controller](https://github.com/users/BrenekH/packages/container/package/encodarr-controller), [Runner](https://github.com/users/BrenekH/packages/container/package/encodarr-runner)).
36+
37+
Pre-built executables are available via the [Releases](https://github.com/BrenekH/encodarr/releases/latest) page.
38+
39+
## Usage
40+
41+
### Docker/Docker Compose
42+
43+
The latest Controller version can be run using the following `docker run` command:
44+
45+
```bash
46+
docker run -d \
47+
--name Encodarr-Controller \
48+
-e TZ=Europe/London \
49+
-v <path to data>:/config:rw \
50+
-v <path to media>:/media:rw \
51+
-p 8123:8123 \
52+
--restart unless-stopped \
53+
--user 1000:1000 \
54+
brenekh/encodarr-controller:latest
55+
```
56+
57+
or if you prefer Docker Compose:
58+
59+
```yml
1060
version: "2.2"
1161
services:
12-
encodarr:
13-
image: brenekh/encodarr:latest
14-
container_name: Encodarr
62+
encodarr-controller:
63+
image: brenekh/encodarr-controller:latest
64+
container_name: Encodarr-Controller
65+
environment:
66+
- TZ=Europe/London
1567
volumes:
16-
- /config:/config:rw
17-
- /media/folder/to/search:/usr/app/tosearch:rw
68+
- <path to controller data>:/config:rw
69+
- <path to media>:/media:rw
1870
ports:
19-
- 5000:5000
71+
- 8123:8123
2072
restart: unless-stopped
21-
cpus: 2.00
22-
stop_signal: SIGINT
73+
user: "1000:1000"
74+
```
75+
76+
The latest Runner version is similar.
77+
78+
Docker run:
79+
80+
```bash
81+
docker run -d \
82+
--name Encodarr-Runner \
83+
-v <path to runner data>:/config:rw \
84+
-e "ENCODARR_RUNNER_NAME=Runner 1" \
85+
-e ENCODARR_RUNNER_CONTROLLER_IP=<Controller IP> \
86+
-e ENCODARR_RUNNER_CONTROLLER_PORT=8123 \
87+
--restart unless-stopped \
88+
brenekh/encodarr-runner:latest
2389
```
2490

25-
## Environment Variables
91+
Docker Compose:
92+
93+
```yml
94+
version: "2.2"
95+
services:
96+
encodarr-runner:
97+
image: brenekh/encodarr-runner:latest
98+
container_name: Encodarr-Runner
99+
volumes:
100+
- <path to runner data>:/config:rw
101+
environment:
102+
- ENCODARR_RUNNER_NAME=Runner 1
103+
- ENCODARR_RUNNER_CONTROLLER_IP=<Controller IP>
104+
- ENCODARR_RUNNER_CONTROLLER_PORT=8123
105+
restart: unless-stopped
106+
```
107+
108+
The Controller `path to media` and the corresponding mount inside the container can be anything you want and you can have as many as you want.
109+
For example, `/mnt/disk/tv:/tv:rw` and `/mnt/disk/movies:/movies:rw`.
110+
111+
In addition, the paths to data that are mounted to `/config` in the container should be separate folders, ideally with full paths\(`/home/user/docker` instead of `~/docker`\).
112+
113+
### Startup Configuration
114+
115+
Startup values configured either through environment variables, or command line arguments.
116+
All of the command line variants expect a value after a space (`--port 8123`) expect the Runner `--debug` flag.
117+
It is a boolean flag.
118+
119+
#### Controller
120+
121+
`ENCODARR_PORT`, `--port` sets the port for the HTTP web server.
122+
For containers, it is recommended to modify the external port (`8124:8123`) instead of setting this value.
123+
(default: `8123`)
124+
125+
`ENCODARR_CONFIG_DIR`, `--config-dir` sets the directory that the configuration files are saved to.
126+
This includes the log file.
127+
In a container, this is pre-set to `/config`.
128+
(default: `<platform user config directory>/encodarr/controller/config`)
129+
130+
#### Runner
131+
132+
`ENCODARR_DEBUG`, `--debug` enables outputting debug messages to the log.
133+
If the environment variable is set to `True`, then debug messages are turned on.
134+
(default: `False`)
135+
136+
`ENCODARR_LOG_FILE` sets the location of the runner log file.
137+
(default: `/config/runner.log`)
138+
139+
`ENCODARR_RUNNER_NAME`, `--name` sets the name to be shown in the Web UI when referring to this runner.
140+
(default: `Runner-<random 3 digit number>`)
141+
142+
`ENCODARR_RUNNER_CONTROLLER_IP`, `--controller-ip` sets the IP for connecting to the Controller.
143+
(default: `localhost`)
144+
145+
`ENCODARR_RUNNER_CONTROLLER_PORT`, `--controller-port` sets the port for connecting to the Controller.
146+
(default: `8123`)
147+
148+
## Contributing
149+
150+
If you want to contribute to this project, head over to [CONTRIBUTING.md](CONTRIBUTING.md) to get started.
151+
Do note that the project is going to be rewritten soon to more closely follow clean architecture guidelines, so contributing to the `master` or `development` branches is not recommended at this time.
152+
153+
## Code of Conduct
26154

27-
### Common
155+
This project holds all maintainers, contributors, and participants to the standards outlined by the Contributor Covenant, a copy of which can be found in [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
28156

29-
- ENCODARR_DEBUG (bool)
157+
## Future Plans
30158

31-
- ENCODARR_LOG_FILE (string)
159+
* Rewrite Runner from Python to Go (following Clean Architecture guidelines)
32160

33-
### Runner
161+
* Rewrite Controller to conform to Clean Architecture guidelines
34162

35-
- ENCODARR_RUNNER_NAME (string)
163+
* Instead of configuring with dropdowns and checkboxes, use a plugin system
36164

37-
- ENCODARR_RUNNER_CONTROLLER_IP (string)
165+
* Massive frontend overhaul
38166

39-
- ENCODARR_RUNNER_CONTROLLER_PORT (integer)
167+
* Scheduled working times
40168

41169
## Attributions
42170

43-
`controller/controller/mediainfo.go` was modified from [pascoej/go-mediainfo](https://github.com/pascoej/go-mediainfo/blob/509f5adb9998a8fe497be4eed69c73d75161709e/mediainfo.go)
171+
`controller/mediainfo/mediainfo.go` was modified from [pascoej/go-mediainfo](https://github.com/pascoej/go-mediainfo/blob/509f5adb9998a8fe497be4eed69c73d75161709e/mediainfo.go).

controller/options/options.go

+9-15
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,16 @@ var port string = "8123"
2020
var configDirConst optionConst = optionConst{"ENCODARR_CONFIG_DIR", "config-dir"}
2121
var configDir string = ""
2222

23-
// TODO: Remove. Search directory is no longer needed because each library has its own.
24-
var searchDirConst optionConst = optionConst{"ENCODARR_SEARCH_DIR", "search-dir"}
25-
var searchDir string = ""
26-
2723
var inputsParsed bool = false
2824

2925
var logger logange.Logger
3026

3127
func init() {
32-
cwd, _ := os.Getwd()
33-
searchDir = cwd
34-
3528
cDir, err := os.UserConfigDir()
3629
if err != nil {
3730
log.Fatalln(err)
3831
}
39-
configDir = cDir + "/encodarr/config"
32+
configDir = cDir + "/encodarr/controller/config"
4033

4134
logger = logange.NewLogger("options")
4235
}
@@ -55,9 +48,7 @@ func parseInputs() {
5548
stringVarFromEnv(&configDir, configDirConst.EnvVar)
5649
stringVar(&configDir, configDirConst.CmdLine, "")
5750

58-
// Search directory
59-
stringVarFromEnv(&searchDir, searchDirConst.EnvVar)
60-
stringVar(&searchDir, searchDirConst.CmdLine, "")
51+
makeConfigDir()
6152

6253
parseCL()
6354

@@ -86,8 +77,11 @@ func ConfigDir() string {
8677
return configDir
8778
}
8879

89-
// SearchDir returns the passed search directory
90-
func SearchDir() string {
91-
parseInputs()
92-
return searchDir
80+
// makeConfigDir creates the options.configDir
81+
func makeConfigDir() {
82+
err := os.MkdirAll(configDir, 0644)
83+
if err != nil {
84+
fmt.Println(err)
85+
logger.Critical(fmt.Sprintf("Failed to create config directory '%v' because of error: %v", configDir, err.Error()))
86+
}
9387
}
+11-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"files": {
3-
"main.css": "/static/css/main.a0813476.chunk.css",
4-
"main.js": "/static/js/main.2ca6d08d.chunk.js",
5-
"main.js.map": "/static/js/main.2ca6d08d.chunk.js.map",
3+
"main.css": "/static/css/main.930f940a.chunk.css",
4+
"main.js": "/static/js/main.abe7b6e2.chunk.js",
5+
"main.js.map": "/static/js/main.abe7b6e2.chunk.js.map",
66
"runtime-main.js": "/static/js/runtime-main.2dd4e8a6.js",
77
"runtime-main.js.map": "/static/js/runtime-main.2dd4e8a6.js.map",
88
"static/css/2.2c2d1656.chunk.css": "/static/css/2.2c2d1656.chunk.css",
@@ -12,19 +12,19 @@
1212
"static/js/3.010aea4f.chunk.js.map": "/static/js/3.010aea4f.chunk.js.map",
1313
"index.html": "/index.html",
1414
"static/css/2.2c2d1656.chunk.css.map": "/static/css/2.2c2d1656.chunk.css.map",
15-
"static/css/main.a0813476.chunk.css.map": "/static/css/main.a0813476.chunk.css.map",
15+
"static/css/main.930f940a.chunk.css.map": "/static/css/main.930f940a.chunk.css.map",
1616
"static/js/2.af4dfa24.chunk.js.LICENSE.txt": "/static/js/2.af4dfa24.chunk.js.LICENSE.txt",
17-
"static/media/Encodarr-Logo.4b0cc1bf.svg": "/static/media/Encodarr-Logo.4b0cc1bf.svg",
18-
"static/media/Info-I.ffc9d3a2.svg": "/static/media/Info-I.ffc9d3a2.svg",
19-
"static/media/addLibraryIcon.dd5f1d29.svg": "/static/media/addLibraryIcon.dd5f1d29.svg",
20-
"static/media/headphones.f1e7bde3.svg": "/static/media/headphones.f1e7bde3.svg",
21-
"static/media/play_button.415684ac.svg": "/static/media/play_button.415684ac.svg"
17+
"static/media/Encodarr-Logo.b8d2df4b.svg": "/static/media/Encodarr-Logo.b8d2df4b.svg",
18+
"static/media/Info-I.4eaee4f4.svg": "/static/media/Info-I.4eaee4f4.svg",
19+
"static/media/addLibraryIcon.22f57e9e.svg": "/static/media/addLibraryIcon.22f57e9e.svg",
20+
"static/media/headphones.d0211b61.svg": "/static/media/headphones.d0211b61.svg",
21+
"static/media/play_button.a97890f5.svg": "/static/media/play_button.a97890f5.svg"
2222
},
2323
"entrypoints": [
2424
"static/js/runtime-main.2dd4e8a6.js",
2525
"static/css/2.2c2d1656.chunk.css",
2626
"static/js/2.af4dfa24.chunk.js",
27-
"static/css/main.a0813476.chunk.css",
28-
"static/js/main.2ca6d08d.chunk.js"
27+
"static/css/main.930f940a.chunk.css",
28+
"static/js/main.abe7b6e2.chunk.js"
2929
]
3030
}

0 commit comments

Comments
 (0)