mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-10-25 22:10:49 +00:00
78edc5eaf4
Add allowlisted configuration management, permission diagnostics, safe service control, and repair workflows across native and Docker installers. Integrate panel capability checks with broker-backed writes and rollback, and document/test the lifecycle contract. Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow)
24 lines
902 B
JavaScript
24 lines
902 B
JavaScript
'use strict';
|
|
|
|
const {
|
|
ALLOWED_BETTERDESK_SERVICES,
|
|
isAllowedBetterDeskService,
|
|
getMutableFileRoots,
|
|
} = require('../services/serverManagement');
|
|
|
|
describe('server management safety boundaries', () => {
|
|
test('allows only BetterDesk service names', () => {
|
|
expect(isAllowedBetterDeskService('betterdesk-server')).toBe(true);
|
|
expect(isAllowedBetterDeskService('betterdesk-console.service')).toBe(true);
|
|
expect(isAllowedBetterDeskService('sshd')).toBe(false);
|
|
expect(ALLOWED_BETTERDESK_SERVICES.has('docker')).toBe(false);
|
|
});
|
|
|
|
test('mutation roots are limited to BetterDesk paths', () => {
|
|
const roots = getMutableFileRoots();
|
|
expect(roots.some((root) => root.includes('rustdesk') || root.includes('BetterDesk'))).toBe(true);
|
|
expect(roots).not.toContain('/var/log');
|
|
expect(roots).not.toContain('/tmp');
|
|
});
|
|
});
|