Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ body:
- AdGuard Home
- Cleanuparr
- Gotify
- Docker Host (terminal)
- Unraid
- Something else
validations:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ external URLs.
- **Wake-on-LAN.** Store your machines (MAC / broadcast / port) in the
profile and wake them from Settings; magic packets are sent with pure
Dart UDP.
- **Terminal.** Add your server as a Docker Host to get a Termux-style SSH
terminal (password or private key, host keys pinned on first use). Give a
service its container name - or pick it from `docker ps` - and long-press
it in the sidebar to open a shell inside that container. Every shell is a
tab on the host's one SSH connection, kept alive while you use the app.
- **Reverse-proxy friendly.** Global and per-instance custom HTTP
headers (Authelia / Cloudflare Access style) ride every request. See
[Behind a reverse proxy](docs/REVERSE_PROXY.md).
Expand Down Expand Up @@ -90,6 +95,7 @@ each one covers:
| AdGuard Home | protection switch and timed pause, statistics, top clients and domains, query log with block and unblock, blocklists, custom rules, blocked services and rewrites, persistent and runtime clients, DNS, cache, access and retention settings, dashboard widget |
| Cleanuparr | system status, operational metrics, active strikes ledger & reset, audit events feed, background cleaner job triggers, dashboard widget (beta) |
| Unraid | array and disk health, system with per-core load, Docker, VM control |
| Docker Host | SSH terminal (tabs, extra-keys row, host-key pinning) and a shell inside each service's container over one shared connection (beta) |

## Install

Expand Down
8 changes: 8 additions & 0 deletions STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ Atrium is a **controller** app. Video playback was removed by design
over pure Dart UDP), **custom HTTP headers** (global + per-instance,
for reverse-proxy auth, kept intact when an instance's own form is
saved), all carried by profile export/import
- **Docker Host terminal** (beta): a Termux-style SSH terminal to the
server (password or private key, kept in the keystore; host keys pinned
on first use), with tabs, an extra-keys row and copy/paste. A service
given its container name - typed or picked from `docker ps` - opens a
shell inside that container from its sidebar long-press. Every shell is a
channel on the host's one SSH connection, which closes once the last
shell exits, after 5 minutes in the background, or when the app closes.
Plain `docker` only for now (no `sudo docker` / podman)
- **Shares and links**: a magnet or `.torrent` shared to Atrium goes to a
torrent client; a movie or show shared from another app (an IMDb, TMDB,
Letterboxd or Trakt link, Showly's text, or a bare title) is looked up on
Expand Down
22 changes: 21 additions & 1 deletion app/lib/src/health_providers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import 'package:core_networking/core_networking.dart';
import 'package:core_profile/core_profile.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import 'terminal/ssh_host_status.dart';
import 'terminal/terminal_hub.dart';

/// The shared [HealthProbe], built from the networking [DioFactory].
final Provider<HealthProbe> healthProbeProvider = Provider<HealthProbe>((
Ref ref,
Expand All @@ -15,9 +18,26 @@ final Provider<HealthProbe> healthProbeProvider = Provider<HealthProbe>((
/// Keyed by `instanceId` (String) so Riverpod caches results across instance
/// object recreations and avoids redundant health probes when scrolling.
final instanceHealthProvider =
FutureProvider.family<Health, String>((Ref ref, String instanceId) {
FutureProvider.family<Health, String>((Ref ref, String instanceId) async {
final Instance? instance = ref.watch(instanceByIdProvider(instanceId));
if (instance == null) return Health.unknown;
if (instance.kind == ServiceKind.dockerHost) {
// Rebuilt when a real login succeeds or is refused, so the dot follows
// at once rather than at the next poll.
final SshLoginRecord? lastLogin = ref.watch(
sshLoginRecordsProvider
.select((Map<String, SshLoginRecord> m) => m[instanceId]),
);
if (ref.read(terminalHubProvider).session(instanceId).status ==
SshStatus.connected) {
// No need to probe a server we are logged in to right now.
return Health.ok;
}
return dockerHostHealth(
probe: await ref.watch(healthProbeProvider).check(instance),
lastLogin: lastLogin,
);
}
return ref.watch(healthProbeProvider).check(instance);
});

Expand Down
74 changes: 74 additions & 0 deletions app/lib/src/screens/dashboard_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import 'package:go_router/go_router.dart';

import '../dashboard/dashboard_board.dart';
import '../health_providers.dart';
import '../terminal/docker_host_status_tile.dart';
import '../terminal/docker_shell.dart';
import '../terminal/terminal_hub.dart';
import '../terminal/terminal_screen.dart';
import 'reorder_sidebar_screen.dart';

/// Home screen. Services live in the navigation drawer (the sidebar); the
Expand Down Expand Up @@ -517,6 +521,10 @@ class _HealthAwareTile extends ConsumerWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (instance.kind == ServiceKind.dockerHost) ...<Widget>[
DockerHostStatusTile(host: instance),
const Divider(),
],
ListTile(
leading: const Icon(Icons.open_in_new),
title: const Text('Open service'),
Expand All @@ -532,6 +540,37 @@ class _HealthAwareTile extends ConsumerWidget {
);
},
),
if (instance.kind != ServiceKind.dockerHost &&
dockerHostFor(
instance,
ref.read(activeInstancesProvider),
) !=
null)
ListTile(
leading: const Icon(Icons.terminal_rounded),
title: const Text('Open shell in container'),
subtitle: _ContainerShellSubtitle(instance: instance),
onTap: () {
Navigator.pop(sheetContext);
if (instance.dockerContainer.isEmpty) {
final GoRouter router = GoRouter.of(context);
Navigator.of(context).pop();
router.goNamed(
AtriumRoutes.editInstanceName,
pathParameters: <String, String>{
'instanceId': instance.id,
},
);
return;
}
openServiceShell(
context,
ref,
instance,
beforeNavigate: () => Navigator.of(context).pop(),
);
},
),
ListTile(
leading: const Icon(Icons.edit),
title: const Text('Edit connection settings'),
Expand All @@ -557,6 +596,41 @@ class _HealthAwareTile extends ConsumerWidget {
}
}

/// The container a service's shell opens in, or the last Docker problem
/// seen on its host - shown here rather than on the host's own dot, since
/// the server itself is fine.
class _ContainerShellSubtitle extends ConsumerWidget {
const _ContainerShellSubtitle({required this.instance});

final Instance instance;

@override
Widget build(BuildContext context, WidgetRef ref) {
if (instance.dockerContainer.isEmpty) {
return const Text('Set the container in its settings');
}
final Instance? host =
dockerHostFor(instance, ref.watch(activeInstancesProvider));
if (host == null) {
return Text(instance.dockerContainer);
}
final HostSession session = ref.watch(terminalHubProvider).session(host.id);
return ListenableBuilder(
listenable: session,
builder: (BuildContext context, Widget? _) {
final String? issue = session.dockerIssue;
if (issue == null) {
return Text(instance.dockerContainer);
}
return Text(
'${instance.dockerContainer} - $issue',
style: TextStyle(color: Theme.of(context).colorScheme.error),
);
},
);
}
}

/// Bottom pill showing the active profile; opens profile management.
class _ProfilePill extends StatelessWidget {
const _ProfilePill({required this.label, required this.onTap});
Expand Down
Loading
Loading