test torrent_list and display test names
[cloudstore.git] / rsync-piper.pl
index b82d339..00eb45b 100755 (executable)
@@ -95,8 +95,14 @@ while(<$p>) {
 
        my ( $login, undef, $uid, $gid, $email, $path, $shell ) = split(/:/,$_,7);
 
-       if ( -d $path && -f "$path/.secrets" ) {
-               my @secrets = map { chomp; $_ } read_file "$path/.secrets";
+       if ( -d $path && -f "$path/.secrets" && ! -e "$path/.meta/secrets" ) {
+               $store->api->mkbasepath( "$path/.meta/secrets" );
+               rename "$path/.secrets", "$path/.meta/secrets";
+               warn "UPGRADE $login rsync secrets location\n";
+       }
+
+       if ( -d $path && -f "$path/.meta/secrets" ) {
+               my @secrets = map { chomp; $_ } read_file "$path/.meta/secrets";
                my $auth_users = join(', ', map { s/:.+$//; $_ } @secrets );
 
                $rsync_config .= <<__RSYNC_MODULE__;
@@ -104,11 +110,11 @@ while(<$p>) {
 [$login]
        path = $path
        auth users = $auth_users
-       secrets file = $path/.secrets
+       secrets file = $path/.meta/secrets
        read only = false
        uid = $uid
        gid = $gid
-       filter = - /.secrets - /.md5
+       filter = - /.meta
 #      refuse options = c delete
 #      dont compress = *
        incoming chmod = u=rwX,g+rX,o+rX