daily.functions 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # -*- mode:sh -*-
  2. # get the latest list of wnpp bugs and their source packages
  3. function wnppbugs() {
  4. log "Fetching latest list of wnpp bugs"
  5. TMPLIST=$( gettempfile )
  6. wget -q -O${TMPLIST} --ca-directory=/etc/ssl/ca-debian https://qa.debian.org/data/bts/wnpp_rm
  7. chmod go+r ${TMPLIST}
  8. mv ${TMPLIST} ${scriptdir}/masterfiles/wnpp_rm
  9. }
  10. # Push files over to security
  11. function pushfilesdb() {
  12. log "Pushing files table to security"
  13. # The key over there should have the following set for the ssh key:
  14. # command="/srv/security-master.debian.org/dak/scripts/debian/update-external-files --update"
  15. psql -c 'COPY files (id, filename, size, md5sum, last_used, sha1sum, sha256sum, created, modified) TO STDOUT' projectb | \
  16. xz -3 | \
  17. ssh -o BatchMode=yes -o ConnectTimeout=30 -o SetupTimeout=30 -2 \
  18. -i ${base}/s3kr1t/push_external_files dak@security-master.debian.org sync
  19. }
  20. # Update wanna-build dump
  21. function wbdump() {
  22. log "Update wanna-build database dump"
  23. ${masterdir}/scripts/nfu/get-w-b-db
  24. }
  25. # Write out sections file
  26. function writesections() {
  27. log "Writing sections.822"
  28. dak write-sections > ${exportdir}/sections.822
  29. }
  30. # Generate stats and charts about the new queue
  31. function newstats() {
  32. log "Generating stats about the new queue"
  33. dak stats new ${webdir}/NEW-stats.yaml 2> /dev/null
  34. log "Generating charts about the new queue"
  35. dak graph-new --rrd=${scriptdir}/graph_new/ --outdir=${webdir}/graph_new/
  36. }
  37. # Generate the contributor data
  38. function contributor() {
  39. log "Submitting data to contributors"
  40. TMPCNTB=$( gettempfile )
  41. REQUESTS_CA_BUNDLE=/etc/ssl/ca-debian/ca-certificates.crt dc-tool --mine="${configdir}/contributor.source" --auth-token @"${base}/s3kr1t/contributor.auth" --source ftp.debian.org --json > ${TMPCNTB}
  42. # Post with curl as a workaround for #801506
  43. # See https://wiki.debian.org/ServicesSSL#curl
  44. dir=/etc/ssl/ca-debian
  45. test -d ${dir} && capath="--capath ${dir}"
  46. curl -s ${capath} https://contributors.debian.org/contributors/post \
  47. -F source=ftp.debian.org \
  48. -F auth_token="$(cat ${base}/s3kr1t/contributor.auth)" \
  49. -F data=@${TMPCNTB} > ${TMPCNTB}.result
  50. log "Results:"
  51. cat ${TMPCNTB}.result
  52. log "----"
  53. rm -f ${TMPCNTB}.result
  54. }
  55. # Clean up urgency log
  56. function cleanurgencylog() {
  57. log "Cleaning up urgency log"
  58. find /srv/ftp.debian.org/web/britney/urgencies -type f -mtime +15 -delete
  59. }
  60. # Update keyring for buildd-add-keys, buildd-remove-keys:
  61. function update-buildd-admin-keyring() {
  62. log "Updateing buildd admin keyring"
  63. . ${configdir}/buildd-keyrings.conf
  64. cd ${scriptdir}/builddkeyrings
  65. gpg --no-tty --no-default-keyring --keyring /srv/keyring.debian.org/keyrings/debian-keyring.gpg --export "${buildd_admin_keys[@]}" |
  66. gpg --no-tty --no-default-keyring --keyring ./adminkeys.gpg.new --import
  67. mv adminkeys.gpg.new adminkeys.gpg
  68. }