daily.functions 2.6 KB

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