Forums

Resolved
0 votes
Update 2 - You can now install the Development Environment in ClearOS 6.2.0 Beta 2 or later

Michel pinged a couple of weeks ago with some developer questions and that in turn inspired me to finish up some of the developer documentation :-) There are still a lot of gaps in the documentation, but we're far enough along that you can now start to:

- Build RPMs
- Build custom software (e.g. VMware modules)
- Create apps, including getting them in the Marketplace

To get a development environment going, please follow the Development Environment Guide. You need ClearOS 6.2.0 Beta 2 or later.

Ohloh

We are going to start using the Ohloh (now) and github (post 6 release) for ClearOS. I encourage those who are planning to contribute to sign up to Ohloh and join the ClearOS project.

Build System

If you would like to build packages in the build system, please let me know. The advantages:

- Provides a clean build environment with 32 and 64 bit builds
- Eases maintenance since many tasks have been automated
- Makes packages available to all users by default (yum --enablerepo=... install xyz)
Wednesday, October 26 2011, 02:26 PM
Share this post:
Responses (46)
  • Accepted Answer

    wilber
    wilber
    Offline
    Tuesday, December 22 2015, 11:54 PM - #Permalink
    Resolved
    0 votes
    Hi Peter, I see that ClearOS 6.7 has been released. Any further updates on this:
    https://tracker.clearos.com/view.php?id=3681

    ?
    The reply is currently minimized Show
  • Accepted Answer

    Friday, July 17 2015, 04:18 PM - #Permalink
    Resolved
    0 votes
    wilber wrote:

    Any reports from the front lines? Is the development environment still plagued by broken/conflicting/missing dependencies in ClearOS 6.6.0? What about in the upcoming ClearOS 7?

    I just fired up a 32-bit ClearOS 6 instance and it looks like the "clearos-epel" repo won't work as is. The development environment needs a whole bunch of packages from EPEL, so that's a show stopper. To get things working, I changed the following two lines in /etc/yum.repos.d/clearos-epel.repo:

    From:

    #baseurl=http://download.fedoraproject.org/pub/epel/$releasever/$basearch
    mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch


    To:

    baseurl=http://download.fedoraproject.org/pub/epel/$releasever/$basearch
    #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch


    Perhaps EPEL changed their 32-bit mirror handling? I raised a but in the tracker - https://tracker.clearos.com/view.php?id=3681
    The reply is currently minimized Show
  • Accepted Answer

    Friday, July 17 2015, 11:04 AM - #Permalink
    Resolved
    0 votes
    What is broken or missing?
    The reply is currently minimized Show
  • Accepted Answer

    wilber
    wilber
    Offline
    Friday, July 17 2015, 03:25 AM - #Permalink
    Resolved
    0 votes
    Any reports from the front lines? Is the development environment still plagued by broken/conflicting/missing dependencies in ClearOS 6.6.0? What about in the upcoming ClearOS 7?
    The reply is currently minimized Show
  • Accepted Answer

    wilber
    wilber
    Offline
    Thursday, February 26 2015, 11:49 PM - #Permalink
    Resolved
    0 votes
    Is the development environment fixed in ClearOS Community 6.6.0 32-bit or are there still broken/missing dependencies?
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, June 26 2013, 04:43 AM - #Permalink
    Resolved
    0 votes
    Peter Baldwin wrote:
    Here's the doc :-)

    http://www.clearfoundation.com/docs/developer/framework/tutorials/managing_daemons


    Thanks a lot. :) :) I will go through the document.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, June 25 2013, 05:54 PM - #Permalink
    Resolved
    0 votes
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, June 19 2013, 08:49 PM - #Permalink
    Resolved
    0 votes
    I'll write up a developer document on the topic. More to come!
    The reply is currently minimized Show
  • Accepted Answer

    Friday, June 14 2013, 11:29 AM - #Permalink
    Resolved
    0 votes
    Thanks for the information. It helped me a lot to understand the functionality of form submission and storing the data. But have a query regarding the configuration file.
    In ClearOS, the changes are written directly to the configuration file.

    You will need to create a similar configuration file for your daemon.

    -- Does it mean every app has their separate configuration file? If so, then in which location shall we create the configuration file and how to establish relationship between the configuration file and daemon?

    If there is only one configuration file in which all changes/settings are mentioned, then how the changes (can be a modification or additional change) will be recognised by daemon ?

    Also, i have understood very little about how to enable(start) and disable(stop) the working process of an app. You mentioned to checkout controllers/server.php file and i did so. Arguments are being passed to constructor but there is no indication of enabling and disabling the process (or, it can be a mistake of my understanding). Can you please provide more details about it?
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, June 12 2013, 08:08 PM - #Permalink
    Resolved
    0 votes
    Debashis Chowdhury wrote:
    I mean to say, after installation of an app, suppose i want to start or stop the working process of that app. How can i do so? For example, the content filter app has the facility to start and stop the working process.


    Yup, the above PPTP example will show you the way.

    Means, how can i execute a command in shell internally with the help of app which will enable or disable a process.For example, enabling/disabling a cron script by executing command internally through an app.


    For normal daemons (in /etc/rc.d/init.d), follow the PPTP app as an example. In general, you can execute commands using the Shell class. Here's an example:


    #!/usr/clearos/sandbox/usr/bin/php
    <?php

    ///////////////////////////////////////////////////////////////////////////////
    // B O O T S T R A P
    ///////////////////////////////////////////////////////////////////////////////

    $bootstrap = getenv('CLEAROS_BOOTSTRAP') ? getenv('CLEAROS_BOOTSTRAP') : '/usr/clearos/framework/shared';
    require_once $bootstrap . '/bootstrap.php';

    ///////////////////////////////////////////////////////////////////////////////
    // D E P E N D E N C I E S
    ///////////////////////////////////////////////////////////////////////////////

    use \clearos\apps\base\Shell as Shell;

    clearos_load_library('base/Shell');

    ///////////////////////////////////////////////////////////////////////////////
    // M A I N
    ///////////////////////////////////////////////////////////////////////////////

    $shell = new Shell();
    $shell->execute('/bin/ls', '/etc');
    $output = $shell->get_output();

    print_r($output);


    Here are some API docs:
    http://code.clearfoundation.com/api/classes/clearos.apps.base.Shell.html
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, June 12 2013, 08:07 PM - #Permalink
    Resolved
    0 votes
    Debashis Chowdhury wrote:
    I mean to say, after installation of an app, suppose i want to start or stop the working process of that app. How can i do so? For example, the content filter app has the facility to start and stop the working process.


    Yup, the above PPTP example will show you the way.

    Means, how can i execute a command in shell internally with the help of app which will enable or disable a process.For example, enabling/disabling a cron script by executing command internally through an app.


    For normal daemons (in /etc/rc.d/init.d), follow the PPTP app as an example. In general, you can execute commands using the Shell class. Here's an example:


    #!/usr/clearos/sandbox/usr/bin/php
    <?php

    ///////////////////////////////////////////////////////////////////////////////
    // B O O T S T R A P
    ///////////////////////////////////////////////////////////////////////////////

    $bootstrap = getenv('CLEAROS_BOOTSTRAP') ? getenv('CLEAROS_BOOTSTRAP') : '/usr/clearos/framework/shared';
    require_once $bootstrap . '/bootstrap.php';

    ///////////////////////////////////////////////////////////////////////////////
    // D E P E N D E N C I E S
    ///////////////////////////////////////////////////////////////////////////////

    use \clearos\apps\base\Shell as Shell;

    clearos_load_library('base/Shell');

    ///////////////////////////////////////////////////////////////////////////////
    // M A I N
    ///////////////////////////////////////////////////////////////////////////////

    $shell = new Shell();
    $shell->execute('/bin/ls', '/etc');
    $output = $shell->get_output();

    print_r($output);


    Here are some API docs:
    http://code.clearfoundation.com/api/classes/clearos.apps.base.Shell.html
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, June 12 2013, 06:01 AM - #Permalink
    Resolved
    0 votes
    Thanks for the answers Peter. I will checkout the PPTP app.

    Peter Baldwin wrote:

    2) How to enable(start) and disable(stop) the working process of an app after installation?
    Do you mean how do you start and stop a daemon?

    I mean to say, after installation of an app, suppose i want to start or stop the working process of that app. How can i do so? For example, the content filter app has the facility to start and stop the working process.

    3) How to enable / disable a core functionality with the help of an app?
    I'm not sure what you mean here. What app are you building?

    Means, how can i execute a command in shell internally with the help of app which will enable or disable a process. For example, enabling/disabling a cron script by executing command internally through an app.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, June 11 2013, 08:08 PM - #Permalink
    Resolved
    0 votes
    Hi Debashis,

    We will continue to chip away at the developer documentation as time permits. It's a high priority, so it won't stay stagnant.

    1) How apps establish connection with core function after installation? What is actually executing internally?
    4) Where the form datas are being stored after submission?


    I'm going to answer 1 and 4 together.

    Take a look at the PPTP server app. It's simple to understand, but still has enough complexity to make it a good starting point. Ultimately, a web form submission runs a bunch of API calls. For example, when a user submits the PPTP settings through the web form, the CodeIgniter framework sends the information to the API with the following block of code in the controller/settings.php file:


    $this->pptpd->set_remote_ip($this->input->post('remote_ip'));
    $this->pptpd->set_local_ip($this->input->post('local_ip'));
    $this->pptpd->set_wins_server($this->input->post('wins'));
    $this->pptpd->set_dns_server($this->input->post('dns'));
    $this->pptpd->reset(TRUE);


    The API (in library/PPTPd.php) does the actual configuration change. In other projects, configuration changes are written to some kind of internal database, and then the configuration file is re-generated. In ClearOS, the changes are written directly to the configuration file.

    2) How to enable(start) and disable(stop) the working process of an app after installation?

    Do you mean how do you start and stop a daemon? If so, take a look at the /var/clearos/base/daemon/pptpd.php file (if PPTP is installed) as an example. You will need to create a similar configuration file for your daemon. Next, follow the controllers/server.php example in the PPTP app. If you get stuck, just let me know -- this answer should really be a standalone document (not just a handful of sentences!)

    3) How to enable / disable a core functionality with the help of an app?

    I'm not sure what you mean here. What app are you building?

    Keep the questions coming, I'm more than happy to help!
    The reply is currently minimized Show
  • Accepted Answer

    Monday, June 10 2013, 01:19 PM - #Permalink
    Resolved
    0 votes
    Hello everyone,

    I have gone through the below mentioned urls to get familiar with clearos app development process and developed 'hello world' app by following the instructions.

    www.clearfoundation.com/docs/developer/apps/start
    www.clearfoundation.com/docs/developer/framework/start


    However, i want to learn more like:
    1) How apps establish connection with core function after installation? What is actually executing internally?
    2) How to enable(start) and disable(stop) the working process of an app after installation?
    3) How to enable / disable a core functionality with the help of an app?
    4) Where the form datas are being stored after submission?

    I tried to know the above process but found nothing useful. Can you provide any tutorial or url so that i can have idea about all these information and the rest?
    Or, can you suggest how can i start core app development process?
    The reply is currently minimized Show
  • Accepted Answer

    Monday, June 10 2013, 01:18 PM - #Permalink
    Resolved
    0 votes
    Peter Baldwin wrote:
    My bad. Update the the "policy_manager" app:

    svn update ~/clearos/webconfig/apps/policy_manager

    If we had our continuous integration system running, that would not have happened!



    Thanks. It fixed the issue.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, June 05 2013, 07:24 PM - #Permalink
    Resolved
    0 votes
    Debashis Chowdhury wrote:
    Hello everyone,

    I created a development environment as suggested in development environment and checked out the source code using: svn co svn://svn.clearfoundation.com/clearos as mentioned in http://www.clearfoundation.com/docs/developer/framework/getting_started . Now, while performing Sanity Check, i saw the clearos login page using https://your.ip.address:1501/ . I entered the normal user login information which was created during clearos setup process. After clicking on login button, i was redirected to https://your.ip.address:1501/app/dashboard page and found the below listed error.

    Fatal error: Class 'clearos\apps\policy_manager\Validation_Exception' not found in /home/username/clearos/webconfig/apps/policy_manager/trunk/libraries/Policy_Manager.php on line 150

    I tried to solve this error but found nothing useful. What's wrong with this?

    Any help on this will be appreciated.


    Welcome to the Clearfoundation forums Debashis Chowdhury!
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, June 05 2013, 04:16 PM - #Permalink
    Resolved
    0 votes
    My bad. Update the the "policy_manager" app:

    svn update ~/clearos/webconfig/apps/policy_manager

    If we had our continuous integration system running, that would not have happened!
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, June 05 2013, 11:47 AM - #Permalink
    Resolved
    0 votes
    Hello everyone,

    I created a development environment as suggested in development environment and checked out the source code using: svn co svn://svn.clearfoundation.com/clearos as mentioned in http://www.clearfoundation.com/docs/developer/framework/getting_started . Now, while performing http://www.clearfoundation.com/docs/developer/framework/getting_started#sanity_check" target="_blank">Sanity Check, i saw the clearos login page using https://your.ip.address:1501/ . I entered the normal user login information which was created during clearos setup process. After clicking on login button, i was redirected to https://your.ip.address:1501/app/dashboard page and found the below listed error.

    Fatal error: Class 'clearos\apps\policy_manager\Validation_Exception' not found in /home/username/clearos/webconfig/apps/policy_manager/trunk/libraries/Policy_Manager.php on line 150

    I tried to solve this error but found nothing useful. What's wrong with this?

    Any help on this will be appreciated.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, May 14 2012, 12:34 PM - #Permalink
    Resolved
    0 votes
    Documentation has been updated here
    http://www.clearfoundation.com/ClearFoundation-Blog/423-clearos-6-developer-tools-now-available.html

    yum upgrade
    yum --enablerepo=clearos-developer,clearos-epel install clearos-devel
    The reply is currently minimized Show
  • Accepted Answer

    Robert
    Robert
    Offline
    Tuesday, March 13 2012, 11:43 AM - #Permalink
    Resolved
    0 votes
    You can also use this.

    yum --enablerepo=clearos-current,clearos-dev,epel install clearos-devel
    The reply is currently minimized Show
  • Accepted Answer

    Arnold
    Arnold
    Offline
    Tuesday, February 07 2012, 01:08 PM - #Permalink
    Resolved
    0 votes
    Peter,

    How can i view the first version of AD connector?
    The reply is currently minimized Show
  • Accepted Answer

    Monday, February 06 2012, 06:05 PM - #Permalink
    Resolved
    0 votes
    Hi DavidAdams and Arnold.

    The first version of the Active Directory Connector is available, but I would wait for the updated version that is coming out shortly (with the release of ClearOS Professional Beta 3). If you send a quick note to me (pbaldwin@clearcenter.com) with your ClearCenter account name, I'll make sure there's an evaluation subscription added to your account -- I'm not sure the self-serve evaluation will be available in Beta 3.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, February 06 2012, 04:21 PM - #Permalink
    Resolved
    0 votes
    Arnold wrote:
    I wanted to test the active directory connector, but i cant install it.

    not avaible?

    Same here, I click on the link in the web interface and it takes me to the marketplace with nothing available. Pity as we are in the process of a WAN based active directory config and the ability to have the same user base across all ClearOS locations would be good.

    Something else that would be nice and I can't seem to find a mention of if/when it is going to happen is Central Management. We have 15 systems scattered across Europe and the Far East and having to check for updates and patches one by one is time consuming and error prone.
    The reply is currently minimized Show
  • Accepted Answer

    Arnold
    Arnold
    Offline
    Monday, February 06 2012, 03:46 PM - #Permalink
    Resolved
    0 votes
    I wanted to test the active directory connector, but i cant install it.

    not avaible?
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, December 27 2011, 06:53 PM - #Permalink
    Resolved
    0 votes
    Yes, indeed that is the problem. Solved now.

    I never had this problem before. So i suppose with beta 2 the character set has changed???
    The reply is currently minimized Show
  • Accepted Answer

    Monday, December 26 2011, 10:30 PM - #Permalink
    Resolved
    0 votes
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, December 24 2011, 04:57 PM - #Permalink
    Resolved
    0 votes
    Today i played a bit with srpm's and rpm's. I saw something weird.


    Length: 663543 (648K) [application/x-rpm]
    Saving to: âlibevent-devel-2.0.10-2.clearos.i686.rpmâ

    100%[===================================================================================================================>] 663,543 271K/s in 2.4s

    2011-12-24 16:58:00 (271 KB/s) - âlibevent-devel-2.0.10-2.clearos.i686.rpmâ


    i mean the â in front and after of libevent-devel-....... Any idea why this happens?
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, December 22 2011, 04:02 PM - #Permalink
    Resolved
    0 votes
    Thank you :bow:
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, December 22 2011, 03:25 PM - #Permalink
    Resolved
    0 votes
    Here's a better yum command so that you don't pull in the "testing" (read: bleeding edge) RPMs:

    yum --enablerepo=clearos-current --enablerepo=clearos-dev --enablerepo=epel install clearos-devel
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, December 21 2011, 11:20 AM - #Permalink
    Resolved
    0 votes
    oh.., good new's.

    Thank you for the quick reply. :cheer:
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, December 21 2011, 11:13 AM - #Permalink
    Resolved
    0 votes
    Hi Marcel,

    If you have the beta1-to-beta2 upgrade, you should be able to run:

    yum --enablerepo=clear* --enablerepo=epel* install clearos-devel

    And then continue with the documentation from http://www.clearfoundation.com/docs/developer/development_environment I'm not 100% sure if this still works especially since we have upgraded everything to upstream's version 6.2. I don't have my devel environment up and running right now for a quick sanity check. Regardless, the devel environment will be yum-installable in beta 2 and I think we might green light the release in the next 24-48 hours :-)
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, December 21 2011, 08:18 AM - #Permalink
    Resolved
    0 votes
    Status update please?
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, November 26 2011, 08:27 AM - #Permalink
    Resolved
    0 votes
    Peter Baldwin wrote:
    I'll get that mirror up and running after the beta 2 release. Shad has all the tools to create a better mirror system, and we already repurposed a server in one of the data centers to get the ball rolling. Eventually, we'll roll this out to all the ClearCenter mirrors (about a dozen systems).


    Thanks for the update Peter.
    The reply is currently minimized Show
  • Accepted Answer

    Friday, November 25 2011, 04:12 PM - #Permalink
    Resolved
    0 votes
    I'll get that mirror up and running after the beta 2 release. Shad has all the tools to create a better mirror system, and we already repurposed a server in one of the data centers to get the ball rolling. Eventually, we'll roll this out to all the ClearCenter mirrors (about a dozen systems).
    The reply is currently minimized Show
  • Accepted Answer

    Friday, November 25 2011, 10:06 AM - #Permalink
    Resolved
    0 votes
    I was really keen to get started on this
    The reply is currently minimized Show
  • Accepted Answer

    Friday, November 18 2011, 05:45 PM - #Permalink
    Resolved
    0 votes
    I'm (hopefully) finishing up this topic with Shad today. We started the conversation this morning but was interrupted by a product meeting. We have another meeting in a few minutes and hopefully we can get back on track after that call.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, November 17 2011, 08:06 PM - #Permalink
    Resolved
    0 votes
    Any update on this subject?

    I have some time this weekend to "prutsen" with RPM's and SPEC files but i have to re install my devel environment.
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, November 05 2011, 08:43 AM - #Permalink
    Resolved
    0 votes
    Peter Baldwin wrote:
    Update - Download No Longer Available :-(

    Wow. We were expecting maybe a dozen people to create this development environment, but over 200 have taken the plunge. That put too much bandwidth strain on the staging download server, so we are making plans to use our usual mirror system. Please stay tuned.


    Wow over 200... ClearOS is populair! :)

    The Clearfoundation has to expand their server capabilities. :)
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, November 02 2011, 02:27 PM - #Permalink
    Resolved
    0 votes
    Good catch. I updated the document using version 6 and the extra line in .rpmmacros is no longer necessary. It's better to have it there to cover both versions though :-)
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, November 02 2011, 12:25 PM - #Permalink
    Resolved
    0 votes
    Good point Nick! i've added it to the environment variables section
    The reply is currently minimized Show
Your Reply