diff options
author | tiotags <tiotags1@gmail.com> | 2021-04-17 22:03:29 +0300 |
---|---|---|
committer | tiotags <tiotags1@gmail.com> | 2021-04-17 22:22:37 +0300 |
commit | c0abb42b17e62539099bd65adcf557839ece7c79 (patch) | |
tree | b995b9a13796cf4b884111649d60ca4aae4b2170 /www-servers/hinsightd | |
parent | x11-terms/terminus-bin: move to v137 (diff) | |
download | guru-c0abb42b17e62539099bd65adcf557839ece7c79.tar.gz guru-c0abb42b17e62539099bd65adcf557839ece7c79.tar.bz2 guru-c0abb42b17e62539099bd65adcf557839ece7c79.zip |
www-servers/hinsightd: added hinsightd http server
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Alexandru Campeanu <tiotags1@gmail.com>
Diffstat (limited to 'www-servers/hinsightd')
-rw-r--r-- | www-servers/hinsightd/files/gentoo.patch | 28 | ||||
-rwxr-xr-x | www-servers/hinsightd/files/init.d.sh | 49 | ||||
-rw-r--r-- | www-servers/hinsightd/hinsightd-9999.ebuild | 61 | ||||
-rw-r--r-- | www-servers/hinsightd/metadata.xml | 11 |
4 files changed, 149 insertions, 0 deletions
diff --git a/www-servers/hinsightd/files/gentoo.patch b/www-servers/hinsightd/files/gentoo.patch new file mode 100644 index 000000000..22925c1dc --- /dev/null +++ b/www-servers/hinsightd/files/gentoo.patch @@ -0,0 +1,28 @@ +diff --git a/src/hin/conf.h b/src/hin/conf.h +index c4f7f4c..29b9375 100644 +--- a/src/hin/conf.h ++++ b/src/hin/conf.h +@@ -2,9 +2,9 @@ + #ifndef HIN_CONF_H + #define HIN_CONF_H + +-#define HIN_CONF_PATH "workdir/main.lua" +-#define HIN_LOGDIR_PATH "build/" +-#define HIN_CWD_PATH "./" ++#define HIN_CONF_PATH "/etc/hinsightd/hinsightd.lua" ++#define HIN_LOGDIR_PATH "/var/log/hinsightd/" ++#define HIN_CWD_PATH "/var/www/localhost/" + + #define HIN_URING_QUEUE_DEPTH 256 + #define HIN_URING_DONT_FORK 0 +@@ -20,8 +20,8 @@ + #define HIN_HTTPD_MAX_HEADER_LINE_SIZE 4096 + #define HIN_HTTPD_MAX_POST_SIZE 4121440 + #define HIN_HTTPD_MAX_DEFLATE_SIZE 0 +-#define HIN_HTTPD_POST_DIRECTORY "/tmp" +-#define HIN_HTTPD_CACHE_DIRECTORY "/tmp" ++#define HIN_HTTPD_POST_DIRECTORY "/var/tmp/hinsightd" ++#define HIN_HTTPD_CACHE_DIRECTORY "/var/tmp/hinsightd" + #define HIN_HTTPD_CACHE_CLEAN_ON_EXIT 1 + #define HIN_HTTPD_CACHE_TMPFILE 0 + #define HIN_HTTPD_CACHE_MAX_SIZE 64 * 1024 * 1024 diff --git a/www-servers/hinsightd/files/init.d.sh b/www-servers/hinsightd/files/init.d.sh new file mode 100755 index 000000000..9146de844 --- /dev/null +++ b/www-servers/hinsightd/files/init.d.sh @@ -0,0 +1,49 @@ +#!/sbin/openrc-run + +NAME=$RC_SVCNAME +RUN_DIR=/var/run/$NAME +LOG_DIR=/var/log/$NAME +TMP_DIR=/var/tmp/$NAME +CWD_DIR=/var/www/localhost +PID_FILE=$RUN_DIR/$NAME.pid +CFG_FILE=/etc/hinsightd/$NAME.lua + +RUN_FILE=/usr/bin/hinsightd +RUN_USER="hinsightd" + +extra_commands="checkconfig reload" + +command=$RUN_FILE +command_args="--config $CFG_FILE --logdir $LOG_DIR --cwd $CWD_DIR --pidfile $PID_FILE --tmpdir $TMP_DIR" +pidfile="$PID_FILE" +command_args_background="--daemonize" +command_user="$RUN_USER:$RUN_USER" + +depend() { + use net +} + +checkconfig() { + $command $command_args --pretend > /dev/null +} + +start_pre() { + checkpath --directory --owner $command_user --mode 0770 $LOG_DIR $TMP_DIR $RUN_DIR + checkconfig || return 1 +} + +reload() { + if ! service_started "${NAME}" ; then + eerror " * ERROR ${NAME} isn't running" + return 1 + fi + + checkconfig || return 1 + + echo " * Reloading ${NAME} ..." + + start-stop-daemon --quiet --signal USR1 --pidfile ${PID_FILE} + eend $? +} + + diff --git a/www-servers/hinsightd/hinsightd-9999.ebuild b/www-servers/hinsightd/hinsightd-9999.ebuild new file mode 100644 index 000000000..e76ea720c --- /dev/null +++ b/www-servers/hinsightd/hinsightd-9999.ebuild @@ -0,0 +1,61 @@ +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LUA_COMPAT=( lua5-{1..4} ) + +inherit git-r3 fcaps + +DESCRIPTION="hinsightd a http/1.1 webserver with (hopefully) minimal goals" +HOMEPAGE="https://gitlab.com/tiotags/hin9" +EGIT_REPO_URI="https://gitlab.com/tiotags/hin9.git" +LICENSE="BSD" +SLOT="0" +KEYWORDS="" +IUSE="" #+openssl + +RDEPEND=" +acct-user/hinsightd +acct-group/hinsightd +sys-libs/liburing +dev-lang/lua:* +sys-libs/zlib +dev-libs/openssl +" + +DEPEND="${RDEPEND}" + +BDEPEND=" +acct-user/hinsightd +acct-group/hinsightd +dev-util/ninja +" + +PATCHES=( +"${FILESDIR}/gentoo.patch" +) + +#src_configure() { +#} + +src_compile() { + cd build + ninja +} + +src_install() { + newbin "${S}/build/hin9 hinsightd" + newinitd "${FILESDIR}/init.d.sh" hinsightd + + insinto /etc/hinsightd + newins "${S}/workdir/main.lua" hinsightd.lua + + keepdir /var/www/localhost/htdocs + keepdir /var/log/hinsightd + keepdir /var/tmp/hinsightd +} + +pkg_postinst() { + fcaps CAP_NET_BIND_SERVICE /usr/bin/hinsightd +} diff --git a/www-servers/hinsightd/metadata.xml b/www-servers/hinsightd/metadata.xml new file mode 100644 index 000000000..9b48d579b --- /dev/null +++ b/www-servers/hinsightd/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- maintainer-needed --> + <longdescription lang="en"> + hinsightd a http/1.1 webserver with (hopefully) minimal goals + </longdescription> + <use> + <!--<flag name="openssl">Enable tls encryption with openssl</flag>--> + </use> +</pkgmetadata> |