Samstag, 23. April 2016

Raspbian repository started

Hi,

after a long period of testing my script and trying to get the Winterfell and Development version up and running it was time to get back to 3.4.

My repo contains my compiled packages and for the impatient ones:

  1. Add the key to your keyring:
    wget -O - https://www.zion-control.org/raspbian/kolab_repo%40zion-control.org |apt-key add -
  2. Add the following line to your sources.list:
    deb http://www.zion-control.org/raspbian/ jessie main
  3. Run update
    apt-get update
  4. Install kolab
    apt-get install kolab
The cyrus package contains a fix for the bug on armhf so it is working. See the following Git-Commit for further informations : https://github.com/cyrusimap/cyrus-imapd/commit/f507861e48b6c50e6394d9a0880aefe34b820dc0

For the Roundcube/iRony/chwala I did a small correction concerning error management and the Sabre libraries.
First of all the error handling:
find /usr/share/roundcubemail/ -name '*php' -exec sed -i 's/PEAR::isError/(new PEAR)->isError/g' {} \;
Repeat this for /usr/share/iRony and /usr/share/chwala.

There is also a manual ToDo right now after installing the packages for the Sabre-Object. So download the Sabre libraries manually from http://sabre.io and reference them in the PHP file /usr/share/iRony/public_html/index.php. Add the following line at the beginning:
require_once("/usr/share/php/SabreDAV/vendor/autoload.php");
Chwala did not install the MySQL database correctly so create them with the SQL script mysql.initial.sql found in the doc directory from the source package.

The new setup is running well on my Pi2 with nginx and SSL with a certificate from letsencrypt :-) following this instructions: https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04

I'm a bit new to create correct debian packages with changelog, new version numbers and so on. But I will do my best so that you can get "right out of the box" packages for using Kolab on RaspberryPi incl. Nginx

Greetz.

Sonntag, 7. Februar 2016

Plan for a clean and fresh install on Debian Jessie

I'm currently planning to migrate (again) to a +Raspberry Pi 2 because my +Cubietruck Cubieboard3 is a bit nasty concerning port forwarding. It doesn't show up in my Fritz!Box so I cannot redirect the ports in a convenient way.

Again I updated my script for getting +Kolab and it should handle all the dependencies in the right way so that you will be able to install it via "apt-get" or "aptitude".

So feel free to get it from my site and test it.

And I will switch from Apache to NginX as a Webserver and IMAP-Proxy as well.

So come back again for updates

Greetz

Dienstag, 2. Februar 2016

Update to Kolab 16

After a long time using +Kolab.org Community and some amazing news around this groupware I decided to go on with Kolab 16.

Currently there are not so many packages for my Debian Jessie release available.
So I decided to compile them again out of the development directory from http://obs.kolabsys.com:82/Kolab:/Development/Debian_7.0/

A few days ago I thought it went well but my Active-Sync was some sort of working. Contacts and Calendar is syncing quite well but no mails. 

I digged into the logfiles in the directory /usr/share/kolab-syncroton/logs and found two errors:
Call to protected method rcube_imap_generic::strToTime() from context 'kolab_sync_data_email' in /usr/share/kolab-syncroton/lib/kolab_sync_data_email.php on line 140
and
 Maximum execution time of 30 seconds exceeded in /usr/share/roundcubemail/program/lib/Roundcube/rcube_imap_generic.php on line 3481

The first one is a known bug and I found it belongs to the new version of +Roundcube 1.2. Following https://git.kolab.org/rSe4d229229fa3de87f0d9c98156632adf8a87fb2d I also changed the line 140 and after that it was working like a charme again.

 The second one can be avoided in modifying the entry max_execution_time in /etc/php5/apache2/php.ini.

So up to now I have the following packages running concerning Kolab:

root@cubietruck:~# dpkg -l | grep -E "(kolab|roundcube|imap)"
ii  chwala                              0.4~dev20160122-0~kolab1    
ii  cyrus-imapd                         2.4.16-4+deb7u2            
ii  cyrus-imapd-2.4                     2.4.16-4+deb7u2            
ii  imapcopy                            1.04-1                      
ii  imapfilter                          1:2.5.2-2                  
ii  irony                               0.4.0-0~kolab1              
ii  kolab                               16.0.0-3                    
ii  kolab-cli                           0.7.14-0~kolab1            
ii  kolab-conf                          0.7.14-0~kolab1            
ii  kolab-freebusy                      1.1.0-0~kolab1              
ii  kolab-imap                          16.0.0-3                    
ii  kolab-ldap                          16.0.0-3                    
ii  kolab-mta                           16.0.0-3                    
ii  kolab-saslauthd                     0.7.14-0~kolab1            
ii  kolab-schema                        3.3-0~kolab1                
ii  kolab-server                        0.7.14-0~kolab1            
ii  kolab-syncroton                     2.3.2-0~kolab1              
ii  kolab-telemetry                     0.7.14-0~kolab1            
ii  kolab-ucs                           16.0.0-3                    
ii  kolab-utils                         3.1~dev20140624-0~kolab1    
ii  kolab-webadmin                      3.2.11~dev20151020-0~kolab1
ii  kolab-webclient                     16.0.0-3                    
ii  kolab-xml                           0.7.14-0~kolab1            
ii  kolabadmin                          0.0.20080222-4              
ii  libcyrus-imap-perl24                2.4.16-4+deb7u2            
ii  libjs-less                          1.7.5-0~kolab2              
ii  libkolab-dev                        2.0~dev20151230-0~kolab1    
ii  libkolab0                           2.0~dev20151230-0~kolab1    
ii  libkolabxml-dev                     1.1.git.1422810799          
ii  libkolabxml1                        1.1.git.1422810799          
ii  libxapian22                         1.2.16-0~kolab1            
ii  node-less                           1.7.5-0~kolab2              
ii  nodejs                              0.12.8-0~kolab1            
ii  php-kolab                           2.0~dev20151230-0~kolab1    
ii  php-kolabformat                     1.1.git.1422810799          
ii  php-net-ldap3                       1.0.4-0~kolab1              
ii  pykolab                             0.7.14-0~kolab1            
ii  python-kolab                        2.0~dev20151230-0~kolab1    
ii  python-kolabformat                  1.1.git.1422810799          
ii  roundcubemail                       1:1.2~dev20160119-0~kolab1  
ii  roundcubemail-plugin-contextmenu    2.1.1-0~kolab1              
ii  roundcubemail-plugin-converse       0.1~dev20140214-0~kolab1    
ii  roundcubemail-plugin-dblog          2.0                        
ii  roundcubemail-plugins-kolab         1:3.2.8-0~kolab1            
ii  roundcubemail-skin-chameleon        0.3.7-0~kolab1              
ii  swig                                2.0.11-0~kolab1            
ii  swig2.0                             2.0.11-0~kolab1            
ii  wallace                             0.7.14-0~kolab1               
To compile all the packages I created a little script in the past. It is working if you have a running kolab installation with all dependencies.

  1. Create a working directory and change into it:
    mkdir /mnt/kolab
    cd /mnt/kolab
  2. Put the script get_kolab.sh in this directory and make it executable.
  3. Create some directories
    mkdir kolab_Development_src
    mkdir kolab_Development_deb
    mkdir compile_log
  4. Change into the src directory and start the script get_kolab.sh with a parameter because it is the first time you start it
    cd kolab_Development_src
    ../get_kolab.sh first
  5. It is necessary to run the script three times because it stops after some packages and I didn't solve this up to now because the workaround (restart) is so easy :-)
    It will continue after the last package
  6. To install all the packages please add the following line top you /etc/apt/sources.list
  7. deb file:/mnt/kolab/kolab_Development_deb ./
So enjoy the update like I do.

Greetz

Freitag, 13. März 2015

How-To - Kolab with Seafile

Hello,

Seafile is an open source cloud software which is free for private use.

There is also a professional edition which is not necessary for my needs. I just want to sync files across more than one device. In the past I used ownCloud which was pretty good for my needs.

First I decided to have ownCloud integrated in Kolab as a backend but I had a bit lack of time so developing a new driver for chwala was not so easy.

After a while I noticed that Seafile is integrated in chwala 0.3.0 and with Kolab 3.4 it is quite stable to install.

Last week I managed all the stuff and here is my Step-By-Step Guide:


  1. Install Kolab 3.4 and test it
    It's obvious that you need Kolab for this. Please refer to the kolab.org web page for an installation guide for your distro
  2. Install seafile and test it.
    The homepage of seafile will guide you through all the stuff you need for that. So just download, extract and run it.
  3. Connect Seafile to Kolab-LDAP
    Following Seafile->Using LDAP is exactly what I did. My installation was spreaded over /opt/seafile, /opt/seafile/seafile-server-latest and /mnt/seafile
    But you'll find your ccnet.conf and add the LDAP part to it (please change the values according to your installation):
    [LDAP]
    HOST = ldap://127.0.0.1
    BASE = ou=People,dc=example,dc=com
    USER_DN = cn=directory manager
    PASSWORD = youdon'tknowjack
    LOGIN_ATTR = mail
  4. Now test seafile again if you can now login with your kolab main mailaddress.
    Please keep in mind that each user has to login for the first time to seafile in order to get the right folders.
  5. If everything is ok, now you have to use Apache as a proxy for Seafile
    Following Seafile -> Deploy with Apache was ok for me for the first time.
    Well, this will break your Kolab if you follow the steps directly.
  6. If this is ok as well, now fine tune a bit the Apache configuration for Seafile.
    These lines should be changed in your apache.conf (or vhost):
    #
    # seahub
    #
    RewriteRule ^/(media.*)$ /$1 [QSA,L,PT]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ /seahub.fcgi$1 [QSA,L,E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    This will redirect all request to Seafile, but if you only have one SSL certificate and one domain you have to ignore this for all the Kolab modules.
    So please add the following RewriteCond to the config:

    RewriteRule ^/(media.*)$ /$1 [QSA,L,PT]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !^/roundcubemail.*
    RewriteCond %{REQUEST_URI} !^/Microsoft.*
    RewriteCond %{REQUEST_URI} !^/iRony.*
    RewriteCond %{REQUEST_URI} !^/chwala.*
    RewriteCond %{REQUEST_URI} !^/kolab.*
    RewriteRule ^(.*)$ /seahub.fcgi$1 [QSA,L,E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    The first RwriteCond tells Apache to rewrite the URL if the file does not exist. For the Kolab installation there are some URL more not to check against an existing file because they are an Alias in the Apache way. So we ignore this rewrite when the URL starts with "roundcube", "Microsoft" (for active sync) and so on.
    Reading the conf above should be:

    Rewrite all URL starting with /media
    ReWrite the URL when the requested file does not exist (! -f)
    AND (is implicitly) the request does not start with roundcube (!/^/roundcubemail.*)
    AND the request does not start with Microsoft
    AND the request does not start with iRony
    AND the erquest does not start with chwala
    AND the request does not start with kolab
    TO /seahub.fcgi PLUS the request string including the trailing slash (^(.*)$ /seahub.fcgi$1)
  7. Now test your Kolab and Seafile again, everything should now work on the same server.
  8. It's time to combine Chwala with Seafile. The most interesting part. :-)
    Please edit your /etc/roundcubemail/config.inc.php file and all the Seafile stuff:

    // seafile
    $config['fileapi_backend'] = 'seafile';
    $config['fileapi_seafile_host'] = 'www.example.com';
    $config['fileapi_seafile_ssl_verify_peer'] = false;
    $config['fileapi_seafile_ssl_verify_host'] = false;
    $config['fileapi_seafile_cache_ttl'] = '14d';
    $config['fileapi_seafile_debug'] = true;
  9. That's it.

Now you can use your Seafile server in Kolab as a file storage. But keep in mind, password protected folders are not accessible through chwala this way.

Feel free to leave any comments and
Greetz

Mittwoch, 4. März 2015

Kolab 3.4 released - New Skin - Chwala driver for Seafile

Hello @all,


+Kolab.org Community released Version 3.4 and it was time to get the new updates up and running.

This time there is a new driver for "chwala" integrated for +Seafile.VN so I gave it a try and tried to mix it all together.

After lots pf solving dependencies and so on I managed to get the new version up and running with Seafile attached.

That's quite amazing, for this you have to configure Seafile through Apache and connect to the LDAP.

When you were able to manage all these things, you can easily save attachments in your cloud and syncing them to your smartphone. :-)

There are still some issues on my Cubietruck which I have to solve but my Idea is to rebuild all the stuff from scratch in a chroot environment and track down all steps to get it working.

Two Screenshots showing the new skin for +Roundcube and the integration of Seafile into Chwala.

That's the new Chameleon skin for Roundcube

The same folders in seafile and chwala except the password protected one.

So the next couple of days I'm trying to set up a new build environment for the ARM-HF packages for Kolab and a Step-By-Step description.

Greetz

Montag, 26. Januar 2015

Migration to "Cubietruck" finished

Hi,

due to a new job since the beginning of the year and moving to a new country I was a bit stressed. In addition to this, my provider changed from IPv4 to IPv6 at a DSLite line.

So my port forwarding is no longer working and I had to organize all the stuff to get access to my mails again :-). Well, that's a disadvantage of my solution but I hope this will be solved somehow.

So my script to install Kolab on my truck:


export RELEASE=3.3
export RELEASEDIR=kolab_3.3_src
mkdir -p /mnt/kolab/$RELEASEDIR
mkdir -p /mnt/kolab/kolab_${RELEASE}_deb
echo "deb-src http://obs.kolabsys.com:82/Kolab:/$RELEASE/Debian_7.0/ ./" > /etc/apt/sources.list.d/kolab.list
echo "deb-src http://obs.kolabsys.com:82/Kolab:/$RELEASE:/Updates/Debian_7.0/ ./" >> /etc/apt/sources.list.d/kolab.list
#echo "deb http://kolab-deb.zion-control.org /" >> /etc/apt/sources.list.d/kolab.list
echo "Package: *" >  /etc/apt/preferences.d/kolab
echo "Pin: origin obs.kolabsys.com" >>  /etc/apt/preferences.d/kolab
echo "Pin-Priority: 501" >>  /etc/apt/preferences.d/kolab
wget -qO - http://obs.kolabsys.com:82/Kolab:/$RELEASE/Debian_7.0/Release.key | apt-key add -
wget -qO - http://obs.kolabsys.com:82/Kolab:/$RELEASE:/Updates/Debian_7.0/Release.key | apt-key add -
aptitude update
cd /mnt/kolab/$RELEASEDIR
echo Get debian sources

wget http://obs.kolabsys.com:82/Kolab:/$RELEASE/Debian_7.0/Packages -O packages.txt
wget http://obs.kolabsys.com:82/Kolab:/$RELEASE:/Updates/Debian_7.0/Packages -O packages_updates.txt
apt-get -ym source `grep Package packages.txt | awk '{print $2}' | grep -v "kolab-ucs" | sort -u`
apt-get -ym source `grep Package packages_updates.txt | awk '{print $2}' | grep -v "kolab-ucs" | sort -u`
apt-get -y build-dep `grep Package packages.txt | awk '{print $2}' | grep -v kolab-ucs | sort -u`
dpkg -i 389-ds-base-libs_1.2.11.29-0_armhf.deb
dpkg -i 389-ds-base-dev_1.2.11.29-0_armhf.deb
cd python-icalendar-3.4/
debuild -us -uc -b
cd ..
apt-get install python-dateutil python-tz
dpkg -i python-icalendar_3.4-1_all.deb
cd libcalendaring_4.9.0
debuild -us -uc -b
cd ..
dpkg -i libcalendaring_4.9.0-3_armhf.deb
dpkg -i libcalendaring-dev_4.9.0-3_armhf.deb
apt-get install libboost-program-options-dev
cd libkolabxml-1.1~dev20140624/
debuild -us -uc -b
cd ..
dpkg -i libkolabxml1_1.1~dev20140624-0~kolab1_armhf.deb
dpkg -i libkolabxml-dev_1.1~dev20140624-0~kolab1_armhf.deb
cd libkolab-0.6~dev20140624/
debuild -us -uc -b
cd ..
dpkg -i libkolab0_0.6~dev20140624-0~kolab1_armhf.deb
dpkg -i libkolab-dev_0.6~dev20140624-0~kolab1_armhf.deb
apt-get -y build-dep `grep Package packages.txt | awk '{print $2}' | grep -v kolab-ucs | sort -u`
apt-get -y build-dep `grep Package packages_updates.txt | awk '{print $2}' | grep -v kolab-ucs | sort -u`
ls -ld * | grep '^d' | awk '{print $9}' | while read verz
do
        cd $verz
        debuild -us -uc -b
        cd ..
done

cp *deb ../kolab_${RELEASE}_deb/
cd ../kolab_${RELEASE}_deb
dpkg-scanpackages -m .  | gzip -c9 > Packages.gz

After a while it was installed and I had to move all mails to my truck. I decided to reorganize all the mails according to the recipient in a separate folder (because of my C@tch@ll). I used "imapfilter" for that and for this I wrote a little LUA script:

function processMailbox(raspberryPi,cubietruck, mb,subfolders)
        -- Status
        total, recent,unseen,nextid = raspberryPi[mb]:check_status()
        -- Alle Nachrichten auswaehlen
        results = raspberryPi[mb]:select_all()
        number = 1
        for _, message in ipairs(results) do
                print ("")
                mailbox, uid = table.unpack(message)
                header = mailbox[uid]:fetch_header()
                recipient = string.gsub(header, ".*for <([A-Za-z0-9-]+@example.com)>.*","%1")
                if (recipient:find(":")) then
                        headerTo = mailbox[uid]:fetch_field('To')
                        if (headerTo == nil) then
                                recipient = "invalid_to@example.com"
                        else
                                headerTo = headerTo:gsub("\r","")
                                headerTo = headerTo:gsub("\n","")
                                headerTo = headerTo:gsub(" ","")
                                headerTo = headerTo:gsub("To: ","")
                                if (headerTo == "") then
                                        recipient = "invalid_to@example.com"
                                else
                                        recipient = headerTo:gsub("To: ","")
                                end
                        end
                end
                if (recipient:find("<")) then
                        recipient = recipient:gsub(".*<(.*)>","%1")
                end
                toFolder = string.gsub(recipient,"(.-)(@.*)","%1")
                messageId = mailbox[uid]:fetch_field("Message-id")
                messageId = string.gsub(messageId,".-<(.-)>","%1")
                subject   = mailbox[uid]:fetch_field('Subject')
                subject   = subject:gsub("\r"," ")
                subject   = subject:gsub("\n"," ")
                print('Processing : <' .. mb .. '>')
                print('Subject    : <' .. subject .. '>')
                print('Recipient  : <' .. recipient .. '>')
                print('Folder     : <' .. toFolder .. '>')
                print('ID         : <' .. messageId .. '>')
                prozent = number / total * 100
                print('Number     : <' .. number .. '/' .. total .. '> in ' .. mb .. ' (' .. prozent .. ' %)')
                cubietruck:create_mailbox('Archive/' .. toFolder)
                toMove = raspberryPi[mb]:contain_field("Message-id",messageId)
                for _, messageM in ipairs(toMove) do
                        tmMB,tmUID = table.unpack(message)
                end
                toMove:copy_messages(cubietruck['Archive/' .. toFolder])
                number = number + 1
        end
        -- process all subfolder
        if (subfolders) then
                rPi_Mailboxes, rPi_Folders = raspberryPi:list_all(mb)
                for _, mbSub in ipairs(rPi_Mailboxes) do
                        processMailbox(raspberryPi,cubietruck,mbSub,true)
                end
        end
end
---------------
--  Options  --
---------------
options.timeout = 120
options.subscribe = true
options.create = true
----------------
--  Accounts  --
----------------
-- Quelle ist Pi und Ziel ist Truck
raspberryPi = IMAP {
    server = 'raspberrypi.example.com',
    username = 'username@example.com',
    password = ':-)',
}
cubietruck = IMAP {
    server = 'cubietruck.example.com',
    username = 'username@example.com',
    password = ';-)',
}
processMailbox(raspberryPi,cubietruck,'Subfolder',false)


Don't hesitate to ask any questions

Greetz

Samstag, 3. Januar 2015

Repository updated for Raspberry Pi and migration to Cubietruck started

Hello,

currently my +Raspberry Pi compiles the packages to the latest version available. (Update from 01.01.2015)

In the next couple of weeks I'm going to migrate from +Raspberry Pi  to my new Cubietruck. I decided to upgrade to a new SBC because the Cubietruck has more power (2 GB Ram instead of 512MB, ARMv7 instead ARMv6 a.s.o.)

For the Cubietruck I decided to go the debootsrap way for a debian image and followed these instructions :
After that I had an amazing fast boot sequence on my "truck". :-) 
I had to fix an  issue on my host because the module "binfmt_misc" was not integrated in my kernel which I compiled myself.

The main difference beetween Raspberry Pi and the Cubietruck is the CPU.
Debian is available for ARMv7 CPUs as "armhf" and for ARMv6 CPUs as "armel" (soft float). The difference is the performance. If you use "armel" on the Raspberry Pi you will loose lots of performance, that's why the guys from Raspbian created their own repository for ARMv6 and "hard float". They compiled nearly every package for the Pi and I did that for the +Kolab packages.

The debian-armhf repository does not contain all of the packages which are necessary for the Kolab installation so my "truck" is compiling all the stuff as well. :-)

Greetz
Andreas