diff --git a/debian/changelog b/debian/changelog index c926b2cf..f6c243c3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ byobu (3.6) unreleased; urgency=low [ Dustin Kirkland ] * usr/bin/byobu: fix SSH_AUTH_SOCK breakage, define $RUN dir, LP: #664059 + * experimental/byobu.php, experimental/README: delete -- Dustin Kirkland Wed, 15 Sep 2010 13:31:03 -0600 diff --git a/experimental/README b/experimental/README deleted file mode 100644 index 2181dc50..00000000 --- a/experimental/README +++ /dev/null @@ -1,24 +0,0 @@ -byobu.php - -This web application is the output of the Canonical Platform's Ubuntu Server Team's first "Fedex" day. - -The goal of this application is to provide a web interface for input to, and output from a running Byobu (GNU Screen) session on an Ubuntu Server. - -The motivation is that most smart phones have really crappy SSH/Terminal applications, but have much better web browsers. Ubuntu system administrators often leave long running processes in detached Byobu sessions, and may want to check them later. Ideally, they would be able to do this from their smart phone. A web interface would provide a very convenient way of doing quick checks on running sessions, and perhaps sending some basic commands. - -The state of this code as of 2010-09-03 15:10:45 is that it's working well as a proof of concept for the www-data user. Obviously this needs to be extended to run as normal users for this to be useful. The devil is in the Apache configuration. - -TODO List: - * Use Apache's suexec module to allow byobu.php to interface with "real" user's byobu sessions (rather than just www-data) - * Use Apache's userdir module to allow users to configure this on/off within their ~/public_html, perhaps by symlinking byobu.php into place (or using a byobu utility to toggle this on/off; could be an administrator only function) - * Use Apache's libapache2-mod-auth-pam to authenticate users with their normal system username/password - * Use Apache's ssl to secure the session - * Handle ctrl characters (no way yet to pass characters like ESC, CTRL, ALT, etc through the form to the session) - * Colorize the byobu status line at the bottom - * Support switching between windows in the byobu session (perhaps tabs in the web UI) - * Make it ajaxy, real time, and faster, with fewer page loads - * Select among one or more open sessions - - -Dustin Kirkland -2010-09-03 15:10:45 diff --git a/experimental/byobu.php b/experimental/byobu.php deleted file mode 100644 index e9970f8d..00000000 --- a/experimental/byobu.php +++ /dev/null @@ -1,140 +0,0 @@ - - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as - published by the Free Software Foundation, version 3 of the - License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -*/ - - -/* Set up some global variables */ -$USER = rtrim(`whoami`); -$EXCHANGE = "/var/run/screen/S-$USER/byobu-exchange"; -$HOST = $_SERVER["HTTP_HOST"]; -$ENV = "HOME=~$USER"; -$TITLE = "$USER@$HOST - byobu web interface"; - -function cmd($command) { -/* Run a backtick command on the system, but first, prepend any - environment variables that we need to (over)load. */ - global $ENV; - return `$ENV $command`; -} - -function markup($input) { -/* Translate screen's text color/attribute markup to HTML */ -/* TODO: this function is just a stub right now */ - if (preg_match("/\{\+b.*\}/", $input)) { - - } - $output = preg_replace("/\{[^\}]+\}/", "", $input); - return($output); -} - -function backticks() { -/* Run all backtick status commands, load and return a hash of statuses */ - $lines = preg_grep("/^backtick.*byobu-status/", file("/usr/share/byobu/profiles/common")); - foreach ($lines as $line) { - $key = preg_replace("/^backtick /", "", $line); - $key = preg_replace("/[^0-9].*/", "", $key); - $value = rtrim(preg_replace("/.*byobu-status /", "", $line)); - switch ($value) { - case "date": - $status = date("Y-m-d"); - break; - case "time": - $status = date("H:i:s"); - break; - default: - //$status = markup(cmd("byobu-status $value")); - $status = markup(htmlspecialchars(cmd("/usr/lib/byobu/$value"))); - break; - } - $backticks["$key"] = "" . $status . ""; - //print("$key -> $value -> $status
"); - } - return $backticks; -} - -function print_status() { -/* Print the bottom two status lines of a byobu session */ -/* TODO: alignment of items needs a little love */ - $backticks = backticks(); - $rows = array("^caption always ", "^hardstatus string "); - print("
");
-	foreach ($rows as $row) {
-		print("");
-		$line = array_pop(preg_grep("/$row/", file("/usr/share/byobu/profiles/common")));
-		$items = preg_split("/[^0-9]+/", $line);
-		for ($i=0; $i
"); - } - print("
"); -} - -function process($command) { - /* Process new command, if posted */ - $command = escapeshellcmd($_POST["q"]); - /* TODO: Currently runs against screen "0"; should have a mechanism - web page for selecting a session */ - cmd("screen -X at 0 stuff \"$command \""); - /* TODO: This sleep is gross, but some locking will be necessary to - ensure that (most) commands execute and complete before the - screen exchange happens */ - sleep(2); - -} - -function print_screen_contents($exchange) { - /* TODO: Currently runs against screen "0"; should have a mechanism - web page for selecting a session */ - cmd("screen -X at 0 eval 'process s' 'exec sed -i \"/./,/^$/!d\" $exchange'"); - /* TODO: This sleep is gross, but it takes a little bit of time for - screen to write the window buffer to a file. Need to speed - this up as much as possible. */ - sleep(2); - print("
" . file_get_contents($exchange) . "
"); -} - -if (isset($_POST["q"])) { - process($_POST["q"]); -} - -?> - - - -<?php print("$TITLE"); ?> - - - - -
- - -