public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: www-apps/miniflux/, www-apps/miniflux/files/
@ 2022-05-06 19:33 Kenton Groombridge
  0 siblings, 0 replies; 2+ messages in thread
From: Kenton Groombridge @ 2022-05-06 19:33 UTC (permalink / raw
  To: gentoo-commits

commit:     56b29be9ab2c0f44dec89e813761c334a931b1cd
Author:     Kenton Groombridge <concord <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 16 18:27:11 2022 +0000
Commit:     Kenton Groombridge <concord <AT> gentoo <DOT> org>
CommitDate: Fri May  6 19:33:07 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56b29be9

www-apps/miniflux: new package, add 2.0.36

Closes: https://github.com/gentoo/gentoo/pull/25048
Signed-off-by: Kenton Groombridge <concord <AT> gentoo.org>

 www-apps/miniflux/Manifest               |  2 +
 www-apps/miniflux/files/README.gentoo    | 76 +++++++++++++++++++++++++
 www-apps/miniflux/files/miniflux.conf    | 22 ++++++++
 www-apps/miniflux/files/miniflux.confd   |  6 ++
 www-apps/miniflux/files/miniflux.initd   | 16 ++++++
 www-apps/miniflux/files/miniflux.service | 22 ++++++++
 www-apps/miniflux/metadata.xml           | 11 ++++
 www-apps/miniflux/miniflux-2.0.36.ebuild | 96 ++++++++++++++++++++++++++++++++
 8 files changed, 251 insertions(+)

diff --git a/www-apps/miniflux/Manifest b/www-apps/miniflux/Manifest
new file mode 100644
index 000000000000..cceb6ac67d55
--- /dev/null
+++ b/www-apps/miniflux/Manifest
@@ -0,0 +1,2 @@
+DIST miniflux-2.0.36-deps.tar.xz 151007452 BLAKE2B b21e2a96e9c19341ff1435deb41558b6a1061d7ed136f4164e577949519582e003bfc0ac7f1d60453dbde89d807fbf2707c878dc3c5e0da874ce8f3b6e6682d9 SHA512 f7708d45ad1ed72faf4a32420c990fdeea25258d7caa2a332781590b169bbaa4ead53baaf1024e2e399921182551876a63a3e516a94fdc074995b5cb1d35b9d1
+DIST miniflux-2.0.36.tar.gz 548596 BLAKE2B b3f6a85d635eb095f41852d3e618e7e2e2b97e83c776f16b4da9a22a0bb03e9c1815c4ea1a9b841ee8132087067fb7e00a084536f99e004c0863adaf6bbc64b0 SHA512 0c3f1b68e1cb9c4cf5e543847abf3cb34bb56152991a3cd257f4886c7573d17fc177f928574040c2d5b339bf8fe39f9504952f234babe1dcd3b824f8ec95c75a

diff --git a/www-apps/miniflux/files/README.gentoo b/www-apps/miniflux/files/README.gentoo
new file mode 100644
index 000000000000..7d236ffadfb6
--- /dev/null
+++ b/www-apps/miniflux/files/README.gentoo
@@ -0,0 +1,76 @@
+Introduction
+============
+
+Below are some common tasks needed to administrate a miniflux instance.
+
+
+Create the Database (Example)
+=============================
+
+# Switch to the postgres user
+$ su - postgres
+
+# Create a database user for miniflux
+$ createuser -P miniflux
+Enter password for new role: ******
+Enter it again: ******
+
+# Create a database for miniflux that belongs to our user
+$ createdb -O miniflux miniflux
+
+# Create the extension hstore as superuser
+$ psql miniflux -c 'create extension hstore'
+CREATE EXTENSION
+
+
+Create the hstore Extension
+===========================
+
+To create the hstore extension, connect to the miniflux database as any user
+with SUPERUSER privileges (like the postgres user) and run:
+
+  CREATE EXTENSION hstore;
+
+Alternatively, give SUPERUSER privileges to the miniflux user only during the
+schema migration:
+
+  ALTER USER miniflux WITH SUPERUSER;
+  -- Run the migrations (miniflux -migrate)
+  ALTER USER miniflux WITH NOSUPERUSER;
+
+
+Create the First Admin User
+===========================
+
+The easiest way to create the first admin user with your new miniflux instance
+is by running:
+
+  miniflux -create-admin
+
+Alternatively, set the DATABASE_URL, RUN_MIGRATIONS, CREATE_ADMIN,
+ADMIN_USERNAME, and ADMIN_PASSWORD variables in your config file or run miniflux
+with these set as environment variables. For example:
+
+  export DATABASE_URL=postgres://miniflux:secretpassword@db/miniflux
+  export RUN_MIGRATIONS=1
+  export CREATE_ADMIN=1
+  export ADMIN_USERNAME=admin
+  export ADMIN_PASSWORD=n0tAstrongPassw0rd!
+  miniflux
+
+
+Migrating the Database
+======================
+
+On upgrades, the miniflux database needs to be migrated to the new schema
+version. This is handled automatically when you run 'emerge --config miniflux'
+but can also be performed using the following manual steps:
+
+1. Export the DATABASE_URL variable.
+2. Disconnect all users by flushing all sessions with 'miniflux -flush-sessions'
+3. Stop the miniflux server.
+4. Backup your database.
+5. Verify that your backup is really working.
+6. Run the database migrations with 'miniflux -migrate' or set the environment
+   variable RUN_MIGRATIONS=1.
+7. Start miniflux.

diff --git a/www-apps/miniflux/files/miniflux.conf b/www-apps/miniflux/files/miniflux.conf
new file mode 100644
index 000000000000..7a2b217f598c
--- /dev/null
+++ b/www-apps/miniflux/files/miniflux.conf
@@ -0,0 +1,22 @@
+# This is a sample configuration file with the most commonly used options needed
+# to get started. For a complete list of available options, see the miniflux (1)
+# man page or visit https://miniflux.app/docs/configuration.html
+
+# Toggle debug mode (increase log level).
+#DEBUG=off
+
+# Postgresql connection parameters.
+# See https://pkg.go.dev/github.com/lib/pq#hdr-Connection_String_Parameters
+# for more details.
+#DATABASE_URL=user=postgres password=postgres dbname=miniflux2 sslmode=disable
+
+# Address to listen on. Use absolute path for a Unix socket.
+#LISTEN_ADDR=127.0.0.1:8080
+
+# Override LISTEN_ADDR to 0.0.0.0:$PORT (Automatic configuration for PaaS).
+# Default is empty.
+#PORT=
+
+# Base URL to generate HTML links and base path for cookies.
+# Default is http://localhost/.
+#BASE_URL=http://localhost/

diff --git a/www-apps/miniflux/files/miniflux.confd b/www-apps/miniflux/files/miniflux.confd
new file mode 100644
index 000000000000..2448e5069f78
--- /dev/null
+++ b/www-apps/miniflux/files/miniflux.confd
@@ -0,0 +1,6 @@
+# User and group miniflux server should run as
+MINIFLUX_USER=miniflux
+MINIFLUX_GROUP=nobody
+
+# Config file the miniflux server should use
+MINIFLUX_CONF=/etc/miniflux.conf

diff --git a/www-apps/miniflux/files/miniflux.initd b/www-apps/miniflux/files/miniflux.initd
new file mode 100644
index 000000000000..f8a8c59132da
--- /dev/null
+++ b/www-apps/miniflux/files/miniflux.initd
@@ -0,0 +1,16 @@
+#!/sbin/openrc-run
+# Copyright 2020-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+: ${MINIFLUX_USER:=miniflux}
+: ${MINIFLUX_GROUP:=nobody}
+: ${MINIFLUX_CONF:=/etc/miniflux.conf}
+
+name="miniflux daemon"
+description="Miniflux Web Server"
+command=/usr/bin/miniflux
+command_args="${miniflux_args} -c ${MINIFLUX_CONF}"
+command_background="true"
+command_user="${MINIFLUX_USER}:${MINIFLUX_GROUP}"
+error_log="/var/log/${RC_SVCNAME}.err"
+pidfile="/run/${RC_SVCNAME}.pid"

diff --git a/www-apps/miniflux/files/miniflux.service b/www-apps/miniflux/files/miniflux.service
new file mode 100644
index 000000000000..5480dd01e603
--- /dev/null
+++ b/www-apps/miniflux/files/miniflux.service
@@ -0,0 +1,22 @@
+[Unit]
+Description=Miniflux Web Server
+Documentation=https://miniflux.app/
+
+After=network.target
+Requires=network.target
+After=postgresql-9.5.service
+After=postgresql-9.6.service
+After=postgresql-10.service
+After=postgresql-11.service
+After=postgresql-12.service
+After=postgresql-13.service
+After=postgresql-14.service
+
+[Service]
+User=miniflux
+ExecStart=/usr/bin/miniflux -c /etc/miniflux.conf
+Restart=always
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target

diff --git a/www-apps/miniflux/metadata.xml b/www-apps/miniflux/metadata.xml
new file mode 100644
index 000000000000..6ae1ef592e60
--- /dev/null
+++ b/www-apps/miniflux/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>concord@gentoo.org</email>
+		<name>Kenton Groombridge</name>
+	</maintainer>
+	<upstream>
+		<remote-id type="github">miniflux/v2</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/www-apps/miniflux/miniflux-2.0.36.ebuild b/www-apps/miniflux/miniflux-2.0.36.ebuild
new file mode 100644
index 000000000000..7352330614f5
--- /dev/null
+++ b/www-apps/miniflux/miniflux-2.0.36.ebuild
@@ -0,0 +1,96 @@
+# Copyright 2020-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module systemd
+
+DESCRIPTION="Minimalist and opinionated feed reader"
+HOMEPAGE="https://miniflux.app https://github.com/miniflux/v2"
+SRC_URI="https://github.com/${PN}/v2/archive/${PV}.tar.gz -> ${P}.tar.gz"
+SRC_URI+=" https://dev.gentoo.org/~concord/distfiles/${P}-deps.tar.xz"
+
+LICENSE="Apache-2.0 BSD BSD-2 MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND="acct-user/miniflux"
+RDEPEND="${DEPEND}
+	>=dev-db/postgresql-9.5
+"
+
+S="${WORKDIR}/v2-${PV}"
+
+src_compile() {
+	ego build -ldflags="-s -w -X 'miniflux.app/version.Version=${PV}' " -o miniflux main.go
+}
+
+src_install() {
+	dobin miniflux
+
+	insinto /etc
+	doins "${FILESDIR}/${PN}.conf"
+
+	newconfd "${FILESDIR}/${PN}.confd" ${PN}
+
+	newinitd "${FILESDIR}/${PN}.initd" ${PN}
+	systemd_dounit "${FILESDIR}/${PN}.service"
+
+	fowners miniflux:root /etc/${PN}.conf
+	fperms o-rwx /etc/${PN}.conf
+
+	local DOCS=(
+		ChangeLog
+		README.md
+		"${FILESDIR}"/README.gentoo
+	)
+
+	# Makefile has no install target, so call einstalldocs directly
+	einstalldocs
+
+	doman "${PN}".1
+}
+
+pkg_postinst() {
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		# This is a new installation
+
+		echo
+		elog "Before using miniflux, you must first create and initialize the database"
+		elog "and enable the hstore extension for it."
+		elog ""
+		elog "Afterwards, create your first admin user by running:"
+		elog "  miniflux -create-admin"
+	else
+		# This is an existing installation
+
+		echo
+		elog "If you are upgrading from a previous version, schema migrations must be performed."
+		elog "To perform the migrations, stop the daemon, backup your database, and run:"
+		elog "  emerge --config =${PF}"
+	fi
+
+	echo
+	elog "Please read"
+	elog ""
+	elog "  ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"
+	elog ""
+	elog "for more information."
+}
+
+pkg_config() {
+	# To be safe, avoid doing migrations if miniflux is running
+	if pgrep miniflux; then
+		die "miniflux appears to be running, refusing to continue."
+	fi
+
+	# Extract the database URL variable instead of just sourcing the config file
+	# because miniflux itself may interpret quotes as part of the URL
+	local DATABASE_URL="$(sed -n 's/^DATABASE_URL=\(.*\)/\1/p' ${EROOT}/etc/${PN}.conf)"
+	[[ -n "${DATABASE_URL}" ]] || die "Failed getting DATABASE_URL from config file"
+
+	DATABASE_URL="${DATABASE_URL}" "${EROOT}"/usr/bin/miniflux -migrate || die "miniflux -migrate failed. Please check the above output for errors."
+
+	echo
+	elog "Database migrations complete."
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: www-apps/miniflux/, www-apps/miniflux/files/
@ 2023-04-02 18:37 Kenton Groombridge
  0 siblings, 0 replies; 2+ messages in thread
From: Kenton Groombridge @ 2023-04-02 18:37 UTC (permalink / raw
  To: gentoo-commits

commit:     34079fa629c8afc2c73b73c9f9dc53c120ba4f41
Author:     Kenton Groombridge <concord <AT> gentoo <DOT> org>
AuthorDate: Sun Apr  2 18:34:34 2023 +0000
Commit:     Kenton Groombridge <concord <AT> gentoo <DOT> org>
CommitDate: Sun Apr  2 18:37:35 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34079fa6

www-apps/miniflux: fix service script

Autocreate the error log file when starting if it does not already
exist.

Signed-off-by: Kenton Groombridge <concord <AT> gentoo.org>

 www-apps/miniflux/files/{miniflux.initd => miniflux.initd-r1}        | 5 +++++
 .../miniflux/{miniflux-2.0.41.ebuild => miniflux-2.0.41-r1.ebuild}   | 2 +-
 .../miniflux/{miniflux-2.0.42.ebuild => miniflux-2.0.42-r1.ebuild}   | 2 +-
 .../miniflux/{miniflux-2.0.43.ebuild => miniflux-2.0.43-r1.ebuild}   | 2 +-
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/www-apps/miniflux/files/miniflux.initd b/www-apps/miniflux/files/miniflux.initd-r1
similarity index 82%
rename from www-apps/miniflux/files/miniflux.initd
rename to www-apps/miniflux/files/miniflux.initd-r1
index f8a8c59132da..3185acdfe39b 100644
--- a/www-apps/miniflux/files/miniflux.initd
+++ b/www-apps/miniflux/files/miniflux.initd-r1
@@ -14,3 +14,8 @@ command_background="true"
 command_user="${MINIFLUX_USER}:${MINIFLUX_GROUP}"
 error_log="/var/log/${RC_SVCNAME}.err"
 pidfile="/run/${RC_SVCNAME}.pid"
+
+start_pre() {
+    checkpath --file --owner "${MINIFLUX_USER}":root --mode 0640 \
+        "${error_log}"
+}

diff --git a/www-apps/miniflux/miniflux-2.0.41.ebuild b/www-apps/miniflux/miniflux-2.0.41-r1.ebuild
similarity index 98%
rename from www-apps/miniflux/miniflux-2.0.41.ebuild
rename to www-apps/miniflux/miniflux-2.0.41-r1.ebuild
index 4c730663df21..b5c188d0c586 100644
--- a/www-apps/miniflux/miniflux-2.0.41.ebuild
+++ b/www-apps/miniflux/miniflux-2.0.41-r1.ebuild
@@ -35,7 +35,7 @@ src_install() {
 
 	newconfd "${FILESDIR}/${PN}.confd" ${PN}
 
-	newinitd "${FILESDIR}/${PN}.initd" ${PN}
+	newinitd "${FILESDIR}/${PN}.initd-r1" ${PN}
 	systemd_dounit "${FILESDIR}/${PN}.service"
 
 	fowners miniflux:root /etc/${PN}.conf

diff --git a/www-apps/miniflux/miniflux-2.0.42.ebuild b/www-apps/miniflux/miniflux-2.0.42-r1.ebuild
similarity index 98%
rename from www-apps/miniflux/miniflux-2.0.42.ebuild
rename to www-apps/miniflux/miniflux-2.0.42-r1.ebuild
index 4c730663df21..b5c188d0c586 100644
--- a/www-apps/miniflux/miniflux-2.0.42.ebuild
+++ b/www-apps/miniflux/miniflux-2.0.42-r1.ebuild
@@ -35,7 +35,7 @@ src_install() {
 
 	newconfd "${FILESDIR}/${PN}.confd" ${PN}
 
-	newinitd "${FILESDIR}/${PN}.initd" ${PN}
+	newinitd "${FILESDIR}/${PN}.initd-r1" ${PN}
 	systemd_dounit "${FILESDIR}/${PN}.service"
 
 	fowners miniflux:root /etc/${PN}.conf

diff --git a/www-apps/miniflux/miniflux-2.0.43.ebuild b/www-apps/miniflux/miniflux-2.0.43-r1.ebuild
similarity index 98%
rename from www-apps/miniflux/miniflux-2.0.43.ebuild
rename to www-apps/miniflux/miniflux-2.0.43-r1.ebuild
index 185b89d61eca..a3c0ff7ef4e8 100644
--- a/www-apps/miniflux/miniflux-2.0.43.ebuild
+++ b/www-apps/miniflux/miniflux-2.0.43-r1.ebuild
@@ -35,7 +35,7 @@ src_install() {
 
 	newconfd "${FILESDIR}/${PN}.confd" ${PN}
 
-	newinitd "${FILESDIR}/${PN}.initd" ${PN}
+	newinitd "${FILESDIR}/${PN}.initd-r1" ${PN}
 	systemd_dounit "${FILESDIR}/${PN}.service"
 
 	fowners miniflux:root /etc/${PN}.conf


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-02 18:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-06 19:33 [gentoo-commits] repo/gentoo:master commit in: www-apps/miniflux/, www-apps/miniflux/files/ Kenton Groombridge
  -- strict thread matches above, loose matches on Subject: below --
2023-04-02 18:37 Kenton Groombridge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox