
cherokee at cherokee-project
Oct 9, 2009, 9:55 AM
Post #1 of 1
(142 views)
Permalink
|
|
[3690] cherokee/trunk/admin: Wizards mega commit
|
|
Revision: 3690 http://svn.cherokee-project.com/changeset/3690 Author: taher Date: 2009-10-09 18:55:44 +0200 (Fri, 09 Oct 2009) Log Message: ----------- Wizards mega commit Modified Paths: -------------- cherokee/trunk/admin/Makefile.am cherokee/trunk/admin/Wizard.py cherokee/trunk/admin/Wizard_Drupal.py cherokee/trunk/admin/Wizard_WordPress.py cherokee/trunk/admin/static/images/wizards/Makefile.am cherokee/trunk/admin/util.py Added Paths: ----------- cherokee/trunk/admin/Wizard_Alfresco.py cherokee/trunk/admin/Wizard_Glassfish.py cherokee/trunk/admin/Wizard_Joomla.py cherokee/trunk/admin/Wizard_Liferay.py cherokee/trunk/admin/Wizard_Moodle.py cherokee/trunk/admin/Wizard_Sugar.py cherokee/trunk/admin/Wizard_Symfony.py cherokee/trunk/admin/Wizard_Trac.py cherokee/trunk/admin/Wizard_Zend.py cherokee/trunk/admin/Wizard_phpBB.py cherokee/trunk/admin/Wizard_phpMyAdmin.py cherokee/trunk/admin/static/images/wizards/Makefile cherokee/trunk/admin/static/images/wizards/Makefile.in cherokee/trunk/admin/static/images/wizards/alfresco.png cherokee/trunk/admin/static/images/wizards/aspnet.png cherokee/trunk/admin/static/images/wizards/dbslayer.png cherokee/trunk/admin/static/images/wizards/glassfish.png cherokee/trunk/admin/static/images/wizards/joomla.png cherokee/trunk/admin/static/images/wizards/liferay.png cherokee/trunk/admin/static/images/wizards/moodle.png cherokee/trunk/admin/static/images/wizards/nagios.png cherokee/trunk/admin/static/images/wizards/phpbb.png cherokee/trunk/admin/static/images/wizards/phpmyadmin.png cherokee/trunk/admin/static/images/wizards/sugarcrm.png cherokee/trunk/admin/static/images/wizards/symfony.png cherokee/trunk/admin/static/images/wizards/trac.png cherokee/trunk/admin/static/images/wizards/zend.png Modified: cherokee/trunk/admin/Makefile.am =================================================================== --- cherokee/trunk/admin/Makefile.am 2009-10-08 16:06:25 UTC (rev 3689) +++ cherokee/trunk/admin/Makefile.am 2009-10-09 16:55:44 UTC (rev 3690) @@ -122,7 +122,18 @@ Wizard_Icons.py \ Wizard_CommonStatic.py \ Wizard_Streaming.py \ -Wizard_rTorrent.py +Wizard_rTorrent.py \ +Wizard_Joomla.py \ +Wizard_Moodle.py \ +Wizard_Sugar.py \ +Wizard_phpBB.py \ +Wizard_phpMyAdmin.py \ +Wizard_Symfony.py \ +Wizard_Zend.py \ +Wizard_Trac.py \ +Wizard_Liferay.py \ +Wizard_Alfresco.py \ +Wizard_Glassfish.py endif adminpy_DATA = $(admin_data) Modified: cherokee/trunk/admin/Wizard.py =================================================================== --- cherokee/trunk/admin/Wizard.py 2009-10-08 16:06:25 UTC (rev 3689) +++ cherokee/trunk/admin/Wizard.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -10,6 +10,7 @@ WIZARD_GROUP_PLATFORM = 'Platforms' WIZARD_GROUP_LANGS = 'Languages' WIZARD_GROUP_MANAGEMENT = 'Management' +WIZARD_GROUP_DB = 'Database' USUAL_STATIC_FILES = ['/favicon.ico', '/robots.txt', '/crossdomain.xml'] Added: cherokee/trunk/admin/Wizard_Alfresco.py =================================================================== --- cherokee/trunk/admin/Wizard_Alfresco.py (rev 0) +++ cherokee/trunk/admin/Wizard_Alfresco.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -0,0 +1,170 @@ +""" +Alfresco wizard. + +Last update: +* Cherokee 0.99.25 +* Alfresco Community Edition +""" +import validations + +from config import * +from util import * +from Page import * +from Wizard import * + +NOTE_VSRV_NAME = _("Name of the new domain that will be created.") +NOTE_HOST_SRC = _('Hostname or IP of the server running Alfresco.') +NOTE_HOST_PRT = _('Port running the service in said host.') +NOTE_WEB_DIR = _("Web folder under which Liferay will be accessible.") + +SOURCE = """ +source!%(src_num)d!env_inherited = 0 +source!%(src_num)d!type = host +source!%(src_num)d!nick = Alfresco %(src_num)d +source!%(src_num)d!host = %(src_host)s:%(src_port)d +""" + +CONFIG_VSRV = SOURCE + """ +%(vsrv_pre)s!nick = %(new_host)s +%(vsrv_pre)s!document_root = /dev/null + +%(vsrv_pre)s!rule!1!match = default +%(vsrv_pre)s!rule!1!encoder!gzip = 1 + +%(vsrv_pre)s!rule!1!handler = proxy +%(vsrv_pre)s!rule!1!handler!balancer = round_robin +%(vsrv_pre)s!rule!1!handler!balancer!source!1 = %(src_num)d +%(vsrv_pre)s!rule!1!handler!in_allow_keepalive = 1 +%(vsrv_pre)s!rule!1!handler!in_preserve_host = 0 +%(vsrv_pre)s!rule!1!handler!in_rewrite_request!1!substring = /share/$1 +""" + +CONFIG_RULES = SOURCE + """ +%(rule_pre)s!encoder!gzip = 1 +%(rule_pre)s!handler = proxy +%(rule_pre)s!handler!balancer = round_robin +%(rule_pre)s!handler!balancer!source!1 = %(src_num)d +%(rule_pre)s!handler!in_allow_keepalive = 1 +%(rule_pre)s!handler!in_preserve_host = 0 +%(rule_pre)s!handler!in_rewrite_request!1!substring = /share/$1 +%(rule_pre)s!match = directory +%(rule_pre)s!match!directory = %(webdir)s +""" + +DATA_VALIDATION = [. + ("tmp!wizard_alfresco!new_host", (validations.is_new_host, 'cfg')), + ("tmp!wizard_alfresco!new_webdir", validations.is_dir_formated), + ("tmp!wizard_alfresco!new_src_port", validations.is_tcp_port) +] + +class Wizard_VServer_Alfresco (WizardPage): + ICON = "alfresco.png" + DESC = "New virtual server based on a Alfresco project." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/wizard/Alfresco', + id = "Alfresco_Page1", + title = _("Alfresco Wizard"), + group = WIZARD_GROUP_CMS) + + def show (self): + return True + + def _render_content (self, url_pre): + txt = '<h1>%s</h1>' % (self.title) + + txt += '<h2>New Virtual Server</h2>' + table = TableProps() + self.AddPropEntry (table, _('New Host Name'), 'tmp!wizard_alfresco!new_host', NOTE_VSRV_NAME, value="alfresco.example.com") + txt += self.Indent(table) + + txt += '<h2>Alfresco Project</h2>' + table = TableProps() + self.AddPropEntry (table, _('Source host'), 'tmp!wizard_alfresco!new_src_host', NOTE_HOST_SRC) + self.AddPropEntry (table, _('Source port'), 'tmp!wizard_alfresco!new_src_port', NOTE_HOST_PRT, value=8080) + txt += self.Indent(table) + + txt += '<h2>Logging</h2>' + txt += self._common_add_logging() + + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + return txt + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + new_host = post.pop('tmp!wizard_alfresco!new_host') + src_host = post.pop('tmp!wizard_alfresco!new_src_host') + src_port = int(post.pop('tmp!wizard_alfresco!new_src_port')) + + # Locals + vsrv_pre = cfg_vsrv_get_next (self._cfg) + src_num, src_pre = cfg_source_get_next (self._cfg) + + # Add the new rules + config = CONFIG_VSRV % (locals()) + self._apply_cfg_chunk (config) + self._common_apply_logging (post, vsrv_pre) + + +class Wizard_Rules_Alfresco (WizardPage): + ICON = "alfresco.png" + DESC = "New directory based on a Alfresco project." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/%s/wizard/Alfresco'%(pre.split('!')[1]), + id = "Alfresco_Page1", + title = _("Alfresco Wizard"), + group = WIZARD_GROUP_CMS) + + def show (self): + return True + + def _render_content (self, url_pre): + txt = '<h1>%s</h1>' % (self.title) + + txt += '<h2>Alfresco Project</h2>' + table = TableProps() + self.AddPropEntry (table, _('Web Directory'), 'tmp!wizard_alfresco!new_webdir', NOTE_WEB_DIR, value="/alfresco") + self.AddPropEntry (table, _('Source host'), 'tmp!wizard_alfresco!new_src_host', NOTE_HOST_SRC, value="localhost") + self.AddPropEntry (table, _('Source port'), 'tmp!wizard_alfresco!new_src_port', NOTE_HOST_PRT, value=8080) + txt += self.Indent(table) + + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + return txt + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + webdir = post.pop('tmp!wizard_alfresco!new_webdir') + src_host = post.pop('tmp!wizard_alfresco!new_src_host') + src_port = int(post.pop('tmp!wizard_alfresco!new_src_port')) + + # Locals + rule_num, rule_pre = cfg_vsrv_rule_get_next (self._cfg, self._pre) + src_num, src_pre = cfg_source_get_next (self._cfg) + + # Add the new rules + config = CONFIG_RULES % (locals()) + self._apply_cfg_chunk (config) + Modified: cherokee/trunk/admin/Wizard_Drupal.py =================================================================== --- cherokee/trunk/admin/Wizard_Drupal.py 2009-10-08 16:06:25 UTC (rev 3689) +++ cherokee/trunk/admin/Wizard_Drupal.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -99,7 +99,7 @@ class Wizard_VServer_Drupal (WizardPage): ICON = "drupal.png" DESC = "Configure a new virtual server using Drupal." - + def __init__ (self, cfg, pre): WizardPage.__init__ (self, cfg, pre, submit = '/vserver/wizard/Drupal', @@ -110,7 +110,7 @@ def show (self): return True - def _render_content (self, url_pre): + def _render_content (self, url_pre): txt = '<h1>%s</h1>' % (self.title) guessed_src = path_find_w_default (SRC_PATHS) @@ -170,7 +170,7 @@ DESC = "Configures Drupal inside a public web directory." def __init__ (self, cfg, pre): - WizardPage.__init__ (self, cfg, pre, + WizardPage.__init__ (self, cfg, pre, submit = '/vserver/%s/wizard/Drupal'%(pre.split('!')[1]), id = "Drupal_Page1", title = _("Drupal Wizard"), @@ -184,7 +184,7 @@ return False return True - def _render_content (self, url_pre): + def _render_content (self, url_pre): guessed_src = path_find_w_default (SRC_PATHS) table = TableProps() Added: cherokee/trunk/admin/Wizard_Glassfish.py =================================================================== --- cherokee/trunk/admin/Wizard_Glassfish.py (rev 0) +++ cherokee/trunk/admin/Wizard_Glassfish.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -0,0 +1,166 @@ +""" +Glassfish wizard. + +Last update: +* Cherokee 0.99.25 +* Glassfish +""" +import validations + +from config import * +from util import * +from Page import * +from Wizard import * + +NOTE_VSRV_NAME = _("Name of the new domain that will be created.") +NOTE_HOST_SRC = _('Hostname or IP of the server running Glassfish. You can add more later to have the load balanced.') +NOTE_HOST_PRT = _('Port running the service in said host. (Example: 8080)') +NOTE_WEB_DIR = _("Web folder under which Glassfish will be accessible.") + +SOURCE = """ +source!%(src_num)d!env_inherited = 0 +source!%(src_num)d!type = host +source!%(src_num)d!nick = Glassfish %(src_num)d +source!%(src_num)d!host = %(src_host)s:%(src_port)d +""" + +CONFIG_VSRV = SOURCE + """ +%(vsrv_pre)s!nick = %(new_host)s +%(vsrv_pre)s!document_root = /dev/null + +%(vsrv_pre)s!rule!1!match = default +%(vsrv_pre)s!rule!1!encoder!gzip = 1 +%(vsrv_pre)s!rule!1!handler = proxy +%(vsrv_pre)s!rule!1!handler!balancer = round_robin +%(vsrv_pre)s!rule!1!handler!balancer!source!1 = %(src_num)d +%(vsrv_pre)s!rule!1!handler!in_allow_keepalive = 1 +%(vsrv_pre)s!rule!1!handler!in_preserve_host = 0 +""" + +CONFIG_RULES = SOURCE + """ +%(rule_pre)s!match = directory +%(rule_pre)s!match!directory = %(webdir)s +%(rule_pre)s!encoder!gzip = 1 +%(rule_pre)s!handler = proxy +%(rule_pre)s!handler!balancer = round_robin +%(rule_pre)s!handler!balancer!source!1 = %(src_num)d +%(rule_pre)s!handler!in_allow_keepalive = 1 +%(rule_pre)s!handler!in_preserve_host = 0 +""" + +DATA_VALIDATION = [. + ("tmp!wizard_glassfish!new_host", (validations.is_new_host, 'cfg')), + ("tmp!wizard_glassfish!new_webdir", validations.is_dir_formated), + ("tmp!wizard_glassfish!new_src_port", validations.is_tcp_port) +] + +class Wizard_VServer_Glassfish (WizardPage): + ICON = "glassfish.png" + DESC = "New virtual server to proxy Glassfish projects." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/wizard/Glassfish', + id = "Glassfish_Page1", + title = _("Glassfish Wizard"), + group = WIZARD_GROUP_PLATFORM) + + def show (self): + return True + + def _render_content (self, url_pre): + txt = '<h1>%s</h1>' % (self.title) + + txt += '<h2>New Virtual Server</h2>' + table = TableProps() + self.AddPropEntry (table, _('New Host Name'), 'tmp!wizard_glassfish!new_host', NOTE_VSRV_NAME, value="glassfish.example.com") + txt += self.Indent(table) + + txt += '<h2>Glassfish Project</h2>' + table = TableProps() + self.AddPropEntry (table, _('Source host'), 'tmp!wizard_glassfish!new_src_host', NOTE_HOST_SRC, value="localhost") + self.AddPropEntry (table, _('Source port'), 'tmp!wizard_glassfish!new_src_port', NOTE_HOST_PRT, value=8080) + txt += self.Indent(table) + + txt += '<h2>Logging</h2>' + txt += self._common_add_logging() + + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + return txt + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + new_host = post.pop('tmp!wizard_glassfish!new_host') + src_host = post.pop('tmp!wizard_glassfish!new_src_host') + src_port = int(post.pop('tmp!wizard_glassfish!new_src_port')) + + # Locals + vsrv_pre = cfg_vsrv_get_next (self._cfg) + src_num, src_pre = cfg_source_get_next (self._cfg) + + # Add the new rules + config = CONFIG_VSRV % (locals()) + self._apply_cfg_chunk (config) + self._common_apply_logging (post, vsrv_pre) + + +class Wizard_Rules_Glassfish (WizardPage): + ICON = "glassfish.png" + DESC = "New directory to proxy Glassfish projects." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/%s/wizard/Glassfish'%(pre.split('!')[1]), + id = "Glassfish_Page1", + title = _("Glassfish Wizard"), + group = WIZARD_GROUP_PLATFORM) + + def show (self): + return True + + def _render_content (self, url_pre): + txt = '<h1>%s</h1>' % (self.title) + + txt += '<h2>Glassfish Project</h2>' + table = TableProps() + self.AddPropEntry (table, _('Web Directory'), 'tmp!wizard_glassfish!new_webdir', NOTE_WEB_DIR, value="/glassfish") + self.AddPropEntry (table, _('Source host'), 'tmp!wizard_glassfish!new_src_host', NOTE_HOST_SRC, value="localhost") + self.AddPropEntry (table, _('Source port'), 'tmp!wizard_glassfish!new_src_port', NOTE_HOST_PRT, value=8080) + txt += self.Indent(table) + + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + return txt + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + webdir = post.pop('tmp!wizard_glassfish!new_webdir') + src_host = post.pop('tmp!wizard_glassfish!new_src_host') + src_port = int(post.pop('tmp!wizard_glassfish!new_src_port')) + + # Locals + rule_num, rule_pre = cfg_vsrv_rule_get_next (self._cfg, self._pre) + src_num, src_pre = cfg_source_get_next (self._cfg) + + # Add the new rules + config = CONFIG_RULES % (locals()) + self._apply_cfg_chunk (config) Added: cherokee/trunk/admin/Wizard_Joomla.py =================================================================== --- cherokee/trunk/admin/Wizard_Joomla.py (rev 0) +++ cherokee/trunk/admin/Wizard_Joomla.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -0,0 +1,233 @@ +""" +Joomla wizard. Last checked with: +* Cherokee: 0.99.25 +* Joomla 1.5.14 +""" +import validations +from config import * +from util import * +from Page import * +from Wizard import * +from Wizard_PHP import wizard_php_get_info +from Wizard_PHP import wizard_php_get_source_info + +NOTE_SOURCES = _("Path to the directory where the Joomla source code is located. (Example: /usr/share/joomla)") +NOTE_WEB_DIR = _("Web directory where you want Joomla to be accessible. (Example: /blog)") +NOTE_HOST = _("Host name of the virtual host that is about to be created.") +ERROR_NO_SRC = _("Does not look like a Joomla source directory.") +ERROR_NO_WEB = _("A web directory must be provided.") +ERROR_NO_HOST = _("A host name must be provided.") + +CONFIG_DIR = """ +%(pre_rule_plus3)s!handler = custom_error +%(pre_rule_plus3)s!handler!error = 403 +%(pre_rule_plus3)s!match = request +%(pre_rule_plus3)s!match!final = 1 +%(pre_rule_plus3)s!match!request = %(ban_regex)s + +%(pre_rule_plus2)s!match = request +%(pre_rule_plus2)s!match!request = ^%(web_dir)s/$ +%(pre_rule_plus2)s!handler = redir +%(pre_rule_plus2)s!handler!rewrite!1!show = 0 +%(pre_rule_plus2)s!handler!rewrite!1!substring = %(web_dir)s/index.php + +%(pre_rule_plus1)s!match = directory +%(pre_rule_plus1)s!match!directory = %(web_dir)s +%(pre_rule_plus1)s!match!final = 0 +%(pre_rule_plus1)s!document_root = %(local_src_dir)s + +# IMPORTANT: The PHP rule comes here + +%(pre_rule_minus1)s!match = and +%(pre_rule_minus1)s!match!left = directory +%(pre_rule_minus1)s!match!left!directory = %(web_dir)s +%(pre_rule_minus1)s!match!right = exists +%(pre_rule_minus1)s!match!right!iocache = 1 +%(pre_rule_minus1)s!match!right!match_any = 1 +%(pre_rule_minus1)s!handler = file + +%(pre_rule_minus2)s!match = directory +%(pre_rule_minus2)s!match!directory = %(web_dir)s +%(pre_rule_minus2)s!handler = redir +%(pre_rule_minus2)s!handler!rewrite!1!show = 0 +%(pre_rule_minus2)s!handler!rewrite!1!regex = /(.*)$ +%(pre_rule_minus2)s!handler!rewrite!1!substring = %(web_dir)s/index.php?q=/$1 +""" + +CONFIG_VSERVER = """ +%(pre_vsrv)s!nick = %(host)s +%(pre_vsrv)s!document_root = %(local_src_dir)s +%(pre_vsrv)s!directory_index = index.php,index.html +%(pre_vsrv)s!error_handler = error_redir +%(pre_vsrv)s!error_handler!403!show = 0 +%(pre_vsrv)s!error_handler!403!url = /index.php +%(pre_vsrv)s!error_handler!404!show = 0 +%(pre_vsrv)s!error_handler!404!url = /index.php + +%(pre_rule_plus1)s!handler = custom_error +%(pre_rule_plus1)s!handler!error = 403 +%(pre_rule_plus1)s!match = request +%(pre_rule_plus1)s!match!final = 1 +%(pre_rule_plus1)s!match!request = %(ban_regex)s + +# IMPORTANT: The PHP rule comes here + +%(pre_rule_minus1)s!handler = common +%(pre_rule_minus1)s!handler!iocache = 0 +%(pre_rule_minus1)s!match = default +%(pre_rule_minus1)s!match!final = 1 +""" + +BAN_REGEX = 'mosConfig_[a-zA-Z_]{1,21}(=|\=)|base64_encode.*\(.*\)|(\<|<).*script.*(\>|>)|GLOBALS(=|\[|\%[0-9A-Z]{0,2})|_REQUEST(=|\[|\%[0-9A-Z]{0,2})' + +SRC_PATHS = [. + "/usr/share/joomla", # Debian, Fedora + "/var/www/*/htdocs/joomla", # Gentoo + "/srv/www/htdocs/joomla", # SuSE + "/usr/local/www/data/joomla*" # BSD +] + +def is_joomla_dir (path, cfg, nochroot): + path = validations.is_local_dir_exists (path, cfg, nochroot) + module_inc = os.path.join (path, 'includes/framework.php') + if not os.path.exists (module_inc): + raise ValueError, ERROR_NO_SRC + return path + +DATA_VALIDATION = [. + ("tmp!wizard_joomla!sources", (is_joomla_dir, 'cfg')), + ("tmp!wizard_joomla!host", (validations.is_new_host, 'cfg')), + ("tmp!wizard_joomla!web_dir", validations.is_dir_formated) +] + +class Wizard_VServer_Joomla (WizardPage): + ICON = "joomla.png" + DESC = "Configure a new virtual server using Joomla." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/wizard/Joomla', + id = "Joomla_Page1", + title = _("Joomla Wizard"), + group = WIZARD_GROUP_CMS) + + def show (self): + return True + + def _render_content (self, url_pre): + txt = '<h1>%s</h1>' % (self.title) + guessed_src = path_find_w_default (SRC_PATHS) + + txt += '<h2>Joomla</h2>' + table = TableProps() + self.AddPropEntry (table, _('New Host Name'), 'tmp!wizard_joomla!host', NOTE_HOST, value="blog.example.com") + self.AddPropEntry (table, _('Source Directory'), 'tmp!wizard_joomla!sources', NOTE_SOURCES, value=guessed_src) + txt += self.Indent(table) + + txt += '<h2>Logging</h2>' + txt += self._common_add_logging() + + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + local_src_dir = post.pop('tmp!wizard_joomla!sources') + host = post.pop('tmp!wizard_joomla!host') + pre_vsrv = cfg_vsrv_get_next (self._cfg) + + # Add PHP Rule + from Wizard_PHP import Wizard_Rules_PHP + php_wizard = Wizard_Rules_PHP (self._cfg, pre_vsrv) + php_wizard.show() + php_wizard.run (pre_vsrv, None) + + # Replacement + php_info = wizard_php_get_info (self._cfg, pre_vsrv) + php_rule = int (php_info['rule'].split('!')[-1]) + + pre_rule_plus1 = "%s!rule!%d" % (pre_vsrv, php_rule + 1) + pre_rule_minus1 = "%s!rule!%d" % (pre_vsrv, php_rule - 1) + + ban_regex = BAN_REGEX + + # Common static + pre_rule_plus2 = "%s!rule!%d" % (pre_vsrv, php_rule + 2) + self._common_add_usual_static_files (pre_rule_plus2) + + # Add the new rules + config = CONFIG_VSERVER % (locals()) + self._apply_cfg_chunk (config) + self._common_apply_logging (post, pre_vsrv) + + +class Wizard_Rules_Joomla (WizardPage): + ICON = "joomla.png" + DESC = "Configures Joomla inside a public web directory." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/%s/wizard/Joomla'%(pre.split('!')[1]), + id = "Joomla_Page1", + title = _("Joomla Wizard"), + group = WIZARD_GROUP_CMS) + + def show (self): + # Check for PHP + php_info = wizard_php_get_info (self._cfg, self._pre) + if not php_info: + self.no_show = "PHP support is required." + return False + return True + + def _render_content (self, url_pre): + guessed_src = path_find_w_default (SRC_PATHS) + + table = TableProps() + self.AddPropEntry (table, _('Web Directory'), 'tmp!wizard_joomla!web_dir', NOTE_WEB_DIR, value="/blog") + self.AddPropEntry (table, _('Source Directory'),'tmp!wizard_joomla!sources', NOTE_SOURCES, value=guessed_src) + + txt = '<h1>%s</h1>' % (self.title) + txt += self.Indent(table) + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + local_src_dir = post.pop('tmp!wizard_joomla!sources') + web_dir = post.pop('tmp!wizard_joomla!web_dir') + + # Replacement + php_info = wizard_php_get_info (self._cfg, self._pre) + php_rule = int (php_info['rule'].split('!')[-1]) + + pre_rule_plus3 = "%s!rule!%d" % (self._pre, php_rule + 3) + pre_rule_plus2 = "%s!rule!%d" % (self._pre, php_rule + 2) + pre_rule_plus1 = "%s!rule!%d" % (self._pre, php_rule + 1) + pre_rule_minus1 = "%s!rule!%d" % (self._pre, php_rule - 1) + pre_rule_minus2 = "%s!rule!%d" % (self._pre, php_rule - 2) + + ban_regex = BAN_REGEX + + # Add the new rules + config = CONFIG_DIR % (locals()) + self._apply_cfg_chunk (config) + Added: cherokee/trunk/admin/Wizard_Liferay.py =================================================================== --- cherokee/trunk/admin/Wizard_Liferay.py (rev 0) +++ cherokee/trunk/admin/Wizard_Liferay.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -0,0 +1,167 @@ +""" +Liferay wizard. + +Last update: +* Cherokee 0.99.25 +* Liferay +""" +import validations + +from config import * +from util import * +from Page import * +from Wizard import * + +NOTE_VSRV_NAME = _("Name of the new domain that will be created.") +NOTE_HOST_SRC = _('Hostname or IP of the server running Liferay.') +NOTE_HOST_PRT = _('Port running the service in said host.') +NOTE_WEB_DIR = _("Web folder under which Liferay will be accessible.") + +SOURCE = """ +source!%(src_num)d!env_inherited = 0 +source!%(src_num)d!type = host +source!%(src_num)d!nick = Liferay %(src_num)d +source!%(src_num)d!host = %(src_host)s:%(src_port)d +""" + +CONFIG_VSRV = SOURCE + """ +%(vsrv_pre)s!nick = %(new_host)s +%(vsrv_pre)s!document_root = /dev/null + +%(vsrv_pre)s!rule!1!match = default +%(vsrv_pre)s!rule!1!encoder!gzip = 1 +%(vsrv_pre)s!rule!1!handler = proxy +%(vsrv_pre)s!rule!1!handler!balancer = round_robin +%(vsrv_pre)s!rule!1!handler!balancer!source!1 = %(src_num)d +%(vsrv_pre)s!rule!1!handler!in_allow_keepalive = 1 +%(vsrv_pre)s!rule!1!handler!in_preserve_host = 0 +""" + +CONFIG_RULES = SOURCE + """ +%(rule_pre)s!match = directory +%(rule_pre)s!match!directory = %(webdir)s +%(rule_pre)s!encoder!gzip = 1 +%(rule_pre)s!handler = proxy +%(rule_pre)s!handler!balancer = round_robin +%(rule_pre)s!handler!balancer!source!1 = %(src_num)d +%(rule_pre)s!handler!in_allow_keepalive = 1 +%(rule_pre)s!handler!in_preserve_host = 0 +""" + +DATA_VALIDATION = [. + ("tmp!wizard_liferay!new_host", (validations.is_new_host, 'cfg')), + ("tmp!wizard_liferay!new_webdir", validations.is_dir_formated), + ("tmp!wizard_liferay!new_src_port", validations.is_tcp_port) +] + +class Wizard_VServer_Liferay (WizardPage): + ICON = "liferay.png" + DESC = "New virtual server based on a Liferay project." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/wizard/Liferay', + id = "Liferay_Page1", + title = _("Liferay Wizard"), + group = WIZARD_GROUP_CMS) + + def show (self): + return True + + def _render_content (self, url_pre): + txt = '<h1>%s</h1>' % (self.title) + + txt += '<h2>New Virtual Server</h2>' + table = TableProps() + self.AddPropEntry (table, _('New Host Name'), 'tmp!wizard_liferay!new_host', NOTE_VSRV_NAME, value="liferay.example.com") + txt += self.Indent(table) + + txt += '<h2>Liferay Project</h2>' + table = TableProps() + self.AddPropEntry (table, _('Source host'), 'tmp!wizard_liferay!new_src_host', NOTE_HOST_SRC, value="localhost") + self.AddPropEntry (table, _('Source port'), 'tmp!wizard_liferay!new_src_port', NOTE_HOST_PRT, value=8080) + txt += self.Indent(table) + + txt += '<h2>Logging</h2>' + txt += self._common_add_logging() + + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + return txt + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + new_host = post.pop('tmp!wizard_liferay!new_host') + src_host = post.pop('tmp!wizard_liferay!new_src_host') + src_port = int(post.pop('tmp!wizard_liferay!new_src_port')) + + # Locals + vsrv_pre = cfg_vsrv_get_next (self._cfg) + src_num, src_pre = cfg_source_get_next (self._cfg) + + # Add the new rules + config = CONFIG_VSRV % (locals()) + self._apply_cfg_chunk (config) + self._common_apply_logging (post, vsrv_pre) + + +class Wizard_Rules_Liferay (WizardPage): + ICON = "liferay.png" + DESC = "New directory based on a Liferay project." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/%s/wizard/Liferay'%(pre.split('!')[1]), + id = "Liferay_Page1", + title = _("Liferay Wizard"), + group = WIZARD_GROUP_CMS) + + def show (self): + return True + + def _render_content (self, url_pre): + txt = '<h1>%s</h1>' % (self.title) + + txt += '<h2>Liferay Project</h2>' + table = TableProps() + self.AddPropEntry (table, _('Web Directory'), 'tmp!wizard_liferay!new_webdir', NOTE_WEB_DIR, value="/liferay") + self.AddPropEntry (table, _('Source host'), 'tmp!wizard_liferay!new_src_host', NOTE_HOST_SRC, value="localhost") + self.AddPropEntry (table, _('Source port'), 'tmp!wizard_liferay!new_src_port', NOTE_HOST_PRT, value=8080) + txt += self.Indent(table) + + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + return txt + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + webdir = post.pop('tmp!wizard_liferay!new_webdir') + src_host = post.pop('tmp!wizard_liferay!new_src_host') + src_port = int(post.pop('tmp!wizard_liferay!new_src_port')) + + # Locals + rule_num, rule_pre = cfg_vsrv_rule_get_next (self._cfg, self._pre) + src_num, src_pre = cfg_source_get_next (self._cfg) + + # Add the new rules + config = CONFIG_RULES % (locals()) + self._apply_cfg_chunk (config) + Added: cherokee/trunk/admin/Wizard_Moodle.py =================================================================== --- cherokee/trunk/admin/Wizard_Moodle.py (rev 0) +++ cherokee/trunk/admin/Wizard_Moodle.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -0,0 +1,184 @@ +""" +Moodle wizard. Tested with: +* Cherokee 0.99.25 +* Moodle 1.9.5+ +""" +import validations +from config import * +from util import * +from Page import * +from Wizard import * +from Wizard_PHP import wizard_php_get_info +from Wizard_PHP import wizard_php_get_source_info + +NOTE_SOURCES = _("Path to the directory where the Moodle source code is located. (Example: /usr/share/moodle)") +NOTE_WEB_DIR = _("Web directory where you want Moodle to be accessible. (Example: /course)") +NOTE_HOST = _("Host name of the virtual host that is about to be created.") +ERROR_NO_SRC = _("Does not look like a Moodle source directory.") +ERROR_NO_WEB = _("A web directory must be provided.") +ERROR_NO_HOST = _("A host name must be provided.") + +CONFIG_DIR = """ +# IMPORTANT: The PHP rule comes here + +%(pre_rule_minus1)s!match = directory +%(pre_rule_minus1)s!match!directory = %(web_dir)s +%(pre_rule_minus1)s!match!final = 0 +%(pre_rule_minus1)s!document_root = %(local_src_dir)s +""" + +CONFIG_VSERVER = """ +%(pre_vsrv)s!document_root = %(local_src_dir)s +%(pre_vsrv)s!nick = %(host)s +%(pre_vsrv)s!directory_index = index.php,index.html + +# IMPORTANT: The PHP rule comes here + +%(pre_rule_minus1)s!handler = common +%(pre_rule_minus1)s!handler!iocache = 0 +%(pre_rule_minus1)s!match = default +%(pre_rule_minus1)s!match!final = 1 +""" + +SRC_PATHS = [. + "/usr/share/moodle", # Debian, Fedora + "/var/www/*/htdocs/moodle", # Gentoo + "/srv/www/htdocs/moodle", # SuSE + "/usr/local/www/data/moodle*" # BSD +] + +def is_moodle_dir (path, cfg, nochroot): + path = validations.is_local_dir_exists (path, cfg, nochroot) + module_inc = os.path.join (path, 'lib/moodlelib.php') + if not os.path.exists (module_inc): + raise ValueError, ERROR_NO_SRC + return path + +DATA_VALIDATION = [. + ("tmp!wizard_moodle!sources", (is_moodle_dir, 'cfg')), + ("tmp!wizard_moodle!host", (validations.is_new_host, 'cfg')), + ("tmp!wizard_moodle!web_dir", validations.is_dir_formated) +] + +class Wizard_VServer_Moodle (WizardPage): + ICON = "moodle.png" + DESC = "Configures Moodle e-learning platform on a new virtual server." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/wizard/Moodle', + id = "Moodle_Page1", + title = _("Moodle Wizard"), + group = WIZARD_GROUP_MANAGEMENT) + + def show (self): + return True + + def _render_content (self, url_pre): + txt = '<h1>%s</h1>' % (self.title) + guessed_src = path_find_w_default (SRC_PATHS) + + txt += '<h2>Moodle</h2>' + table = TableProps() + self.AddPropEntry (table, _('New Host Name'), 'tmp!wizard_moodle!host', NOTE_HOST, value="course.example.com") + self.AddPropEntry (table, _('Source Directory'), 'tmp!wizard_moodle!sources', NOTE_SOURCES, value=guessed_src) + txt += self.Indent(table) + + txt += '<h2>Logging</h2>' + txt += self._common_add_logging() + + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + local_src_dir = post.pop('tmp!wizard_moodle!sources') + host = post.pop('tmp!wizard_moodle!host') + pre_vsrv = cfg_vsrv_get_next (self._cfg) + + # Add PHP Rule + from Wizard_PHP import Wizard_Rules_PHP + php_wizard = Wizard_Rules_PHP (self._cfg, pre_vsrv) + php_wizard.show() + php_wizard.run (pre_vsrv, None) + + # Replacement + php_info = wizard_php_get_info (self._cfg, pre_vsrv) + php_rule = int (php_info['rule'].split('!')[-1]) + + pre_rule_minus1 = "%s!rule!%d" % (pre_vsrv, php_rule - 1) + + # Common static + pre_rule_plus1 = "%s!rule!%d" % (pre_vsrv, php_rule + 1) + self._common_add_usual_static_files (pre_rule_plus1) + + # Add the new rules + config = CONFIG_VSERVER % (locals()) + self._apply_cfg_chunk (config) + self._common_apply_logging (post, pre_vsrv) + + +class Wizard_Rules_Moodle (WizardPage): + ICON = "moodle.png" + DESC = "Configures Moodle e-learning platform inside a public web directory." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/%s/wizard/Moodle'%(pre.split('!')[1]), + id = "Moodle_Page1", + title = _("Moodle Wizard"), + group = WIZARD_GROUP_MANAGEMENT) + + def show (self): + # Check for PHP + php_info = wizard_php_get_info (self._cfg, self._pre) + if not php_info: + self.no_show = "PHP support is required." + return False + return True + + def _render_content (self, url_pre): + guessed_src = path_find_w_default (SRC_PATHS) + + table = TableProps() + self.AddPropEntry (table, _('Web Directory'), 'tmp!wizard_moodle!web_dir', NOTE_WEB_DIR, value="/course") + self.AddPropEntry (table, _('Source Directory'),'tmp!wizard_moodle!sources', NOTE_SOURCES, value=guessed_src) + + txt = '<h1>%s</h1>' % (self.title) + txt += self.Indent(table) + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + local_src_dir = post.pop('tmp!wizard_moodle!sources') + web_dir = post.pop('tmp!wizard_moodle!web_dir') + + # Replacement + php_info = wizard_php_get_info (self._cfg, self._pre) + php_rule = int (php_info['rule'].split('!')[-1]) + + pre_rule_minus1 = "%s!rule!%d" % (self._pre, php_rule - 1) + + # Add the new rules + config = CONFIG_DIR % (locals()) + self._apply_cfg_chunk (config) + Added: cherokee/trunk/admin/Wizard_Sugar.py =================================================================== --- cherokee/trunk/admin/Wizard_Sugar.py (rev 0) +++ cherokee/trunk/admin/Wizard_Sugar.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -0,0 +1,225 @@ +""" +SugarCRM wizard. Last checked with: +* Cherokee 0.99.25 +* SugarCE 5.5.0 +""" +import validations +from config import * +from util import * +from Page import * +from Wizard import * +from Wizard_PHP import wizard_php_get_info +from Wizard_PHP import wizard_php_get_source_info + +NOTE_SOURCES = _("Path to the directory where the Sugar CRM source code is located. (Example: /usr/share/sugar)") +NOTE_WEB_DIR = _("Web directory where you want Sugar CRM to be accessible. (Example: /crm)") +NOTE_HOST = _("Host name of the virtual host that is about to be created.") +ERROR_NO_SRC = _("Does not look like a Sugar CRM source directory.") +ERROR_NO_WEB = _("A web directory must be provided.") +ERROR_NO_HOST = _("A host name must be provided.") + +CONFIG_DIR = """ +# The PHP rule comes here + +%(pre_rule_minus1)s!match = directory +%(pre_rule_minus1)s!match!directory = %(web_dir)s +%(pre_rule_minus1)s!match!final = 0 +%(pre_rule_minus1)s!document_root = %(local_src_dir)s + +%(pre_rule_minus2)s!handler = redir +%(pre_rule_minus2)s!handler!rewrite!1!show = 1 +%(pre_rule_minus2)s!handler!rewrite!1!substring = %(web_dir)s/index.php +%(pre_rule_minus2)s!match = request +%(pre_rule_minus2)s!match!request = ^/.*/.*\.php + +%(pre_rule_minus3)s!handler = redir +%(pre_rule_minus3)s!handler!rewrite!1!show = 1 +%(pre_rule_minus3)s!handler!rewrite!1!substring = %(web_dir)s/index.php +%(pre_rule_minus3)s!match = request +%(pre_rule_minus3)s!match!request = emailmandelivery.php + +%(pre_rule_minus4)s!handler = redir +%(pre_rule_minus4)s!handler!rewrite!1!show = 0 +%(pre_rule_minus4)s!handler!rewrite!1!substring = %(web_dir)s/log_file_restricted.html +%(pre_rule_minus4)s!match = request +%(pre_rule_minus4)s!match!request = ^/(.*\.log.*|not_imported_.*txt) +""" + +CONFIG_SRV = """ +%(pre_vsrv)s!nick = %(host)s +%(pre_vsrv)s!document_root = %(local_src_dir)s +%(pre_vsrv)s!directory_index = index.php,index.html + +%(pre_rule_plus3)s!handler = redir +%(pre_rule_plus3)s!handler!rewrite!1!show = 1 +%(pre_rule_plus3)s!handler!rewrite!1!substring = /index.php +%(pre_rule_plus3)s!match = request +%(pre_rule_plus3)s!match!request = ^/.*/.*\.php + +%(pre_rule_plus2)s!handler = redir +%(pre_rule_plus2)s!handler!rewrite!1!show = 1 +%(pre_rule_plus2)s!handler!rewrite!1!substring = /index.php +%(pre_rule_plus2)s!match = request +%(pre_rule_plus2)s!match!request = emailmandelivery.php + +%(pre_rule_plus1)s!handler = redir +%(pre_rule_plus1)s!handler!rewrite!1!show = 0 +%(pre_rule_plus1)s!handler!rewrite!1!substring = /log_file_restricted.html +%(pre_rule_plus1)s!match = request +%(pre_rule_plus1)s!match!request = ^/(.*\.log.*|not_imported_.*txt) + +# The PHP rule comes here + +%(pre_rule_minus1)s!handler = common +%(pre_rule_minus1)s!handler!iocache = 0 +%(pre_rule_minus1)s!match = default +""" + +SRC_PATHS = [. + "/usr/share/sugar", # Debian, Fedora + "/var/www/*/htdocs/sugar", # Gentoo + "/srv/www/htdocs/sugar", # SuSE + "/usr/local/www/data/sugar" # BSD +] + +def is_sugar_dir (path, cfg, nochroot): + path = validations.is_local_dir_exists (path, cfg, nochroot) + module_inc = os.path.join (path, 'include/entryPoint.php') + if not os.path.exists (module_inc): + raise ValueError, ERROR_NO_SRC + return path + +DATA_VALIDATION = [. + ("tmp!wizard_sugar!sources", (is_sugar_dir, 'cfg')), + ("tmp!wizard_sugar!host", (validations.is_new_host, 'cfg')), + ("tmp!wizard_sugar!web_dir", validations.is_dir_formated) +] + + +class Wizard_VServer_Sugar (WizardPage): + ICON = "sugarcrm.png" + DESC = "Configure a new virtual server for Sugar CRM." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/wizard/Sugar', + id = "Sugar_Page1", + title = _("Sugar Wizard"), + group = WIZARD_GROUP_MANAGEMENT) + + def show (self): + return True + + def _render_content (self, url_pre): + txt = '<h1>%s</h1>' % (self.title) + guessed_src = path_find_w_default (SRC_PATHS) + + txt += '<h2>Sugar</h2>' + table = TableProps() + self.AddPropEntry (table, _('New Host Name'), 'tmp!wizard_sugar!host', NOTE_HOST, value="sugar.example.com") + self.AddPropEntry (table, _('Source Directory'), 'tmp!wizard_sugar!sources', NOTE_SOURCES, value=guessed_src) + txt += self.Indent(table) + + txt += '<h2>Logging</h2>' + txt += self._common_add_logging() + + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + local_src_dir = post.pop('tmp!wizard_sugar!sources') + host = post.pop('tmp!wizard_sugar!host') + pre_vsrv = cfg_vsrv_get_next (self._cfg) + + # Add PHP Rule + from Wizard_PHP import Wizard_Rules_PHP + php_wizard = Wizard_Rules_PHP (self._cfg, pre_vsrv) + php_wizard.show() + php_wizard.run (pre_vsrv, None) + + # Replacement + php_info = wizard_php_get_info (self._cfg, pre_vsrv) + php_rule = int (php_info['rule'].split('!')[-1]) + + pre_rule_plus3 = "%s!rule!%d" % (pre_vsrv, php_rule + 3) + pre_rule_plus2 = "%s!rule!%d" % (pre_vsrv, php_rule + 2) + pre_rule_plus1 = "%s!rule!%d" % (pre_vsrv, php_rule + 1) + pre_rule_minus1 = "%s!rule!%d" % (pre_vsrv, php_rule - 1) + + # Common static + pre_rule_plus4 = "%s!rule!%d" % (pre_vsrv, php_rule + 4) + self._common_add_usual_static_files (pre_rule_plus4) + + # Add the new rules + config = CONFIG_SRV % (locals()) + self._apply_cfg_chunk (config) + self._common_apply_logging (post, pre_vsrv) + + +class Wizard_Rules_Sugar (WizardPage): + ICON = "sugarcrm.png" + DESC = "Configures Sugar CRM inside a public web directory." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/%s/wizard/Sugar'%(pre.split('!')[1]), + id = "Sugar_Page1", + title = _("Sugar Wizard"), + group = WIZARD_GROUP_MANAGEMENT) + + def show (self): + # Check for PHP + php_info = wizard_php_get_info (self._cfg, self._pre) + if not php_info: + self.no_show = "PHP support is required." + return False + return True + + def _render_content (self, url_pre): + guessed_src = path_find_w_default (SRC_PATHS) + + table = TableProps() + self.AddPropEntry (table, _('Web Directory'), 'tmp!wizard_sugar!web_dir', NOTE_WEB_DIR, value="/sugar") + self.AddPropEntry (table, _('Source Directory'),'tmp!wizard_sugar!sources', NOTE_SOURCES, value=guessed_src) + + txt = '<h1>%s</h1>' % (self.title) + txt += self.Indent(table) + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + local_src_dir = post.pop('tmp!wizard_sugar!sources') + web_dir = post.pop('tmp!wizard_sugar!web_dir') + + # Replacement + php_info = wizard_php_get_info (self._cfg, self._pre) + php_rule = int (php_info['rule'].split('!')[-1]) + + pre_rule_minus4 = "%s!rule!%d" % (self._pre, php_rule - 4) + pre_rule_minus3 = "%s!rule!%d" % (self._pre, php_rule - 3) + pre_rule_minus2 = "%s!rule!%d" % (self._pre, php_rule - 2) + pre_rule_minus1 = "%s!rule!%d" % (self._pre, php_rule - 1) + + # Add the new rules + config = CONFIG_DIR % (locals()) + self._apply_cfg_chunk (config) Added: cherokee/trunk/admin/Wizard_Symfony.py =================================================================== --- cherokee/trunk/admin/Wizard_Symfony.py (rev 0) +++ cherokee/trunk/admin/Wizard_Symfony.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -0,0 +1,225 @@ +""" +Symfony wizard. Checked with: +* Cherokee 0.99.25 +* Symfony 1.2.9 +""" +import validations +from config import * +from util import * +from Page import * +from Wizard import * +from Wizard_PHP import wizard_php_get_info +from Wizard_PHP import wizard_php_get_source_info + +NOTE_SOURCES = _("Path to the directory where Symfony is installed. (Example: /usr/share/php/data/symfony)") +NOTE_DROOT = _("Path to the web folder of the Symfony project. (Example: /home/user/sf_project/web)") +NOTE_WEB_DIR = _("Web directory where you want Symfony to be accessible. (Example: /app)") +NOTE_HOST = _("Host name of the virtual host that is about to be created.") +ERROR_NO_SRC = _("Does not look like a Symfony source directory.") +ERROR_NO_WEB = _("A web directory must be provided.") +ERROR_NO_HOST = _("A host name must be provided.") + +CONFIG_DIR = """ +%(pre_rule_plus1)s!document_root = %(local_src_dir)s/web/sf +%(pre_rule_plus1)s!encoder!gzip = 1 +%(pre_rule_plus1)s!handler = file +%(pre_rule_plus1)s!handler!iocache = 1 +%(pre_rule_plus1)s!match = directory +%(pre_rule_plus1)s!match!directory = %(web_dir)s/sf + +# PHP rule + +%(pre_rule_minus1)s!match = and +%(pre_rule_minus1)s!match!final = 1 +%(pre_rule_minus1)s!match!left = directory +%(pre_rule_minus1)s!match!left!directory = %(web_dir)s +%(pre_rule_minus1)s!match!right = exists +%(pre_rule_minus1)s!match!right!iocache = 1 +%(pre_rule_minus1)s!match!right!match_any = 1 +%(pre_rule_minus1)s!handler = file +%(pre_rule_minus1)s!handler!iocache = 1 + +%(pre_rule_minus2)s!match = request +%(pre_rule_minus2)s!match!request = %(web_dir)s/(.+) +%(pre_rule_minus2)s!handler = redir +%(pre_rule_minus2)s!handler!rewrite!1!show = 0 +%(pre_rule_minus2)s!handler!rewrite!1!substring = %(web_dir)s/index.php +""" + +CONFIG_VSERVER = """ +%(pre_vsrv)s!nick = %(host)s +%(pre_vsrv)s!document_root = %(document_root)s +%(pre_vsrv)s!directory_index = index.php,index.html + +%(pre_rule_plus1)s!document_root = %(local_src_dir)s/web/sf +%(pre_rule_plus1)s!encoder!gzip = 1 +%(pre_rule_plus1)s!handler = file +%(pre_rule_plus1)s!handler!iocache = 1 +%(pre_rule_plus1)s!match = directory +%(pre_rule_plus1)s!match!directory = /sf + +# PHP rule + +%(pre_rule_minus1)s!handler = file +%(pre_rule_minus1)s!match = and +%(pre_rule_minus1)s!match!right = exists +%(pre_rule_minus1)s!match!right!match_any = 1 +%(pre_rule_minus1)s!match!right!match_index_files = 1 +%(pre_rule_minus1)s!match!right!match_only_files = 1 +%(pre_rule_minus1)s!match!left = not +%(pre_rule_minus1)s!match!left!right = request +%(pre_rule_minus1)s!match!left!right!request = ^/$ + +%(pre_rule_minus2)s!handler = redir +%(pre_rule_minus2)s!handler!rewrite!1!regex = /.+ +%(pre_rule_minus2)s!handler!rewrite!1!show = 0 +%(pre_rule_minus2)s!handler!rewrite!1!substring = /index.php +%(pre_rule_minus2)s!match = default +""" + +SRC_PATHS = [. + "/usr/share/php/data/symfony1.0", # Debian, Fedora + "/usr/share/php/data/symfony1.2", + "/usr/share/php/data/symfony", + "/usr/local/lib/php/data/symfony" # Pear installation +] + +def is_symfony_dir (path, cfg, nochroot): + path = validations.is_local_dir_exists (path, cfg, nochroot) + module_inc = os.path.join (path, 'bin/symfony.php') + if not os.path.exists (module_inc): + raise ValueError, ERROR_NO_SRC + return path + +DATA_VALIDATION = [. + ("tmp!wizard_symfony!sources", (is_symfony_dir, 'cfg')), + ("tmp!wizard_symfony!host", (validations.is_new_host, 'cfg')), + ("tmp!wizard_symfony!web_dir", validations.is_dir_formated), + ("tmp!wizard_symfony!document_root", (validations.is_local_dir_exists, 'cfg')) +] + +class Wizard_VServer_Symfony (WizardPage): + ICON = "symfony.png" + DESC = "Configure a new virtual server using Symfony." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/wizard/Symfony', + id = "Symfony_Page1", + title = _("Symfony Wizard"), + group = WIZARD_GROUP_PLATFORM) + + def show (self): + return True + + def _render_content (self, url_pre): + txt = '<h1>%s</h1>' % (self.title) + guessed_src = path_find_w_default (SRC_PATHS) + + txt += '<h2>Symfony</h2>' + table = TableProps() + self.AddPropEntry (table, _('New Host Name'), 'tmp!wizard_symfony!host', NOTE_HOST, value="app.example.com") + self.AddPropEntry (table, _('Project Source'), 'tmp!wizard_symfony!document_root', NOTE_DROOT, value="/var/www") + self.AddPropEntry (table, _('Symfony Package'), 'tmp!wizard_symfony!sources', NOTE_SOURCES, value=guessed_src) + txt += self.Indent(table) + + txt += '<h2>Logging</h2>' + txt += self._common_add_logging() + + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + local_src_dir = post.pop('tmp!wizard_symfony!sources') + document_root = post.pop('tmp!wizard_symfony!document_root') + host = post.pop('tmp!wizard_symfony!host') + pre_vsrv = cfg_vsrv_get_next (self._cfg) + + # Add PHP Rule + from Wizard_PHP import Wizard_Rules_PHP + php_wizard = Wizard_Rules_PHP (self._cfg, pre_vsrv) + php_wizard.show() + php_wizard.run (pre_vsrv, None) + + # Replacement + php_info = wizard_php_get_info (self._cfg, pre_vsrv) + php_rule = int (php_info['rule'].split('!')[-1]) + + pre_rule_plus1 = "%s!rule!%d" % (pre_vsrv, php_rule + 1) + pre_rule_minus1 = "%s!rule!%d" % (pre_vsrv, php_rule - 1) + pre_rule_minus2 = "%s!rule!%d" % (pre_vsrv, php_rule - 2) + + # Add the new rules + config = CONFIG_VSERVER % (locals()) + self._apply_cfg_chunk (config) + self._common_apply_logging (post, pre_vsrv) + + +class Wizard_Rules_Symfony (WizardPage): + ICON = "symfony.png" + DESC = "Configures Symfony inside a public web directory." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/%s/wizard/Symfony'%(pre.split('!')[1]), + id = "Symfony_Page1", + title = _("Symfony Wizard"), + group = WIZARD_GROUP_PLATFORM) + + def show (self): + # Check for PHP + php_info = wizard_php_get_info (self._cfg, self._pre) + if not php_info: + self.no_show = "PHP support is required." + return False + return True + + def _render_content (self, url_pre): + guessed_src = path_find_w_default (SRC_PATHS) + + table = TableProps() + self.AddPropEntry (table, _('Web Directory'), 'tmp!wizard_symfony!web_dir', NOTE_WEB_DIR, value="/app") + self.AddPropEntry (table, _('Project Source'), 'tmp!wizard_symfony!document_root', NOTE_DROOT, value="/var/www") + self.AddPropEntry (table, _('Symfony Package'), 'tmp!wizard_symfony!sources', NOTE_SOURCES, value=guessed_src) + + txt = '<h1>%s</h1>' % (self.title) + txt += self.Indent(table) + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + local_src_dir = post.pop('tmp!wizard_symfony!sources') + document_root = post.pop('tmp!wizard_symfony!document_root') + web_dir = post.pop('tmp!wizard_symfony!web_dir') + + # Replacement + php_info = wizard_php_get_info (self._cfg, self._pre) + php_rule = int (php_info['rule'].split('!')[-1]) + + pre_rule_plus1 = "%s!rule!%d" % (self._pre, php_rule + 1) + pre_rule_minus1 = "%s!rule!%d" % (self._pre, php_rule - 1) + pre_rule_minus2 = "%s!rule!%d" % (self._pre, php_rule - 2) + + # Add the new rules + config = CONFIG_DIR % (locals()) + self._apply_cfg_chunk (config) Added: cherokee/trunk/admin/Wizard_Trac.py =================================================================== --- cherokee/trunk/admin/Wizard_Trac.py (rev 0) +++ cherokee/trunk/admin/Wizard_Trac.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -0,0 +1,142 @@ +""" +Trac wizard. + +Last update: +* Cherokee 0.99.25 +* Trac 0.11.1 +""" +import validations + +from config import * +from util import * +from Page import * +from Wizard import * + +NOTE_TRAC_PROJECT = _("Local path to the Trac project.") +NOTE_TRAC_DATA = _("Local path to the Trac installation. (Example: /usr/share/trac)") +NOTE_NEW_HOST = _("Name of the new domain that will be created.") + +ERROR_NO_TRAC_PROJECT = _("It does not look like a Trac based project directory.") +ERROR_NO_TRAC_DATA = _("It does not look like a Trac installation.") + +# TCP port value is automatically asigned to one currently not in use + +SOURCE = """ +source!%(src_num)d!type = interpreter +source!%(src_num)d!nick = Trac %(src_num)d +source!%(src_num)d!host = 127.0.0.1:%(src_port)d +source!%(src_num)d!interpreter = tracd --single-env --daemonize --protocol=scgi --hostname=127.0.0.1 --port=%(src_port)s %(trac_project)s +""" + +CONFIG_VSRV = SOURCE + """ +%(vsrv_pre)s!nick = %(new_host)s +%(vsrv_pre)s!document_root = /dev/null + +%(vsrv_pre)s!rule!10!match = directory +%(vsrv_pre)s!rule!10!match!directory = /chrome/common +%(vsrv_pre)s!rule!10!document_root = %(trac_data)s/htdocs +%(vsrv_pre)s!rule!10!handler = file +%(vsrv_pre)s!rule!10!expiration = time +%(vsrv_pre)s!rule!10!expiration!time = 7d + +%(vsrv_pre)s!rule!1!match = default +%(vsrv_pre)s!rule!1!encoder!gzip = 1 +%(vsrv_pre)s!rule!1!handler = scgi +%(vsrv_pre)s!rule!1!handler!change_user = 0 +%(vsrv_pre)s!rule!1!handler!check_file = 0 +%(vsrv_pre)s!rule!1!handler!error_handler = 0 +%(vsrv_pre)s!rule!1!handler!pass_req_headers = 1 +%(vsrv_pre)s!rule!1!handler!xsendfile = 0 +%(vsrv_pre)s!rule!1!handler!balancer = round_robin +%(vsrv_pre)s!rule!1!handler!balancer!source!1 = %(src_num)d +""" + +def is_trac_data (path, cfg, nochroot): + path = validations.is_local_dir_exists (path, cfg, nochroot) + manage = os.path.join (path, "htdocs") + + if not os.path.exists (manage): + raise ValueError, ERROR_NO_TRAC_DATA + return path + +def is_trac_project (path, cfg, nochroot): + path = validations.is_local_dir_exists (path, cfg, nochroot) + manage = os.path.join (path, "conf/trac.ini") + + if not os.path.exists (manage): + raise ValueError, ERROR_NO_TRAC_PROJECT + return path + +DATA_VALIDATION = [. + ("tmp!wizard_trac!trac_data", (is_trac_data, 'cfg')), + ("tmp!wizard_trac!trac_project",(is_trac_project, 'cfg')), + ("tmp!wizard_trac!new_host", (validations.is_new_host, 'cfg')), + ("tmp!wizard_trac!new_webdir", validations.is_dir_formated) +] + +SRC_PATHS = [ + "/usr/share/pyshared/trac", + "/usr/share/trac" +] + +class Wizard_VServer_Trac (WizardPage): + ICON = "trac.png" + DESC = "New virtual server based on a Trac project." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/wizard/Trac', + id = "Trac_Page1", + title = _("Trac Wizard"), + group = WIZARD_GROUP_CMS) + + def show (self): + return True + + def _render_content (self, url_pre): + txt = '<h1>%s</h1>' % (self.title) + guessed_src = path_find_w_default (SRC_PATHS) + + txt += '<h2>New Virtual Server</h2>' + table = TableProps() + self.AddPropEntry (table, _('New Host Name'), 'tmp!wizard_trac!new_host', NOTE_NEW_HOST, value="trac.example.com") + txt += self.Indent(table) + + txt += '<h2>Trac Project</h2>' + table = TableProps() + self.AddPropEntry (table, _('Project Directory'), 'tmp!wizard_trac!trac_project', NOTE_TRAC_PROJECT, value=os_get_document_root()) + self.AddPropEntry (table, _('Trac Directory'), 'tmp!wizard_trac!trac_data', NOTE_TRAC_DATA, value=guessed_src) + txt += self.Indent(table) + + txt += '<h2>Logging</h2>' + txt += self._common_add_logging() + + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + return txt + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + new_host = post.pop('tmp!wizard_trac!new_host') + trac_data = post.pop('tmp!wizard_trac!trac_data') + trac_project = post.pop('tmp!wizard_trac!trac_project') + + # Locals + vsrv_pre = cfg_vsrv_get_next (self._cfg) + src_num, src_pre = cfg_source_get_next (self._cfg) + src_port = cfg_source_find_free_port () + + # Add the new rules + config = CONFIG_VSRV % (locals()) + self._apply_cfg_chunk (config) + self._common_apply_logging (post, vsrv_pre) + Modified: cherokee/trunk/admin/Wizard_WordPress.py =================================================================== --- cherokee/trunk/admin/Wizard_WordPress.py 2009-10-08 16:06:25 UTC (rev 3689) +++ cherokee/trunk/admin/Wizard_WordPress.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -99,8 +99,8 @@ def show (self): return True - - def _render_content (self, url_pre): + + def _render_content (self, url_pre): txt = '<h1>%s</h1>' % (self.title) guessed_src = path_find_w_default (SRC_PATHS) Added: cherokee/trunk/admin/Wizard_Zend.py =================================================================== --- cherokee/trunk/admin/Wizard_Zend.py (rev 0) +++ cherokee/trunk/admin/Wizard_Zend.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -0,0 +1,193 @@ +""" +Zend wizard. Checked with: +* Cherokee 0.99.25 +* Zend 1.9.3 +""" +import validations +from config import * +from util import * +from Page import * +from Wizard import * +from Wizard_PHP import wizard_php_get_info +from Wizard_PHP import wizard_php_get_source_info + +NOTE_SOURCES = _("Path to the directory where the Zend source code is located. (Example: /usr/share/zend)") +NOTE_WEB_DIR = _("Web directory where you want Zend to be accessible. (Example: /blog)") +NOTE_HOST = _("Host name of the virtual host that is about to be created.") +ERROR_NO_SRC = _("Does not look like a Zend source directory.") +ERROR_NO_WEB = _("A web directory must be provided.") +ERROR_NO_HOST = _("A host name must be provided.") + +CONFIG_DIR = """ +# PHP rule + +%(pre_rule_minus1)s!document_root = %(local_src_dir)s +%(pre_rule_minus1)s!match = directory +%(pre_rule_minus1)s!match!directory = %(web_dir)s +%(pre_rule_minus1)s!match!final = 0 + +%(pre_rule_minus2)s!match = and +%(pre_rule_minus2)s!match!final = 1 +%(pre_rule_minus2)s!match!left = directory +%(pre_rule_minus2)s!match!left!directory = %(web_dir)s +%(pre_rule_minus2)s!match!right = exists +%(pre_rule_minus2)s!match!right!iocache = 1 +%(pre_rule_minus2)s!match!right!match_any = 1 +%(pre_rule_minus2)s!handler = file +%(pre_rule_minus2)s!handler!iocache = 1 + +%(pre_rule_minus3)s!match = request +%(pre_rule_minus3)s!match!request = %(web_dir)s/.+ +%(pre_rule_minus3)s!handler = redir +%(pre_rule_minus3)s!handler!rewrite!1!show = 0 +%(pre_rule_minus3)s!handler!rewrite!1!substring = %(web_dir)s/index.php +""" + +CONFIG_VSERVER = """ +%(pre_vsrv)s!nick = %(host)s +%(pre_vsrv)s!document_root = %(local_src_dir)s +%(pre_vsrv)s!directory_index = index.php,index.html + +# PHP rule + +%(pre_rule_minus1)s!handler = common +%(pre_rule_minus1)s!match = fullpath +%(pre_rule_minus1)s!match!fullpath!1 = / + +%(pre_rule_minus2)s!handler = common +%(pre_rule_minus2)s!match = exists +%(pre_rule_minus2)s!match!match_any = 1 + +%(pre_rule_minus3)s!handler = redir +%(pre_rule_minus3)s!handler!rewrite!1!regex = ^.*$ +%(pre_rule_minus3)s!handler!rewrite!1!show = 0 +%(pre_rule_minus3)s!handler!rewrite!1!substring = /index.php +%(pre_rule_minus3)s!match = default +%(pre_rule_minus3)s!match!final = 1 +""" + + +DATA_VALIDATION = [. + ("tmp!wizard_zend!sources", (validations.is_local_dir_exists, 'cfg')), + ("tmp!wizard_zend!host", (validations.is_new_host, 'cfg')), + ("tmp!wizard_zend!web_dir", validations.is_dir_formated) +] + +class Wizard_VServer_Zend (WizardPage): + ICON = "zend.png" + DESC = "Configures Zend in a new virtual server." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/wizard/Zend', + id = "Zend_Page1", + title = _("Zend Wizard"), + group = WIZARD_GROUP_PLATFORM) + + def show (self): + return True + + def _render_content (self, url_pre): + txt = '<h1>%s</h1>' % (self.title) + + txt += '<h2>Zend</h2>' + table = TableProps() + self.AddPropEntry (table, _('New Host Name'), 'tmp!wizard_zend!host', NOTE_HOST, value="zend.example.com") + self.AddPropEntry (table, _('Source Directory'), 'tmp!wizard_zend!sources', NOTE_SOURCES, value="/var/www") + txt += self.Indent(table) + + txt += '<h2>Logging</h2>' + txt += self._common_add_logging() + + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + local_src_dir = post.pop('tmp!wizard_zend!sources') + host = post.pop('tmp!wizard_zend!host') + pre_vsrv = cfg_vsrv_get_next (self._cfg) + + # Add PHP Rule + from Wizard_PHP import Wizard_Rules_PHP + php_wizard = Wizard_Rules_PHP (self._cfg, pre_vsrv) + php_wizard.show() + php_wizard.run (pre_vsrv, None) + + # Replacement + php_info = wizard_php_get_info (self._cfg, pre_vsrv) + php_rule = int (php_info['rule'].split('!')[-1]) + + pre_rule_minus1 = "%s!rule!%d" % (pre_vsrv, php_rule - 1) + pre_rule_minus2 = "%s!rule!%d" % (pre_vsrv, php_rule - 2) + pre_rule_minus3 = "%s!rule!%d" % (pre_vsrv, php_rule - 3) + + # Add the new rules + config = CONFIG_VSERVER % (locals()) + self._apply_cfg_chunk (config) + self._common_apply_logging (post, pre_vsrv) + + +class Wizard_Rules_Zend (WizardPage): + ICON = "zend.png" + DESC = "Configures Zend inside a public web directory." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/%s/wizard/Zend'%(pre.split('!')[1]), + id = "Zend_Page1", + title = _("Zend Wizard"), + group = WIZARD_GROUP_PLATFORM) + + def show (self): + # Check for PHP + php_info = wizard_php_get_info (self._cfg, self._pre) + if not php_info: + self.no_show = "PHP support is required." + return False + return True + + def _render_content (self, url_pre): + table = TableProps() + self.AddPropEntry (table, _('Web Directory'), 'tmp!wizard_zend!web_dir', NOTE_WEB_DIR, value="/zend") + self.AddPropEntry (table, _('Source Directory'),'tmp!wizard_zend!sources', NOTE_SOURCES, value="/var/www") + + txt = '<h1>%s</h1>' % (self.title) + txt += self.Indent(table) + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + local_src_dir = post.pop('tmp!wizard_zend!sources') + web_dir = post.pop('tmp!wizard_zend!web_dir') + + # Replacement + php_info = wizard_php_get_info (self._cfg, self._pre) + php_rule = int (php_info['rule'].split('!')[-1]) + + pre_rule_minus1 = "%s!rule!%d" % (self._pre, php_rule - 1) + pre_rule_minus2 = "%s!rule!%d" % (self._pre, php_rule - 2) + pre_rule_minus3 = "%s!rule!%d" % (self._pre, php_rule - 3) + + # Add the new rules + config = CONFIG_DIR % (locals()) + self._apply_cfg_chunk (config) Added: cherokee/trunk/admin/Wizard_phpBB.py =================================================================== --- cherokee/trunk/admin/Wizard_phpBB.py (rev 0) +++ cherokee/trunk/admin/Wizard_phpBB.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -0,0 +1,189 @@ +""" +phpBB wizard. Last checked with: +* Cherokee 0.99.25 +* phpBB 3.0.5 +""" +import validations +from config import * +from util import * +from Page import * +from Wizard import * +from Wizard_PHP import wizard_php_get_info +from Wizard_PHP import wizard_php_get_source_info + +NOTE_SOURCES = _("Path to the directory where the phpBB source code is located. (Example: /usr/share/phpbb)") +NOTE_WEB_DIR = _("Web directory where you want phpBB to be accessible. (Example: /phpbb)") +NOTE_HOST = _("Host name of the virtual host that is about to be created.") +ERROR_NO_SRC = _("Does not look like a phpBB source directory.") +ERROR_NO_WEB = _("A web directory must be provided.") +ERROR_NO_HOST = _("A host name must be provided.") + +CONFIG_DIR = """ +%(pre_rule_plus1)s!handler = custom_error +%(pre_rule_plus1)s!handler!error = 403 +%(pre_rule_plus1)s!match = request +%(pre_rule_plus1)s!match!request = ^%(web_dir)s/(config.php|common.php|cache/.*|files/.*|images/avatars/upload/.*|store/.*) + +# IMPORTANT: The PHP rule comes here +""" + +CONFIG_VSERVER = """ +%(pre_vsrv)s!nick = %(host)s +%(pre_vsrv)s!document_root = %(local_src_dir)s +%(pre_vsrv)s!directory_index = index.php,index.html + +%(pre_rule_plus1)s!handler = custom_error +%(pre_rule_plus1)s!handler!error = 403 +%(pre_rule_plus1)s!match = request +%(pre_rule_plus1)s!match!request = /(config.php|common.php|cache/.*|files/.*|images/avatars/upload/.*|store/.*) + +# The PHP rule comes here + +%(pre_rule_minus1)s!handler = common +%(pre_rule_minus1)s!handler!iocache = 0 +%(pre_rule_minus1)s!match = default +""" + +SRC_PATHS = [. + "/usr/share/phpBB3", # Debian, Fedora + "/usr/share/phpbb", + "/var/www/*/htdocs/phpbb", # Gentoo + "/srv/www/htdocs/phpbb", # SuSE + "/usr/local/www/data/phpbb*" # BSD +] + +def is_phpbb_dir (path, cfg, nochroot): + path = validations.is_local_dir_exists (path, cfg, nochroot) + module_inc = os.path.join (path, 'includes/bbcode.php') + if not os.path.exists (module_inc): + raise ValueError, ERROR_NO_SRC + return path + +DATA_VALIDATION = [. + ("tmp!wizard_phpbb!sources", (is_phpbb_dir, 'cfg')), + ("tmp!wizard_phpbb!host", (validations.is_new_host, 'cfg')), + ("tmp!wizard_phpbb!web_dir", validations.is_dir_formated) +] + +class Wizard_VServer_phpBB (WizardPage): + ICON = "phpbb.png" + DESC = "Configure a new virtual server using phpBB." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/wizard/phpBB', + id = "phpBB_Page1", + title = _("phpBB Wizard"), + group = WIZARD_GROUP_MISC) + + def show (self): + return True + + def _render_content (self, url_pre): + txt = '<h1>%s</h1>' % (self.title) + guessed_src = path_find_w_default (SRC_PATHS) + + txt += '<h2>phpBB</h2>' + table = TableProps() + self.AddPropEntry (table, _('New Host Name'), 'tmp!wizard_phpbb!host', NOTE_HOST, value="bulletin.example.com") + self.AddPropEntry (table, _('Source Directory'), 'tmp!wizard_phpbb!sources', NOTE_SOURCES, value=guessed_src) + txt += self.Indent(table) + + txt += '<h2>Logging</h2>' + txt += self._common_add_logging() + + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + local_src_dir = post.pop('tmp!wizard_phpbb!sources') + host = post.pop('tmp!wizard_phpbb!host') + pre_vsrv = cfg_vsrv_get_next (self._cfg) + + # Add PHP Rule + from Wizard_PHP import Wizard_Rules_PHP + php_wizard = Wizard_Rules_PHP (self._cfg, pre_vsrv) + php_wizard.show() + php_wizard.run (pre_vsrv, None) + + # Replacement + php_info = wizard_php_get_info (self._cfg, pre_vsrv) + php_rule = int (php_info['rule'].split('!')[-1]) + + pre_rule_plus1 = "%s!rule!%d" % (pre_vsrv, php_rule + 1) + pre_rule_minus1 = "%s!rule!%d" % (pre_vsrv, php_rule - 1) + + # Common static + pre_rule_plus3 = "%s!rule!%d" % (pre_vsrv, php_rule + 3) + self._common_add_usual_static_files (pre_rule_plus3) + + # Add the new rules + config = CONFIG_VSERVER % (locals()) + self._apply_cfg_chunk (config) + self._common_apply_logging (post, pre_vsrv) + + +class Wizard_Rules_phpBB (WizardPage): + ICON = "phpbb.png" + DESC = "Configures phpBB inside a public web directory." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/%s/wizard/phpBB'%(pre.split('!')[1]), + id = "phpBB_Page1", + title = _("phpBB Wizard"), + group = WIZARD_GROUP_MISC) + + def show (self): + # Check for PHP + php_info = wizard_php_get_info (self._cfg, self._pre) + if not php_info: + self.no_show = "PHP support is required." + return False + return True + + def _render_content (self, url_pre): + guessed_src = path_find_w_default (SRC_PATHS) + + table = TableProps() + self.AddPropEntry (table, _('Web Directory'), 'tmp!wizard_phpbb!web_dir', NOTE_WEB_DIR, value="/bulletin") + self.AddPropEntry (table, _('Source Directory'),'tmp!wizard_phpbb!sources', NOTE_SOURCES, value=guessed_src) + + txt = '<h1>%s</h1>' % (self.title) + txt += self.Indent(table) + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + local_src_dir = post.pop('tmp!wizard_phpbb!sources') + web_dir = post.pop('tmp!wizard_phpbb!web_dir') + + # Replacement + php_info = wizard_php_get_info (self._cfg, self._pre) + php_rule = int (php_info['rule'].split('!')[-1]) + + pre_rule_plus1 = "%s!rule!%d" % (self._pre, php_rule + 1) + + # Add the new rules + config = CONFIG_DIR % (locals()) + self._apply_cfg_chunk (config) Added: cherokee/trunk/admin/Wizard_phpMyAdmin.py =================================================================== --- cherokee/trunk/admin/Wizard_phpMyAdmin.py (rev 0) +++ cherokee/trunk/admin/Wizard_phpMyAdmin.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -0,0 +1,106 @@ +""" +phpMyAdmin wizard. Checked with: +* Cherokee 0.99.25 +* phpMyAdmin 3.1.2 +""" +import validations +from config import * +from util import * +from Page import * +from Wizard import * +from Wizard_PHP import wizard_php_get_info +from Wizard_PHP import wizard_php_get_source_info + +NOTE_SOURCES = _("Path to the directory where the phpMyAdmin source code is located. (Example: /usr/share/phpmyadmin)") +NOTE_WEB_DIR = _("Web directory where you want phpMyAdmin to be accessible. (Example: /phpmyadmin)") +ERROR_NO_SRC = _("Does not look like a phpMyAdmin source directory.") +ERROR_NO_WEB = _("A web directory must be provided.") + +CONFIG_DIR = """ +%(pre_rule_plus2)s!handler = custom_error +%(pre_rule_plus2)s!handler!error = 403 +%(pre_rule_plus2)s!match = or +%(pre_rule_plus2)s!match!left = directory +%(pre_rule_plus2)s!match!left!directory = %(web_dir)s/libraries +%(pre_rule_plus2)s!match!right = directory +%(pre_rule_plus2)s!match!right!directory = %(web_dir)s/setup/lib + +%(pre_rule_plus1)s!match = directory +%(pre_rule_plus1)s!match!directory = %(web_dir)s +%(pre_rule_plus1)s!match!final = 0 +%(pre_rule_plus1)s!document_root = %(local_src_dir)s + +# IMPORTANT: The PHP rule comes here +""" + +SRC_PATHS = [ + "/usr/share/phpmyadmin" # Debian, Fedora +] + +def is_phpmyadmin_dir (path, cfg, nochroot): + path = validations.is_local_dir_exists (path, cfg, nochroot) + module_inc = os.path.join (path, 'libraries/PMA.php') + if not os.path.exists (module_inc): + raise ValueError, ERROR_NO_SRC + return path + +DATA_VALIDATION = [ + ("tmp!wizard_phpmyadmin!sources", (is_phpmyadmin_dir, 'cfg')), + ("tmp!wizard_phpmyadmin!web_dir", validations.is_dir_formated) +] + +class Wizard_Rules_phpMyAdmin (WizardPage): + ICON = "phpmyadmin.png" + DESC = "Configures phpMyAdmin inside a public web directory." + + def __init__ (self, cfg, pre): + WizardPage.__init__ (self, cfg, pre, + submit = '/vserver/%s/wizard/phpMyAdmin'%(pre.split('!')[1]), + id = "phpMyAdmin_Page1", + title = _("phpMyAdmin Wizard"), + group = WIZARD_GROUP_DB) + + def show (self): + # Check for PHP + php_info = wizard_php_get_info (self._cfg, self._pre) + if not php_info: + self.no_show = "PHP support is required." + return False + return True + + def _render_content (self, url_pre): + guessed_src = path_find_w_default (SRC_PATHS) + + table = TableProps() + self.AddPropEntry (table, _('Web Directory'), 'tmp!wizard_phpmyadmin!web_dir', NOTE_WEB_DIR, value="/phpmyadmin") + self.AddPropEntry (table, _('Source Directory'),'tmp!wizard_phpmyadmin!sources', NOTE_SOURCES, value=guessed_src) + + txt = '<h1>%s</h1>' % (self.title) + txt += self.Indent(table) + form = Form (url_pre, add_submit=True, auto=False) + return form.Render(txt, DEFAULT_SUBMIT_VALUE) + + def _op_apply (self, post): + # Store tmp, validate and clean up tmp + self._cfg_store_post (post) + + self._ValidateChanges (post, DATA_VALIDATION) + if self.has_errors(): + return + + self._cfg_clean_values (post) + + # Incoming info + local_src_dir = post.pop('tmp!wizard_phpmyadmin!sources') + web_dir = post.pop('tmp!wizard_phpmyadmin!web_dir') + + # Replacement + php_info = wizard_php_get_info (self._cfg, self._pre) + php_rule = int (php_info['rule'].split('!')[-1]) + + pre_rule_plus2 = "%s!rule!%d" % (self._pre, php_rule + 2) + pre_rule_plus1 = "%s!rule!%d" % (self._pre, php_rule + 1) + + # Add the new rules + config = CONFIG_DIR % (locals()) + self._apply_cfg_chunk (config) Added: cherokee/trunk/admin/static/images/wizards/Makefile =================================================================== --- cherokee/trunk/admin/static/images/wizards/Makefile (rev 0) +++ cherokee/trunk/admin/static/images/wizards/Makefile 2009-10-09 16:55:44 UTC (rev 3690) @@ -0,0 +1,440 @@ +# Makefile.in generated by automake 1.10.2 from Makefile.am. +# admin/static/images/wizards/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + + +pkgdatadir = $(datadir)/cherokee +pkglibdir = $(libdir)/cherokee +pkgincludedir = $(includedir)/cherokee +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = i686-pc-linux-gnu +host_triplet = i686-pc-linux-gnu +subdir = admin/static/images/wizards +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/etr_socket_nsl.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libwww.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/mysql.m4 $(top_srcdir)/m4/network.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/pwd_grp.m4 \ + $(top_srcdir)/m4/sendfile_samba.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(wizardsdir)" +wizardsDATA_INSTALL = $(INSTALL_DATA) +DATA = $(wizards_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /home/taher/src/svn.cherokee-project.com/cherokee/trunk/missing --run aclocal-1.10 +AMTAR = ${SHELL} /home/taher/src/svn.cherokee-project.com/cherokee/trunk/missing --run tar +AR = ar +AS = as +AUTOCONF = ${SHELL} /home/taher/src/svn.cherokee-project.com/cherokee/trunk/missing --run autoconf +AUTOHEADER = ${SHELL} /home/taher/src/svn.cherokee-project.com/cherokee/trunk/missing --run autoheader +AUTOMAKE = ${SHELL} /home/taher/src/svn.cherokee-project.com/cherokee/trunk/missing --run automake-1.10 +AWK = gawk +CC = gcc -std=gnu99 +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CHEROKEE_AGE = 0 +CHEROKEE_CURRENT = 0 +CHEROKEE_REVISION = 1 +CPP = gcc -E +CPPFLAGS = +CRYPT_CFLAGS = +CRYPT_LIBS = -lcrypt +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = dlltool +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +ETR_SOCKET_LIBS = +EXEEXT = +FFMPEG_CFLAGS = +FFMPEG_LIBS = -lm +FGREP = /bin/grep -F +GETTEXT_MACRO_VERSION = 0.17 +GMSGFMT = /usr/bin/msgfmt +GMSGFMT_015 = /usr/bin/msgfmt +GREP = /bin/grep +HAVE_MSGFMT = yes +HaveRtldGlobal = YES +HaveRtldLocal = YES +HaveRtldNext = YES +HaveRtldNow = YES +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = /usr/bin/ld +LDFLAGS = +LIBOBJS = +LIBS = -lcrypto -ldl +LIBSSL_CFLAGS = +LIBSSL_LIBS = -lssl +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBTOOL_EXPORT_OPTIONS = -export-symbols-regex "^[^_].*" +LIPO = +LN_S = ln -s +LTLIBOBJS = +MAINT = # +MAKEINFO = ${SHELL} /home/taher/src/svn.cherokee-project.com/cherokee/trunk/missing --run makeinfo +MKDIR_P = /bin/mkdir -p +MSGFMT = /usr/bin/msgfmt +MSGFMT_015 = /usr/bin/msgfmt +MSGMERGE = /usr/bin/msgmerge +MYSQL_CFLAGS = -I/usr/include/mysql -DBIG_JOINS=1 -fPIC -fno-strict-aliasing +MYSQL_CONFIG = /usr/bin/mysql_config +MYSQL_LDFLAGS = -Wl,-Bsymbolic-functions -rdynamic -L/usr/lib/mysql -lmysqlclient +MYSQL_VERSION = 5.0.75 +NM = /usr/bin/nm -B +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OTOOL = +OTOOL64 = +PACKAGE = cherokee +PACKAGE_BUGREPORT = http://bugs.cherokee-project.com/ +PACKAGE_MAJOR_VERSION = 0 +PACKAGE_MICRO_VERSION = 25 +PACKAGE_MINOR_VERSION = 99 +PACKAGE_NAME = cherokee +PACKAGE_PATCH_VERSION = b3689 +PACKAGE_STRING = cherokee 0.99.25 +PACKAGE_TARNAME = cherokee +PACKAGE_VERSION = 0.99.25b3689 +PATH_SEPARATOR = : +PHPCGI = /usr/bin/php-cgi +PTHREAD_CFLAGS = -D_REENTRANT +PTHREAD_LIBS = -lpthread +RANLIB = ranlib +RT_LIBS = -lrt +SED = /bin/sed +SET_MAKE = +SHELL = /bin/bash +STRIP = strip +USE_NLS = yes +VERSION = 0.99.25b3689 +WWW_GROUP = +WWW_ROOT = /var/www +WWW_USER = +XGETTEXT = /usr/bin/xgettext +XGETTEXT_015 = /usr/bin/xgettext +XGETTEXT_EXTRA_OPTIONS = +abs_builddir = /home/taher/src/svn.cherokee-project.com/cherokee/trunk/admin/static/images/wizards +abs_srcdir = /home/taher/src/svn.cherokee-project.com/cherokee/trunk/admin/static/images/wizards +abs_top_builddir = /home/taher/src/svn.cherokee-project.com/cherokee/trunk +abs_top_srcdir = /home/taher/src/svn.cherokee-project.com/cherokee/trunk +ac_ct_CC = gcc +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = i686-pc-linux-gnu +build_alias = +build_cpu = i686 +build_os = linux-gnu +build_vendor = pc +builddir = . +cherokeepath = /usr/sbin/cherokee +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i686-pc-linux-gnu +host_alias = +host_cpu = i686 +host_os = linux-gnu +host_vendor = pc +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = $(SHELL) /home/taher/src/svn.cherokee-project.com/cherokee/trunk/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = /var +lt_ECHO = echo +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = /etc +target_alias = +top_build_prefix = ../../../../ +top_builddir = ../../../.. +top_srcdir = ../../../.. +wizardsdir = "$(datadir)/cherokee/admin/static/images/wizards" +wizards_DATA = \ +alfresco.png \ +aspnet.png \ +common_static.png \ +dbslayer.png \ +django.png \ +drupal.png \ +glassfish.png \ +hotlinking.png \ +icons.png \ +joomla.png \ +liferay.png \ +mailman.png \ +moodle.png \ +nagios.png \ +phpbb.png \ +php.jpg \ +phpmyadmin.png \ +redirect.jpg \ +ror.png \ +rtorrent.png \ +streaming.png \ +sugarcrm.png \ +symfony.png \ +trac.png \ +wordpress.png \ +zend.png + +EXTRA_DIST = \ +$(wizards_DATA) + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu admin/static/images/wizards/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu admin/static/images/wizards/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: # $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): # $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-wizardsDATA: $(wizards_DATA) + @$(NORMAL_INSTALL) + test -z "$(wizardsdir)" || $(MKDIR_P) "$(DESTDIR)$(wizardsdir)" + @list='$(wizards_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(wizardsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(wizardsdir)/$$f'"; \ + $(wizardsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(wizardsdir)/$$f"; \ + done + +uninstall-wizardsDATA: + @$(NORMAL_UNINSTALL) + @list='$(wizards_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(wizardsdir)/$$f'"; \ + rm -f "$(DESTDIR)$(wizardsdir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(wizardsdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-wizardsDATA + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-wizardsDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + install-wizardsDATA installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-wizardsDATA + +# Tell versions [.3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Modified: cherokee/trunk/admin/static/images/wizards/Makefile.am =================================================================== --- cherokee/trunk/admin/static/images/wizards/Makefile.am 2009-10-08 16:06:25 UTC (rev 3689) +++ cherokee/trunk/admin/static/images/wizards/Makefile.am 2009-10-09 16:55:44 UTC (rev 3690) @@ -2,18 +2,32 @@ wizardsdir = "$(datadir)/cherokee/admin/static/images/wizards" wizards_DATA = \ +alfresco.png \ +aspnet.png \ +common_static.png \ +dbslayer.png \ +django.png \ +drupal.png \ +glassfish.png \ +hotlinking.png \ +icons.png \ +joomla.png \ +liferay.png \ +mailman.png \ +moodle.png \ +nagios.png \ +phpbb.png \ php.jpg \ -wordpress.png \ +phpmyadmin.png \ redirect.jpg \ -django.png \ -hotlinking.png \ -drupal.png \ ror.png \ -mailman.png \ -icons.png \ -common_static.png \ +rtorrent.png \ streaming.png \ -rtorrent.png +sugarcrm.png \ +symfony.png \ +trac.png \ +wordpress.png \ +zend.png EXTRA_DIST = \ $(wizards_DATA) Added: cherokee/trunk/admin/static/images/wizards/Makefile.in =================================================================== --- cherokee/trunk/admin/static/images/wizards/Makefile.in (rev 0) +++ cherokee/trunk/admin/static/images/wizards/Makefile.in 2009-10-09 16:55:44 UTC (rev 3690) @@ -0,0 +1,440 @@ +# Makefile.in generated by automake 1.10.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = admin/static/images/wizards +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/etr_socket_nsl.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libwww.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/mysql.m4 $(top_srcdir)/m4/network.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/pwd_grp.m4 \ + $(top_srcdir)/m4/sendfile_samba.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(wizardsdir)" +wizardsDATA_INSTALL = $(INSTALL_DATA) +DATA = $(wizards_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHEROKEE_AGE = @CHEROKEE_AGE@ +CHEROKEE_CURRENT = @CHEROKEE_CURRENT@ +CHEROKEE_REVISION = @CHEROKEE_REVISION@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CRYPT_CFLAGS = @CRYPT_CFLAGS@ +CRYPT_LIBS = @CRYPT_LIBS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETR_SOCKET_LIBS = @ETR_SOCKET_LIBS@ +EXEEXT = @EXEEXT@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FGREP = @FGREP@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +HAVE_MSGFMT = @HAVE_MSGFMT@ +HaveRtldGlobal = @HaveRtldGlobal@ +HaveRtldLocal = @HaveRtldLocal@ +HaveRtldNext = @HaveRtldNext@ +HaveRtldNow = @HaveRtldNow@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSSL_CFLAGS = @LIBSSL_CFLAGS@ +LIBSSL_LIBS = @LIBSSL_LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_EXPORT_OPTIONS = @LIBTOOL_EXPORT_OPTIONS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +MYSQL_CFLAGS = @MYSQL_CFLAGS@ +MYSQL_CONFIG = @MYSQL_CONFIG@ +MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ +MYSQL_VERSION = @MYSQL_VERSION@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_MAJOR_VERSION = @PACKAGE_MAJOR_VERSION@ +PACKAGE_MICRO_VERSION = @PACKAGE_MICRO_VERSION@ +PACKAGE_MINOR_VERSION = @PACKAGE_MINOR_VERSION@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_PATCH_VERSION = @PACKAGE_PATCH_VERSION@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PHPCGI = @PHPCGI@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +RT_LIBS = @RT_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WWW_GROUP = @WWW_GROUP@ +WWW_ROOT = @WWW_ROOT@ +WWW_USER = @WWW_USER@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +cherokeepath = @cherokeepath@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +wizardsdir = "$(datadir)/cherokee/admin/static/images/wizards" +wizards_DATA = \ +alfresco.png \ +aspnet.png \ +common_static.png \ +dbslayer.png \ +django.png \ +drupal.png \ +glassfish.png \ +hotlinking.png \ +icons.png \ +joomla.png \ +liferay.png \ +mailman.png \ +moodle.png \ +nagios.png \ +phpbb.png \ +php.jpg \ +phpmyadmin.png \ +redirect.jpg \ +ror.png \ +rtorrent.png \ +streaming.png \ +sugarcrm.png \ +symfony.png \ +trac.png \ +wordpress.png \ +zend.png + +EXTRA_DIST = \ +$(wizards_DATA) + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu admin/static/images/wizards/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu admin/static/images/wizards/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-wizardsDATA: $(wizards_DATA) + @$(NORMAL_INSTALL) + test -z "$(wizardsdir)" || $(MKDIR_P) "$(DESTDIR)$(wizardsdir)" + @list='$(wizards_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(wizardsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(wizardsdir)/$$f'"; \ + $(wizardsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(wizardsdir)/$$f"; \ + done + +uninstall-wizardsDATA: + @$(NORMAL_UNINSTALL) + @list='$(wizards_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(wizardsdir)/$$f'"; \ + rm -f "$(DESTDIR)$(wizardsdir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(wizardsdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-wizardsDATA + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-wizardsDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + install-wizardsDATA installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-wizardsDATA + +# Tell versions [.3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Added: cherokee/trunk/admin/static/images/wizards/alfresco.png =================================================================== (Binary files differ) Property changes on: cherokee/trunk/admin/static/images/wizards/alfresco.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: cherokee/trunk/admin/static/images/wizards/aspnet.png =================================================================== (Binary files differ) Property changes on: cherokee/trunk/admin/static/images/wizards/aspnet.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: cherokee/trunk/admin/static/images/wizards/dbslayer.png =================================================================== (Binary files differ) Property changes on: cherokee/trunk/admin/static/images/wizards/dbslayer.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: cherokee/trunk/admin/static/images/wizards/glassfish.png =================================================================== (Binary files differ) Property changes on: cherokee/trunk/admin/static/images/wizards/glassfish.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: cherokee/trunk/admin/static/images/wizards/joomla.png =================================================================== (Binary files differ) Property changes on: cherokee/trunk/admin/static/images/wizards/joomla.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: cherokee/trunk/admin/static/images/wizards/liferay.png =================================================================== (Binary files differ) Property changes on: cherokee/trunk/admin/static/images/wizards/liferay.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: cherokee/trunk/admin/static/images/wizards/moodle.png =================================================================== (Binary files differ) Property changes on: cherokee/trunk/admin/static/images/wizards/moodle.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: cherokee/trunk/admin/static/images/wizards/nagios.png =================================================================== (Binary files differ) Property changes on: cherokee/trunk/admin/static/images/wizards/nagios.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: cherokee/trunk/admin/static/images/wizards/phpbb.png =================================================================== (Binary files differ) Property changes on: cherokee/trunk/admin/static/images/wizards/phpbb.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: cherokee/trunk/admin/static/images/wizards/phpmyadmin.png =================================================================== (Binary files differ) Property changes on: cherokee/trunk/admin/static/images/wizards/phpmyadmin.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: cherokee/trunk/admin/static/images/wizards/sugarcrm.png =================================================================== (Binary files differ) Property changes on: cherokee/trunk/admin/static/images/wizards/sugarcrm.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: cherokee/trunk/admin/static/images/wizards/symfony.png =================================================================== (Binary files differ) Property changes on: cherokee/trunk/admin/static/images/wizards/symfony.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: cherokee/trunk/admin/static/images/wizards/trac.png =================================================================== (Binary files differ) Property changes on: cherokee/trunk/admin/static/images/wizards/trac.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: cherokee/trunk/admin/static/images/wizards/zend.png =================================================================== (Binary files differ) Property changes on: cherokee/trunk/admin/static/images/wizards/zend.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: cherokee/trunk/admin/util.py =================================================================== --- cherokee/trunk/admin/util.py 2009-10-08 16:06:25 UTC (rev 3689) +++ cherokee/trunk/admin/util.py 2009-10-09 16:55:44 UTC (rev 3690) @@ -1,6 +1,7 @@ import os import sys import glob +import socket # # Virtual Server @@ -51,7 +52,7 @@ next = tmp[-1] + 10 return (next, "source!%d" % (next)) -def cfg_source_find_interpreter (cfg, +def cfg_source_find_interpreter (cfg, in_interpreter = None, in_nick = None): for i in cfg.keys("source"): @@ -74,7 +75,7 @@ colon = host.rfind(':') if colon < 0: continue - + port = int (host[colon+1:]) if port < 1024: continue @@ -87,7 +88,16 @@ assert (False) +def cfg_source_find_free_port (host_name='localhost'): + """Return a port not currently running anything""" + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.bind((host_name, 0)) + addr, port = s.getsockname() + s.close() + return port + + # # Paths #
|