1. Store
  2. Apps
  3. Hardware
  4. Support
  5. Solutions

ClearFoundation

Forums
ClearOS ClearFoundation and ClearCenter have moved to the new website ClearOS.com (https://clearos.com). We are making this change in order to improve search and exposure of ClearOS to the world. There are several improvements that are being made and some that are still on the table for development. The forums are now live on clearos.com and locked on this site until all the redirects are in place. If you have issues using the new site, feel free to ask on the #clearfoundation room in IRC chat on freenode.net or engage with a chat agent on the site if they are around. Our goal is to complete this step so that we can be properly ready for the types of communication that will be essential for the release of ClearOS 7!
Welcome, Guest
Development Environment Changes Forum is locked
(1 viewing) 1 Guest
Go to bottomPage: 12
TOPIC: Development Environment Changes
*
#57265
Development Environment Changes 1 Year, 5 Months ago  
Hi everyone,

Some changes were made to the development environment in order to:

- Add git/github support
- Provide a migration path to github (which is happening post ClearOS 6.5.0)
- Provide a stable version of the framework (no more "SVN trunk")

Under the hood, the default engine is switching from using the development framework & theme in SVN (typically exported to ~/clearos/webconfig) to the live framework & theme version in /usr/clearos. It's not a big change, but it is one that requires some manual changes detailed below.

Sorry for the hassle, but these changes will prevent such annoyances in the future! If you have any problems, please contact me.

Upgrade to the latest ClearOS version

First, you need to upgrade your development system to the latest ClearOS release: 6.5.0 (beta)
If you don't want to upgrade right now, that's fine too of course.

Code:

yum --enablerepo=clearos-updates-testing,clearos-developer upgrade



Update framework settings

Most of you probably want to start using the stable version of the framework instead of SVN trunk. If you want to move to the stable version, remove the references to the CLEAROS_BOOTSTRAP environment variable in ~/.bash_profile. You will need to re-login, or unset the environment variable after making the change.

If you want to continue use the bleeding edge framework in SVN, leave the CLEAROS_BOOTSTRAP environment variable as is. However, you need to update to the latest framework version in SVN trunk:

Code:

svn update ~/clearos/webconfig/framework




Update the Apache configlet

Using your regular user account (not root), update the Apache configlet. Make a backup just in case you need to review it:

Code:

sudo cp /usr/clearos/sandbox/etc/httpd/conf.d/devel.conf \
   /usr/clearos/sandbox/etc/httpd/conf.d/devel.conf.bak
clearos -w setup



The "clearos -w setup" command resets the /usr/clearos/sandbox/etc/httpd/conf.d/devel.conf file so that the default framework and theme are used.


Create/update your ~/.clearos configuration

If you want to keep the development/SVN versions of the ClearFoundation and ClearCenter apps / themes in your environment, your .clearos file should look like:

Code:


<?php 
\clearos\framework\Config::$apps_paths[] = 'clearcenter/webconfig/apps';
\clearos\framework\Config::$apps_paths[] = 'clearos/webconfig/apps';
\clearos\framework\Config::$theme_paths = array('clearos/webconfig/themes');


After making necessary changes to .clearos, you need to reload webconfig with the new path information:

clearos reload

If all you need to see is your own app, then your .clearos configuration should have a single entry:
Code:


<?php 
\clearos\framework\Config::$apps_paths[] = 'my_apps';


Change my_apps to whatever subdirectory in your home directory contains your app source code.


Framework Development

If you ever need to use the development versions of the framework, you can find the document on the topic here:

www.clearfoundation.com/docs/developer/f..._development_version
Peter Baldwin
Developer
Posts: 2143
graphgraph
User Offline Click here to see the profile of this user
The topic has been locked.
 
#57277
Re: Development Environment Changes 1 Year, 5 Months ago  
Works well for me! thanks Pete
Tim Burgess
Moderator
Posts: 6766
graph
User Offline Click here to see the profile of this user
The topic has been locked.
 
#57278
Re:Development Environment Changes 1 Year, 5 Months ago  
Thanks for the tutorial.
However a few comments from a beginners Point of view:

1. It is neccessary to download the Shell Extension app from the marketplace and change the login Shell for the "ordinary development" user to something else than "nologin".

2. The file ~/.clearos : Does it belong to the home dir of the root user or the "ordinary user"? (My guess is the ordinary user)

3. Before you can do a "sudo" command as an "ordinary user" you need (as root), edit the /etc/sudoers file and add YourUserNameHere ALL=(ALL) ALL as a new line just after the "root ALL=(ALL) ALL" entry

/Fred
Fredrik Fornstad
Senior Boarder
Posts: 55
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2013/11/11 17:16 By Fred_Swede.
The topic has been locked.
 
#57279
Re:Development Environment Changes 1 Year, 5 Months ago  
1. Yes - good point! It assumes that your login has basic bash access (yum install app-shell-extension-core)
2. Home directory of the developer user
3. This is not normally required, and probably discouraged as you shouldn't want to or need to give your developer user sudo rights. I tend to just 'su' back and forth if required to get root access, or run two terminals...
Tim Burgess
Moderator
Posts: 6766
graph
User Offline Click here to see the profile of this user
Last Edit: 2013/11/11 17:23 By timb80.
The topic has been locked.
 
#57280
Re:Development Environment Changes 1 Year, 5 Months ago  
Pete - is there some extra config for 'approot'? none of the SVN images or paths seems to work.
Tim Burgess
Moderator
Posts: 6766
graph
User Offline Click here to see the profile of this user
The topic has been locked.
 
#57285
Re:Development Environment Changes 1 Year, 5 Months ago  
Hi Fredrik,

1. It is neccessary to download the Shell Extension app from the marketplace and change the login Shell for the "ordinary development" user to something else than "nologin".
The "clearos setup" command as described here creates a developer user account in the old school shadow system (/etc/passwd /etc/shadow). Keeping the account outside LDAP is handy for developers working on the various account drivers (OpenLDAP, Samba 4)... no LDAP required.

3. Before you can do a "sudo" command as an "ordinary user" you need (as root), edit the /etc/sudoers file and add YourUserNameHere ALL=(ALL) ALL as a new line just after the "root ALL=(ALL) ALL" entry
The "clearos setup" command handles this step too It doesn't grant all access but the same access as webconfig. The gory details are in this doc (which is a continuation of Tim's setup script/doc!)
Peter Baldwin
Developer
Posts: 2143
graphgraph
User Offline Click here to see the profile of this user
The topic has been locked.
 
#57286
Re:Development Environment Changes 1 Year, 5 Months ago  
Hi Tim,

Pete - is there some extra config for 'approot'? none of the SVN images or paths seems to work.
Does the "clearos reload" command work? This creates the /usr/clearos/sandbox/etc/httpd/conf.d/devel-paths.conf which should contain something like the following (per app root):

Code:

Alias /clearos/approot/ /home/devuser/clearos/webconfig/apps/

<Directory /home/devuser/clearos/webconfig/apps/*/htdocs>
  Order Deny,Allow
  Allow from All
</Directory>

<Directory /home/devuser/clearos/webconfig/apps/*/*/htdocs>
  Order Deny,Allow
  Allow from All
</Directory>

<Directory /home/devuser/clearos/webconfig/apps>
  Order Deny,Allow
  Deny from All
</Directory>

Peter Baldwin
Developer
Posts: 2143
graphgraph
User Offline Click here to see the profile of this user
The topic has been locked.
 
#57287
Re:Development Environment Changes 1 Year, 5 Months ago  
Does any of this apply to those of us who may compile an occasional rpm from a srpm (having already set up the development environment)?
yaye
Gold Boarder
Posts: 175
graphgraph
User Offline Click here to see the profile of this user
The topic has been locked.
"To see the earth as we now see it, small and blue and beautiful in that eternal silence where it floats, is to see ourselves as riders on the earth together, brothers on that bright loveliness in the unending night, brothers who see now they are truly brothers." - Archibald MacLeish, Brothers in Eternal Cold
 
#57290
Re:Development Environment Changes 1 Year, 5 Months ago  
Hm,
Do we have a chicken/egg situation here? I really would like to setup my environment to meet all good practices etc, but I do not quite get it in this case.

In the tutorial in the first post in this thread it says that I should run "clearos -w setup" as an "regular" user. But that will not work since either the developer user account has not yet been created or a regular user (created in the user mgmt app in webconfig) will not be allowed to login at the console (and is as Peter says bad practice).

Should the command

Code:

clearos -w setup



be run as root, and after that I should continue and login as the new user and continue there to do all commands?

/Fred
Fredrik Fornstad
Senior Boarder
Posts: 55
graphgraph
User Offline Click here to see the profile of this user
The topic has been locked.
 
#57294
Re:Development Environment Changes 1 Year, 5 Months ago  
@Yaye - no only for webconfig app development. Building RPMs is completely seperate

@Frederik - Sorry I had mislead you in my reply (I used an LDAP user for bash login so used the shell extension). As Pete notes the 'clearos setup' command creates a system user for development, and therefore the 'clearos -w setup' is normally run first time as the root user. For more details see the other developer docs www.clearfoundation.com/docs/developer/development_environment

@Pete - no it created a blank devel-paths.conf file. It may be because I have an LDAP developer user and setup my dev environment manually before the clearos command... I'll check
Tim Burgess
Moderator
Posts: 6766
graph
User Offline Click here to see the profile of this user
The topic has been locked.
 
Go to topPage: 12
  get the latest posts directly to your desktop