mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-11 08:03:16 -04:00
net-misc/gmid: fix initd script
It writes a valid PID file now Other changes: * add a reasonable default configuration file * automatically generate a self-signed certificate for localhost Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Anna Vyalkova <cyber@sysrq.in>
This commit is contained in:
8
net-misc/gmid/files/gmid.conf
Normal file
8
net-misc/gmid/files/gmid.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
user "gemini" # drop privileges
|
||||
|
||||
server "localhost" {
|
||||
root "/var/gemini/localhost"
|
||||
auto index on
|
||||
cert "/etc/ssl/gmid/gmid.crt"
|
||||
key "/etc/ssl/gmid/gmid.key"
|
||||
}
|
||||
@@ -2,12 +2,3 @@
|
||||
|
||||
# Configuration file
|
||||
#GMID_CONFIGFILE="/etc/gmid/gmid.conf"
|
||||
|
||||
# PID file
|
||||
#GMID_PIDFILE="/var/run/gmid.pid"
|
||||
|
||||
# User to run gmid as
|
||||
#GMID_USER="gemini"
|
||||
|
||||
# Group to run gmid as
|
||||
#GMID_GROUP="gemini"
|
||||
|
||||
@@ -12,10 +12,9 @@ description_reload="Reload the gmid configuration without losing connections."
|
||||
GMID_CONFIGFILE=${GMID_CONFIGFILE:-/etc/gmid/gmid.conf}
|
||||
|
||||
command="/usr/bin/gmid"
|
||||
command_args="-c \"${GMID_CONFIGFILE}\""
|
||||
pidfile=${GMID_PIDFILE:-/var/run/gmid.pid}
|
||||
user=${GMID_USER:-gemini}
|
||||
group=${GMID_GROUP:-gemini}
|
||||
command_args="-c \"${GMID_CONFIGFILE}\" -f"
|
||||
command_background=1
|
||||
pidfile="/var/run/gmid.pid"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit toolchain-funcs
|
||||
SSL_DEPS_SKIP=1
|
||||
SSL_DAYS=36500
|
||||
|
||||
inherit ssl-cert toolchain-funcs
|
||||
|
||||
DESCRIPTION="simple and secure Gemini server"
|
||||
HOMEPAGE="https://www.omarpolo.com/pages/gmid.html"
|
||||
@@ -53,13 +56,23 @@ src_configure() {
|
||||
src_install() {
|
||||
default
|
||||
|
||||
dodir /etc/gmid
|
||||
cp "${FILESDIR}"/gmid.conf "${ED}"/etc/gmid/gmid.conf || die
|
||||
|
||||
newinitd "${FILESDIR}"/gmid.initd gmid
|
||||
newconfd "${FILESDIR}"/gmid.confd gmid
|
||||
|
||||
keepdir /var/gemini/localhost
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
if [[ ! -f "${EROOT}"/etc/ssl/${PN}/${PN}.key ]]; then
|
||||
install_cert /etc/ssl/${PN}/${PN}
|
||||
chown gemini:gemini "${EROOT}"/etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
|
||||
fi
|
||||
|
||||
einfo "This gemini server can be run as a user with zero configuration.\n"
|
||||
einfo "In order to use it with the init service you will need to generate a"
|
||||
einfo "self-signed TLS certificate and key and set up the configuration"
|
||||
einfo "self-signed TLS certificate and a key and set up the configuration"
|
||||
einfo "file (see man 1 gmid for details)."
|
||||
}
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit toolchain-funcs
|
||||
SSL_DEPS_SKIP=1
|
||||
SSL_DAYS=36500
|
||||
|
||||
inherit ssl-cert toolchain-funcs
|
||||
|
||||
DESCRIPTION="simple and secure Gemini server"
|
||||
HOMEPAGE="https://www.omarpolo.com/pages/gmid.html"
|
||||
@@ -53,13 +56,23 @@ src_configure() {
|
||||
src_install() {
|
||||
default
|
||||
|
||||
dodir /etc/gmid
|
||||
cp "${FILESDIR}"/gmid.conf "${ED}"/etc/gmid/gmid.conf || die
|
||||
|
||||
newinitd "${FILESDIR}"/gmid.initd gmid
|
||||
newconfd "${FILESDIR}"/gmid.confd gmid
|
||||
|
||||
keepdir /var/gemini/localhost
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
if [[ ! -f "${EROOT}"/etc/ssl/${PN}/${PN}.key ]]; then
|
||||
install_cert /etc/ssl/${PN}/${PN}
|
||||
chown gemini:gemini "${EROOT}"/etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
|
||||
fi
|
||||
|
||||
einfo "This gemini server can be run as a user with zero configuration.\n"
|
||||
einfo "In order to use it with the init service you will need to generate a"
|
||||
einfo "self-signed TLS certificate and key and set up the configuration"
|
||||
einfo "self-signed TLS certificate and a key and set up the configuration"
|
||||
einfo "file (see man 1 gmid for details)."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user