aboutsummaryrefslogtreecommitdiffstats
path: root/manage.php
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.com>2025-04-25 01:13:03 +0100
committerLeonardo Bishop <me@leonardobishop.com>2025-04-25 01:13:03 +0100
commitc86f2b723e6956a6544bf98dc5011bd303280c6e (patch)
treef889fc105517e8a83863de621aa18a48e1231565 /manage.php
parent45a18c0ecb364c42307641b4057ff5a814e69b2e (diff)
Restructure repository
Diffstat (limited to 'manage.php')
-rw-r--r--manage.php68
1 files changed, 0 insertions, 68 deletions
diff --git a/manage.php b/manage.php
deleted file mode 100644
index c4858ca..0000000
--- a/manage.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-require_once('util.php');
-require_once('serviceDefinitions.php');
-
-session_start();
-
-$container = $_GET['container'];
-$action = $_GET['action'];
-
-Util\doSessionCheck('manage.php?container=' . $container);
-?>
-<!DOCTYPE html>
-<html>
-
-<head>
- <title>Manage container</title>
- <link rel="stylesheet" type="text/css" href="styles.css">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-</head>
-
-<body>
- <div class="container">
- <h1>Manage container: <?php echo $container ?></h1>
- <a href="index.php">Home</a>
- <a href="status.php">Status</a>
- <hr>
- <?php
- //if (empty($container)) {
- // Util\createBanner('✗', 'No service specified', 'bad');
- // return;
- //}
- //if (!in_array($service, array_map(function ($s) {
- // return $s->name;
- //}, $services))) {
- // Util\createBanner('✗', "Service '$service' is unknown", 'bad');
- // return;
- //}
-
- $status = Util\getDockerStatus($container);
-
- if ($status->status === '-') {
- Util\createBanner('✗', "Container '$container' not found", 'bad');
- return;
- }
-
- if ($action === 'start' || $action === 'stop' || $action === 'restart' || $action === 'logs') {
- // if ($action === 'start' || $action === 'stop' || $action === 'restart') {
- $safeService = escapeshellarg($container);
- Util\doShellExec('sudo docker ' . $action . ' ' . $safeService, '/manage.php?container=' . $container, $action);
- }
-
- Util\createStatusBanner($status);
- ?>
- <p>
- <details>
- <summary>Status as reported by Docker</summary>
- <?php Util\createStatusTable($status); ?>
- </details>
- </p>
-
- <p class="control-list">
- <a href="manage.php?container=<?php echo $container ?>&action=logs">[Logs]</a>
- <a href="manage.php?container=<?php echo $container ?>&action=start">[Start]</a>
- <a href="manage.php?container=<?php echo $container ?>&action=stop">[Stop]</a>
- <a href="manage.php?container=<?php echo $container ?>&action=restart">[Restart]</a>
- </p>
- </div>
-</body>