Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 55 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,68 @@
# CDMClient
CDM - Centralized Download Manager Client
**CDM - Centralized Download Manager Client**
CDMClient is the client application for the [CDM Server](https://github.com/radaron/CDMServer/tree/master).

This client communicates with the CDM Server to periodically send the download status from Transmission and check for new torrent files to download. If new torrents are available, they are downloaded and added to Transmission using the `transmission-rpc` library.

## Installation

### Install/Upgrade package
``` shell
### Install or Upgrade the Package
Run the following command to install or upgrade CDMClient:
```shell
python3 -m pip install --upgrade CDMClient --user
```

### Create service
``` shell
echo "[Unit]
Description=cdm-client service
After=multi-user.target
Conflicts=getty@tty1.service
[Service]
User=${USER}
Type=simple
Environment="LC_ALL=C.UTF-8"
Environment="LANG=C.UTF-8"
ExecStart=${HOME}/.local/bin/cdm-client
Restart=on-failure
RestartSec=3
[Install]
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/cdm-client.service
```
``` shell
sudo systemctl daemon-reload
sudo systemctl enable cdm-client.service
sudo systemctl start cdm-client.service
```
### Create a Systemd Service
To set up CDMClient as a systemd service, execute the following commands:

1. Create the service file:
```shell
echo "[Unit]
Description=cdm-client service
After=multi-user.target
Conflicts=getty@tty1.service

[Service]
User=${USER}
Type=simple
Environment="LC_ALL=C.UTF-8"
Environment="LANG=C.UTF-8"
ExecStart=${HOME}/.local/bin/cdm-client
Restart=on-failure
RestartSec=3

## Configuartion
Config file path: ```~/.config/cdm_client/config.ini```
[Install]
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/cdm-client.service
```

This file automatically generated when the service starts. See the example below.
``` ini
2. Reload systemd and enable the service:
```shell
sudo systemctl daemon-reload
sudo systemctl enable cdm-client.service
sudo systemctl start cdm-client.service
```

## Configuration
The configuration file is located at:
```~/.config/cdm_client/config.ini```

This file is automatically generated when the service starts. Below is an example configuration:

```ini
[connection]
server_host =
api_key =
rpc_user =
rpc_password =
server_host = "https://cdm.test.com"
api_key = "1409d6ed79280aadcbe20f8f21981e89"
rpc_user = "admin"
rpc_password = "admin"
```

## Check logs
``` shell
### Configuration Details:
- **`server_host`**: The full URL of the CDM Server (e.g., `https://cdm.server.com`).
- **`api_key`**: The API key generated when adding a new device on the CDM Server's devices page. Refer to the [Devices Page Documentation](https://github.com/radaron/CDMServer/blob/master/doc/USAGE.md#devices-page).
- **`rpc_user`** and **`rpc_password`**: Required only if Transmission RPC authentication is enabled. See the [Transmission RPC Configuration Guide](https://help.ubuntu.com/community/TransmissionHowTo) for more details.

## Viewing Logs
To monitor the service logs, use the following command:
```shell
journalctl -fu cdm-client
```
```
2 changes: 1 addition & 1 deletion cdm_client/cdm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def run(self) -> None:
self._download_files()
except Exception: # pylint: disable=broad-except
self._logger.exception("An error occurred.")
sleep(30)
sleep(10)


def main() -> None:
Expand Down