UPGRADING.rst 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  1. Upgrading Pagure
  2. ================
  3. From 5.2 to 5.3
  4. ---------------
  5. The 5.3 release contains a database schema updates, so:
  6. * Update the data schema using alembic: ``alembic upgrade head``
  7. (As usual, do your backups before).
  8. While working on pagure 5.3, we found that the version of python werkzeug
  9. available in CentOS 7 is too old and makes some of pagure's tests fail. We
  10. recomment it to be upgrade to at least 0.9.6.
  11. New configuration keys have been added:
  12. * ENABLE_TICKETS_NAMESPACE
  13. * FEDORA_MESSAGING_NOTIFICATIONS
  14. * SYNTAX_ALIAS_OVERRIDES
  15. * ALWAYS_STOMP_ON_COMMITS
  16. * ALWAYS_MQTT_ON_COMMITS
  17. * MQTT_TOPIC_PREFIX
  18. From 5.1.x to 5.2
  19. -----------------
  20. The 5.2 release contains a database schema updates, so:
  21. * Update the data schema using alembic: ``alembic upgrade head``
  22. (As usual, do your backups before).
  23. If you run into issues with the ``hook_mirror``, see the upgrade notes for
  24. the release 5.1.4 below.
  25. Note that the minimal version of pygit2 has been bumped to: 0.26.0
  26. New configuration keys have been added:
  27. * MQTT_NOTIFICATIONS
  28. * MQTT_HOST
  29. * MQTT_PORT
  30. * MQTT_USERNAME
  31. * MQTT_PASSWORD
  32. * MQTT_CA_CERTS
  33. * MQTT_CERTFILE
  34. * MQTT_KEYFILE
  35. * MQTT_CERT_REQS
  36. * MQTT_TLS_VERSION
  37. * MQTT_CIPHERS
  38. * DISABLE_MIRROR_IN
  39. * SSH_ADMIN_TOKEN
  40. * GIT_GARBAGE_COLLECT
  41. * DISABLE_REMOTE_PR
  42. * ADMIN_EMAIL
  43. * LOG_ALL_COMMITS
  44. * ARCHIVE_FOLDER
  45. One configuration key changes its default structure:
  46. * TRIGGER_CI
  47. From 5.1 to 5.1.4
  48. -----------------
  49. In the development of 5.1.4 it was found out that the alembic migration
  50. ``ba538b2648b7`` that creates the ``hook_mirror`` table was incomplete.
  51. If you created that table via alembic, you will likely want to re-run it. Beware
  52. that applying the following commands will destroy any data you have in this
  53. table.
  54. * Mark the database to this migration::
  55. alembic stamp ba538b2648b7
  56. * Remove the ``hook_mirror`` table so it can be re-generated::
  57. alembic downgrade -1
  58. * Re-run that single migration::
  59. alembic upgrade +1
  60. * Marking the database to the last current migration (as of 5.1.4)::
  61. alembic stamp f16ab75e4d32
  62. Again, any project that tried to setup the mirroring feature in pagure will need
  63. to be reconfigured.
  64. Another option (that will prevent loosing any data in this table) is to
  65. adjust the table manually using these SQL queries:
  66. ::
  67. ALTER TABLE hook_mirror ADD COLUMN 'public_key' TEXT;
  68. ALTER TABLE hook_mirror ADD COLUMN 'target' TEXT;
  69. ALTER TABLE hook_mirror ADD COLUMN 'last_log' TEXT;
  70. From 5.x to 5.1
  71. ---------------
  72. The 5.1 release contains a database schema updates, so:
  73. * Update the data schema using alembic: ``alembic upgrade head``
  74. (As usual, do your backups before).
  75. New configuration keys added:
  76. * ALLOW_ADMIN_IGNORE_EXISTING_REPOS
  77. * ALLOW_HTTP_PULL_PUSH
  78. * ALLOW_HTTP_PUSH
  79. * HTTP_REPO_ACCESS_GITOLITE
  80. From 5.0 to 5.0.1
  81. -----------------
  82. The 5.0 release was missing a database schema migration to add the
  83. ``hook_mirror`` table. This alembic migration has been added, so if you have
  84. note update to 5.0, you will want to update your database schema using:
  85. ``alembic upgrade head``. If you went around this issue by running the
  86. ``pagure_createdb.py`` script, you can mark you database schema up to date using
  87. ``alembic stamp ba538b2648b7``.
  88. From 4.x to 5.0
  89. ---------------
  90. The release 5.0 brings some changes to the database schema.
  91. * Update the data schema using alembic: ``alembic upgrade head``
  92. New configuration keys added:
  93. * PR_TARGET_MATCHING_BRANCH
  94. * EMAIL_ON_WATCHCOMMITS
  95. * THEME
  96. * GIT_AUTH_BACKEND (replacing GITOLITE_BACKEND, backward compatibility kept for
  97. now)
  98. * REPOSPANNER_PSEUDO_FOLDER
  99. * REPOSPANNER_NEW_REPO
  100. * REPOSPANNER_NEW_REPO_ADMIN_OVERRIDE
  101. * REPOSPANNER_NEW_FORK
  102. * REPOSPANNER_ADMIN_MIGRATION
  103. * REPOSPANNER_REGIONS
  104. * SSH_KEYS_USERNAME_LOOKUP
  105. * SSH_KEYS_USERNAME_EXPECT
  106. * SSH_KEYS_OPTIONS
  107. Configuration deprecated:
  108. * BOOTSTRAP_URLS_CSS
  109. * BOOTSTRAP_URLS_JS
  110. * FILE_SIZE_HIGHLIGHT
  111. * HTML_TITLE
  112. * GITOLITE_BACKEND
  113. Note: Some configuration keys changed their default value:
  114. * LOGGING
  115. * PRIVATE_PROJECTS
  116. * EMAIL_ERROR
  117. * FROM_EMAIL
  118. * DOMAIN_EMAIL_NOTIFICATIONS
  119. * APP_URL
  120. * DOC_APP_URL
  121. * GIT_URL_SSH
  122. * GIT_URL_GIT
  123. * FEDMSG_NOTIFICATIONS
  124. * PAGURE_AUTH
  125. From 3.x to 4.0
  126. ---------------
  127. The release 4.0 brings some changes to the database schema.
  128. * Update the data schema using alembic: ``alembic upgrade head``
  129. New configuration keys added:
  130. * EMAIL_ON_WATCHCOMMITS
  131. * ALWAYS_FEDMSG_ON_COMMITS
  132. * SESSION_TYPE
  133. * PROJECT_TEMPLATE_PATH
  134. * FORK_TEMPLATE_PATH
  135. From 3.13 to 3.13.1
  136. -------------------
  137. The release 3.13.1 brings one change to the database schema to remove a database
  138. constraint (pull_requests_check in the pull_requests table) that is not only no
  139. longer needed but even blocking now.
  140. * Update the data schema using alembic: ``alembic upgrade head``
  141. From 3.12 to 3.13
  142. -----------------
  143. The release 3.13 brings some features and bug fixes but does not have any
  144. changes made to the database schema or new configuration keys. Update should be
  145. straight forward.
  146. From 3.11 to 3.12
  147. -----------------
  148. The release 3.12 brings some changes to the database schema.
  149. * Update the data schema using alembic: ``alembic upgrade head``
  150. Note that this release bring support for `OpenID
  151. Connect<https://en.wikipedia.org/wiki/OpenID_Connect>`_ authentication, meaning
  152. pagure can now be deployed with authentication coming from, for example, google.
  153. This brings a number of new configuration keys:
  154. * OIDC_CLIENT_SECRETS
  155. * OIDC_ID_TOKEN_COOKIE_SECURE
  156. * OIDC_SCOPES
  157. * OIDC_PAGURE_EMAIL
  158. * OIDC_PAGURE_FULLNAME
  159. * OIDC_PAGURE_USERNAME
  160. * OIDC_PAGURE_SSH_KEY
  161. * OIDC_PAGURE_GROUPS
  162. * OIDC_PAGURE_USERNAME_FALLBACK
  163. From 3.10 to 3.11
  164. -----------------
  165. The release 3.11 brings some changes to the database schema.
  166. * Update the data schema using alembic: ``alembic upgrade head``
  167. In addition, if you are deploying pagure with fedmsg support you had to set
  168. fedmsg to the
  169. `active <http://www.fedmsg.com/en/stable/publishing/#publishing-through-a-relay>`_
  170. mode for the workers to be able to send fedmsg messages. This is now the
  171. default and forced configuration.
  172. New API acls:
  173. * commit_flag
  174. * pull_request_subscribe
  175. From 3.9 to 3.10
  176. ----------------
  177. The release 3.10 brings some changes to the database schema.
  178. * Update the data schema using alembic: ``alembic upgrade head``
  179. From 3.8 to 3.9
  180. ---------------
  181. This release brings a number of bug fixes and features but does not require
  182. any special precaution when upgrading.
  183. From 3.7 to 3.8
  184. ---------------
  185. The release 3.8 brings some changes to the database schema.
  186. * Update the data schema using alembic: ``alembic upgrade head``
  187. New configuration keys added:
  188. * PROJECT_NAME_REGEX
  189. From 3.6 to 3.7
  190. ---------------
  191. The release 3.7 brings some changes to the database schema.
  192. * Update the data schema using alembic: ``alembic upgrade head``
  193. New configuration keys added:
  194. * ENABLE_DEL_FORKS
  195. * ENABLE_UI_NEW_PROJECTS
  196. From 3.5 to 3.6
  197. ---------------
  198. New configuration keys added:
  199. * GITOLITE_CELERY_QUEUE
  200. From 3.4 to 3.5
  201. ---------------
  202. New configuration keys added:
  203. * USER_ACLS
  204. * CASE_SENSITIVE
  205. * HTML_TITLE
  206. From 3.3 to 3.4
  207. ---------------
  208. New configuration keys added:
  209. * DEPLOY_KEY
  210. * LOCAL_SSH_KEY
  211. * ALLOW_DELETE_BRANCH
  212. From 3.2 to 3.3
  213. ---------------
  214. [SECURITY FIX]: The 3.3 release contains an important security fix.
  215. If you are using the private project feature of pagure, the gitolite
  216. configuration generated was still granting access to the private projects. This
  217. made the private projects visible and accessible.
  218. After updating to 3.3, ensure your gitolite configuration gets re-generated
  219. (pagure-admin refresh-gitolite can help you with this).
  220. The 3.3 release brings some adjustments to the database schema.
  221. * Update the database schema using alembic: ``alembic upgrade head``
  222. From 3.1 to 3.2
  223. ---------------
  224. While not being a bug fix, this release has no database schema changes.
  225. However, this release breaks the plugin interface for auth introduced in 3.1 and
  226. changed in 3.1. If you are using pagure-dist-git, make sure to upgrade to at
  227. least 0.4. This interface will be considered stable in 3.4 and announced as
  228. such.
  229. From 3.0 to 3.1
  230. ---------------
  231. While not being a bug fix, this release has no database schema changes.
  232. However, this release breaks the plugin interface for auth introduced in 3.0. If
  233. you are using pagure-dist-git, make sure to upgrade to at least 0.3.
  234. From 2.15 to 3.0
  235. ----------------
  236. The 3.0 version was released with some major re-architecturing. The interaction
  237. with the backend git repo (being the main source repo or the tickets or requests
  238. repos) are now done by a worker that is triggered via a message queue.
  239. This communication is done using `celery <http://www.celeryproject.org/>`_ and
  240. via one of the message queue celery supports (pagure currently defaulting to
  241. `redis <https://redis.io/>`_.
  242. So to get pagure 3.0 running, you will need to get your own message queue (such
  243. as redis) up running and configured in pagure's configuration.
  244. This major version bump has also been an opportunity to rename all the services
  245. to use the same naming schema of pagure-<service>.
  246. The rename is as such:
  247. +------------------+-----------------+
  248. | In 2.x | From 3.0 |
  249. +==================+=================+
  250. | pagure-ci | pagure-ci |
  251. +------------------+-----------------+
  252. | ev-server | pagure-ev |
  253. +------------------+-----------------+
  254. | pagure-loadjson | pagure-loadjson |
  255. +------------------+-----------------+
  256. | pagure-logcom | pagure-logcom |
  257. +------------------+-----------------+
  258. | milters | pagure-milters |
  259. +------------------+-----------------+
  260. | webhook-server | pagure-webhook |
  261. +------------------+-----------------+
  262. | | pagure-worker |
  263. +------------------+-----------------+
  264. .. note:: This last service is the service mentioned above and it is part of
  265. pagure core, not optional unlike the other services in this table.
  266. This release also introduces some new configuration keys:
  267. - ``CELERY_CONFIG`` defaults to ``{}``
  268. - ``ATTACHMENTS_FOLDER``, to be configured
  269. - ``GITOLITE_BACKEND`` defaults to ``gitolite3``, deprecates ``GITOLITE_VERSION``
  270. - ``EXTERNAL_COMMITTER`` defaults to ``{}``
  271. - ``REQUIRED_GROUPS`` defaults to ``{}``
  272. This version also introduces a few database changes, so you will need to update
  273. the database schema using alembic: ``alembic upgrade head``.
  274. From 2.14 to 2.15
  275. -----------------
  276. The 2.15 release brings some adjustments to the database scheme.
  277. * Update the database schame using alembic: ``alembic upgrade head``
  278. From 2.13 to 2.14
  279. -----------------
  280. The 2.14 release brings some adjustments to the database scheme.
  281. * Update the database schame using alembic: ``alembic upgrade head``
  282. From 2.12 to 2.13
  283. -----------------
  284. The 2.13 release brings some adjustments to the database scheme.
  285. * Update the database schame using alembic: ``alembic upgrade head``
  286. From 2.11 to 2.12
  287. -----------------
  288. From this release on, we will have alembic migration script for new table
  289. creation, so there will no longer be a need to use ``createdb.py``
  290. The 2.12 release brings some adjustments to the database scheme.
  291. * Update the database schame using alembic: ``alembic upgrade head``
  292. From 2.10 to 2.11
  293. -----------------
  294. The 2.10 releases brings some adjustments to the database scheme.
  295. * Create the new DB tables and the new status field using the ``createdb.py``
  296. script.
  297. * Update the database schame using alembic: ``alembic upgrade head``
  298. From 2.9 to 2.10
  299. ----------------
  300. The 2.10 releases brings some little changes to the database scheme.
  301. Therefore when upgrading to 2.10, you will have to:
  302. * Update the database schame using alembic: ``alembic upgrade head``
  303. From 2.8 to 2.9
  304. ---------------
  305. The 2.9 releases brings some adjustments to the database scheme.
  306. * Create the new DB tables and the new status field using the ``createdb.py``
  307. script.
  308. * Update the database schame using alembic: ``alembic upgrade head``
  309. If you are interested in loading your local data into the ``pagure_logs`` table
  310. that this new release adds (data which is then displayed in the calendar heatmap
  311. on the user's page), you can find two utility scripts in
  312. https://pagure.io/pagure-utility that will help you to do that. They are:
  313. * fill_logs_from_db - Based on the data present in the database, this script
  314. fills the ``pagure_logs`` table (this will add: new ticket, new comment, new
  315. PR, closing a PR or a ticket and so on).
  316. * fill_logs_from_gits - By going through all the git repo hosted in your pagure
  317. instance, it will log who did what when.
  318. From 2.7 to 2.8
  319. ---------------
  320. 2.8 brings a little change to the database scheme.
  321. Therefore when upgrading to from 2.7 to 2.8, you will have to:
  322. * Update the database schame using alembic: ``alembic upgrade head``
  323. From 2.6 to 2.7
  324. ---------------
  325. 2.7 adds new tables as well as changes some of the existing ones.
  326. Therefore when upgrading to 2.7, you will have to:
  327. * Create the new DB tables and the new status field using the ``createdb.py``
  328. script.
  329. * Update the database schame using alembic, one of the upgrade will require
  330. access to pagure's configuration file, which should thus be passed onto the
  331. command via an environment variable:
  332. ``PAGURE_CONFIG=/path/to/pagure.cf alembic upgrade head``
  333. This release also brings a new configuration key:
  334. * ``INSTANCE_NAME`` used in the welcome screen shown upon first login (only with
  335. FAS and OpenID auth) to describe the instance
  336. The API has also been upgraded to a version ``0.8`` due to the changes (backward
  337. compatible) made to support the introduction of `close_status` to issues.
  338. From 2.5 to 2.6
  339. ---------------
  340. 2.6 brings quite a few changes and some of them impacting the database scheme.
  341. Therefore when upgrading from 2.4 to 2.6, you will have to:
  342. * Update the database schame using alembic: ``alembic upgrade head``
  343. From 2.4 to 2.5
  344. ---------------
  345. 2.5 brings quite a few changes and some of them impacting the database scheme.
  346. Therefore when upgrading from 2.4 to 2.5, you will have to:
  347. * Update the database schame using alembic: ``alembic upgrade head``
  348. From 2.3 to 2.4
  349. ---------------
  350. 2.4 brings quite a few changes and some of them impacting the database scheme.
  351. Therefore when upgrading from 2.3.x to 2.4, you will have to:
  352. * Update the database schame using alembic: ``alembic upgrade head``
  353. This update also brings some new configuration keys:
  354. * ``VIRUS_SCAN_ATTACHMENTS`` allows turning on or off checking attachments for
  355. virus using clamav. This requires pyclamd but is entirely optional (and off by
  356. default)
  357. * ``PAGURE_CI_SERVICES`` allows specifying with which CI (Continuous
  358. Integration) services this pagure instance can integrate with. Currently, only
  359. `Jenkins` is supported, but this configuration key defaults to ``None``.
  360. From 2.2 to 2.3
  361. ---------------
  362. 2.3 brings a few changes impacting the database scheme, including a new
  363. `duplicate` status for tickets, a feature allowing one to `watch` or
  364. `unwatch` a project and notifications on tickets as exist on pull-requests.
  365. Therefore, when upgrading from 2.2.x to 2.3, you will have to :
  366. * Create the new DB tables and the new status field using the ``createdb.py`` script.
  367. * Update the database schame using alembic: ``alembic upgrade head``
  368. This update also brings a new configuration key:
  369. * ``PAGURE_ADMIN_USERS`` allows to mark some users as instance-wide admins, giving
  370. them full access to every projects, private or not. This feature can then be
  371. used as a way to clean spams.
  372. * ``SMTP_PORT`` allows to specify the port to use when contacting the SMTP
  373. server
  374. * ``SMTP_SSL`` allows to specify whether to use SSL when contacting the SMTP
  375. server
  376. * ``SMTP_USERNAME`` and ``SMTP_PASSWORD`` if provided together allow to contact
  377. an SMTP requiring authentication.
  378. In this update is also added the script ``api_key_expire_mail.py`` meant to be
  379. run by a daily cron job and warning users when their API token is nearing its
  380. expiration date.
  381. 2.2.2
  382. -----
  383. Release 2.2.2 contains an important security fix, blocking a source of XSS
  384. attack.
  385. From 2.1 to 2.2
  386. ---------------
  387. 2.2 brings a number of bug fixes and a few improvements.
  388. One of the major changes impacts the databases where we must change some of the
  389. table so that the foreign key cascade on delete (fixes deleting a project when a
  390. few plugins were activated).
  391. When upgrading for 2.1 to 2.2 all you will have to do is:
  392. * Update the database scheme using alembic: ``alembic upgrade head``
  393. .. note:: If you run another database system than PostgreSQL the alembic
  394. revision ``317a285e04a8_delete_hooks.py`` will require adjustment as the
  395. foreign key constraints are named and the names are driver dependant.
  396. From 2.0 to 2.1
  397. ---------------
  398. 2.1 brings its usual flow of improvements and bug fixes.
  399. When upgrading from 2.0.x to 2.1 all you will have to:
  400. * Update the database schame using alembic: ``alembic upgrade head``
  401. From 1.x to 2.0
  402. ---------------
  403. As the version change indicates, 2.0 brings quite a number of changes,
  404. including some that are not backward compatible.
  405. When upgrading to 2.0 you will have to:
  406. * Update the database schema using alembic: ``alembic upgrade head``
  407. * Create the new DB tables so that the new plugins work using the
  408. ``createdb.py`` script
  409. * Move the forks git repo
  410. Forked git repos are now located under the same folder as the regular git
  411. repos, just under a ``forks/`` subfolder.
  412. So the structure changes from: ::
  413. repos/
  414. ├── foo.git
  415. └── bar.git
  416. forks/
  417. ├── patrick/
  418. │  ├── test.git
  419. │  └── ipsilon.git
  420. └── pingou/
  421. ├── foo.git
  422. └── bar.git
  423. to: ::
  424. repos/
  425. ├── foo.git
  426. ├── bar.git
  427. └── forks/
  428. ├── patrick/
  429. │  ├── test.git
  430. │  └── ipsilon.git
  431. └── pingou/
  432. ├── foo.git
  433. └── bar.git
  434. So the entire ``forks`` folder is moved under the ``repos`` folder where
  435. the other repositories are, containing the sources of the projects.
  436. Git repos for ``tickets``, ``requests`` and ``docs`` will be trickier to
  437. move as the structure changes from: ::
  438. tickets/
  439. ├── foo.git
  440. ├── bar.git
  441. ├── patrick/
  442. │  ├── test.git
  443. │  └── ipsilon.git
  444. └── pingou/
  445. ├── foo.git
  446. └── bar.git
  447. to: ::
  448. tickets/
  449. ├── foo.git
  450. ├── bar.git
  451. └── forks/
  452. ├── patrick/
  453. │  ├── test.git
  454. │  └── ipsilon.git
  455. └── pingou/
  456. ├── foo.git
  457. └── bar.git
  458. Same for the ``requests`` and the ``docs`` git repos.
  459. As you can see in the ``tickets``, ``requests`` and ``docs`` folders there
  460. are two types of folders, git repos which are folder with a name ending
  461. with ``.git``, and folder corresponding to usernames. These last ones are
  462. the ones to be moved into a subfolder ``forks/``.
  463. This can be done using something like: ::
  464. mkdir forks
  465. for i in `ls -1 |grep -v '\.git'`; do mv $i forks/; done
  466. * Re-generate the gitolite configuration.
  467. This can be done via the ``Re-generate gitolite ACLs file`` button in the
  468. admin page.
  469. * Keep URLs backward compatible
  470. The support of pseudo-namespace in pagure 2.0 has required some changes
  471. to the URL schema:
  472. https://pagure.io/pagure/053d8cc95fcd50c23a8b0a7f70e55f8d1cc7aebb
  473. became:
  474. https://pagure.io/pagure/c/053d8cc95fcd50c23a8b0a7f70e55f8d1cc7aebb
  475. (Note the added /c/ in it)
  476. We introduced a backward compatibility fix for this.
  477. This fix is however *disabled* by default so if you wish to keep the URLs
  478. valid, you will need to adjust you configuration file to include: ::
  479. OLD_VIEW_COMMIT_ENABLED = True