README: refresh screenshots (new title bar, feature toolbar, VPN options) and add SFTP; add scripts/screenshots.js to regenerate them with demo data and simulated connections
Co-Authored-By: Claude Opus 5.5 <[email protected]>
No files matched your search
@@ -79,9 +79,9 @@ RDP, SFTP, port forwarding and VPN are only available in the desktop app.
|
||||
|  |  |
|
||||
| **Docker & Podman** containers with CPU and memory usage | **Firewall** rules for UFW and iptables |
|
||||
|  |  |
|
||||
| **Network**: interfaces, bonds (LACP), bridges, gateway and DNS | **VPN**: WireGuard and OpenVPN, connected automatically per host |
|
||||
|  | |
|
||||
| **Settings**: language, app lock, LAN sync and themes | |
|
||||
| **Network**: interfaces, bonds (LACP), bridges, gateway and DNS | **VPN**: WireGuard and OpenVPN, connected automatically per host when it isn't reachable directly |
|
||||
|  |  |
|
||||
| **SFTP**: local and remote side by side, drag & drop between them | **Settings**: language, app lock, LAN sync and themes |
|
||||
|
||||
## Web version (Docker)
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 655 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 868 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 576 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 647 KiB |
@@ -0,0 +1,264 @@
|
||||
// README-Screenshots mit Demo-Daten erzeugen: npx electron scripts/screenshots.js (läuft ca. 20 s im Hintergrund)
|
||||
// Startet MrTerm mit einem leeren Profil und einem Demo-Tresor. SSH, SFTP, Docker, Firewall und Netzwerk
|
||||
// werden simuliert (keine echten Verbindungen), die Bilder landen in docs/screenshots/.
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
const { app, ipcMain, BrowserWindow } = require('electron');
|
||||
|
||||
const ROOT = path.join(__dirname, '..');
|
||||
const OUT = path.join(ROOT, 'docs', 'screenshots');
|
||||
const profile = path.join(os.tmpdir(), 'mrterm-screenshots');
|
||||
fs.rmSync(profile, { recursive: true, force: true });
|
||||
fs.mkdirSync(profile);
|
||||
app.setPath('userData', profile);
|
||||
process.env.MRTERM_SCREENSHOTS = '1';
|
||||
|
||||
// ---------------------------------------------------------------- Demo-Tresor
|
||||
const now = Date.now();
|
||||
const G = { home: 'g-homelab', cloud: 'g-cloud' };
|
||||
const host = (id, label, address, username, color, groupId, extra = {}) => ({ id, label, address, port: 22, username, protocol: 'ssh', groupId, color, auth: 'password', ...extra });
|
||||
const vault = {
|
||||
version: 1,
|
||||
groups: [{ id: G.cloud, label: 'Cloud', parentId: null }, { id: G.home, label: 'Homelab', parentId: null }],
|
||||
hosts: [
|
||||
host('h-pve', 'pve', '192.168.0.20', 'root', '#3ecf8e', G.home),
|
||||
host('h-docker', 'docker-host', '192.168.0.30', 'admin', '#ffb454', G.home),
|
||||
host('h-ha', 'home-assistant', '192.168.0.40', 'root', '#c792ea', G.home),
|
||||
host('h-nas', 'nas', '192.168.0.10', 'admin', '#ff6b6b', G.home),
|
||||
host('h-win', 'win11-workstation', '192.168.0.55', 'louis', '#ff5c7a', G.home, { protocol: 'rdp', port: 3389 }),
|
||||
host('h-db', 'db-primary', '10.20.0.5', 'deploy', '#8b93a7', G.cloud, { vpnId: 'v-office', jumpHostId: 'h-web1' }),
|
||||
host('h-web1', 'web-01', '203.0.113.11', 'deploy', '#7c83ff', G.cloud, { auth: 'key', keyId: 'k-deploy' }),
|
||||
host('h-web2', 'web-02', '203.0.113.12', 'deploy', '#3ecf8e', G.cloud, { auth: 'key', keyId: 'k-deploy' }),
|
||||
],
|
||||
keys: [{ id: 'k-deploy', label: 'deploy@ci', type: 'ed25519', publicKey: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDemoKeyOnlyForScreenshots deploy@ci', privateKey: '' }],
|
||||
snippets: [
|
||||
{ id: 's1', label: 'System update', command: 'sudo apt update && sudo apt upgrade -y', autoRun: true },
|
||||
{ id: 's2', label: 'Disk usage', command: 'df -h -x tmpfs', autoRun: true },
|
||||
],
|
||||
forwards: [],
|
||||
vpns: [
|
||||
{ id: 'v-office', type: 'wireguard', label: 'Office', config: '[Interface]\nPrivateKey = demo\nAddress = 10.8.0.2/32\n\n[Peer]\nPublicKey = demo\nEndpoint = vpn.example.com:51820\nAllowedIPs = 10.20.0.0/16', disconnectOnQuit: true, onlyIfUnreachable: true, disconnectOnClose: true },
|
||||
{ id: 'v-hetzner', type: 'openvpn', label: 'Datacenter', config: 'client\ndev tun\nremote vpn.example.net 1194', disconnectOnQuit: true, onlyIfUnreachable: true },
|
||||
],
|
||||
knownHosts: {},
|
||||
history: [{ hostId: 'h-pve', at: now - 60000 }, { hostId: 'h-docker', at: now - 3600000 }],
|
||||
aiChats: [],
|
||||
tombstones: [],
|
||||
settings: { language: 'en', updateAutoCheck: false },
|
||||
};
|
||||
fs.writeFileSync(path.join(profile, 'vault.dat'), JSON.stringify(vault));
|
||||
|
||||
// ---------------------------------------------------------------- Simulierte Verbindungen
|
||||
// Anzeige wie mit System-Keyring ("Vault encrypted"), die Demo-Datei bleibt trotzdem lesbar
|
||||
const { Store } = require('../src/main/store');
|
||||
const load = Store.prototype.load;
|
||||
Store.prototype.load = function () { const d = load.call(this); this.encrypted = true; return d; };
|
||||
Store.prototype.save = function () {};
|
||||
const { SshManager } = require('../src/main/ssh');
|
||||
const { DockerManager } = require('../src/main/docker');
|
||||
const { FirewallManager, parseUfw, parseIptables } = require('../src/main/firewall');
|
||||
const { NetworkConfigManager } = require('../src/main/network');
|
||||
const { VpnManager } = require('../src/main/vpn');
|
||||
|
||||
const TERM = [
|
||||
'\x1b[1;32mroot@pve\x1b[0m:\x1b[1;34m~\x1b[0m# fastfetch --logo none',
|
||||
'\x1b[1;36mroot\x1b[0m@\x1b[1;36mpve\x1b[0m', '---------',
|
||||
'\x1b[1;36mOS\x1b[0m: Proxmox VE 8.2.4 (Debian 12 bookworm) x86_64',
|
||||
'\x1b[1;36mKernel\x1b[0m: 6.8.12-1-pve',
|
||||
'\x1b[1;36mUptime\x1b[0m: 41 days, 3 hours, 12 mins',
|
||||
'\x1b[1;36mCPU\x1b[0m: AMD Ryzen 9 5950X (32) @ 5.05 GHz',
|
||||
'\x1b[1;36mMemory\x1b[0m: 38.21 GiB / 125.71 GiB (30%)',
|
||||
'\x1b[1;36mDisk (/)\x1b[0m: 18.4 GiB / 94.0 GiB (20%) - ext4',
|
||||
'\x1b[1;36mLocal IP (vmbr0)\x1b[0m: 192.168.0.20/24', '',
|
||||
'\x1b[1;32mroot@pve\x1b[0m:\x1b[1;34m~\x1b[0m# qm list',
|
||||
' VMID NAME STATUS MEM(MB) BOOTDISK(GB) PID',
|
||||
' 100 docker-host \x1b[32mrunning\x1b[0m 16384 64.00 2231',
|
||||
' 101 home-assistant \x1b[32mrunning\x1b[0m 4096 32.00 2318',
|
||||
' 102 win11 \x1b[31mstopped\x1b[0m 8192 128.00 0',
|
||||
' 103 k3s-node-1 \x1b[32mrunning\x1b[0m 8192 40.00 2502', '',
|
||||
'\x1b[1;32mroot@pve\x1b[0m:\x1b[1;34m~\x1b[0m# systemctl --failed',
|
||||
' UNIT LOAD ACTIVE SUB DESCRIPTION', '0 loaded units listed.',
|
||||
'\x1b[1;32mroot@pve\x1b[0m:\x1b[1;34m~\x1b[0m# ',
|
||||
].join('\r\n');
|
||||
SshManager.prototype.openShell = async (sid, h, size, send) => { setTimeout(() => send('data', TERM), 300); };
|
||||
SshManager.prototype.write = () => {};
|
||||
SshManager.prototype.resize = () => {};
|
||||
SshManager.prototype.close = () => {};
|
||||
|
||||
const day = 86400000;
|
||||
const file = (name, size, age, isDir = false) => ({ name, size, mtime: now - age, isDir, isLink: false, mode: isDir ? 0o40755 : 0o100644 });
|
||||
const REMOTE = {
|
||||
'/root': [file('backups', 4096, 2 * day, true), file('scripts', 4096, 9 * day, true), file('iso', 4096, 30 * day, true),
|
||||
file('.bashrc', 3526, 200 * day), file('.profile', 161, 200 * day), file('cluster-notes.md', 4812, 3 * day),
|
||||
file('vzdump-qemu-100.vma.zst', 8455716864, 1 * day), file('pve-backup.sh', 1893, 12 * day), file('interfaces.bak', 702, 40 * day)],
|
||||
};
|
||||
SshManager.prototype.openSftp = async () => ({ home: '/root' });
|
||||
SshManager.prototype.sftpList = async (id, dir) => REMOTE[dir] || [];
|
||||
|
||||
const CONTAINERS = [
|
||||
['gitea', 'gitea/gitea:1.22', 'running', 'Up 3 days', '0.0.0.0:2222->22/tcp', '0.35%', '154.0MiB'],
|
||||
['nextcloud', 'nextcloud:29-apache', 'running', 'Up 12 days (healthy)', '', '1.84%', '412.7MiB'],
|
||||
['nextcloud-db', 'mariadb:11', 'running', 'Up 12 days', '3306/tcp', '0.47%', '188.2MiB'],
|
||||
['traefik', 'traefik:v3.1', 'running', 'Up 12 days', '0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp', '0.21%', '48.3MiB'],
|
||||
['uptime-kuma', 'louislam/uptime-kuma:1', 'running', 'Up 12 days (healthy)', '3001/tcp', '0.92%', '96.4MiB'],
|
||||
['vaultwarden', 'vaultwarden/server:latest', 'running', 'Up 5 days (healthy)', '', '0.03%', '22.9MiB'],
|
||||
['backup-restic', 'restic/restic:0.17', 'exited', 'Exited (0) 6 hours ago', '', '', ''],
|
||||
].map(([name, image, state, status, ports, cpu, mem], i) => ({ id: `c0ffee00${i}abc`, name, image, state, status, ports, cpu, mem }));
|
||||
const dockerList = async () => ({ runtime: 'docker', sudo: false, containers: CONTAINERS.map(({ cpu, mem, ...c }) => c) });
|
||||
DockerManager.prototype.open = dockerList;
|
||||
DockerManager.prototype.list = dockerList;
|
||||
DockerManager.prototype.stats = async () => Object.fromEntries(CONTAINERS.filter((c) => c.cpu).map((c) => [c.id, { cpu: c.cpu, mem: `${c.mem} / 125.7GiB` }]));
|
||||
DockerManager.prototype.close = () => {};
|
||||
|
||||
const UFW = `Status: active
|
||||
|
||||
To Action From
|
||||
-- ------ ----
|
||||
[ 1] 22/tcp ALLOW IN 192.168.0.0/24 # SSH (MrTerm)
|
||||
[ 2] 8006/tcp ALLOW IN 192.168.0.0/24 # Proxmox web UI
|
||||
[ 3] 80,443/tcp ALLOW IN Anywhere # traefik
|
||||
[ 4] 2222/tcp LIMIT IN Anywhere # gitea ssh
|
||||
[ 5] 3306/tcp DENY IN Anywhere
|
||||
[ 6] 51820/udp ALLOW IN Anywhere # WireGuard
|
||||
[ 7] 80,443/tcp (v6) ALLOW IN Anywhere (v6) # traefik
|
||||
[ 8] 51820/udp (v6) ALLOW IN Anywhere (v6) # WireGuard`;
|
||||
const IPT = `-P INPUT DROP
|
||||
-P FORWARD DROP
|
||||
-P OUTPUT ACCEPT
|
||||
-A INPUT -i lo -j ACCEPT
|
||||
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
||||
-A INPUT -s 192.168.0.0/24 -p tcp -m tcp --dport 22 -j ACCEPT
|
||||
-A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT`;
|
||||
FirewallManager.prototype.open = async () => ({ tools: ['ufw', 'iptables', 'ip6tables'], sudo: false });
|
||||
FirewallManager.prototype.list = async (id, b) => (b === 'ufw' ? { ...parseUfw(UFW), defaults: { incoming: 'deny', outgoing: 'allow', routed: 'disabled' } } : { chains: parseIptables(IPT) });
|
||||
FirewallManager.prototype.close = () => {};
|
||||
|
||||
const link = (ifname, mac, extra = {}) => ({ ifname, address: mac, mtu: 1500, operstate: 'UP', link_type: 'ether', ...extra });
|
||||
const GATHER = `@@HOSTNAME
|
||||
pve
|
||||
@@OS
|
||||
Debian GNU/Linux 12 (bookworm)
|
||||
@@BACKEND
|
||||
ifupdown
|
||||
@@LINK
|
||||
${JSON.stringify([
|
||||
link('lo', '00:00:00:00:00:00', { link_type: 'loopback' }),
|
||||
link('eno1', 'a4:bf:01:11:22:01', { master: 'bond0', linkinfo: { info_slave_kind: 'bond' } }),
|
||||
link('eno2', 'a4:bf:01:11:22:02', { master: 'bond0', linkinfo: { info_slave_kind: 'bond' } }),
|
||||
link('eno3', 'a4:bf:01:11:22:03', { operstate: 'DOWN' }),
|
||||
link('bond0', 'a4:bf:01:11:22:01', { master: 'vmbr0', linkinfo: { info_kind: 'bond', info_slave_kind: 'bridge' } }),
|
||||
link('vmbr0', 'a4:bf:01:11:22:01', { linkinfo: { info_kind: 'bridge' } }),
|
||||
])}
|
||||
@@ADDR
|
||||
${JSON.stringify([{ ifname: 'vmbr0', addr_info: [{ family: 'inet', local: '192.168.0.20', prefixlen: 24, scope: 'global' }, { family: 'inet6', local: '2a01:598::20', prefixlen: 64, scope: 'global' }] }])}
|
||||
@@ROUTE
|
||||
${JSON.stringify([{ gateway: '192.168.0.1', dev: 'vmbr0' }])}
|
||||
@@ROUTE6
|
||||
[]
|
||||
@@RESOLVTYPE
|
||||
file
|
||||
@@RESOLV
|
||||
search home.lan
|
||||
nameserver 192.168.0.202
|
||||
nameserver 1.1.1.1
|
||||
@@BONDING
|
||||
== bond0
|
||||
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
|
||||
Transmit Hash Policy: layer2+3 (2)
|
||||
MII Status: up
|
||||
LACP rate: fast
|
||||
|
||||
Slave Interface: eno1
|
||||
MII Status: up
|
||||
Speed: 1000 Mbps
|
||||
Aggregator ID: 1
|
||||
|
||||
Slave Interface: eno2
|
||||
MII Status: up
|
||||
Speed: 1000 Mbps
|
||||
Aggregator ID: 1
|
||||
@@IFUPDOWN
|
||||
==FILE /etc/network/interfaces
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
auto eno1
|
||||
iface eno1 inet manual
|
||||
|
||||
auto eno2
|
||||
iface eno2 inet manual
|
||||
|
||||
auto bond0
|
||||
iface bond0 inet manual
|
||||
bond-slaves eno1 eno2
|
||||
bond-miimon 100
|
||||
bond-mode 802.3ad
|
||||
bond-xmit-hash-policy layer2+3
|
||||
bond-lacp-rate fast
|
||||
|
||||
auto vmbr0
|
||||
iface vmbr0 inet static
|
||||
address 192.168.0.20/24
|
||||
gateway 192.168.0.1
|
||||
bridge-ports bond0
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
||||
@@FILES
|
||||
/etc/network/interfaces
|
||||
@@PENDING
|
||||
@@END`;
|
||||
NetworkConfigManager.prototype.open = async function (id, h) { this.sessions.set(id, { host: h, sudo: false }); return this.read(id); };
|
||||
NetworkConfigManager.prototype.rootOk = async () => GATHER;
|
||||
NetworkConfigManager.prototype.close = () => {};
|
||||
|
||||
VpnManager.prototype.status = async () => ({ 'v-office': true });
|
||||
VpnManager.prototype.ensureForHost = async () => false;
|
||||
|
||||
// Lokale Dateien nicht vom echten Rechner zeigen
|
||||
const LOCAL = '/home/louis';
|
||||
const LOCAL_FILES = [file('Documents', 4096, 1 * day, true), file('Downloads', 4096, 0.1 * day, true), file('Projects', 4096, 2 * day, true),
|
||||
file('proxmox-ve_8.2-1.iso', 1356732416, 60 * day), file('nextcloud-compose.yml', 2214, 5 * day), file('notes.txt', 912, 1 * day)];
|
||||
const realHandle = ipcMain.handle.bind(ipcMain);
|
||||
const MOCK = { 'local:home': () => LOCAL, 'local:list': () => LOCAL_FILES, 'local:roots': () => [] };
|
||||
ipcMain.handle = (ch, fn) => realHandle(ch, MOCK[ch] ? async () => ({ ok: true, value: MOCK[ch]() }) : fn);
|
||||
|
||||
require('../src/main/main.js');
|
||||
|
||||
// ---------------------------------------------------------------- Ablauf
|
||||
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
app.whenReady().then(async () => {
|
||||
await sleep(2500);
|
||||
const win = BrowserWindow.getAllWindows()[0];
|
||||
win.setSize(1360, 860);
|
||||
win.show(); win.focus();
|
||||
win.webContents.setBackgroundThrottling(false);
|
||||
const js = (code) => win.webContents.executeJavaScript(`(async () => { ${code} })()`);
|
||||
const shot = async (name, code, wait = 1200) => {
|
||||
await js(code); await sleep(wait);
|
||||
// Neu zeichnen erzwingen, sonst liefert capturePage gelegentlich das vorige Bild
|
||||
win.webContents.invalidate();
|
||||
await js('await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)));');
|
||||
await sleep(300);
|
||||
fs.writeFileSync(path.join(OUT, name + '.png'), (await win.webContents.capturePage()).toPNG());
|
||||
console.log('✓', name);
|
||||
};
|
||||
const host = (id) => `S.vault.hosts.find((x) => x.id === '${id}')`;
|
||||
const home = `activateTab('home');`;
|
||||
const closeDrawer = `document.querySelectorAll('.drawer-bg, .modal-bg').forEach((e) => e.remove());`;
|
||||
try {
|
||||
await shot('hosts', `goGroup('${G.home}');`);
|
||||
await shot('edit-host', `editHost(${host('h-db')});`);
|
||||
await js(closeDrawer);
|
||||
await shot('vpn', `${home} $('#sidebar .nav[data-view=vpns]').click(); editVpn(S.vault.vpns[0]);`);
|
||||
await js(closeDrawer);
|
||||
await shot('settings', `$('#sidebar .nav[data-view=settings]').click();`);
|
||||
await js(`$('#sidebar .nav[data-view=hosts]').click();`);
|
||||
await shot('terminal', `openTerminal(${host('h-pve')});`, 1800);
|
||||
await shot('sftp', `openSftp(${host('h-pve')});`);
|
||||
await shot('docker', `openDocker(${host('h-pve')});`);
|
||||
await shot('firewall', `openFirewall(${host('h-pve')});`);
|
||||
await shot('network', `openNetwork(${host('h-pve')});`);
|
||||
} catch (e) { console.error(e); process.exitCode = 1; }
|
||||
app.exit();
|
||||
});
|
||||