]> git.pld-linux.org Git - projects/pld-builder.new.git/commitdiff
- rsync passwords are now stored in separate file rather then in urls;
authorMichal Moskal <michal@moskal.me>
Thu, 12 Jun 2003 20:06:08 +0000 (20:06 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
  also --password-file is used in rsync invocation

Changed files:
    PLD_Builder/file_sender.py -> 1.5
    PLD_Builder/path.py -> 1.10
    admin/fresh-queue.sh -> 1.8
    config/builder.conf -> 1.9
    config/rsync-passwords -> 1.1

PLD_Builder/file_sender.py
PLD_Builder/path.py
admin/fresh-queue.sh
config/builder.conf
config/rsync-passwords [new file with mode: 0644]

index fec2cfbd1a84f310cc2d052651a74f26a5f85389..01c6d94fd35d0ed64836eb9066a715f3264a7f17 100644 (file)
@@ -47,22 +47,33 @@ def copy_file(src, target):
     problem = "cannot copy file: %s" % format_exception_only(exctype, value)
     return 1
 
-def rsync_file(src, user, password, host, path):
+def rsync_file(src, target, host):
   global problem
-  # FIXME: use --password-file?
-  f = os.popen("RSYNC_PASSWORD='%s' rsync --verbose --archive %s %s@%s::%s 2>&1 < /dev/null" \
-                % (password, src, user, host, path))
+  p = open(path.rsync_password_file, "r")
+  password = None
+  for l in p.xreadlines():
+    l = string.split(l)
+    if len(l) >= 2 and l[0] == host:
+      password = l[1]
+  p.close()
+  rsync = "rsync --verbose --archive"
+  if password != None:
+    p = open(".rsync.pass", "w")
+    os.chmod(".rsync.pass", 0600)
+    p.write("%s\n" % password)
+    p.close()
+    rsync += " --password-file .rsync.pass"
+  f = os.popen("%s %s %s 2>&1 < /dev/null" % (rsync, src, target))
   problem = f.read()
+  res = f.close()
+  if password != None: os.unlink(".rsync.pass")
   return f.close()
   
 def send_file(src, target):
   log.notice("sending %s" % target)
-  m = re.match('rsync://([^@:]+):([^@]+)@([^/:]+)(:|/)(.*)', target)
+  m = re.match('rsync://([^/]+)/.*', target)
   if m:
-    return rsync_file(src, user = m.group(1), 
-                           password = m.group(2), 
-                           host = m.group(3),
-                           path = m.group(5))
+    return rsync_file(src, target, host = m.group(1))
   if target != "" and target[0] == '/':
     return copy_file(src, target)
   m = re.match('scp://([^@:]+@[^/:]+)(:|)(.*)', target)
@@ -102,6 +113,7 @@ def maybe_flush_queue(dir):
 
 def flush_queue(dir):
   q = []
+  os.chdir(dir)
   for f in glob.glob(dir + "/*.desc"):
     d = read_name_val(f)
     if d != None: q.append(d)
index 26674b6618cf4a7f89710cde0c610732d6c96bc0..06edb6ee6f953601c2a8b5554a20b928d788c372 100644 (file)
@@ -8,6 +8,7 @@ www_dir = root_dir + "www/"
 
 acl_conf = conf_dir + "acl.conf"
 builder_conf = conf_dir + "builder.conf"
+rsync_password_file = conf_dir + "rsync-passwords"
 
 # spool/
 queue_file = spool_dir + "queue"
index 04d842228d64266c68eacd4ce9e34b2c60c3a1f6..2117df08d28fe30441b6fabd1e0763c1ee1576ec 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+umask 077
+
 if [ "$1" != "y" ] ; then
   echo "this scripts kills current queue and installs new"
   echo "run '$0 y' to run it"
@@ -13,3 +15,6 @@ echo -n > spool/processed_ids
 echo -n > spool/got_lock
 echo '<queue/>' > spool/queue
 echo '<queue/>' > spool/req_queue
+
+chmod 755 www www/srpms
+chmod 644 www/max_req_no
index 76c7998cb2ccebdff4a26d280e3db02cea807329..dfdc016fdc447245c609bbcb22f7267b2fc60d09 100644 (file)
@@ -2,6 +2,10 @@
 # builder email (in From:)
 email = malekith@roke.freak
 admin_email = malekith@roke.freak
+# list of binary builders
+binary_builders = roke-athlon
+# the only src builder
+src_builder = roke-src
 
 # ------ Binary builders config:
 # how much jobs can be run at once
@@ -15,20 +19,14 @@ queue_signed_by = src_builder_roke
 # email where to send status notifications
 notify_email = srpms_builder@roke.freak
 
-# ------- Src builder config:
-# list of binary builders
-binary_builders = athlon
-# the only src builder
-src_builder = roke-src
-
 [roke-src]
 arch = athlon
 chroot = /adm/chroot-src
-buildlogs_url = rsync://bl:foobar123@roke.freak/buildlogs/nest/SRPMS/.new/
+buildlogs_url = rsync://bl@roke.freak/buildlogs/nest/SRPMS/.new/
 ftp_url = scp://ftpadm@roke.freak/home/services/ftpd/dists/nest/ready/SRPMS
 
 [roke-athlon]
 arch = athlon
 chroot = /adm/chroot-athlon
-buildlogs_url = rsync://bl:foobar123@roke.freak/buildlogs/nest/athlon/.new/
+buildlogs_url = rsync://bl@roke.freak/buildlogs/nest/athlon/.new/
 ftp_url = scp://ftpadm@roke.freak/home/services/ftpd/dists/nest/ready/athlon
diff --git a/config/rsync-passwords b/config/rsync-passwords
new file mode 100644 (file)
index 0000000..84d767c
--- /dev/null
@@ -0,0 +1,6 @@
+# This file lists passwords to rsync service on given
+# user@host. 
+# Example entry:
+# foo@bar.com  SeCr3t
+
+bl@roke.freak  foobar123
This page took 0.166039 seconds and 4 git commands to generate.