Outils personnels
Vous êtes ici : Accueil 2008 Août 03
HADOPI - Le Net en France : black-out

03

03/08/2008

Blog opening

by kiorky — last modified 03/08/2008 20:41
Classé sous :

There is a long time i must have done that.

IT s done now, my blog is open :)

Stay tuned for new entries.

 

What will may be next:

  • Plone customization
  • Refactor logo and design of this bare plone.
  • Integration with cryptelium services
  • Cofee and tea

loggerhead and auto publishing

by kiorky — last modified 03/08/2008 23:40
Classé sous :

Setting up auto publishing and ui into loggerhead.dev

Althought i was playing in the wonderfull world of mercurial, i 'm trying out bazaar and its tools.

The goal of the week end was to set up some repositories and a source browser on top of them.

In bazaar world, there is not much choice to achieve that. In other terms, you re really encouraged to use loggerhead.

 

So, i began to set up a repository, file access and so on... Then look at the loggerhead documentation. Great, there is some sort of auto publishing feature.

This is a mechanism like our beloved mercurial's hgwebdir.cgi to autopublish branches inside a top level directory.

 

Installation

So, the procedure i used was really simple:

Grab it

bzr branch http://bazaar.launchpad.net/%7Eloggerhead-team/loggerhead/trunk/ loggerhead.dev

Edit and point to my top level directory

cp loggerhead.conf* loggerhead.conf

vi loggerhead.conf

Set up a gentoo init script to start it and schedule for starting after apache2

$ cat /etc/init.d/loggerhead
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
        need net apache2
}

start() {
        ebegin "Starting $server_name server"
        start-stop-daemon --start  --user $user  --quiet --background \
        -p $pid_file -m  --exec "$py"  --  "$start_cmd"
        eend $?
}

stop() {
        ebegin "Stopping $server_name  server"
        "$py"  --  "$stop_cmd"  2>&1 >> /dev/null
        eend $?
}

$ cat /etc/conf.d/loggerhead
start_cmd=/path/loggerhead.dev/start-loggerhead
stop_cmd=/path/loggerhead.dev/stop-loggerhead
pid_file="/path/loggerhead.dev/loggerhead.pid"
user="apache"
py=`which python`
server_name="Loggerhead"

 Configure apache for serving both bazaar and loggerhead on the same vhost

...
Vhost basic and directories directives
...
# setting an alias to point to the bazaar directory

Alias /repos/ /path/repos/


RewriteEngine on

# mapping to /repos  if we are not browsing on loggerhead or if we are directly "branching"
RewriteCond  %{REQUEST_URI}  !^(/repos/.*)$
RewriteCond  %{REQUEST_URI}  ^(.*\.bzr.*)$
RewriteRule  ^/(.*)$         /repos/$1   [R,L]

# mapping to loggerhead otherwise
RewriteCond  %{REQUEST_URI}  !^(.*\.bzr.*)$
RewriteCond  %{REQUEST_URI}  !^(/repos/.*)$
RewriteCond  %{REQUEST_URI}  !^(/icons/.*)$
RewriteRule  ^/(.*)          http://bzr.cryptelium.net:1337/$1 [P]
RewriteCond  %{REQUEST_URI}  !^(.*\.bzr.*)$
RewriteCond  %{REQUEST_URI}  !^(/repos/.*)$
RewriteCond  %{REQUEST_URI}  !^(/icons/.*)$
RewriteRule  ^/(.*)/$        http://bzr.cryptelium.net:1337/$1 [P]

# The two [P] RewriteRules are just ProxyPass rules which allow to redirect to the loggerhead server.

 

Are we done yet ?

Unfortunatly not.

Loggerhead is stupid and will not publish two branches with same name.

Another thing is that it will take the branch name for display in UI.

I REALLLY do not like that. I prefer to see full pathes in the UI. That helps my little brain with tree view focus to function properly.

 

Why ?

This cannot be served (just b/c will be):

a/c
b/c

 

b/c/d

Results in

d

 

Fix ?

For my own use, i make my own fix :)

But i upstreamed the result there:https://bugs.launchpad.net/loggerhead/+bug/254411

This allows me to publish my repositories with path views :)

 

Result

http://bzr.cryptelium.net/