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)
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)
Share this post:
Responses (46)
-
Accepted Answer
Hi Peter, I see that ClearOS 6.7 has been released. Any further updates on this:
https://tracker.clearos.com/view.php?id=3681
? -
Accepted Answer
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 -
Accepted Answer
-
Accepted Answer
-
Accepted Answer
-
Accepted Answer
-
Accepted Answer
-
Accepted Answer
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? -
Accepted Answer
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 -
Accepted Answer
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 -
Accepted Answer
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. -
Accepted Answer
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! -
Accepted Answer
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? -
Accepted Answer
-
Accepted Answer
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! -
Accepted Answer
-
Accepted Answer
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. -
Accepted Answer
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 -
Accepted Answer
-
Accepted Answer
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. -
Accepted Answer
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. -
Accepted Answer
-
Accepted Answer
-
Accepted Answer
-
Accepted Answer
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? -
Accepted Answer
-
Accepted Answer
-
Accepted Answer
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 :-) -
Accepted Answer
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. -
Accepted Answer
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). -
Accepted Answer
-
Accepted Answer
-
Accepted Answer
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. -
Accepted Answer
-
Accepted Answer

Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »