From 752d6256e5204b958b0ef7905675a940b5e9172f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 12 May 2022 16:42:50 +0300 Subject: gentoo resync : 12.05.2022 --- 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 +++++++++ 5 files changed, 142 insertions(+) create mode 100644 www-apps/miniflux/files/README.gentoo create mode 100644 www-apps/miniflux/files/miniflux.conf create mode 100644 www-apps/miniflux/files/miniflux.confd create mode 100644 www-apps/miniflux/files/miniflux.initd create mode 100644 www-apps/miniflux/files/miniflux.service (limited to 'www-apps/miniflux/files') 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 -- cgit v1.2.3