<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Odc</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Odc"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Odc"/>
	<updated>2026-04-26T21:44:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Patchwork&amp;diff=15393</id>
		<title>Patchwork</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Patchwork&amp;diff=15393"/>
		<updated>2018-08-03T09:24:12Z</updated>

		<summary type="html">&lt;p&gt;Odc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Patchwork is a widely used patch review system.&lt;br /&gt;
&lt;br /&gt;
This How-To aims to give a basis to setup Patchwork with PostgreSQL as backend.&lt;br /&gt;
&lt;br /&gt;
There are some aspects which can be improved that this how-to is not covering.&lt;br /&gt;
* Create an apk for patchwork with init script&lt;br /&gt;
* Describe how to setup Patchwork for one project&lt;br /&gt;
* Describe how to setup Patchwork with MariaDB&lt;br /&gt;
&lt;br /&gt;
== Initial package installation and setup PostgreSQL==&lt;br /&gt;
{{Cmd|apk add python py-django1.5 py-psycopg2 py-django-registration git postgresql}}&lt;br /&gt;
{{Cmd|/etc/init.d/postgresql setup}}&lt;br /&gt;
{{Cmd|/etc/init.d/postgresql start}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; we are using py-django1.5 even if py-django (ver.1.7) is present in the repository.&lt;br /&gt;
This is because Patchwork is not yet compatible with django 1.7.&lt;br /&gt;
&lt;br /&gt;
Create a regular account called &amp;quot;pwuser&amp;quot;:&lt;br /&gt;
{{Cmd|adduser pwuser}}&lt;br /&gt;
&lt;br /&gt;
As root:&lt;br /&gt;
{{Cmd|su - postgresql&lt;br /&gt;
createdb patchwork&lt;br /&gt;
createuser pwuser&lt;br /&gt;
createuser www-data&lt;br /&gt;
createuser nobody}}&lt;br /&gt;
&lt;br /&gt;
Last two users are hardcoded in one of the next sql script. That&#039;s why you need to create it.&lt;br /&gt;
&lt;br /&gt;
== Patchwork Installation and Configuration ==&lt;br /&gt;
Login with &amp;quot;pwuser&amp;quot; and clone the patchwork&#039;s git repository:&lt;br /&gt;
{{Cmd|git clone git://ozlabs.org/home/jk/git/patchwork}}&lt;br /&gt;
&lt;br /&gt;
Create a local_settings.py starting from settings.py:&lt;br /&gt;
{{Cmd|cd patchwork/apps&lt;br /&gt;
cp settings.py local_settings.py}}&lt;br /&gt;
&lt;br /&gt;
Customize local_settings.py according with your need.&lt;br /&gt;
&lt;br /&gt;
SECRET_KEY can be generated with the following python script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import string, random&lt;br /&gt;
chars = string.letters + string.digits + string.punctuation&lt;br /&gt;
print repr(&amp;quot;&amp;quot;.join([random.choice(chars) for i in range(0,50)]))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, populate PostgreSQL with patchwork database.&lt;br /&gt;
&lt;br /&gt;
As &amp;quot;pwuser&amp;quot;:&lt;br /&gt;
{{Cmd|python patchwork/apps/manage.py syncdb}}&lt;br /&gt;
&lt;br /&gt;
At the end, the script will ask for patchwork&#039;s administrator username,email, and password.&lt;br /&gt;
&lt;br /&gt;
Run another script for setting up the user&#039;s permissions:&lt;br /&gt;
{{Cmd|psql -f patchwork/lib/sql/grant-all.postgres.sql patchwork}}&lt;br /&gt;
&lt;br /&gt;
Now you can run the server:&lt;br /&gt;
{{Cmd|python patchwork/apps/manage.py runserver 0.0.0.0:8000}}&lt;br /&gt;
&lt;br /&gt;
Point your browser to http://$PATCHWORKS_SERVER_ADDRESS:8000&lt;br /&gt;
&lt;br /&gt;
Login with the username and password you set before.&lt;br /&gt;
&lt;br /&gt;
Enjoy.&lt;br /&gt;
&lt;br /&gt;
[[Category:Mail]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Programming]]&lt;/div&gt;</summary>
		<author><name>Odc</name></author>
	</entry>
</feed>