fix: remove auto-appending of /RPC2 from RTorrentClient and finalize PDCA documentation
Some checks failed
Build and Push Docker Image / build (push) Failing after 40s
CI / Security audit (push) Failing after 45s
CI / Tests & coverage (push) Failing after 55s
Docs Check / Markdown lint (push) Successful in 1m1s
Docs Check / Mermaid diagram parse check (push) Successful in 1m23s
Licence Check / Licence compatibility and copyright header verification (push) Failing after 28s
Some checks failed
Build and Push Docker Image / build (push) Failing after 40s
CI / Security audit (push) Failing after 45s
CI / Tests & coverage (push) Failing after 55s
Docs Check / Markdown lint (push) Successful in 1m1s
Docs Check / Mermaid diagram parse check (push) Successful in 1m23s
Licence Check / Licence compatibility and copyright header verification (push) Failing after 28s
- Remove auto-appending of /RPC2 from RTorrentClient constructor - Use exact URL from config (supports custom paths like whatbox.ca/xmlrpc) - Update .env.sample with clear URL path documentation and examples - Update README.md with comprehensive PDCA section and all download clients - Add URL path verification tests (whatbox.ca, custom paths, no auth) - Update architecture diagram to include Transmission and rTorrent - Update Docker Compose example to include all download clients - Update prerequisites to mention all supported download clients - Update "What It Does" and "The Matching Process" sections
This commit is contained in:
@@ -39,12 +39,11 @@ describe('RTorrentClient', () => {
|
||||
expect(client.getInstanceId()).toBe('test-rtorrent');
|
||||
expect(client.name).toBe('Test rTorrent');
|
||||
expect(client.url).toBe('http://localhost:8080');
|
||||
expect(client.rpcUrl).toBe('http://localhost:8080/RPC2');
|
||||
});
|
||||
|
||||
it('should create xmlrpc client with basic auth when credentials provided', () => {
|
||||
it('should create xmlrpc client with exact URL from config (no auto-append)', () => {
|
||||
expect(xmlrpc.createClient).toHaveBeenCalledWith({
|
||||
url: 'http://localhost:8080/RPC2',
|
||||
url: 'http://localhost:8080',
|
||||
headers: {
|
||||
Authorization: `Basic ${Buffer.from('rtorrent:rtorrent').toString('base64')}`
|
||||
}
|
||||
@@ -56,13 +55,44 @@ describe('RTorrentClient', () => {
|
||||
const noAuthConfig = {
|
||||
id: 'test-rtorrent-noauth',
|
||||
name: 'Test rTorrent No Auth',
|
||||
url: 'http://localhost:8080'
|
||||
url: 'http://localhost:8080/RPC2'
|
||||
};
|
||||
new RTorrentClient(noAuthConfig);
|
||||
expect(xmlrpc.createClient).toHaveBeenCalledWith({
|
||||
url: 'http://localhost:8080/RPC2'
|
||||
});
|
||||
});
|
||||
|
||||
it('should use whatbox.ca-style /xmlrpc path exactly as configured', () => {
|
||||
xmlrpc.createClient.mockClear();
|
||||
const whatboxConfig = {
|
||||
id: 'test-whatbox',
|
||||
name: 'Whatbox',
|
||||
url: 'https://user.whatbox.ca/xmlrpc',
|
||||
username: 'user',
|
||||
password: 'pass'
|
||||
};
|
||||
new RTorrentClient(whatboxConfig);
|
||||
expect(xmlrpc.createClient).toHaveBeenCalledWith({
|
||||
url: 'https://user.whatbox.ca/xmlrpc',
|
||||
headers: {
|
||||
Authorization: `Basic ${Buffer.from('user:pass').toString('base64')}`
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('should use custom RPC path exactly as configured', () => {
|
||||
xmlrpc.createClient.mockClear();
|
||||
const customConfig = {
|
||||
id: 'test-custom',
|
||||
name: 'Custom',
|
||||
url: 'https://example.com/custom/rpc/path'
|
||||
};
|
||||
new RTorrentClient(customConfig);
|
||||
expect(xmlrpc.createClient).toHaveBeenCalledWith({
|
||||
url: 'https://example.com/custom/rpc/path'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Connection Test', () => {
|
||||
|
||||
Reference in New Issue
Block a user