Bug#353536: FAI class dependency

2008-09-10 Thread Jonathan Beckman
I think dependency handling is really, really hard to do correctly. If you
guys really want that feature, I'd recommend breaking out the code from apt
or aptitude and build something a top on that, because frankly you are not
going to make something better then that.

Because I don't think you want to solve, WEB depends on POSTGRES but POSTGRES
should be before WEBPOSTGRES which should be after WEB. That is a rather simple
case, it could get a lot nastier then that.


But I believe that if you introduce dependency handling people's classes are
going to get really complex; that is not a good thing.

I'd prefer more operations to the class determination scripts(fcopy,
fai-do-scripts), a + operator would make a lot of those nasty dependencies
uneccesary. I often find myself longing for this when I have to create a
class that's just for both cases. Example: POSTGRES+SERVICE1 and
POSTGRES+SERVICE2 should have different configuration files, but SERVICE1
and SERVICE2 shouldn't always have postgres so I can't do a SERVICE{1,2}
in files/ or packages_config/. So I must have two different classes:
SERVICE{1,2}_POSTGRES.


-- 
Jonathan Beckman
Network Operator
Spotify



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#496883: fai-client: get-config-dir-svn doesn't support password

2008-08-29 Thread Jonathan Beckman
On Thu, Aug 28, 2008 at 11:20 PM, Henning Sprang [EMAIL PROTECTED] wrote:
 Even though, with the connection data in the nfsroot, you could also think
 about if simple anonymous svn would not be enough :)
Not if you want to do this without host-based authentication and also with a
internet accessible subversion server. I like to keep as much of my system
a secret from the rest of the world as possible.


-- 
Jonathan Beckman
Network Operator
Spotify



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#496883: fai-client: get-config-dir-svn doesn't support password

2008-08-28 Thread Jonathan Beckman
Package: fai-client
Severity: wishlist
Tags: patch

To have a secure method to get the configuration space with subversion
you should have a password. I have patched the get-config-dir-svn file
to enable support for this.
Index: lib/get-config-dir-svn
===
--- lib/get-config-dir-svn  (revision 5003)
+++ lib/get-config-dir-svn  (working copy)
@@ -9,9 +9,11 @@
 # Short-Description: get $FAI from an svn repository.
 ### END SUBROUTINE INFO
 
-# matched string: svn://[EMAIL PROTECTED]/svnpath
+# matched string: svn://user:[EMAIL PROTECTED]/svnpath
 protocol=$(expr match $FAI_CONFIG_SRC '\([^:]*\)://')
-username=$(expr match $FAI_CONFIG_SRC '[^:]*://\([EMAIL PROTECTED])@')
+username=$(expr match $FAI_CONFIG_SRC '[^:]*://\([^@:]*\)[@:]')
+password=$(expr match $FAI_CONFIG_SRC '[^:]*://[^:]*:\([EMAIL PROTECTED])@')
+
 svnpath=$(expr match $FAI_CONFIG_SRC '[^:]*://[EMAIL 
PROTECTED]@\([^[:space:]]\+\)')
 
 case $protocol in
@@ -39,15 +41,16 @@
 esac

 [ -n $username ]  user=--username $username
+[ -n $password ]  pass=--password $password
 [ -z $username ]  svnurl=$FAI_CONFIG_SRC
 
 if [ -d $FAI/.svn ] ; then
echo Updating SVN in $FAI
cd $FAI
-   svn up $user | grep -v 'Updated to revision'  $LOGDIR/getconf.log
+   svn up $user $pass | grep -v 'Updated to revision'  $LOGDIR/getconf.log
task_error 701
 else 
echo Checking out SVN
-   svn co $user $svnurl $FAI | grep -v 'Checked out revision'  
$LOGDIR/getconf.log
+   svn co $user $pass $svnurl $FAI | grep -v 'Checked out revision'  
$LOGDIR/getconf.log
task_error 702
 fi


Bug#496883: fai-client: get-config-dir-svn doesn't support password

2008-08-28 Thread Jonathan Beckman
On Thu, Aug 28, 2008 at 11:24 AM, Henning Glawe [EMAIL PROTECTED] wrote:
 well, I was doing it the same way as with cvs: simply copy the authentication
 data to the nfsroot by copying recursively a properly setup .subversion
 directory ;)
Sounds like a bad solution :) I'd prefer to have support for password in the
uri-parser


-- 
Jonathan Beckman
Network Operator
Spotify



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#496883: fai-client: get-config-dir-svn doesn't support password

2008-08-28 Thread Jonathan Beckman
Tags: patch

I remade the patch so it also handles URLs without usernames
This patch fixes #441436.

-- 
Jonathan Beckman
Network Operator
Spotify


This e-mail (including any attachments) may contain information that is
confidential and/or privileged. It is intended only for the recipient(s).
If you have reason to believe that you are not the intended recipient of
this e-mail, please contact the sender immediately and delete the e-mail
from your computer.
Index: get-config-dir-svn
===
--- get-config-dir-svn	(revision 5050)
+++ get-config-dir-svn	(working copy)
@@ -9,11 +9,19 @@
 # Short-Description: get $FAI from an svn repository.
 ### END SUBROUTINE INFO
 
-# matched string: svn://[EMAIL PROTECTED]/svnpath
+# matched string: svn://user:[EMAIL PROTECTED]/svnpath
 protocol=$(expr match $FAI_CONFIG_SRC '\([^:]*\)://')
-username=$(expr match $FAI_CONFIG_SRC '[^:]*://\([EMAIL PROTECTED])@')
-svnpath=$(expr match $FAI_CONFIG_SRC '[^:]*://[EMAIL PROTECTED]@\([^[:space:]]\+\)')
+username=$(expr match $FAI_CONFIG_SRC '[^:]*://\([^@:]*\)[@:]')
 
+# If we have a username in our url we should parse out svnpath differently
+# also we should parse out possible password.
+if [ -n $username ]; then
+svnpath=$(expr match $FAI_CONFIG_SRC '[^:]*://[EMAIL PROTECTED]@\([^[:space:]]\+\)')
+password=$(expr match $FAI_CONFIG_SRC '[^:]*://[^:]*:\([EMAIL PROTECTED])@')
+else
+svnpath=$(expr match $FAI_CONFIG_SRC '[^:]*://\([^[:space:]]\+\)')
+fi
+
 case $protocol in
 	svn)
 		svnurl=svn://$svnpath
@@ -39,15 +47,16 @@
 esac
 		
 [ -n $username ]  user=--username $username
+[ -n $password ]  pass=--password $password
 [ -z $username ]  svnurl=$FAI_CONFIG_SRC
 
 if [ -d $FAI/.svn ] ; then
echo Updating SVN in $FAI
cd $FAI
-   svn up $user | grep -v 'Updated to revision'  $LOGDIR/getconf.log
+   svn up $user $pass | grep -v 'Updated to revision'  $LOGDIR/getconf.log
task_error 701
 else 
echo Checking out SVN
-   svn co $user $svnurl $FAI | grep -v 'Checked out revision'  $LOGDIR/getconf.log
+   svn co $user $pass $svnurl $FAI | grep -v 'Checked out revision'  $LOGDIR/getconf.log
task_error 702
 fi