Code for importing packagesite.yaml information into FreshPorts https://www.freshports.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
3.3KB

  1. These are the instructions for updating a FreshPorts instance to use the new
  2. packages features.
  3. pkg install freshports-www
  4. Database upgrade:
  5. From a copy of svn+ssh://svnusers@svn.int.unixathome.org/freshports-1/database-schema/trunk
  6. psql DB
  7. begin;
  8. CREATE ROLE packaging;
  9. \i updates-2020-04-20-packages.ddl
  10. \i ri.txt
  11. \i updates-2020-04-20-packages.ddl.after.ri.xt
  12. \i sp.txt
  13. Should be no errors.
  14. These are OK:
  15. psql:ri.txt:1024: NOTICE: trigger "ports_origin_maintain" for relation "ports" does not exist, skipping
  16. psql:ri.txt:1043: NOTICE: trigger "packages_last_checked_maintain" for relation "abi" does not exist, skipping
  17. Ignore them.
  18. configure pg_hba.conf to allow new package-based users
  19. create user packager? password 'changeme' IN ROLE packaging;
  20. on the webserver: freshports-www-packages
  21. - nope, nothing in there releated to packages
  22. permissions from configuration/POSTGRESQL.sql
  23. On the ingress server:
  24. sudo pkg install packages-import
  25. In /usr/local/etc/freshports/config.ini set the redacted values, and the PACKAGER_DBUSER
  26. for this host.
  27. in /usr/local/etc/freshports/config.ini set BASEDIR_PACKAGER
  28. Add to /etc/periodic.conf:
  29. fp_check_repos_for_new_builds_enable="YES"
  30. On the web server:
  31. Create your [jailed?] filesystem for use with the database....
  32. re: https://dan.langille.org/2020/04/29/using-zfs-rollback-for-cache-clearing/
  33. Snapshot the 'empty' rollback point:
  34. sudo zfs snapshot system/data/freshports-cache-packages/CHANGEME@empty
  35. Delegate the rollback:
  36. sudo zfs allow freshports rollback system/data/freshports-cache-packages/CHANGEME
  37. set the correct dataset name in /usr/local/etc/freshports/fp-listen.ini
  38. PKG_ZFS_SNAPSHOT = system/data/freshports-cache-packages/CHANGEME@empty
  39. update /usr/local/etc/freshports/config.pm based on config.pm.sample
  40. -- insert this so fp-listen knows to listen
  41. freshports.org=# insert into listen_for ( name, script_name ) values ('listen_for', 'ClearPackagesCache');
  42. This was my original note:
  43. need role creation
  44. invoke
  45. Need tables.
  46. * /usr/local/www/freshports/configuration/POSTGRESQL.sql for db permissions
  47. * /usr/home/dan/src/freshports/database-schema/sp.txt
  48. * /usr/home/dan/src/freshports/database-schema/ri.txt
  49. freshports.test=# alter table packages_raw owner to packager_test;
  50. ALTER TABLE
  51. /etc/periodic.conf
  52. fp_check_repos_for_new_builds_enable="YES"
  53. create role packager_test with password 'redacted';
  54. grant packaging to packager_test
  55. grant select on element_pathname to packaging;
  56. grant select on ports to packaging;
  57. grant UPDATE ON packages_raw TO packaging;
  58. grant update on packages to packaging;
  59. alter user packager_test login;
  60. /usr/local/etc/freshports/config.sh needs these new entries:
  61. BASEDIR_PACKAGER="/var/db/freshports/packagesite"
  62. /usr/local/etc/freshports/config.pm needs these:
  63. +$FreshPorts::Config::NewReposReadyForImport = $FreshPorts::Config::BaseDir . '/signals/new_repo_ready_for_import';
  64. +$FreshPorts::Config::NewRepoImported = $FreshPorts::Config::BaseDir . '/signals/new_repo_imported';
  65. /usr/local/etc/freshports/config.ini needs these:
  66. CATEGORY_CACHE_PATH = %(BASEDIR)s/cache/categories/%%s/*
  67. # this is the name of the zfs filesystem to rollback, including the snapshot name
  68. PKG_ZFS_SNAPSHOT = system/data/freshports-cache-packages/dev-nginx01@empty
  69. create new packages fileset