I’m retracting myself from the ownCloud contributors

As the header says I will no longer be part of the ownCloud contributors. It has been a major - not to say the main - part of of life for the past 2½ years; they do roll by, don't they...
When I started it was as most hobby-programmers just to scratch my own itch, but it has been a great joy and pleasure to work with the many enthusiatic people.
When Frank started his company around the project I was just as happy and gladly signed a contributors agreement for my few contributions to ownCloud core.

The ownCloud project was for me both as mentioned to scratch my own itch regarding many points, but also a way for me to heal my own mind with some brainwork that I hadn't been able to do elsewhere. For personal reasons I'd been out of a job - unable to perform it - but after I had my disability pension I could have some peace and let me try to build some strength.
It helped a lot to work with these great people.

Lately - for the better part of 1½ year - this hasn't been my feeling. I may be wrong but it is my strong feeling that ownCloud Inc. has become the priority, and the community a workbench for improving and taking over the apps.
If this is not so, keep doing your awesome work.
For those having the same feeling as me, I urge you to form an ownCloud Foundation. I don't have the strength myself, but I will gladly join and support it.
Frank, I'd wished you'd seen and supported it

Sorry for all errors in this text; this is for me a very emotional departure.

Edit: I'll explain my reasons for leaving and my wishes for the future of the ownCloud community further soon. At this moment I just need to gather my thoughts first.

Below a redacted excerpt of what triggered it. It may not seem important, but if you know your github-foo your can find find it all

 karlitschek commented 2 days ago

Sorry but we don´t want to dumb more libraries in the ownCloud core only because they might be useful. Apps are free to ship components like that if they want to use it. At the later stage if 4-5 apps ship the same component in the exact same version then we might consider to add the to the ownCloud core, or not.

 karlitschek commented 2 days ago

I'm not saying this is not useful, secure, good code or in other ways helpful. But this doesn't mean that we should dump all useful code into the core. The design goal of the owncloud core is to be as small as possible. In fact it is already too big. So if this is useful then we should use it for the news app API first and perhaps other apps. This doesn't mean that we have to dump it into the core to make it heavier, difficult to maintain and to keep stable

 tanghus commented 21 hours ago

As it has been - wisely - decided to move the AppFramework to core, I am interested in having it both lean, but more importantly usable and secure. Therefore I prefer to have great implementations which are closely scrutinized for security issues.
A security issue that would be present in at least 3 apps has already been detected. I think that speaks for itself for including it in core.

 tanghus commented 9 hours ago

In case my point didn't come clearly thru, as I may sometimes try to soften my views when putting them into words.

    The design goal of the owncloud core is to be as small as possible. In fact it is already too big.

Recommendable, but what does that exactly mean? What is not needed in core? archive, migration, memcache, ocs, vobject, activitymanager, api, avatar, backgroundjob, cache, contactsmanager, tags, eventsource or files for that matter? Plus everything else under /apps. Fine, lets scrap it and start from scratch. I can actually mention a few that I wouldn't be missed (including some of my contributions), but that's another matter.

Design-wise it would probably be good, but we would be left with basically nothing.

Some of the good decisions that have been made during the past ~1½ year - from my PoV - are

    The strict adherence to interfaces in new contributions
    The introduction of the Server "container"
    The (partly) inclusion of the AppFramework.

Those - and other - changes can make it possible to actually move towards a mature, trustworthy codebase.
I have no special attachments to including CORS middleware, but I understand from several parties, that I trust, that it is a small, yet important part to include, and rejecting it as bloat is both disrespectful and counter-productive. So my rant is not about CORS - it's about the culture and attitude that I sometimes see in this community. What I seen is community members reluctant to voice their opinions for improvements.
To say it straight out: The community should have priority over both "The Inc." and "The Founder". Otherwise it's not a community anymore, and I don't see a place for myself in it.
Alternatively the two quoted nouns could find better ways for making compromises - without compromising the project - pun intended ;)
If none of those objects are met I frighten for the future culture of this project, but so be it; I find another place to try to keep my mind sound, because quite honestly recently it has done quite the opposite[*]

[*] With exceptions of course. No one mentioned, no one forgotten.

PS: I've tried to keep this rant in a sober tone, although my state might not be so (otherwise I probably wouldn't have written it) and I expect any responses to it to be made in public.

Frank Karlitschek
karlitschek commented 2 hours ago

@tanghus Thanks a lot. I don´t think this has anything to do with Inc. or anything else.
This is purely about the long term maintainability of the core. And this is something anything who wants that ownCloud still exists in 5-10 years should care about.
We all know several other projects where this framework/libraries bloat went wrong.
Frank Karlitschek
karlitschek commented 2 hours ago

O.K. Let´s put this into core under this conditions:

    Full documentation how this should be used by app developers is available on doc.owncloud.org at the same time.
    At least two independent apps are fully ported to use this.
    @Raydiation maintains this for the time being exactly as the rest of the app framework.

    Someone actively

    Someone starts to port other pieces of ownCloud to use this so that we don´t have code duplication.

Additionally we should also regularly check which code, frameworks or dependencies in core can be removed. Otherwise we run into a long term problem.

 tanghus commented an hour ago

    Full documentation how this should be used by app developers is available on doc.owncloud.org
    at the same time.

Reasonable and preferable.

    At least two independent apps are fully ported to use this.

I believe that should be the case for oC7 or oC8. Longterm dev is of essence.

    @Raydiation maintains this for the time being exactly as the rest of the app framework.

I think this should be rephrased to "there must always be an active, responsible maintainer." which is documented in the source file. I don't know if there's a @maintainer tag in http://www.phpdoc.org/ ?
That it should always be @Raydiation counts out the bus-factor ;)
Also where would that that place all other core developers including you Frank? We have git blame and I've been personally hit by that recently ;)

    Someone actively

Meaning what? If it's correct it doesn't have to change. This correlates with the maintainer or other developers related to this.

    Someone starts to port other pieces of ownCloud to use this so that we don´t have code duplication.


    Additionally we should also regularly check which code, frameworks or dependencies in core can be removed. Otherwise we run into a long term problem.

This should be addressed in a separate issue and I'm sorry @XXX that I kinda hijacked this issue for that.

 tanghus commented 19 minutes ago

    This is purely about the long term maintainability of the core. And this is something anything who wants that ownCloud still exists in 5-10 years should care about.

To be very forthright I'm not not sure which ownCloud you mean here? Is it to be sure independent developers can produce efficient and secure code, or is it to secure that the Inc. have less dependencies when they use their paid work force to make solid apps for paying customers?
The arguments and motives have become too opaque for me, and after 2½ years of mostly enjoying this project, I'll have to retract myself from it.

@XXX sorry for misusing this PR.
Frank Karlitschek
karlitschek commented 11 minutes ago

@tanghus I´m not really sure what you mean here. Like I said this has nothing to do with Inc. or anything else.
We all have invested a lot of time and energy into ownCloud. So it is in our all interested that the ownCloud core and the apps will be maintainable and stable and working and mostly bugfree for as long as possible. Because of that we have to do some quality check when architectural changes are done in the core. I think this is good maintainership in general.

Flattr this!

New Journal and TAL Page Templates for ownCloud releases

Freshly packed releases of Journal and TAL Page Templates are now available. If you use ownCloud 5 you can go to the App settings and enable them there.

There are very few changes in the apps, except that they have been updated for ownCloud 5.


 - Updated for ownCloud 5 and TAL Page Templates 0.2.
 - Fix: Author not being saved.
 - Fix: Share entry not removed.
 - Fix: Journals didn't show in search.
Fork on Github

TAL Page Templates:

- Use OC_TemplateLayout to render the layout. All apps using TALTemplate
  will have to update their templates and remove any markup besides what
  they want rendered. See the manual for more info.

- The classes now uses the OCA\TAL namespace.
NOTE: This version requires adjusting of your templates.
Since version 0.2 TAL Page Templates uses OC_TemplateLayout to, well, layout the page 😉 This means that you will have to strip your templates from any HTML elements sorrounding your content. If your page previously looked like:
<!DOCTYPE html>
<html metal:use-macro="${maintemplate}">
		<title>TAL Page Templates</title>
		<div id="content" metal:fill-slot="content">
		Your content here...
You will need to strip it down to:
	Your content here...
Read more about TAL Page Templates
Fork on Github

Flattr this!

Posted in KDE, ownCloud. No Comments »

ownCloud 5.0 beta 1

ownCloud-200pxStart testing :-)

From:	Frank Karlitschek 
To:	"owncloud@kde.org Mailinglist" 
Date:	Wed, 20 Feb 2013

Hi everybody,

I'm very happy to announce the beta 1 of ownCloud 5

You can download it here:

This is beta quality and it is not recommended to use this in a production environment. 
But if you want to help with testing and QA please download it and give feedback on 
the bugtracker:
Let's give it a hard test.

The new encryption system is not yet part of this release but it will be included in
the next beta. An improved UI for the external filesystem mounting will also come with 
the next beta.

Thanks to everybody who contributed and especially the people who worked super hard on
fixing bugs in the last few weeks and during the developer sprint last weekend.

You guys rock!!!


Posted in Cloud, ownCloud. Tags: . 6 Comments »

Syncing your N900 with ownCloud – an update

Back in January I wrote a post about syncing your Nokia N900 with ownCloud (btw, please read that first, if you have any questions/problems using the instructions here). Since I got a lot of very good advice and information in the comments on it, I thought I would post an update with a simpler and more correct configuration. Karel, who also commented on the post, was kind enough to send me his setup. Please refer to the original post for info about connecting to your device with SSH etc. For reference I use syncevolution version 1.2.2-1 from the extras-devel repository and a snapshot of ownCloud from git master, but it should also work fine with a recent 4.0.x release. As in the original post owncloud refers to the URL to the root of your onCloud installation e.g. http://example.com/owncloud, user is your login and password is your password. My default calendar is called calendar and my address book is called default. First create a main configuration for ownCloud:
syncevolution --configure \
	--template webdav \
	username=user \
	password=password \
Then configure remote URLs and link them to the owncloud config we just created. First the calendar:
syncevolution --configure \
	database=owncloud/remote.php/caldav/calendars/user/calendar/ \
	backend=caldav \
	target-config@owncloud calendar
And the address book:
syncevolution --configure \
	database=owncloud/remote.php/carddav/addressbooks/user/default/ \
	backend=carddav \
	target-config@owncloud contacts
I think the next command creates the entry which will be available in the UI pointing to the owncloud config we created with the first command, and yes, username and password are supposed to be empty:
syncevolution --configure \
	--template SyncEvolution_Client \
	sync=none \
	syncURL=local://@owncloud \
	username= \
	password= \
Now create the configuration for the local storage. The calendar:
syncevolution --configure \
	sync=two-way \
	backend=calendar \
	database=N900 \
	owncloud calendar
The N900 database is the standard storage. You can see the available ones by running syncevolution from the command line, and you can create new local calendars from the Calendar app and link them to e.g. your Work and Private calendars, just remember that the case matters, so the names must be entered exactly as they are printed by syncevolution. And the address book:
syncevolution --configure \
	sync=two-way \
	backend=contacts \
	database=file:///home/user/.osso-abook/db \
	owncloud contacts
Now everything should be OK, but let us make some quick tests.
syncevolution --print-items target-config@owncloud calendar
This should print the URI part and and the summary of all events.
syncevolution --print-items target-config@owncloud contacts
This should just show the URI part of all contacts. If everything worked out OK it's time to do the actual syncing. If you already have events and/or contacts on your device you want to keep you should do an initial slow sync:
syncevolution --sync slow owncloud
Some times you need to do it several times for it to succeed, but once you don't get any more error you can run a normal incrementel sync just by running
syncevolution owncloud
I chose to update everything from the server and ran
syncevolution --sync refresh-from-server owncloud calendar
syncevolution --sync refresh-from-server owncloud contacts
Note: Read this comment first!

Now you can also sync using the syncevolution-frontend app. Just click on the icon Syncevolution and you will see owncloud listed, and when you click on it you will get to the sync options:

Syncevolution overview

Syncevolution overview

Syncevolution options

Syncevolution options

Unfortunately the latest stable release still doesn't support VTODO or VJOURNAL for Notes and Tasks, but according to the information on the pre-release page for version 1.3, it is added there.

If you have any problems when configuring, please read the original post and any comments there first.

Flattr this!

Posted in ownCloud, Sync. Tags: , , . 78 Comments »

Tales of a Metal Cloud – Part 2

Metal Cloud
Photo by dedalusj

This article is looong overdue. I started it in July 2012 and never got any further, but now ownCloud 5 is released, and I have just released version 0.2 of TAL Page Templates for ownCloud so here it goes 😉 (Some of the examples for "current" ownCloud templates are a bit outdated, but I hope you get the gist of it)

In last episode of...

In the previous post about TAL Page Templates for ownCloud I gave my reasons for wanting to implement PHPTAL in ownCloud, and gave a short example of the benefits it will give for the developer. I wrote I "...will dig deeper into how to use it to render a full page, how to access variables, how to make use of the powerfull METAL.." which I have later decided not to do, as many have described that better than I could do, so if you're not familiar with TAL and METAL, there's plenty to read in the resources section in that post. I also wrote that I would show "...how I’ve plugged it all in to use ownClouds built-in authentication, template discovery and internationalization system", but thinking about it, there is no reason for showing how it's implemented, but rather I should show more of how to use the ownCloud specific parts. So this will mostly be a manual-like listing of how to use TAL page templates compared to the current use of inline PHP code.

What's next

With ownCloud 5 comes the new App Framework with another template engine - Twig. Personally I'm not very fond of the Twig markup, so hopefully from ownCloud 6 it will be possible to choose which engine to use. The App Framework is still very new, and I haven't explored it properly, but I'm sure it will be a great adition to ownCloud - especially if you can use TAL to write your templates 😉

Links and images

A lot of the scripting used in ownClouds page templates is for linking to apps, pages, services and images. There are several convenience methods for this. PHPTAL implements the standard set of TALES expressions, but also allows you to create custom expression modifiers. I have utilized this to substitute the direct PHP calls.

Linking to an image

<img class="svg" src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" />
<img class="svg" src="<?php echo image_path('app', 'someimage.png'); ?>" alt="ownCloud" />
<img class="svg" tal:attributes="src image:string:logo-wide.svg" alt="ownCloud" />
<img class="svg" tal:attributes="src image:string:app/someimage.png" alt="ownCloud" />

Constructing a link

<a href="<?php echo link_to('', 'index.php'); ?>">Home</a>
<a href="<?php echo link_to('app', 'index.php'); ?>">Some app</a>
<a tal:attributes="href linkto:string:index.php">Home</a>
<a tal:attributes="href linkto:string:app/index.php">Some app</a>

Link to remote service

<link rel="stylesheet" href="<?php echo OC_Helper::linkToRemote('core.css') ?>" type="text/css" media="screen" />
<a href="<?php echo OC_Helper::linkToRemote('webdav') ?>">WebDAV</a>
<link rel="stylesheet" type="text/css" media="screen" tal:attributes="href remote:string:core.css" />
<a tal:attributes="href remote:string:webdav">WebDAV</a>

Accessing configuration

ownCloud version: <?php echo OCP\Config::getSystemValue('version'); ?>
Default quota: <?php echo OCP\Config::getAppValue('files', 'default_quota'); ?>
Calendar time zone: <?php echo OCP\Config::getUserValue(OCP\User::getUser(), 'calendar', 'timezone'); ?>
ownCloud version: ${config:string:sys/version}
Default quota: ${config:string:app/files/default_quota}
Calendar time zone: ${config:string:user/calendar/timezone}

Translating content

<p><?php echo $l->t('This will be translated.'); ?><p>
<p i18n:translate="">This will be translated.<p>

Translating content with variables


There is no standardized way to do this currently. I have seen both translation keys using printf formatting and custom interpolation using e.g. curly brackets.

<tal:block i18n:name="username" tal:content="user" />
<p i18n:translate="">Your user name is ${username}.</p>

Your user name is ${username}.

Or you can wrap it in some markup:

<p i18n:translate="">
Welcome back <span i18n:name="username" tal:replace="user"/>.

Welcome back .


Translating attributes.

<img alt="<?php echo $l->t('Log out');?>" title="<?php echo $l->t('Log out');?>" src="<?php echo image_path('', 'actions/logout.svg'); ?>" />
<img tal:attributes="src image:string:/actions/logout.svg" i18n:attributes="alt;title" alt="Log out" title="Log out" />
See more...


$arr = array('color' => 'red',
            'taste' => 'sweet',
            'shape' => 'round',
            'name'  => 'apple');
<select size="4">
<?php foreach($$arr as $key=>$value) { ?>
<option value="<php echo $key; >" ><php echo $value; ></option>
<?php } ?>
<select size="4">
<option tal:repeat="item arr" tal:attributes="value repeat/item/key" tal:content="item"></option>

If you want to try it out, you will need ownCloud 5.x where you can enable the "TAL Page Templates for ownCloud" app from Settings/Apps. If you prefer to install from git, it's available at Github.

Flattr this!

Posted in ownCloud, PHP. Tags: , , . No Comments »

Tales of a Metal Cloud – Part 1

About reaching the goal and beautifying the path or Usability is also about the code (usability in the code?).
Metal Cloud

Many moons ago, when I unintentionally had ended up as a web developer, I had the pleasure of working for two small companies that both used Plone and hence ZPT - Zope Page Templates. After messing around with all kinds of ugly, inconsistent web coding, it was a relief to be able to use the clean markup that TAL provides, and seamlessly assemble pages using METAL.

Using Zope also had the benefit of having Python as it's backend scripting language. I don't want to dive into how much I prefer Python over PHP - enough has been said about that already - and I fully acknowledge that the ubiquity of PHP makes it the perfect choice for a project like ownCloud. Nor do I want to question the strength of the template class used in ownCloud; you can do practically everything. But the strength of OC_Template is IMHO also it's weakness.

During the few months I've been coding for ownCloud, ideas for it's usage have spawned, new apps pop up, code is being tweaked to do amazing stuff and soon the app repository will be "there's an app for that" also for ownCloud.

Being at the point where everyone can create and publish an app for ownCloud sets up some requirements:

  • Maintainability: If the app is ever abandoned, it has to be easy for a new maintainer to take over. This leads to:
  • Readability: No-one wants to maintain an app with poorly structured code and markup, or with none or insufficient documentation.
  • Validity: This is very broad and covers e.g. packaging, cross browser usability and that the markup adheres to common standards.
Maintain the beauty of the markup.

With the Template Attribute Language (TAL) we can achieve having beautifully structured markup, and the interpreter will let us know of any missing end tags or wrongly nested markup, as a matter of fact the page won't render if we mess it up.

The good thing is that some good people have made a PHP library that implements TAL, TALES and METAL, so I've made a proof of concept ownCloud integration using it, which actually works pretty well, if I may say so 😉

Time to show what this will mean for the template author. As example I use the form for editing the structured name data in the ownCloud Contacts app.
Below is how the currently used markup looks.

< ?php
$name = isset($_['name'])?$_['name']:'';
<div id="edit_name_dialog" title="Edit name">
	<dl class="form">
		<dt><label for="pre">< ?php echo $l->t('Hon. prefixes'); ?></label></dt>
			<input name="pre" id="pre" value="<?php echo isset($name[3]) ? $name[3] : ''; ?/>" type="text" list="prefixes" />
			<datalist id="prefixes">
				<option value="<?php echo $l->t('Mrs.'); ?>">
				</option><option value="<?php echo $l->t('Mr.'); ?>">
				</option><option value="<?php echo $l->t('Sir'); ?>">
				</option><option value="<?php echo $l->t('Dr.'); ?>">
		<dt><label for="giv">< ?php echo $l->t('Given name'); ?></label></dt>
		<dd><input name="giv" id="giv" value="<?php echo isset($name[1]) ? $name[1] : ''; ?/>" type="text" /></dd>
		<dt><label for="add">< ?php echo $l->t('Additional names'); ?></label></dt>
		<dd><input name="add" id="add" value="<?php echo isset($name[2]) ? $name[2] : ''; ?/>" type="text" /></dd>
		<dt><label for="fam">< ?php echo $l->t('Family name'); ?></label></dt>
		<dd><input name="fam" id="fam" value="<?php echo isset($name[0]) ? $name[0] : ''; ?/>" type="text" /></dd>
		<dt><label for="suf">< ?php echo $l->t('Hon. suffixes'); ?></label></dt>
			<input name="suf" id="suf" value="<?php echo isset($name[4]) ? $name[4] : ''; ?/>" type="text" list="suffixes" />
			<datalist id="suffixes">
				<option value="<?php echo $l->t('M.D.'); ?>">
				</option><option value="<?php echo $l->t('Ph.D.'); ?>">
				</option><option value="<?php echo $l->t('Jr.'); ?>">
				</option><option value="<?php echo $l->t('Sn.'); ?>">

This isn't exactly pretty, and if you want to use a visual HTML editor, it won't look good there either. And believe me, this isn't the worst looking example 😉
Let's see the same snippet edited for using TAL and TALES

<div id="edit_name_dialog" i18n:domain="contacts" i18n:attributes="title" title="Edit name">
	<fieldset tal:condition="name">
	<dl class="form">
		<dt><label for="pre">Hon. prefixes</label></dt>
			<input name="pre" id="pre" tal:attributes="value name/3|nothing" value="" type="text" list="prefixes" />
			<datalist id="prefixes">
				<option i18n:attributes="value" value="Mrs." />
				<option i18n:attributes="value" value="Mr." />
				<option i18n:attributes="value" value="Sir" />
				<option i18n:attributes="value" value="Dr" />
		<dt><label for="giv" i18n:translate="">Given name</label></dt>
		<dd><input name="giv" id="giv" tal:attributes="value name/1|nothing" value="" type="text" /></dd>
		<dt><label for="add" i18n:translate="">Additional names</label></dt>
		<dd><input name="add" id="add" tal:attributes="value name/2|nothing" value="" type="text" /></dd>
		<dt><label for="fam" i18n:translate="">Family name</label></dt>
		<dd><input name="fam" id="fam" tal:attributes="value name/0|nothing" value="" type="text" /></dd>
		<dt><label for="suf" i18n:translate="">Hon. suffixes</label></dt>
			<input name="suf" id="suf" tal:attributes="value name/4|nothing" value="" type="text" list="suffixes" />
			<datalist id="suffixes">
				<option i18n:attributes="value" value="M.D." />
				<option i18n:attributes="value" value="Ph.D." />
				<option i18n:attributes="value" value="Jr." />
				<option i18n:attributes="value" value="Sn." />

In part 1 I've shown the basics of using TAL, but this is only a foretaste of how PHPTAL can be used in ownCloud. In the next part - hopefully comming shortly - I will dig deeper into how to use it to render a full page, how to access variables, how to make use of the powerfull METAL macros and how I've plugged it all in to use ownClouds built-in authentication, template discovery and internationalization system.

In the meanwhile have a look at the resources below for information about TAL, TALES and METAL

Update: I wrote this article quite a while ago, but never got around to publishing it. In the mean time I've made my implementation available at https://github.com/tanghus/tal/ and made a Journal/Notes app utilizing it which is available at https://github.com/tanghus/journal/. I will publish both soon at the ownCloud app repository.
Update 2: The TAL Page Templates only works on current git master which will be released as ownCloud 5 in some time within the next couple of months 😉 Update 3: I have released TAL Page Templates for ownCloud 4.5 and it is available from the app repository, or from Settings/Apps when you have installed/upgraded to 4.5. At the same time I have released a small Journal/Notes app which uses the TAL templates.

Flattr this!

Posted in ownCloud, Programming. Tags: , , . 7 Comments »

Backup ownCloud Calendar and Contacts

I have my ownCloud instance in a sub-domain at my hosting provider, so I prefer to make a weekly backup of my calendar and contacts. There is no documented way of doing this afaik, but if you run a *nix-like system where wget is installed, it's actually pretty straight forward. In this example owncloud refers to the URL to the root of your ownCloud installation e.g. http://example.com/owncloud, user is your login and password is your password. The URL to use is the same you use if you want to download the calendar or address book manually. In the upper, right corner of the Calendar and the Contacts app, there's a button named respectively Calendars and Address books. When you click on that, you get a dialog box with a list of your calendar(s) and address book(s). The screen shot below is from the Contacts app. To download manually push the Download button button. Instead of doing that, right-click on it, and select "Copy link location" (or whatever your browser calls it) from the context menu. Choose addressbook Your clipboard will now hold a URL looking something owncloud/apps/contacts/export.php?bookid=1 - for the calendar it would look like owncloud/apps/calendar/export.php?calid=1. Make a simple script using those URLs:
DATE=`date +"%Y-%W"`

# Download and gzip contacts.
wget --auth-no-challenge --no-clobber --http-user=user --http-password=password \
  -O $HOME/pimdata_backup/contacts-$DATE.vcf "owncloud/?app=contacts&getfile=export.php?bookid=1"
gzip -f $HOME/pimdata_backup/contacts-$DATE.vcf

# Download and gzip calendar.
wget --auth-no-challenge --no-clobber --http-user=user --http-password=password \
  -O $HOME/pimdata_backup/calendar-$DATE.ics "owncloud/?app=calendar&getfile=export.php?calid=1"
gzip -f $HOME/pimdata_backup/calendar-$DATE.ics
The --auth-no-challenge is to avoid having the server send an authentication challenge, which would mess up the download. The --no-clobber is to avoid downloading a file that already exists. When gzipping the downloaded file it gets a .gz extension appended to the filename, so it should normally not be an issue though. The backup files will now have names containing the year and week number like contacts-2012-17.vcf.gz and calendar-2012-17.ics.gz. If you prefer to backup in another schedule than weekly, you will of course have to change the date command accordingly. Save the script somewhere preferably in your PATH - I use ~/bin for my scripts - and make it executable: chmod u+x ~/bin/owncloud_backup.sh - or whatever you choose to call it. Test if the script works and set it up to run on a regular basis as a cron job or any other job scheduler; I use KAlarm because it's so damn easy to use 😉 You could use curl instead of wget, it's just a matter of preference. Update: As Klaus Muth mentions in a comment, it cannot be stressed enough that this method should not be used in a multi user environment as it places passwords in the process list at runtime.
Update 2 June 13 2012: I have updated the paths for ownCloud >= 4.3 (git master and stable4). HTTP Auth was broken in versions before that.

Flattr this!

Posted in Cloud, Linux, ownCloud. Tags: . 26 Comments »

Syncing your N900 with ownCloud

The other day I was lucky to get my hands on and old, solid Nokia N900 device. As I'm very enthusiastic about ownCloud, and currently also coding a bit on the Contacts App, of course the first the I had to do, was to set up syncing ownCloud Calendar and Contacts. Unfortunately that involved getting my hands dirty with syncevolution. I have tried that before with different configurations and devices, but I have always caved in after battling with the huge amount of configuration options and files. It took me from 9 PM to 9 AM to get it to work, but now I do believe I've got it right. Still a little rough around the edges, but that I can always fix, ha :-) As it involved editing a lot of files and running commands in a terminal window, I started with setting up an SSH server on the device. DuckDuckGo came to the rescue, and I found instructions on getting root access and connecting to the device over WiFi with SSH. Once you're logged into the device remember to change to the normal user account with the command 'su user' and go to the users home directory with 'cd'. In this example owncloud refers to the URL to the root of your onCloud installation e.g. http://example.com/owncloud, user is your login and password is - you guessed right - your password 😉 The default first calendar in onCloud is called default calendar. The space in the name is asking for trouble, so I created a new calendar and called it calendar. Easy to remember. First setup the sync to the ownCloud server:
syncevolution --configure \
             --template SyncEvolution \
             backend=CalDAV \
             --sync-property username=user \
             --sync-property password=password \
             --sync-property syncURL=owncloud/apps/calendar/caldav.php/calendars/user/calendar \
             --sync-property deviceId=n900 \
              consumerReady=0 \
Test to see if there is a connection to the server by listing the events:
syncevolution --print-items target-config@owncloud-calendar calendar
If you get any errors try to have a look at the access log for the webserver ownCloud uses and read the one syncevolution produces. It's very verbose to say the least. Next setup the connection to the calendar on the device:
syncevolution --configure \
              --template "SyncEvolution Client" \
              syncURL=local://@owncloud-calendar \
              evolutionsource=N900 \
              username= \
              password= \
              type=maemo-events \
              consumerReady=1 \
              owncloud-calendar calendar
The username and password fields are empty on purpose because the credentials for the server sync is used, but for some reason they have to be there. Now it's time to see if it works by running the first sync. It has to be run in slow mode the first time, and yes, it is really slow.
syncevolution --sync slow owncloud-calendar
Syncevolution is very picky on the validity of the data and I had a couple of disturbing error messages during the first sync, but everything seemed to work OK. For doing normal incremental sync run:
syncevolution owncloud-calendar
Of course you don't want to have to open a terminal everytime you want to sync, but I'll leave that as an excercise for the reader 😉 (Hint: look in the Resources section) Now for the Contacts. Set up the server sync:
syncevolution --configure \
              --template SyncEvolution \
              backend=CardDAV \
              --sync-property username=user \
              --sync-property password=password \
              --sync-property syncURL=owncloud/apps/contacts/carddav.php/addressbooks/user/default \
             --sync-property deviceId=n900 \
              consumerReady=0 \
              target-config@owncloud-contacts contacts
And again a test:
syncevolution --print-items target-config@owncloud-contacts contacts
Set up sync to the local address book:
syncevolution --configure \
              --template "SyncEvolution Client" \
              syncURL=local://@owncloud-contacts \
              evolutionsource=file:///home/user/.osso-abook/db \
              username= \
              password= \
              type=evolution-contacts \
              consumerReady=1 \
              owncloud-contacts contacts
Initial slow sync:
syncevolution --sync slow owncloud-contacts
And incremental sync:
syncevolution owncloud-contacts
Syncevolution saves the configuration in ~/.config/syncevolution, so if you mess something up, just run rm -rf ~/.config/syncevolution/* (yes, I have once tried to add an extra space when running a similar command...) This setup will likely also work on the Nokia N800 and N9 and possibly on other devices too. Update: I have made a follow-up on this post with a simplified and more correct configuation. Resources: Sync Maemo 5 / Nokia N900 How to synchronize your Nokia N900's calendar with any calendar accessible to evolution (also if you usually use Thunderbird Lightning, Korganizer, ...) [SyncEvolution] CalDAV/CardDAV backends available How to connect PC to my Nokia N900 over WIFI? Root Access

Flattr this!

Posted in ownCloud, Sync. Tags: , . 68 Comments »