Merge branch 'master' into dependabot/pip/mkdocs-material-7.3.3

pull/368/head
TRaSH 3 years ago committed by GitHub
commit c0d1b677f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,57 +2,112 @@
!!! note
Being I don't have a Synology myself and I kind of hate the Synology GUI for the dockers, I'm doing this with the use of docker-compose.
Being I don't have a Synology myself and I kind of hate the Synology GUI for the dockers, I'm doing this with the use of docker-compose through a terminal.
This works like 10x faster then the GUI and after adding it shows up in the GUI.
This is faster then the GUI and after installing, it shows up in the Docker GUI.
Thanks to faxity for the initial compose that I used to create the Synology Guide.
We need to get some information that we need later to setup the docker-compose file.
And a very big thanks to [Bokkoman](https://www.buymeacoffee.com/bokkoman){:target="_blank" rel="noopener noreferrer"} and [BZwart](https://github.com/BaukeZwart){:target="_blank" rel="noopener noreferrer"} that updated this Guide for DSM 7 and also offered their help on discord as Synology Support Team.
## PUID and PGID
## Install Docker
In order for the Docker container to access the shares on the Synology,
we need to give it the same permissions as your main user who has access to those shares.
For this we need to figure out the PUID and the PGID of the user having access to your shares.
You need to install Docker from the `Package Center`. This should also create a share named `docker`, check File Station if it is present.
You will need to SSH into your Synology.
If you didn't already enable it you need to do that first
## Create the main share
![!synology-control-panel](images/synology-control-panel.png)
!!! attention
To get Hardlinks and Atomic-Moves working with your Synology you will need to make use of **ONE** share with subfolders.
We will use a new share named `data` (lowercase) for all your library media.
Later in this guide, we will fill this share with subfolders.
To create a new share:
`Control Panel` > `Shared Folder` > click `Create` > choose `Create Shared Folder`
![!create_share](images/create_share.png)
Name this shared folder `data`. You can disable the trash can. Click next until you are done.
## Create a user
For this, we are going to create a new user that only has access to the share(s) that we use for this guide.
Go to `Control Panel` > `User & Group`
In the `User` section, create a new user. Name it whatever you like, but for this guide we will use `docker`.
![!adduser](images/adduser.PNG)
Fill out the rest of the information, generate a password or type your own.
Then use a program like Putty and SSH to your Synology.
Click next, you will now be able to select which group this user will belong to, it should only be `users`. Click `Next`.
Login if you get a popup asking if you want to trust the key,
### Assign shared folder permissions
In this screen you will be able to select which Shares this user will have access to, click `No Access` on the top, this will deny all access.
Now only select `Read/Write` on the shares `docker` and `data`.
![!Assign shared folders permissions](images/adduser_2.PNG)
Click `Next` until you reach `Assign application permissions`
### Assign application permissions
In this screen you will be able to select which application this user will have access to, Check `Deny` for all applications.
![!Assign application permissions](images/adduser_3.PNG)
Continue to click `Next` until you are finished.
## SSH
You are mostly going to use the terminal. Some parts will need the Synology web GUI.
To enable terminal, you need to enable SSH in the Synology Settings.
`Control Panel` > `Terminal & SNMP` > `Enable SSH service`
![!synology-control-panel](images/synology-ssh.png)
Then use a program like [Putty](https://www.putty.org/){:target="_blank" rel="noopener noreferrer"} and you can SSH into your Synology.
If you get a popup asking if you want to trust the key,
Just press `OK` or `ACCEPT`
Enter the login information of your main Synology user account.
### PUID and PGID
In order for the Docker container to access the shares on the Synology, we need to know the user ID (PUID) and group ID (PGID) from the `docker` user we just created.
Go into your terminal app, login to your synology ssh.
Once logged in type `id $user`. Change $user to the newly created username `docker`.
![!synology-id](images/synology-id.png)
Once logged in type `id`.
This will show your UID (aka PUID).
Which in this screenshot is `1026` for the administrator
This will show you the UID (aka PUID).
Which in this screenshot is `1035` for the docker user
and the GID (aka PGID) which is `100` for the users group.
Remember these values for later use.
!!! note
!!! attention
Yes we know it's not recommended to use the admin account but if you already know this then you wouldn't need to read this ;)
It is not recommended to use (anymore) your admin/main user account. That is why we just created a new user.
------
## Folder Structure
!!! attention
To get Hardlinks and Atomic-Moves working with your Synology you will need to make use of **ONE** share with subfolders.
For this example we're going to make use of the share called `data`.
For this example we're going to make use of a share called `data`.
On the host (Synology) terminal you will need to add `/volume1/` before it. So `/volume1/data`
On the host (Synology) you will need to add `/volume1/` before it. So `/volume1/data`
The `data` folder has sub-folders for `torrents` and `usenet` and each of these have sub-folders for `tv`, `movie` and `music` downloads to keep things neat. The `media` folder has nicely named `TV`, `Movies` and `Music` sub-folders, this is your library and what youd pass to Plex, Emby or JellyFin.
The `data` folder has sub-folders for `torrents` and `usenet` and each of these have sub-folders for `tv`, `movie` and `music` downloads to keep things neat. The `library` folder has nicely named `tv`, `movies` and `music` sub-folders, this is your library and what youd pass to Plex, Emby or JellyFin.
These subfolders you need to create your self.
@ -69,41 +124,45 @@ data
│ ├── music
│ └── tv
└── media
├── movies
├── music
└── tv
├── movies
├── music
└── tv
```
--8<-- "includes/hardlinks/breakdown-folder-structure.md"
------
## Appdata
### Create the needed subfolder
Your appdata will be stored in `/volume1/docker/appdata/{appname}`
These `{appname}` sub folders you need to create your self. (*This is a limitation of the Synology*)
We're going to do this in Putty or a similar program.
Here we will create the needed subfolders for your media library and also for your preferred download client.
If you use both then run both commands
#### If you use usenet
```bash
sudo mkdir /volume1/docker/appdata
cd /volume1/docker/appdata
sudo mkdir radarr sonarr bazarr plex tautulli pullio
# The following is needed for plex transcode location
sudo mkdir /tmp/plex
sudo mkdir -p /volume1/data/{usenet/{tv,movies,music},media/{tv,movies,music}}
```
??? bug "plex transcode location `/tmp/plex` - [CLICK TO EXPAND]"
The extra created `/tmp/plex` folder for plex's transcode location won't survive a reboot.
#### If you use torrents
```bash
sudo mkdir -p /volume1/data/{torrents/{tv,movies,music},media/{tv,movies,music}}
```
so you will need to create in your task scheduler a "triggered task" that runs on startup of the nas.
------
Add the following command as root: `mkdir /tmp/plex/`
### Appdata
![!Create task](images/synology-create-task.png)
Your appdata will be stored in `/volume1/docker/appdata/{appname}`
These `{appname}` sub folders you need to create your self. (*This is a limitation of the Synology*)
We're going to do this in Putty or a similar program.
![!Create task](images/synology-task-settings.png)
```bash
sudo mkdir -p /volume1/docker/appdata/{radarr,sonarr,bazarr,plex,pullio}
```
If you need extra help please come to [![Discord chat](https://img.shields.io/discord/492590071455940612?style=for-the-badge&color=4051B5&logo=discord)](https://trash-guides.info/discord){:target="_blank" rel="noopener noreferrer"}
You can add your own sub folders for your download client(s) using the command above.
So your appdata folder will look like this.
@ -119,19 +178,26 @@ docker
├── bazarr
├── plex
├── pullio
└── tautulli
└── (your download client, i.e. nzbget; sabnzbd; qbittorrent)
```
------
## Needed files
First we will download the `docker-compose.yml` file
Now we are ready to move to the installation of containers.
For this, we need two files:
1. `docker-compose.yml`
1. `.env`
We will start with downloading the `docker-compose.yml` file
Download this [docker-compose.yml](https://github.com/TRaSH-/Guides-Synology-Templates/blob/main/docker-compose/docker-compose.yml){:target="_blank" rel="noopener noreferrer"} to your `/volume1/docker/appdata` location so you got your important stuff together.
```bash
sudo wget https://raw.githubusercontent.com/TRaSH-/Guides-Synology-Templates/main/docker-compose/docker-compose.yml
sudo wget https://raw.githubusercontent.com/TRaSH-/Guides-Synology-Templates/main/docker-compose/docker-compose.yml -P /volume1/docker/appdata/
```
??? question "What's included and What's not included - [CLICK TO EXPAND]"
@ -142,11 +208,10 @@ sudo wget https://raw.githubusercontent.com/TRaSH-/Guides-Synology-Templates/mai
- Sonarr
- Bazarr (Subtitle searcher and downloaded)
- Plex
- Tautulli
What's not included.
I didn't add a downloader to it because it depends on what you prefer usenet/torrents and which client you prefer, so i created a new [Repository](https://github.com/TRaSH-/Guides-Synology-Templates){:target="_blank" rel="noopener noreferrer"} on Github where I provide and maintain some templates that you can find in the `template` folder ready to use with the main `docker-compose.yml`.
I didn't add a download client to it, because it depends on what you prefer (usenet/torrent) and which client you prefer, so I created a new [Repository](https://github.com/TRaSH-/Guides-Synology-Templates/tree/main/templates){:target="_blank" rel="noopener noreferrer"} on Github where I provide and maintain some templates that are ready to use with the main `docker-compose.yml`.
The only thing you need to do is copy/paste what's inside the `.yml` file in to the main `docker-compose.yml`, the template also has the command what you need to use to create the [appdata](#appdata) folder that we explained earlier.
@ -155,7 +220,7 @@ Second we will download the `.env` file
Download this [.env](https://github.com/TRaSH-/Guides-Synology-Templates/blob/main/docker-compose/.env){:target="_blank" rel="noopener noreferrer"} to your `/volume1/docker/appdata` location so you got your important stuff together.
```bash
sudo wget https://raw.githubusercontent.com/TRaSH-/Guides-Synology-Templates/main/docker-compose/.env
sudo wget https://raw.githubusercontent.com/TRaSH-/Guides-Synology-Templates/main/docker-compose/.env -P /volume1/docker/appdata/
```
!!! attention
@ -163,23 +228,28 @@ sudo wget https://raw.githubusercontent.com/TRaSH-/Guides-Synology-Templates/mai
------
### Changes you need to do
### Changes and preparations
The `.env` we downloaded holds the variables/information you need to change so everything works (I added also a description in the `.env` file)
!!! tip
If you need to edit docker-compose.yml ot he .env file we advise to use [Notepad++](https://notepad-plus-plus.org/){:target="_blank" rel="noopener noreferrer"} or [Visual Studio Code](https://code.visualstudio.com/){:target="_blank" rel="noopener noreferrer"}
!!! info ""
The `.env` holds more variables/information for other containers
The `.env` file we downloaded holds the variables/information you need to change in order for everything to work. I added explanations in the `.env` file.
1. DOCKERCONFDIR (only change this if you know what you're doing and decide to use another path then in this guide used)
1. DOCKERDATADIR (only change this if you know what you're doing and decide to use another path then in this guide used)
1. PUID/PGID (this info you got earlier from [HERE](#puid-and-pgid))
1. TZ (Change to your timezone)
1. DOCKERCONFDIR (only change this if you know what you're doing and decide to use another path than this guide used)
1. DOCKERDATADIR (only change this if you know what you're doing and decide to use another path than this guide used)
1. PUID/PGID (this info you got earlier from [HERE](#puid-and-pgid)
1. TZ (Change to your timezone, can be found [HERE](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones){:target="_blank" rel="noopener noreferrer"}
1. Install and Create a task scheduler for Pullio, so your containers stay up to date.
!!! info ""
The `.env` holds more variables/information for other containers you don't need to remove those variables and will be only used when you install the other containers.
------
#### Pullio - Auto update docker-compose the correct way
Pullio allows you to automatically update your containers. And send you a notification through various means. In my setup, I use a Discord Webhook.
First you need to download Pullio
```bash
@ -187,9 +257,9 @@ First you need to download Pullio
sudo chmod +x /usr/local/bin/pullio
```
For Pullio you will need to create in your task scheduler a "triggered task" that runs for example at 4am at night with root privileges.
For Pullio to work, you will need to create in your Task Scheduler a "triggered task" that runs for example at 4am at night with root privileges.
Add the following 2 lines to your triggered task
Add the following line to your triggered task
```bash
/usr/local/bin/pullio > /volume1/docker/appdata/pullio/pullio.log 2>&1
@ -204,10 +274,10 @@ More info about Pullio [HERE](https://hotio.dev/pullio/){:target="_blank" rel="n
Now we need to make sure that the newly created files and folders have the correct permissions.
!!! note
If you're using another user then `admin` then you need to change it in the commands below !!!
If you're using another user than `docker`, then you need to change it in the commands below !!!
```bash
sudo chown -R admin:users /volume1/data /volume1/docker
sudo chown -R docker:users /volume1/data /volume1/docker
sudo chmod -R a=,a+rX,u+w,g+w /volume1/data /volume1/docker
```
@ -216,7 +286,8 @@ sudo chmod -R a=,a+rX,u+w,g+w /volume1/data /volume1/docker
## Run the Docker Compose
!!! important
make sure you deleted/removed all your existing dockers from the GUI and also remove your native installs of these applications !!!
make sure you delete/remove all your existing dockers from the Docker GUI and also remove your native installs (in Package Center) of these applications !!!
If you had previous installed apps, make a backup of their config folders.
When you did all the above steps you only need to type the following in your `/volume1/docker/appdata`
@ -225,7 +296,7 @@ cd /volume1/docker/appdata
sudo docker-compose up -d
```
You will notice that all the images will be downloaded, and after that the containers will be started. If you get a error then look at the error what it says and try to fix it. If you still got issues then put your used docker-compose.yml on [0bin](https://0bin.net/){:target="_blank" rel="noopener noreferrer"} and join the guides-discord [here](https://trash-guides.info/discord){:target="_blank" rel="noopener noreferrer"} and provide the pastebin link with the error, have patience because of timezone differences.
You will notice that all the images will be downloaded, after that the containers will be started. If you get a error then look at the error what it says and try to fix it. If you still got issues then put your used docker-compose.yml on [0bin](https://0bin.net/){:target="_blank" rel="noopener noreferrer"} and join the guides-discord [here](https://trash-guides.info/discord){:target="_blank" rel="noopener noreferrer"} and provide the pastebin link with the error, have patience because of timezone differences.
------
@ -233,10 +304,10 @@ You will notice that all the images will be downloaded, and after that the conta
!!! attention
If you need to do any changes only edit the `docker-compose.yml` file and activate the changes when you type `sudo docker-compose up -d` again.
If you need to do any changes, only edit the `docker-compose.yml` file. To activate the changes, run the command `sudo docker-compose -f /volume1/docker/appdata/docker-compose.yml up -d` again.
Any changes you do/did in the GUI will be reverted when you run the docker-compose.
Any changes you do/did in the GUI will be reverted when you run the docker-compose command.
Just don't use the GUI !!!
Just don't use the GUI, only for information purposes !!!
--8<-- "includes/hardlinks/docker-compose-commands.md"

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Loading…
Cancel
Save