[livesupport-dev] multiple LS developers on the same system
  • Primarily to Tomas,

    As the issue of having multiple developers on the same system has come
    up repeatedly (like having a bunch of us on ls-dev), I intend to create
    the possibilty for everyone to have their LiveSupport instance based on
    the CVS contents.

    for more background, see http://bugs.campware.org/view.php?id=753


    for this, all the different users have to have the following, separately:

    - a separate database
    - a separate ODBC data source for the database
    - their own URLs for the PHP XML-RPC interfaces
    - a sperate port for the scheduler daemon


    let's say we have developer John Doe, with the user id john_doe, that
    his personal setup could be:

    database: LiveSupport-john_doe
    ODBC data source: LiveSupport-john_doe

    (database user could still be test/test, the database server remaining
    localhost)

    PHP XML-RPC base URLs:

    http://localhost/~john_doe/livesupportStorageServer
    http://localhost/~john_doe/livesupportArchiveServer
    http://localhost/~john_doe/livesupportUI

    his port for the scheduler daemon could be the base port + the sum of
    his user id's letters' ASCII code, in this case:

    j o h n _ d o e
    6a6f 686e 5f64 6f65

    6a + 6f + 68 + 6e + 5f + 64 + 6f + 65 = 0x346 = 838

    thus the port could be 3344 + 838 = 4182.



    now, to achieve all this, we have to store the personalized
    configuration information somewhere accessible to the tools from the
    CVS. but, we have to make sure that this information would not be
    _replacing_ config files stored in the CVS - since if we do so, making a
    cvs commit would overwrite the generic config file with a personalized
    version. (and we'd have a commit war going on - the same config file
    replaced all the time with personalised versions from different people)

    for the scheduler daemon and the ODBC data source, this can be done
    easily. for example, the scheduler daemon could look for a config file
    at ~/.ls_schedler.xml or ~/.livesupport/scheduler.xml .

    but for the PHP interfaces, I don't know how this could be achieved.
    it's easy to have a symlink from ~/public_html/livesupportStorageServer
    to ~/src/livesupport/modules/storageServer/var (or whereever the LS
    sources are). but, it will include
    ~/src/livesupport/modules/storageServer/var/conf.php, which is a generic
    config file stored in the CVS.

    as I'm not that knowledgable with PHP, I'm asking Tomas: how could we
    make sure that the PHP XML-RPC interface would read a personalized
    config file, that's _not_ part of the CVS?


    Akos

    ------------------------------------------
    Posted to Phorum via PhorumMail
  • 6 Comments sorted by
  • Hi,
    good idea - it's needed,
    I've solve this in PHP part when ls-dev was installed - I've modified
    conf.php files and simply didn't commit them Smile
    You are right, that more robust solution is needed.

    It's possible to look for e.g. confLocal.php, which would not be
    added to CVS. It would be checked at start of conf.php processing and if
    exists, ignore conf.php.
    There should be a confLocal.php.template for easy start of using it.
    But I'm little bit weak in CVS - I don't know if there would be real
    danger that somebody add confLocal.php to CVS by mistake Sad
    (this method would be useless if it have the same danger-level as commiting
    modified conf.php, but I think it's safer)

    Is it OK?

    Tomas Hlava
    th@red2head.com

    On Tue, 05 Apr 2005 12:02:05 +0200 Akos Maroy wrote:
    > Primarily to Tomas,
    >
    > As the issue of having multiple developers on the same system has come
    > up repeatedly (like having a bunch of us on ls-dev), I intend to create
    > the possibilty for everyone to have their LiveSupport instance based on
    > the CVS contents.
    >
    > for more background, see http://bugs.campware.org/view.php?id=753
    >
    >
    > for this, all the different users have to have the following, separately:
    >
    > - a separate database
    > - a separate ODBC data source for the database
    > - their own URLs for the PHP XML-RPC interfaces
    > - a sperate port for the scheduler daemon
    >
    >
    > let's say we have developer John Doe, with the user id john_doe, that
    > his personal setup could be:
    >
    > database: LiveSupport-john_doe
    > ODBC data source: LiveSupport-john_doe
    >
    > (database user could still be test/test, the database server remaining
    > localhost)
    >
    > PHP XML-RPC base URLs:
    >
    > http://localhost/~john_doe/livesupportStorageServer
    > http://localhost/~john_doe/livesupportArchiveServer
    > http://localhost/~john_doe/livesupportUI
    >
    > his port for the scheduler daemon could be the base port + the sum of
    > his user id's letters' ASCII code, in this case:
    >
    > j o h n _ d o e
    > 6a6f 686e 5f64 6f65
    >
    > 6a + 6f + 68 + 6e + 5f + 64 + 6f + 65 = 0x346 = 838
    >
    > thus the port could be 3344 + 838 = 4182.
    >
    >
    >
    > now, to achieve all this, we have to store the personalized
    > configuration information somewhere accessible to the tools from the
    > CVS. but, we have to make sure that this information would not be
    > _replacing_ config files stored in the CVS - since if we do so, making a
    > cvs commit would overwrite the generic config file with a personalized
    > version. (and we'd have a commit war going on - the same config file
    > replaced all the time with personalised versions from different people)
    >
    > for the scheduler daemon and the ODBC data source, this can be done
    > easily. for example, the scheduler daemon could look for a config file
    > at ~/.ls_schedler.xml or ~/.livesupport/scheduler.xml .
    >
    > but for the PHP interfaces, I don't know how this could be achieved.
    > it's easy to have a symlink from ~/public_html/livesupportStorageServer
    > to ~/src/livesupport/modules/storageServer/var (or whereever the LS
    > sources are). but, it will include
    > ~/src/livesupport/modules/storageServer/var/conf.php, which is a generic
    > config file stored in the CVS.
    >
    > as I'm not that knowledgable with PHP, I'm asking Tomas: how could we
    > make sure that the PHP XML-RPC interface would read a personalized
    > config file, that's _not_ part of the CVS?
    >
    >
    > Akos

    ------------------------------------------
    Posted to Phorum via PhorumMail
  • Hi,

    If you process conf.conf is it a idea to check the confLocal.php from your
    ~/ home directory?

    Frans van Berckel

    >
    > Hi,
    > good idea - it's needed,
    > I've solve this in PHP part when ls-dev was installed - I've modified
    > conf.php files and simply didn't commit them Smile
    > You are right, that more robust solution is needed.
    >
    > It's possible to look for e.g. confLocal.php, which would not be
    > added to CVS. It would be checked at start of conf.php processing and if
    > exists, ignore conf.php.
    > There should be a confLocal.php.template for easy start of using it.
    > But I'm little bit weak in CVS - I don't know if there would be real
    > danger that somebody add confLocal.php to CVS by mistake Sad
    > (this method would be useless if it have the same danger-level as
    > commiting
    > modified conf.php, but I think it's safer)
    >
    > Is it OK?
    >
    > Tomas Hlava
    > th@red2head.com
    >
    > On Tue, 05 Apr 2005 12:02:05 +0200 Akos Maroy wrote:
    >> Primarily to Tomas,
    >>
    >> As the issue of having multiple developers on the same system has come
    >> up repeatedly (like having a bunch of us on ls-dev), I intend to create
    >> the possibilty for everyone to have their LiveSupport instance based on
    >> the CVS contents.
    >>
    >> for more background, see http://bugs.campware.org/view.php?id=753
    >>
    >>
    >> for this, all the different users have to have the following,
    >> separately:
    >>
    >> - a separate database
    >> - a separate ODBC data source for the database
    >> - their own URLs for the PHP XML-RPC interfaces
    >> - a sperate port for the scheduler daemon
    >>
    >>
    >> let's say we have developer John Doe, with the user id john_doe, that
    >> his personal setup could be:
    >>
    >> database: LiveSupport-john_doe
    >> ODBC data source: LiveSupport-john_doe
    >>
    >> (database user could still be test/test, the database server remaining
    >> localhost)
    >>
    >> PHP XML-RPC base URLs:
    >>
    >> http://localhost/~john_doe/livesupportStorageServer
    >> http://localhost/~john_doe/livesupportArchiveServer
    >> http://localhost/~john_doe/livesupportUI
    >>
    >> his port for the scheduler daemon could be the base port + the sum of
    >> his user id's letters' ASCII code, in this case:
    >>
    >> j o h n _ d o e
    >> 6a6f 686e 5f64 6f65
    >>
    >> 6a + 6f + 68 + 6e + 5f + 64 + 6f + 65 = 0x346 = 838
    >>
    >> thus the port could be 3344 + 838 = 4182.
    >>
    >>
    >>
    >> now, to achieve all this, we have to store the personalized
    >> configuration information somewhere accessible to the tools from the
    >> CVS. but, we have to make sure that this information would not be
    >> _replacing_ config files stored in the CVS - since if we do so, making a
    >> cvs commit would overwrite the generic config file with a personalized
    >> version. (and we'd have a commit war going on - the same config file
    >> replaced all the time with personalised versions from different people)
    >>
    >> for the scheduler daemon and the ODBC data source, this can be done
    >> easily. for example, the scheduler daemon could look for a config file
    >> at ~/.ls_schedler.xml or ~/.livesupport/scheduler.xml .
    >>
    >> but for the PHP interfaces, I don't know how this could be achieved.
    >> it's easy to have a symlink from ~/public_html/livesupportStorageServer
    >> to ~/src/livesupport/modules/storageServer/var (or whereever the LS
    >> sources are). but, it will include
    >> ~/src/livesupport/modules/storageServer/var/conf.php, which is a generic
    >> config file stored in the CVS.
    >>
    >> as I'm not that knowledgable with PHP, I'm asking Tomas: how could we
    >> make sure that the PHP XML-RPC interface would read a personalized
    >> config file, that's _not_ part of the CVS?
    >>
    >>
    >> Akos
    >
    >

    ------------------------------------------
    Posted to Phorum via PhorumMail
  • On Tue, 5 Apr 2005 14:12:39 +0200 (CEST) Frans van Berckel wrote:
    > Hi,
    >
    > If you process conf.conf is it a idea to check the confLocal.php from your
    > ~/ home directory?
    >
    > Frans van Berckel
    >

    I think not - it's possible that PHP wouldn't know about home dir
    (it runs under httpd/apache user), the confLocal.php would be located
    in personal checkouted copy of CVS tree in the same dir as conf.php.
    (after copy and modify confLocal.php.template)

    Tomas Hlava
    th@red2head.com

    ------------------------------------------
    Posted to Phorum via PhorumMail
  • Tomas Hlava wrote:
    > On Tue, 5 Apr 2005 14:12:39 +0200 (CEST) Frans van Berckel wrote:
    >
    >>Hi,
    >>
    >>If you process conf.conf is it a idea to check the confLocal.php from your
    >>~/ home directory?
    >>
    >>Frans van Berckel
    >>

    hm, seems I didn't get Frans' response to my e-mail. strange Sad

    >
    >
    > I think not - it's possible that PHP wouldn't know about home dir
    > (it runs under httpd/apache user), the confLocal.php would be located
    > in personal checkouted copy of CVS tree in the same dir as conf.php.
    > (after copy and modify confLocal.php.template)

    since then I did some research. it seems it's possible to deduce the
    owner, based on the ownership of the php file (and with a checked out
    CVS, the owner of all files in the CVS is the user who checked it out).

    for example, for me the following PHP script:


    header("Content-type: text/plain");

    $this_file = $_SERVER["SCRIPT_FILENAME"];

    echo "This file is: $this_file\n";

    $fileowner_id = fileowner($this_file);

    echo "The file owner's id is: $fileowner_id\n";

    $fileowner_array = posix_getpwuid($fileowner_id);

    echo "The file's owner is: " . $fileowner_array['name'] . "\n";
    echo "The file's home directory is: " . $fileowner_array['dir'] . "\n";

    ?>


    produces the following page:

    This file is: /home/darkeye/public_html/proba.php
    The file owner's id is: 1000
    The file's owner is: darkeye
    The file's home directory is: /home/darkeye


    thus, one could use ~/.livesupport/conf.php , as we can find out where
    the home directory is.


    I was thinking on changing conf.php, so that it would look first, if a
    ~/.livesupport/conf.php exists, it would use setting from there,
    otherwise it would use settings as before.

    What do you think?


    Akos

    ------------------------------------------
    Posted to Phorum via PhorumMail
  • On Tue, 05 Apr 2005 14:32:08 +0200 Akos Maroy wrote:
    > ...
    > hm, seems I didn't get Frans' response to my e-mail. strange Sad

    It seems to be posted normally to livesupport-dev maillist.

    > ...
    > since then I did some research. it seems it's possible to deduce the
    > owner, based on the ownership of the php file (and with a checked out
    > CVS, the owner of all files in the CVS is the user who checked it out).
    >
    > for example, for me the following PHP script:
    >
    >
    > > header("Content-type: text/plain");
    >
    > $this_file = $_SERVER["SCRIPT_FILENAME"];
    >
    > echo "This file is: $this_file\n";
    >
    > $fileowner_id = fileowner($this_file);
    >
    > echo "The file owner's id is: $fileowner_id\n";
    >
    > $fileowner_array = posix_getpwuid($fileowner_id);
    >
    > echo "The file's owner is: " . $fileowner_array['name'] . "\n";
    > echo "The file's home directory is: " . $fileowner_array['dir'] . "\n";
    >
    > ?>
    >
    >
    > produces the following page:
    >
    > This file is: /home/darkeye/public_html/proba.php
    > The file owner's id is: 1000
    > The file's owner is: darkeye
    > The file's home directory is: /home/darkeye
    >
    >
    > thus, one could use ~/.livesupport/conf.php , as we can find out where
    > the home directory is.
    >
    >
    > I was thinking on changing conf.php, so that it would look first, if a
    > ~/.livesupport/conf.php exists, it would use setting from there,
    > otherwise it would use settings as before.
    >
    > What do you think?
    >
    >
    > Akos

    Smile Yes!

    My approach was affected by possibility to have more copies of PHP part
    at the same time (I have used it for working on different problems), but
    it's not usually needed.

    --
    Tomas Hlava
    th@red2head.com

    ------------------------------------------
    Posted to Phorum via PhorumMail
  • Tomas Hlava wrote:
    >>hm, seems I didn't get Frans' response to my e-mail. strange Sad
    >
    >
    > It seems to be posted normally to livesupport-dev maillist.

    now I got his e-mail, but not yours, the one he reply to.

    it seems there's some disturbance in the force Smile

    > Smile Yes!
    >
    > My approach was affected by possibility to have more copies of PHP part
    > at the same time (I have used it for working on different problems), but
    > it's not usually needed.

    OK, than I'll try to change the PHP part as well accordingly. of course
    I'll ask you to double-check after I've done so...


    Akos

    ------------------------------------------
    Posted to Phorum via PhorumMail