daily.functions 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 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. }
  35. # Generate the contributor data
  36. function contributor() {
  37. log "Submitting data to contributors"
  38. TMPCNTB=$( gettempfile )
  39. 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}
  40. # Post with curl as a workaround for #801506
  41. # See https://wiki.debian.org/ServicesSSL#curl
  42. dir=/etc/ssl/ca-debian
  43. test -d ${dir} && capath="--capath ${dir}"
  44. curl -s ${capath} https://contributors.debian.org/contributors/post \
  45. -F source=ftp.debian.org \
  46. -F auth_token="$(cat ${base}/s3kr1t/contributor.auth)" \
  47. -F data=@${TMPCNTB} > ${TMPCNTB}.result
  48. log "Results:"
  49. cat ${TMPCNTB}.result
  50. log "----"
  51. rm -f ${TMPCNTB}.result
  52. }
  53. # Clean up urgency log
  54. function cleanurgencylog() {
  55. log "Cleaning up urgency log"
  56. find /srv/ftp.debian.org/web/britney/urgencies -type f -mtime +15 -delete
  57. }
  58. # Update keyring for buildd-add-keys, buildd-remove-keys:
  59. function update-buildd-admin-keyring() {
  60. log "Updateing buildd admin keyring"
  61. . ${configdir}/buildd-keyrings.conf
  62. cd ${scriptdir}/builddkeyrings
  63. gpg --no-tty --no-default-keyring --keyring /srv/keyring.debian.org/keyrings/debian-keyring.gpg --export "${buildd_admin_keys[@]}" |
  64. gpg --no-tty --no-default-keyring --keyring ./adminkeys.gpg.new --import
  65. mv adminkeys.gpg.new adminkeys.gpg
  66. }