From 3cdeae97f6d57f187361ce09057946fd4ccd4ef0 Mon Sep 17 00:00:00 2001 From: "jrayhawk+piny.be@omgwallhack.org" Date: Wed, 27 Apr 2011 18:33:28 -0700 Subject: Switch shortname hashes over to adduser-safe characters --- libpiny/lib/Piny/Repo.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm index 25bd744..14a26d1 100644 --- a/libpiny/lib/Piny/Repo.pm +++ b/libpiny/lib/Piny/Repo.pm @@ -470,8 +470,8 @@ around BUILDARGS => sub { }; }; -my @letter1 = ( 'a' .. 'z', 'A' .. 'Z' ); # First digit is base 52. -my @lettern = ( '0' .. '9', 'a' .. 'z', 'A' .. 'Z', '-', '_' ); # Remaining digits are base 64. +my @letter1 = ( 'a' .. 'z' ); # First digit is base 26. +my @lettern = ( '0' .. '9', 'a' .. 'z', '-', '_' ); # Remaining digits are base 38. sub _build_shortname { my ( $s ) = @_; -- cgit v1.2.3 From a98de20ab17b51c307454f095d37a2f9d1f71c55 Mon Sep 17 00:00:00 2001 From: "jrayhawk+piny.be@omgwallhack.org" Date: Wed, 27 Apr 2011 18:37:55 -0700 Subject: Correcting wrappergroup to use shortname --- libpiny/lib/Piny/Repo.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm index 14a26d1..0f2ad99 100644 --- a/libpiny/lib/Piny/Repo.pm +++ b/libpiny/lib/Piny/Repo.pm @@ -578,12 +578,12 @@ sub _build_ikiwiki_setup { $config->{"wrappers"} = [ { "wrapper" => $s->ikiwiki_cgipath - , "wrappergroup" => $s->group->name + , "wrappergroup" => "git-" . $s->shortname , "wrappermode" => "06755" , "cgi" => 1 } , { "wrapper" => $s->path . "/hooks/post-update" - , "wrappergroup" => $s->group->name + , "wrappergroup" => "git-" . $s->shortname , "wrappermode" => "06755" , "notify" => 0 } -- cgit v1.2.3 From e220c2c38d7997c628ab015ba2049f2bfe633e90 Mon Sep 17 00:00:00 2001 From: "jrayhawk+piny.be@omgwallhack.org" Date: Wed, 27 Apr 2011 18:43:46 -0700 Subject: Revert "Correcting wrappergroup to use shortname" This reverts commit a98de20ab17b51c307454f095d37a2f9d1f71c55. --- libpiny/lib/Piny/Repo.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm index b46e41b..edcc54c 100644 --- a/libpiny/lib/Piny/Repo.pm +++ b/libpiny/lib/Piny/Repo.pm @@ -578,12 +578,12 @@ sub _build_ikiwiki_setup { $config->{"wrappers"} = [ { "wrapper" => $s->ikiwiki_cgipath - , "wrappergroup" => "git-" . $s->shortname + , "wrappergroup" => $s->group->name , "wrappermode" => "06755" , "cgi" => 1 } , { "wrapper" => $s->path . "/hooks/post-update" - , "wrappergroup" => "git-" . $s->shortname + , "wrappergroup" => $s->group->name , "wrappermode" => "06755" , "notify" => 0 } -- cgit v1.2.3 From 2d93fcaec5a756d3cec9a188c4bd22fa116df9a1 Mon Sep 17 00:00:00 2001 From: "jrayhawk+piny.be@omgwallhack.org" Date: Wed, 27 Apr 2011 18:49:17 -0700 Subject: Switch rmrepo over to new shortnames --- libpiny/lib/Piny/Repo.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm index edcc54c..62f3d4d 100644 --- a/libpiny/lib/Piny/Repo.pm +++ b/libpiny/lib/Piny/Repo.pm @@ -324,9 +324,9 @@ sub destroy { my $ikiuser = Piny::User::IkiWiki->new( "name" => "iki-" . $s->name ); - system( "deluser", "--remove-home", $ikiuser->name ); - system( "delgroup", $ikiuser->name ); - system( "delgroup", "git-" . $s->name ); + system( "deluser", "--remove-home", "iki-" . $s->shortname ); + system( "delgroup", "iki-" . $s->shortname ); + system( "delgroup", $s->group->name ); }; -- cgit v1.2.3 From bd108be4cd1d055653070a4774935415093dbf12 Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Wed, 27 Apr 2011 18:51:56 -0700 Subject: Issue: repo name limit: closing --- docs/issues/repo_name_limit.mdwn | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/issues/repo_name_limit.mdwn b/docs/issues/repo_name_limit.mdwn index 7b42eb6..15b4023 100644 --- a/docs/issues/repo_name_limit.mdwn +++ b/docs/issues/repo_name_limit.mdwn @@ -1,4 +1,4 @@ -* Status: [[!taglink open]] +* Status: [[!taglink closed]] * Assigned to: [[!taglink jrayhawk]], [[!taglink jblake]] * Priority: [[!taglink now]] * Opened by: jrayhawk @@ -11,3 +11,7 @@ Possible solution: optional use of truncated md5 (the first character needing to ## 20110424 jrayhawk Added 31-character limit to usernames, still need to do the rest. + +## 20110427 jrayhawk + +seems to be working; closing -- cgit v1.2.3 From b3e1b1478f86ceaa76e1c67ef4c25cc285508886 Mon Sep 17 00:00:00 2001 From: "jrayhawk+piny.be@omgwallhack.org" Date: Wed, 27 Apr 2011 19:02:51 -0700 Subject: Removing bizarre attempt to mkdir and chown a relative $ikiwiki->user --- libpiny/lib/Piny/Repo.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm index 62f3d4d..b2fbd2d 100644 --- a/libpiny/lib/Piny/Repo.pm +++ b/libpiny/lib/Piny/Repo.pm @@ -249,7 +249,7 @@ sub rebuild { system( "/usr/bin/git", "clone", "--quiet", $s->path, $s->ikiwiki_srcdir ) and die "Could not clone repo to ikiwiki srcdir!"; }; - foreach( $ikiuser->name, $s->ikiwiki_srcdir, $s->ikiwiki_destdir, $s->secure_path ) { + foreach( $s->ikiwiki_srcdir, $s->ikiwiki_destdir, $s->secure_path ) { unless( -d $_ ) { mkdir( $_ ) }; system( "/bin/chown", "-R", $ikiuser->name . ".", $_ ) and die "Could not change ownership of ikiwiki directories!"; }; -- cgit v1.2.3 From abf9510070afe050a897ca23c5e0ca56bbb78568 Mon Sep 17 00:00:00 2001 From: "jrayhawk+piny.be@omgwallhack.org" Date: Wed, 27 Apr 2011 19:14:29 -0700 Subject: rebuildrepo: remove old ikiwiki state --- libpiny/lib/Piny/Repo.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm index b2fbd2d..be363bd 100644 --- a/libpiny/lib/Piny/Repo.pm +++ b/libpiny/lib/Piny/Repo.pm @@ -249,6 +249,8 @@ sub rebuild { system( "/usr/bin/git", "clone", "--quiet", $s->path, $s->ikiwiki_srcdir ) and die "Could not clone repo to ikiwiki srcdir!"; }; + system( "/usr/bin/find " . $s->ikiwiki_srcdir . " -type d -name .ikiwiki -print0 | xargs -0 --no-run-if-empty rm -r") and die "Could not remove old Ikiwiki state dir!"; + foreach( $s->ikiwiki_srcdir, $s->ikiwiki_destdir, $s->secure_path ) { unless( -d $_ ) { mkdir( $_ ) }; system( "/bin/chown", "-R", $ikiuser->name . ".", $_ ) and die "Could not change ownership of ikiwiki directories!"; -- cgit v1.2.3