README 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. Initialising a dak database schema
  2. ==================================
  3. The following packages are needed for the database:
  4. * postgresql-9.6 postgresql-client-9.6 postgresql-9.6-debversion
  5. and the following packages for dak itself:
  6. * python-psycopg2 python-sqlalchemy python-apt gnupg dpkg-dev lintian
  7. binutils-multiarch python-yaml less python-ldap python-pyrss2gen python-rrdtool
  8. symlinks python-debian python-debianbts
  9. (the schema assumes at least postgresql 9.1; ftpmaster in Debian currently uses
  10. the postgresql 9.6 version from Debian 9)
  11. The following roles are assumed to exist:
  12. * dak: database superuser: needs to be an actual user
  13. * ftpmaster: role which should be given to archive administrators
  14. * ftpteam: people who can do NEW processing, overrides, removals, etc
  15. * ftptrainee: people who can add notes to packages in NEW
  16. For the purposes of this document, we'll be working in /srv/dak
  17. Set up the dak user:
  18. # sudo addgroup ftpmaster
  19. # sudo adduser dak --disabled-login --ingroup ftpmaster --shell /bin/bash
  20. Set up the dak directory:
  21. # sudo mkdir /etc/dak
  22. # sudo mkdir /srv/dak
  23. Create a symlink to /srv/dak/etc/dak.conf in /etc/dak
  24. (The actual file will be created by the setup script)
  25. # sudo ln -s /srv/dak/etc/dak.conf /etc/dak/dak.conf
  26. This script does the rest of the work. It uses the generic variables set in
  27. init_vars, which can be customized if needed.
  28. # setup/dak-setup.sh
  29. The above script symlinks the dak.py script to /srv/dak/bin/dak, you should also
  30. update your PATH variable to be able to execute dak:
  31. # export PATH="/srv/dak/bin:${PATH}"
  32. WARNING: Please check the templates in /srv/dak/templates over and customise
  33. as necessary
  34. Set up a private signing key: don't set a passphrase as dak will not
  35. pass one through to gpg. Guard this key carefully!
  36. The key only needs to be able to sign, it doesn't need to be able
  37. to encrypt.
  38. # gpg --homedir /srv/dak/keyrings/s3kr1t/dot-gnupg --gen-key
  39. Remember the signing key id for when creating the suite below.
  40. Here we'll pretend it is DDDDDDDD for convenience
  41. Import some developer keys.
  42. Either import from keyservers (here AAAAAAAA):
  43. # gpg --no-default-keyring --keyring /srv/dak/keyrings/upload-keyring.gpg --recv-key AAAAAAAA
  44. or import from files:
  45. # gpg --no-default-keyring --keyring /srv/dak/keyrings/upload-keyring.gpg --import /path/to/keyfile
  46. Import the developer keys into the database
  47. The -U '%s' tells dak to add UIDs automatically
  48. # dak import-keyring -U '%s' /srv/dak/keyrings/upload-keyring.gpg
  49. Add some architectures you care about:
  50. # dak admin architecture add i386 "Intel x86 port"
  51. # dak admin architecture add amd64 "AMD64 port"
  52. Add a suite (origin=, label= and codename= are optional)
  53. signingkey= will ensure that Release files are signed
  54. # dak admin suite add-all-arches unstable x.y.z origin=MyDistro label=Master codename=sid signingkey=DDDDDDDD
  55. Add the components to the suite
  56. # dak admin s-c add unstable main contrib non-free
  57. Re-run dak init-dirs to add new suite directories to /srv/dak
  58. # dak init-dirs
  59. #######################################################################
  60. # Example package flow
  61. #######################################################################
  62. For this example, we've grabbed and built the hello source package
  63. for AMD64 and copied it into /srv/dak/queue/unchecked.
  64. We start by performing initial package checks which will
  65. result in the package being moved to NEW
  66. # dak process-upload -d /srv/dak/queue/unchecked
  67. -----------------------------------------------------------------------
  68. hello_2.6-1_amd64.changes
  69. hello (2.6-1) unstable; urgency=low
  70. .
  71. * New upstream release.
  72. * Drop unused INSTALL_PROGRAM stuff.
  73. * Switch to 3.0 (quilt) source format.
  74. * Standards-Version: 3.9.1 (no special changes for this).
  75. source:hello
  76. binary:hello
  77. binary:hello is NEW.
  78. source:hello is NEW.
  79. [N]ew, Skip, Quit ? N
  80. ACCEPT-TO-NEW
  81. Installed 1 package set, 646 KB.
  82. -----------------------------------------------------------------------
  83. We can now look at the NEW queue-report
  84. # dak queue-report
  85. -----------------------------------------------------------------------
  86. NEW
  87. ---
  88. hello | 2.6-1 | source amd64 | 42 seconds old
  89. 1 new source package / 1 new package in total / 0 new package to be processed.
  90. -----------------------------------------------------------------------
  91. And we can then process the NEW queue:
  92. # dak process-new
  93. -----------------------------------------------------------------------
  94. hello_2.6-1_amd64.changes
  95. -------------------------
  96. Target: unstable
  97. Changed-By: Santiago Vila <sanvila@debian.org>
  98. NEW
  99. hello optional devel
  100. dsc:hello extra misc
  101. Add overrides, Edit overrides, Check, Manual reject, Note edit, Prod, [S]kip, Quit ?A
  102. PENDING ACCEPT
  103. -----------------------------------------------------------------------
  104. At this stage, the package has been marked as ACCEPTed from NEW.
  105. We now need to process the NEW policy queue:
  106. # dak process-policy new
  107. -----------------------------------------------------------------------
  108. Processing changes file: hello_2.6-1_amd64.changes
  109. ACCEPT
  110. -----------------------------------------------------------------------
  111. We can now see that dak knows about the package:
  112. # dak ls -S hello
  113. -----------------------------------------------------------------------
  114. hello | 2.6-1 | unstable | source, amd64
  115. -----------------------------------------------------------------------
  116. # dak control-suite -l unstable
  117. -----------------------------------------------------------------------
  118. hello 2.6-1 amd64
  119. hello 2.6-1 source
  120. -----------------------------------------------------------------------
  121. Next, we can generate the packages and sources files:
  122. # dak generate-packages-sources2
  123. (zcat /srv/dak/ftp/dists/unstable/main/binary-amd64/Packages.gz for instance)
  124. And finally, we can generate the signed Release files:
  125. # dak generate-release
  126. -----------------------------------------------------------------------
  127. Processing new
  128. Processing byhand
  129. Processing unstable
  130. -----------------------------------------------------------------------
  131. (Look at /srv/dak/ftp/dists/unstable/Release, Release.gpg and InRelease)
  132. #######################################################################
  133. # Next steps
  134. #######################################################################
  135. The debian archive automates most of these steps in jobs called
  136. cron.unchecked, cron.hourly and cron.dinstall.
  137. TODO: Write example (simplified) versions of these cronjobs which will
  138. do for most installs.