Skip to content

Commit 84f4ab3

Browse files
authored
Merge pull request #3 from radaron/2-create-readme
Update README
2 parents d4fa4d8 + 9429d3a commit 84f4ab3

2 files changed

Lines changed: 56 additions & 37 deletions

File tree

README.md

Lines changed: 55 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,68 @@
11
# CDMClient
2-
CDM - Centralized Download Manager Client
2+
**CDM - Centralized Download Manager Client**
3+
CDMClient is the client application for the [CDM Server](https://github.com/radaron/CDMServer/tree/master).
4+
5+
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.
36

47
## Installation
58

6-
### Install/Upgrade package
7-
``` shell
9+
### Install or Upgrade the Package
10+
Run the following command to install or upgrade CDMClient:
11+
```shell
812
python3 -m pip install --upgrade CDMClient --user
913
```
1014

11-
### Create service
12-
``` shell
13-
echo "[Unit]
14-
Description=cdm-client service
15-
After=multi-user.target
16-
Conflicts=getty@tty1.service
17-
[Service]
18-
User=${USER}
19-
Type=simple
20-
Environment="LC_ALL=C.UTF-8"
21-
Environment="LANG=C.UTF-8"
22-
ExecStart=${HOME}/.local/bin/cdm-client
23-
Restart=on-failure
24-
RestartSec=3
25-
[Install]
26-
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/cdm-client.service
27-
```
28-
``` shell
29-
sudo systemctl daemon-reload
30-
sudo systemctl enable cdm-client.service
31-
sudo systemctl start cdm-client.service
32-
```
15+
### Create a Systemd Service
16+
To set up CDMClient as a systemd service, execute the following commands:
17+
18+
1. Create the service file:
19+
```shell
20+
echo "[Unit]
21+
Description=cdm-client service
22+
After=multi-user.target
23+
Conflicts=getty@tty1.service
24+
25+
[Service]
26+
User=${USER}
27+
Type=simple
28+
Environment="LC_ALL=C.UTF-8"
29+
Environment="LANG=C.UTF-8"
30+
ExecStart=${HOME}/.local/bin/cdm-client
31+
Restart=on-failure
32+
RestartSec=3
3333
34-
## Configuartion
35-
Config file path: ```~/.config/cdm_client/config.ini```
34+
[Install]
35+
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/cdm-client.service
36+
```
3637

37-
This file automatically generated when the service starts. See the example below.
38-
``` ini
38+
2. Reload systemd and enable the service:
39+
```shell
40+
sudo systemctl daemon-reload
41+
sudo systemctl enable cdm-client.service
42+
sudo systemctl start cdm-client.service
43+
```
44+
45+
## Configuration
46+
The configuration file is located at:
47+
```~/.config/cdm_client/config.ini```
48+
49+
This file is automatically generated when the service starts. Below is an example configuration:
50+
51+
```ini
3952
[connection]
40-
server_host =
41-
api_key =
42-
rpc_user =
43-
rpc_password =
53+
server_host = "https://cdm.test.com"
54+
api_key = "1409d6ed79280aadcbe20f8f21981e89"
55+
rpc_user = "admin"
56+
rpc_password = "admin"
4457
```
4558

46-
## Check logs
47-
``` shell
59+
### Configuration Details:
60+
- **`server_host`**: The full URL of the CDM Server (e.g., `https://cdm.server.com`).
61+
- **`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).
62+
- **`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.
63+
64+
## Viewing Logs
65+
To monitor the service logs, use the following command:
66+
```shell
4867
journalctl -fu cdm-client
49-
```
68+
```

cdm_client/cdm_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def run(self) -> None:
5858
self._download_files()
5959
except Exception: # pylint: disable=broad-except
6060
self._logger.exception("An error occurred.")
61-
sleep(30)
61+
sleep(10)
6262

6363

6464
def main() -> None:

0 commit comments

Comments
 (0)