Current time: 12-22-2024, 09:44 PM Hello There, Guest! (LoginRegister)


Post Reply 
New ispCP Software Installer *RC1*
Author Message
TheCry Away
Member
***

Posts: 851
Joined: Oct 2008
Reputation: 21
Post: #11
RE: New ispCP Software Installer *BETA*
Hi nuxwin.
One question before.
Have you ever installed the beta?
If no, then i will anwser.... Smile

The new codelines are all comment...
But not the variables which i added in a query...
Before i add a new routine i search in other files (where i ment there are such routines which i need)
I think that the paths are not hard coded. If someone find a hard codes path i will fix it.

One file will be fixed in future, because there are hard code paths.

Edit: One command i could not find in the ispcp.conf. This is mkdir.
I think i will add all needed paths to the ispcp.conf.
(This post was last modified: 08-14-2009 04:08 PM by TheCry.)
08-14-2009 03:23 PM
Find all posts by this user Quote this message in a reply
Nuxwin
Unregistered

 
Post: #12
RE: New ispCP Software Installer *BETA*
Hi ;
Hum, do you want me to go crazy ? Big Grin

beta 9.1 --> ispcp-sw-mngr script

Code:
sub sw_add_data {
...

    $rs = sys_command_rs("/bin/cp $sw_src_path-$sw_software_id.tar.gz $sw_tmp_path/");
    $rs = sys_command_rs("/bin/tar -xzf $sw_tmp_path/$sw_software_archive-$sw_software_id.tar.gz");
    $rs = sys_command_rs("/bin/cp -r $sw_tmp_path/web/* $sw_dest_path/");
    $rs = sys_command_rs("/bin/chown -R $uid:$gid $sw_dest_path/*");
    $rs = sys_command_rs("/bin/sh $sw_tmp_path/$sw_software_archive \"install,$sw_software_db,$sw_software_prefix,

...
}

sub sw_del_data {
...
        $rs = sys_command_rs("/bin/cp $sw_src_path-$sw_software_id.tar.gz $sw_tmp_path/");
        $rs = sys_command_rs("/bin/tar -xzf $sw_tmp_path/$sw_software_archive-$sw_software_id.tar.gz");
        $rs = sys_command_rs("/bin/sh $sw_tmp_path/$sw_software_archive \"delete,$sw_software_db,$sw_software_prefix,$sw_database,$sw_database_user,$sw_da​tabase_tmp_pwd,$sw_install_username,$sw_install_password,$sw_install_email,$dmn_​name,$sw_dest_path,$sw_pfad\"");
        $rs = sys_command_rs("/bin/rm -rf $sw_tmp_path");
...

}

Conffile /etc/ispcp/ispcp.conf (debian example) :

Code:
...
CMD_CHOWN = /bin/chown
...
CMD_CP = /bin/cp
...
CMD_TAR = /bin/tar
...

If other commands are required, they should be put in the ispcp.conf, not to hard.
08-14-2009 04:21 PM
Quote this message in a reply
TheCry Away
Member
***

Posts: 851
Joined: Oct 2008
Reputation: 21
Post: #13
RE: New ispCP Software Installer *BETA*
Noooo....
I don't want to make you crazy.. Wink
Quote:One file will be fixed in future, because there are hard code paths.

This will be all fixed in Beta 10...
I've found all paths in the ispcp.conf.
With Beta 10 all paths in the perl scripts und php scripts will be variable with the ispcp.conf!
(This post was last modified: 08-14-2009 04:40 PM by TheCry.)
08-14-2009 04:33 PM
Find all posts by this user Quote this message in a reply
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #14
RE: New ispCP Software Installer *BETA*
Fine! The first Dev with a powerfull feedback.
Nuxwin, is the rest Ok ?
Do you see any security reasons or a big Problem to integreate it in later ispCP Versions (1.0.2) ?

I like the installer very well and test every *BETA* Version!

Greez BeNe
08-14-2009 04:38 PM
Visit this user's website Find all posts by this user Quote this message in a reply
TheCry Away
Member
***

Posts: 851
Joined: Oct 2008
Reputation: 21
Post: #15
RE: New ispCP Software Installer *BETA*
Ok...
Now all paths are used by ispcp.conf. No hardcoded paths more...
Thank for the hints.
08-14-2009 05:32 PM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #16
RE: New ispCP Software Installer *BETA*
I took a quick look to the patch and have a few comments:

1. The GUI function "get_software_permission" is defined in multiple files. Move it to "gui/includes/ispcp-functions.php" and it will be available in all your scripts, but defined just once.

2. Your new files include this license line:
PHP Code:
* @copyright     2001-2006 by moleSoftware GmbH 

Are you working in moleSoftware GmbH? no? So get rid of it! Wink

3. I know that current code is a real mess, but newer one need not to be. Please stick to the ispcp coding style conventions (for example, closing parentheses must be indented at the same column as it's matching line):
PHP Code:
$sampleArray = array(
    
'firstKey'  => 'firstValue',
    
'secondKey' => 'secondValue'
); 
instead of what you mostly use:
PHP Code:
$sampleArray = array(
    
'firstKey'  => 'firstValue',
    
'secondKey' => 'secondValue'
    
); 

4. Try to reduce some verbosity in your code. I've no time to provide a line-by-line review right now, but things like:
PHP Code:
    if(empty($install_username) || empty($install_password) || empty($install_email)){
        
set_page_message(tr('You have to fill out inputs!'));
    }
    elseif(!
preg_match("/htdocs/",$other_dir)){
        
set_page_message(tr('You cant\'t install outside from htdocs!'));
    }
    elseif(
$rs->fields['software_db'] == "1" && empty($sql_user) || 
$rs->fields['software_db'] == "1" && empty($sql_pass) || 
$rs->fields['software_db'] == "1" && empty($selected_db)){
            
set_page_message(tr('You have to fill out all database inputs!'));
    }
    elseif(
$rs->fields['software_db'] == "1" && !@mysql_connect("localhost"$sql_user$sql_pass)){
        
set_page_message(tr('Please check your sql-username and password!'));
    } 
may be written clearer (and following ispcp style):
PHP Code:
    if (empty($install_username) || empty($install_password) || empty($install_email)) {
        
set_page_message(tr("You have to fill out inputs!"));
    } elseif (!
preg_match("/htdocs/"$other_dir)) {
        
set_page_message(tr("You can't install outside htdocs!"));
    } elseif (
$rs->fields['software_db']) {
        if (empty(
$sql_user) || empty($sql_pass) || empty($selected_db)) {
            
set_page_message(tr("You have to fill out all database inputs!"));
        } elseif !@
mysql_connect("localhost"$sql_user$sql_pass)) {
            
set_page_message(tr("Please check your sql-username and password!"));
        }
    } 

Also note that "localhost" is hardcoded in here... bad thing Wink

As you see, most things are cosmetic issues. Great (and tough!) work TheCry! LOTS of kudos for you!
(This post was last modified: 08-14-2009 06:44 PM by kilburn.)
08-14-2009 06:41 PM
Visit this user's website Find all posts by this user Quote this message in a reply
TheCry Away
Member
***

Posts: 851
Joined: Oct 2008
Reputation: 21
Post: #17
RE: New ispCP Software Installer *BETA*
Ok... There is a lot to do for me.. Smile

Should i remove the complete copyright from all new files?
08-14-2009 06:56 PM
Find all posts by this user Quote this message in a reply
Nuxwin
Unregistered

 
Post: #18
RE: New ispCP Software Installer *BETA*
Example for your possible copyright :

Perl script:
Code:
# Copyright (C) 2009  Laurent Declercq <l.declercq@nuxwin.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

PHP script
Code:
/**
* Your program name
*
* @copyright     2009 Laurent Declercq
* @link         http://www.domain.tld
* @author     Laurent Declercq <l.declercq@nuxwin.com>
*
* @license
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
*   This program is distributed in the hope that it will be useful,
*   but WITHOUT ANY WARRANTY; without even the implied warranty of
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*   GNU General Public License for more details.
*
*   You should have received a copy of the GNU General Public License along
*   with this program; if not, write to the Free Software Foundation, Inc.,
*   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

Of course, you can replace GPL by MPL if you want.
08-14-2009 06:59 PM
Quote this message in a reply
ephigenie Offline
Project Leader
*******
Administrators

Posts: 1,578
Joined: Oct 2006
Reputation: 15
Post: #19
RE: New ispCP Software Installer *BETA*
If you want it integrated (as i want, too) then please use GPL License.

Our Goal is to provide everything under the gpl.
All new files should only list you & ispCP (the Molesoft thing is only for old scripts valid which were not newly created by us) .
08-14-2009 07:15 PM
Visit this user's website Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #20
RE: New ispCP Software Installer *BETA*
Quote:Of course, you can replace GPL by MPL if you want.
No, you can not!, sorry.

Moreover, I may be wrong on this because I've found no docs stating it, but I think all contributions must assign the copyright to "IspCP team" in order to be in trunk. Despite that, it's ok if you want to put your name as author, but not as copyright holder.
08-14-2009 07:17 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 12 Guest(s)