From: "Liam McLoughlin" <hexxeh@hexxeh.net>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoaster:webui commit in: /, web/
Date: Wed, 10 Aug 2011 17:39:24 +0000 (UTC) [thread overview]
Message-ID: <7f2c98b0d095c5c173fed07a0f8f32d51798d97e.hexxeh@gentoo> (raw)
Message-ID: <20110810173924.slP5Uy39nInoLr1hsj82nOCRAVkpYE8L3TmIu5yS3Og@z> (raw)
commit: 7f2c98b0d095c5c173fed07a0f8f32d51798d97e
Author: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
AuthorDate: Wed Aug 10 17:39:11 2011 +0000
Commit: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
CommitDate: Wed Aug 10 17:39:11 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=7f2c98b0
Combine configs, fix image download path via a new config option, add initscript
---
config.php | 9 ++++++++-
gentoaster | 35 +++++++++++++++++++++++++++++++++++
gentoaster.sql | 20 ++++++++++++++++++++
web/config.php | 11 ++++-------
web/index.php | 1 -
web/status.php | 2 +-
6 files changed, 68 insertions(+), 10 deletions(-)
diff --git a/config.php b/config.php
index c1807fa..96b5728 100644
--- a/config.php
+++ b/config.php
@@ -5,12 +5,19 @@
// Set the publically viewable URL for this Gentoaster instance
define("GENTOASTER_URL", "http://192.168.2.169");
+
+ // Set the publically viewable URL for images to be downloaded
+ // This should point to the same folder as CONFIGURATIONS_PATH
+ define("IMAGES_URL", "http://192.168.2.169/images");
// Set the path that completed images should be stored at
define("CONFIGURATIONS_PATH", "/var/www/gentoaster/images");
// Set the path to the folder the Gentoaster tool is at
- define("GENTOASTER_PATH", "/usr/share/gentoaster");
+ // As long as we're not being used by the WebUI
+ if (!defined("GENTOASTER_PATH")) {
+ define("GENTOASTER_PATH", "/usr/share/gentoaster");
+ }
// Set the name of the image creation tool
define("BUILD_TOOL_NAME", "create_image.sh");
diff --git a/gentoaster b/gentoaster
new file mode 100755
index 0000000..32d7d63
--- /dev/null
+++ b/gentoaster
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+USER=root
+GENTOASTER=/usr/share/gentoaster/daemon.php
+RETVAL=0
+
+start() {
+ echo "Starting Gentoaster"
+ start-stop-daemon --quiet --start --background --chuid "$USER" --exec /usr/bin/php -- -f $GENTOASTER
+ RETVAL=$?
+}
+stop() {
+ echo "Stopping Gentoaster"
+ killall -q -w -u $USER $GENTOASTER
+ RETVAL=$?
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ *)
+ echo "Usage: gentoaster {start|stop|restart}"
+ exit 1
+ ;;
+esac
+exit $RETVAL
+
diff --git a/gentoaster.sql b/gentoaster.sql
new file mode 100644
index 0000000..17034b8
--- /dev/null
+++ b/gentoaster.sql
@@ -0,0 +1,20 @@
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `builds` (
+ `id` varchar(32) NOT NULL,
+ `handle` varchar(32) NOT NULL,
+ `returncode` int(11) DEFAULT NULL,
+ `result` text,
+ `ipaddress` varchar(15) DEFAULT NULL,
+ `email` varchar(50) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `ports` (
+ `id` varchar(32) NOT NULL,
+ `port` int(11) NOT NULL,
+ `pid` int(11) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
diff --git a/web/config.php b/web/config.php
index 38076e8..9c5ef50 100644
--- a/web/config.php
+++ b/web/config.php
@@ -36,13 +36,10 @@
// What should we limit the virtual machine disk size to?
define("MAX_DISK_SIZE", 16384);
- // Set the MySQL access details that should be used
- define("MYSQL_HOSTNAME", "localhost");
- define("MYSQL_USERNAME", "gentoaster");
- define("MYSQL_PASSWORD", "");
- define("MYSQL_DATABASE", "gentoaster");
-
// Set the RECAPTCHA keys that should be used, if enabled
define("RECAPTCHA_ENABLED", false);
define("RECAPTCHA_PUBLIC_KEY", "REPLACE_ME");
- define("RECAPTCHA_PRIVATE_KEY", "REPLACE_ME");
\ No newline at end of file
+ define("RECAPTCHA_PRIVATE_KEY", "REPLACE_ME");
+
+ // Load all the configuration for the daemon, too
+ require_once GENTOASTER_PATH."/config.php";
\ No newline at end of file
diff --git a/web/index.php b/web/index.php
index f46af2b..6bb2f9f 100644
--- a/web/index.php
+++ b/web/index.php
@@ -1,6 +1,5 @@
<?php
require_once "config.php";
- require_once GENTOASTER_PATH."/config.php";
if (RECAPTCHA_ENABLED) {
require_once "recaptcha.php";
diff --git a/web/status.php b/web/status.php
index 69e8afc..bde0ad2 100644
--- a/web/status.php
+++ b/web/status.php
@@ -69,7 +69,7 @@
"What would you like to do now?".
"<br /><br /><center>".
"<table><tr><td>".
- "<a href=\"/gentoaster/".
+ "<a href=\"".IMAGES_URL."/".
$buildID."/".$buildID.
".tar.gz\">".
"<img style=\"padding: 10px;\" ".
next reply other threads:[~2011-08-10 17:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-12 23:18 Liam McLoughlin [this message]
2011-08-10 17:39 ` [gentoo-commits] proj/gentoaster:webui commit in: /, web/ Liam McLoughlin
-- strict thread matches above, loose matches on Subject: below --
2011-08-15 1:20 [gentoo-commits] proj/gentoaster:master " Liam McLoughlin
2011-08-15 1:17 Liam McLoughlin
2011-08-12 23:18 Liam McLoughlin
2011-08-12 23:17 Liam McLoughlin
2011-08-12 23:17 Liam McLoughlin
2011-07-24 2:43 [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin
2011-08-12 23:17 ` [gentoo-commits] proj/gentoaster:master " Liam McLoughlin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7f2c98b0d095c5c173fed07a0f8f32d51798d97e.hexxeh@gentoo \
--to=hexxeh@hexxeh.net \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox