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.
:-1:

 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
Owner
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
Owner
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.

Agreed.

    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
Owner
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.

Journal:

0.3
 - 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:

0.2
- 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}">
	<head>
		<title>TAL Page Templates</title>
	</head>
	<body>
		<div id="content" metal:fill-slot="content">
		Your content here...
		</div>
	</body>
</html>
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:
http://owncloud.org/releases/owncloud-5.0.0-beta1.tar.bz2

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:
https://github.com/owncloud/core/issues
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!!!

Frank

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

Installing Ruby RVM on Ubuntu 12.10

I've never used Ruby even though it's apparently the language of the hour (or maybe some hours ago - I'm often late on such stuff), but had to use it today to run some scripts. I didn't know what RVM was until a couple of hours ago, but when I had to use it, I found out that the package doesn't exist on 12.10 :-/

There's probably some PPA out there with updated packages, but a quick search didn't reveal any, so I decided to install it manually. As the packaged Ruby is kinda outdated, and doesn't match with some of the gems, I also installed a fresh version of that. To avoid clashing with anything that might need the packaged version, I installed it in my home directory. Luckily the RVM packagers made it very simple to do.

Prerequisites:

sudo apt-get install libxslt1.1 libxslt-dev xvfb build-essential git-core curl
Maybe they're not all needed for ruby/rvm, but I followed an instruction on how to run Cumbumber tests for ownCloud. Install RVM (from the RVM install page):
\curl -L https://get.rvm.io | bash -s stable --ruby
Add code to source some init code to your .bashrc (no idea what it does):
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
Add the bin directory to your PATH:
echo 'export PATH=$HOME/.rvm/bin:$PATH' >> ~/.bashrc
And source it:
. .bashrc
Install necessary dependencies:
bundle install

That's it. Feel free to comment, but I most likely can't answer any questions, because all I did was to collect some snippets from various sources and boil them down to some easy steps :-)

flattr this!

Posted in Ruby, Ubuntu. Tags: , , . 4 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 \
	target-config@owncloud
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= \
	owncloud
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: , , . 75 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

Before:
<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" />
After:
<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

Before:
<a href="<?php echo link_to('', 'index.php'); ?>">Home</a>
<a href="<?php echo link_to('app', 'index.php'); ?>">Some app</a>
After:
<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

Before:
<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>
After:
<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

Before:
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'); ?>
After:
ownCloud version: ${config:string:sys/version}
Default quota: ${config:string:app/files/default_quota}
Calendar time zone: ${config:string:user/calendar/timezone}

Translating content

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

Translating content with variables

Before:

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.

After:
<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"/>.
</p>

Welcome back .

Read more...

Translating attributes.

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

Iterating

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

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">
	<form>
	<fieldset>
	<dl class="form">
		<dt><label for="pre">< ?php echo $l->t('Hon. prefixes'); ?></label></dt>
		<dd>
			<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.'); ?>">
			</option></datalist>
		</dd>
		<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>
		<dd>
			<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.'); ?>">
			</option></datalist>
		</dd>
	</dl>
	</fieldset>
	</form>
</div>

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">
	<form>
	<fieldset tal:condition="name">
	<dl class="form">
		<dt><label for="pre">Hon. prefixes</label></dt>
		<dd>
			<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" />
			</datalist>
		</dd>
		<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>
		<dd>
			<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." />
			</datalist>
		</dd>
	</dl>
	</fieldset>
	</form>
</div>

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:
#!/bin/bash
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: . 25 Comments »

Yet another MySQL vs. AppArmor barf

I freaking hate AppArmor! Of course only because I don't want to be bothered when an update makes a mess of it - I really don't know how it works but I don't want to need to know either. Some months ago I tried out Logitech Media Server on my box, and it screwed it up big time. Now it seems there has been an update, so it doesn't accept symlinks anymore. It seems logical that it shouldn't, but Ubuntu could have done a better job fixing it - or maybe it's because I had already edited it, that it didn't get updated..? A search lead me to an issue at Launchpad about it, but I've only skimmed through it. Anyways, today when I rebooted MySQL wouldn't run and /var/log/syslog was filled with entries like this:
Mar 30 11:55:31 tanghus kernel: [ 1309.198481] type=1400 audit(1333101331.343:97): apparmor="DENIED" operation="mknod" parent=1 profile="/usr/sbin/mysqld" name="/run/mysqld/mysqld.sock" pid=7192 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=114 ouid=114
Mar 30 11:55:36 tanghus kernel: [ 1314.463559] init: mysql main process (7192) terminated with status 1
Mar 30 11:55:36 tanghus kernel: [ 1314.463606] init: mysql main process ended, respawning
Mar 30 11:56:01 tanghus kernel: [ 1339.105333] init: mysql post-start process (7194) terminated with status 1
Mar 30 11:56:01 tanghus kernel: [ 1339.111425] type=1400 audit(1333101361.335:98): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=7291 comm="apparmor_parser"
To fix it edit /etc/apparmor.d/usr.sbin.mysqld and replace the lines: /var/run/mysqld/mysqld.pid w, /var/run/mysqld/mysqld.sock w, with: /run/mysqld/mysqld.pid w, /run/mysqld/mysqld.sock w, and restart mysql by running sudo service mysql restart - if it doesn't respawn by itself. AppArmor should automagically refresh from the change of it's configuration file, otherwise run sudo service apparmor restart.

flattr this!

Is Kubuntu up for a great future?

One could argue so. Harald Sitter (apachelogger) tells that a lot of the base software Kubuntu relies on, will move from the main to universe repository, and that it:
(...) bares a great deal of opportunities for Kubuntu. Primarily it gives the community yet bigger control over what the distribution looks like as we do not need to get software approved to be worthy of Canonical’s support. At the same time it also reduces the policy overhead (main inclusion for those who have heared of it). The detanglement allows us to move even closer to KDE without having to worry about conflicting interests (...)
I have used Kubuntu since one of the first releases (something with a hedgehog?) and enjoy that KDE packages appears in the PPA fast and well tested. One of my major complaints about Kubuntu is that packages such as qtwebkit are totally out of date, and causes crashes and lack of functionality in the up-to-date KDE programs and libraries. Maybe a really community driven Kubuntu will prove to be much better in the long run? Via How Kubuntu Did Not Change | Apachelogger's Log.

flattr this!

Posted in KDE, Kubuntu. No Comments »