<?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=StrangePerson</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=StrangePerson"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/StrangePerson"/>
	<updated>2026-04-30T18:14:22Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Postgresql&amp;diff=31963</id>
		<title>Postgresql</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Postgresql&amp;diff=31963"/>
		<updated>2026-01-14T06:41:15Z</updated>

		<summary type="html">&lt;p&gt;StrangePerson: update PostgreSQL versions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PostgreSQL is a well known opensource database that scales well and is easy to use.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
PostgreSQL 18 is the latest version since [[https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.23.0#PostgreSQL_18|v3.23]].&lt;br /&gt;
&lt;br /&gt;
To install PostgreSQL 18,&lt;br /&gt;
{{Cmd|# apk add postgresql18 postgresql18-contrib}}&lt;br /&gt;
{{Cmd|# rc-update add postgresql}}&lt;br /&gt;
{{Cmd|# rc-service postgresql start}}&lt;br /&gt;
&lt;br /&gt;
This will start the postgresql server and perform some initial configuration. It will also create a system user called &#039;&#039;&#039;postgres&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Older versions of PostgreSQL 16 and PostgreSQL 15 are still available as of [[Release Notes for Alpine 3.22.0|v3.22]] and can be installed using the same commands as above except for replacing the version number in the appropriate package names. For example, {{pkg|postgresql17}} is to be replaced by {{pkg|postgresql16}} and {{pkg|postgresql15}} for PostgreSQL 16 and PostgreSQL 15 respectively.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
Login as the postgres user and start psql to create a new user and database:&lt;br /&gt;
{{Cmd|su postgres}}&lt;br /&gt;
{{Cmd|psql}}&lt;br /&gt;
{{Cmd|create user user with encrypted password &#039;password&#039;;}}&lt;br /&gt;
{{Cmd|create database database;}}&lt;br /&gt;
{{Cmd|grant all privileges on database database to user;}}&lt;br /&gt;
&lt;br /&gt;
=== Network access ===&lt;br /&gt;
&lt;br /&gt;
By default only local access is allowed to PostgreSQL. To allow other networked services to access the database we need to configure PostgreSQL to allow external connections.&lt;br /&gt;
&lt;br /&gt;
In this example, we are using PostgreSQL v16, so substitute below for your specific version.&lt;br /&gt;
Edit the {{Path|/etc/postgresql16/postgresql.conf}} file using &amp;lt;code&amp;gt;nano&amp;lt;/code&amp;gt; or any other {{ic|&amp;lt;editor&amp;gt; /etc/postgresql16/postgresql.conf}}&lt;br /&gt;
Find the line that starts with &amp;lt;pre&amp;gt;#listen_addresses = &#039;localhost&#039;&amp;lt;/pre&amp;gt; &lt;br /&gt;
Uncomment it and change it to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;listen_addresses = &#039;*&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you want it to listen on a specific ip you can change * to 192.168.1.2/24.&lt;br /&gt;
Save the file and change the next config file.&lt;br /&gt;
&lt;br /&gt;
Modify the {{Path|/etc/postgresql16/pg_hba.conf}} file using &amp;lt;code&amp;gt;nano&amp;lt;/code&amp;gt; or any other {{ic|&amp;lt;editor&amp;gt; /etc/postgresql16/pg_hba.conf}}&lt;br /&gt;
Look for the line: &amp;lt;pre&amp;gt;host    all             all             127.0.0.1/32            md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
And change it to: &amp;lt;pre&amp;gt;host all all 0.0.0.0/0 md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
This line allows connections from any IP address and requires a password for authentication (md5).&lt;br /&gt;
Restart the server to allow incoming connections from other hosts. {{Cmd|rc-service postgresql restart}}&lt;br /&gt;
&lt;br /&gt;
Allow the port through the firewall. For [[UFW]] firewall type: {{Cmd|ufw allow 5432}}&lt;br /&gt;
&lt;br /&gt;
This is a basic configuration. You can configure the PostgreSQL server to only allow certain networks or IP&#039;s to connect, but that&#039;s beyond the scope of this documentation.&lt;br /&gt;
&lt;br /&gt;
== Switching between PostgreSQL versions ==&lt;br /&gt;
&lt;br /&gt;
On Alpine Linux, you can use the command `pg_versions` to switch between PostgreSQL versions. This is very helpful when upgrading the version you are using.&lt;br /&gt;
&lt;br /&gt;
== Upgrading PostgreSQL ==&lt;br /&gt;
&lt;br /&gt;
Please follow along with [https://perrotta.dev/2025/05/postgresql-major-version-upgrade-on-alpine-linux/ this guide] and adjust the version you are moving from and the version you are upgrading to.&lt;br /&gt;
&lt;br /&gt;
There&#039;s also [https://beune.dev/posts/upgrade-alpine-postgresql/ this].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [https://blog.devart.com/configure-postgresql-to-allow-remote-connection.html Guide for Upgrading PostgreSQL]&lt;br /&gt;
* [https://beune.dev/posts/upgrade-alpine-postgresql/  older postgresql upgrade guide]&lt;br /&gt;
&lt;br /&gt;
[[Category:Database]] &lt;br /&gt;
[[Category:Server]]&lt;/div&gt;</summary>
		<author><name>StrangePerson</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Development_using_git:Quality_assurance&amp;diff=31296</id>
		<title>Development using git:Quality assurance</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Development_using_git:Quality_assurance&amp;diff=31296"/>
		<updated>2025-10-29T18:59:55Z</updated>

		<summary type="html">&lt;p&gt;StrangePerson: &amp;quot;sanitycheck&amp;quot; is obsolete, use &amp;quot;validate&amp;quot; instead&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Before pushing anything to it is good to make sure that:&lt;br /&gt;
# The package actually builds&lt;br /&gt;
# Commit message is good&lt;br /&gt;
# pkgrel is bumped if needed&lt;br /&gt;
# no whitespace damage (last chars of a line is whitespace)&lt;br /&gt;
&lt;br /&gt;
The following git hook will help you catch some common errors early:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# Redirect output to stderr.&lt;br /&gt;
exec 1&amp;gt;&amp;amp;2&lt;br /&gt;
&lt;br /&gt;
git diff --cached --name-only HEAD | grep &#039;APKBUILD$&#039; | while read f; do&lt;br /&gt;
        olddir=$PWD&lt;br /&gt;
        cd ${f%/APKBUILD}&lt;br /&gt;
        if ! abuild validate &amp;amp;&amp;amp; verify; then&lt;br /&gt;
                exit 1&lt;br /&gt;
        fi&lt;br /&gt;
        cd &amp;quot;$olddir&amp;quot;&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
# If there are whitespace errors, print the offending file names and fail.&lt;br /&gt;
exec git diff-index --check --cached HEAD --&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install it as .git/hooks/pre-commit and make it executable.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>StrangePerson</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_examples:Rust&amp;diff=31295</id>
		<title>APKBUILD examples:Rust</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_examples:Rust&amp;diff=31295"/>
		<updated>2025-10-29T18:40:35Z</updated>

		<summary type="html">&lt;p&gt;StrangePerson: add info about an issue with cargo-auditable, fix typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Considerations ==&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;cargo-auditable&amp;lt;/code&amp;gt; to encode dependency information into binaries.&lt;br /&gt;
&lt;br /&gt;
One may encounter an issue when a package refuses to build using &amp;lt;code&amp;gt;cargo-auditable&amp;lt;/code&amp;gt;, but successfully builds with &amp;lt;code&amp;gt;cargo&amp;lt;/code&amp;gt;. This is because &amp;lt;code&amp;gt;cargo&amp;lt;/code&amp;gt; itself exposes faulty data. More info can be found [https://github.com/rust-secure-code/cargo-auditable/issues/124 here].&lt;br /&gt;
&lt;br /&gt;
Most Rust projects use &amp;lt;code&amp;gt;cargo&amp;lt;/code&amp;gt; to fetch Rust library dependencies. The current convention is to use &amp;lt;code&amp;gt;options=&amp;quot;net&amp;quot;&amp;lt;/code&amp;gt; fetch these during the &amp;lt;code&amp;gt;prepare()&amp;lt;/code&amp;gt; phase. Use the &amp;lt;code&amp;gt;--locked&amp;lt;/code&amp;gt; flag to ensure that the exact same versions of dependencies are fetched on each rebuild. If a package is missing a lockfile, include one with the aport and attempt to recommend upstream to include one.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Basic example ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
maintainer=&amp;quot;Hugo Osvaldo Barrera &amp;lt;hugo@whynothugo.nl&amp;gt;&amp;quot;&lt;br /&gt;
pkgname=harper&lt;br /&gt;
pkgver=0.59.0&lt;br /&gt;
pkgrel=0&lt;br /&gt;
pkgdesc=&amp;quot;Grammar checker that respects your privacy&amp;quot;&lt;br /&gt;
url=&amp;quot;https://github.com/elijah-potter/harper&amp;quot;&lt;br /&gt;
arch=&amp;quot;all&amp;quot;&lt;br /&gt;
license=&amp;quot;Apache-2.0&amp;quot;&lt;br /&gt;
makedepends=&amp;quot;cargo-auditable rust&amp;quot;&lt;br /&gt;
source=&amp;quot;harper-$pkgver.tar.gz::https://github.com/elijah-potter/harper/archive/v$pkgver/harper-$pkgver.tar.gz&amp;quot;&lt;br /&gt;
options=&amp;quot;net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
prepare() {&lt;br /&gt;
	default_prepare&lt;br /&gt;
&lt;br /&gt;
	cargo fetch --target=&amp;quot;$CHOST&amp;quot; --locked&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
build() {&lt;br /&gt;
	cargo auditable build --release --frozen&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
check() {&lt;br /&gt;
	cargo test --frozen&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
package() {&lt;br /&gt;
	install -Dm755 target/release/harper-cli &amp;quot;$pkgdir&amp;quot;/usr/bin/harper-cli&lt;br /&gt;
	install -Dm755 target/release/harper-ls &amp;quot;$pkgdir&amp;quot;/usr/bin/harper-ls&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sha512sums=&amp;quot;&lt;br /&gt;
e5be781b33ba624e2447464a51ff8c0b565a42d7bf957c2fd6655f4bf312211fcf669bbb152b62a57494f89fd7fbee7eda37bbbaf7a61c5d4c8c9684ffe687bd  harper-0.48.0.tar.gz&lt;br /&gt;
&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[APKBUILD examples]]&lt;br /&gt;
* [[Creating an Alpine package]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]] [[Category:Rust]]&lt;/div&gt;</summary>
		<author><name>StrangePerson</name></author>
	</entry>
</feed>