Sunday, August 14, 2011

CLEAR: Part 1

To help explain CLEAR, I'll start by talking a little bit about each of the words that make up the acronym:
  1. Configuration
  2. LookUp
  3. Every Application
  4. Runtime
1. Configuration
As a software engineer, almost every application I've worked on or built requires some sort of configuration to be functional. By configuration, I'm talking about information such as a datasource url, an SMTP host, or even a simple 'from' email, to name a few. The list of different configuration properties goes on and on and is ultimately dependent on the business needs of the application.

2. LookUp
Not only do most applications require configuration, but most require that the configuration information change depending on where the application is running.

For instance, taking a datasource url as an example, you might want to set that URL to something different in a development or QA environment than what you have it set to in a production environment.

Or, using an email as another example, lets imagine you have a contact form in your web application and, when submitted, that form sends user information to a special 'contact@mywebsite.com' email address. Well, while implementing this functionality, it would be nice to be able to change this email to, maybe, a personal email for testing.

The LookUp mechanism in CLEAR provides for this type of configurability.

3. Every Application
CLEAR is designed to work in every type of system and support every type of business need. From enterprise to brochure web solutions, to mobile, to everything in between, you can use CLEAR to configure your Java or Groovy project.

4. Runtime
As hinted to above, CLEAR is used to configure your application's runtime and supports configuration for many different runtime settings.

In "CLEAR: Part 2" I'll go into specifics and discuss how you can use it in your application.

In the meantime, if you're interested in more information please head on over to Github:

CLEAR: Configuration LookUp For Every Application Runtime

I've started a new open source project today called CLEAR. CLEAR stands for Configuration LookUp for Every Application Runtime and is a configuration management solution for Java and Groovy applications.

So, "What exactly is CLEAR?", you ask? I'll try and answer this over a series of future blog posts but, in the meantime, the project is hosted at Github so head on over there and check it out if you're interested:

Postfix issues on OS X Lion

After recently installing a fresh copy of Lion (thanks TUAW for this lovely article: Mac 101: Creating a recovery disk using Recovery Disk Assistant) I've encountered some issues using Postfix as an SMTP server.

After an hour of researching I finally resolved my issue. Here are the steps I went through to fix it:

1. First, I looked in the postfix mail log to see if there were log messages indicating a problem:

> less /var/log/mail.log

And found this message:

fatal: open /etc/postfix/submit.cred: No such file or directory

2. To resolve this, I created the /etc/postfix/submit.cred file (must use sudo):

> sudo touch /etc/postfix/submit.cred

3. After creating the file, I then reloaded postfix:

> sudo postfix reload

4. After reloading, I checked the log file again and saw this message:

fatal: unsafe ownership or permissions on /etc/postfix/submit.cred: uid/gid/mode are 0/0/644 should be 0/0/0600

5. Next, I changed the ownership permissions on the submit.cred file and then reloaded postfix again:

> sudo chmod 600 /etc/postfix/submit.cred; sudo postfix reload

6. After reloading, I noticed a warning in the log file:

warning: no valid hostport|username|password entries in /etc/postfix/submit.cred

7. Finally, I edited the submit.cred file and added the following:

localhost|username|password

* change 'username' and 'password' appropriately.

8. I then reloaded postfix for a final time:

> sudo postfix reload

Hopefully this works you too!