Page MenuHomeFreeBSD

D57369.id179009.diff
No OneTemporary

D57369.id179009.diff

Index: net-mgmt/Makefile
===================================================================
--- net-mgmt/Makefile
+++ net-mgmt/Makefile
@@ -412,6 +412,7 @@
SUBDIR += unbound_exporter
SUBDIR += unifi10
SUBDIR += unifi9
+ SUBDIR += uptime-kuma
SUBDIR += victoria-logs
SUBDIR += victoria-metrics
SUBDIR += virt-viewer
Index: net-mgmt/uptime-kuma/Makefile
===================================================================
--- /dev/null
+++ net-mgmt/uptime-kuma/Makefile
@@ -0,0 +1,132 @@
+PORTNAME= uptime-kuma
+DISTVERSION= 2.3.2
+CATEGORIES= net-mgmt www
+MASTER_SITES= LOCAL/dch/${PORTNAME}/:npmcache \
+ https://github.com/louislam/${PORTNAME}/releases/download/${DISTVERSION}/:dist
+DISTFILES= ${PORTNAME}-npm-cache-${DISTVERSION}${EXTRACT_SUFX}:npmcache \
+ dist.tar.gz:dist
+DIST_SUBDIR= ${PORTNAME}
+EXTRACT_ONLY= ${PORTNAME}-npm-cache-${DISTVERSION}${EXTRACT_SUFX} \
+ louislam-${PORTNAME}-${DISTVERSION}_GH0.tar.gz
+
+MAINTAINER= dch@FreeBSD.org
+COMMENT= Self-hosted server monitoring tool
+WWW= https://github.com/louislam/uptime-kuma
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= ${LOCALBASE}/bin/npm:www/npm \
+ esbuild:devel/esbuild
+LIB_DEPENDS= libsqlite3.so:databases/sqlite3
+
+USES= gmake nodejs:lts,build,run python:build
+USE_GITHUB= yes
+GH_ACCOUNT= louislam
+USE_RC_SUBR= uptimekuma
+
+WWWDIR= ${PREFIX}/www/${PORTNAME}
+
+SUB_LIST+= GROUPS=${GROUPS} \
+ USERS=${USERS}
+
+USERS= www
+GROUPS= www
+
+PLIST_SUB+= _NODE_ARCH=${_NODE_ARCH} \
+ GROUPS=${GROUPS} \
+ USERS=${USERS}
+
+_NODE_ARCH= ${ARCH:S/aarch64/arm64/:S/amd64/x64/}
+_NPM_CACHE= ${WRKDIR}/.npm
+
+post-extract:
+ @${MKDIR} ${_NPM_CACHE}
+ ${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/dist.tar.gz -C ${WRKSRC}
+
+do-build:
+ cd ${WRKSRC} && \
+ ${SETENV} ${MAKE_ENV} HOME=${WRKDIR} npm_config_cache=${_NPM_CACHE} \
+ npm_config_offline=true npm_config_python=${PYTHON_CMD} \
+ npm_config_nodedir=${LOCALBASE} CFLAGS="-I${LOCALBASE}/include" \
+ CXXFLAGS="-I${LOCALBASE}/include" npm ci --ignore-scripts \
+ --legacy-peer-deps --no-audit --no-fund --no-progress
+# hack out the esbuild version check and let us use whats in ports
+ ${SED} -i '' \
+ '/checkAndPreparePackage()\.then/,$$d' \
+ ${WRKSRC}/node_modules/esbuild/install.js
+ ${ECHO_CMD} 'checkAndPreparePackage();' >> ${WRKSRC}/node_modules/esbuild/install.js
+ cd ${WRKSRC} && \
+ ${SETENV} ${MAKE_ENV} HOME=${WRKDIR} npm_config_cache=${_NPM_CACHE} \
+ npm_config_offline=true npm_config_python=${PYTHON_CMD} \
+ npm_config_nodedir=${LOCALBASE} ESBUILD_BINARY_PATH=${LOCALBASE}/bin/esbuild \
+ CFLAGS="-I${LOCALBASE}/include" CXXFLAGS="-I${LOCALBASE}/include" \
+ npm rebuild --legacy-peer-deps --no-audit --no-fund --no-progress
+
+post-build:
+ ${SED} -i '' \
+ "s/process.platform === 'linux'/process.platform === 'freebsd'/" \
+ ${WRKSRC}/node_modules/playwright-core/lib/server/registry/index.js
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${WWWDIR}
+.for d in server src db extra dist dist-frontend
+ if [ -d ${WRKSRC}/${d} ]; then \
+ (cd ${WRKSRC} && \
+ ${COPYTREE_SHARE} ${d} ${STAGEDIR}${WWWDIR}); \
+ fi
+.endfor
+ ${INSTALL_DATA} ${WRKSRC}/package.json \
+ ${STAGEDIR}${WWWDIR}
+ ${INSTALL_DATA} ${WRKSRC}/package-lock.json \
+ ${STAGEDIR}${WWWDIR}
+ (cd ${WRKSRC} && \
+ ${COPYTREE_SHARE} node_modules ${STAGEDIR}${WWWDIR})
+ ${RM} -r ${STAGEDIR}${WWWDIR}/node_modules/@esbuild
+ ${RM} -r ${STAGEDIR}${WWWDIR}/node_modules/@rollup
+ ${RM} -r ${STAGEDIR}${WWWDIR}/node_modules/@louislam/sqlite3/build-tmp-napi-v6
+ ${RM} ${STAGEDIR}${WWWDIR}/node_modules/@louislam/node-addon-api/node_api.Makefile
+ ${RM} ${STAGEDIR}${WWWDIR}/node_modules/@louislam/node-addon-api/nothing.target.mk
+ ${RM} -r ${STAGEDIR}${WWWDIR}/node_modules/cpu-features/build/Release/.deps
+ ${RM} -r ${STAGEDIR}${WWWDIR}/node_modules/cpu-features/build/Release/obj.target
+ ${RM} ${STAGEDIR}${WWWDIR}/node_modules/cpu-features/build/Release/cpu_features.a
+ ${RM} ${STAGEDIR}${WWWDIR}/node_modules/cpu-features/build/Makefile
+ ${RM} ${STAGEDIR}${WWWDIR}/node_modules/cpu-features/build/binding.Makefile
+ ${RM} ${STAGEDIR}${WWWDIR}/node_modules/cpu-features/build/config.gypi
+ ${RM} ${STAGEDIR}${WWWDIR}/node_modules/cpu-features/build/cpufeatures.target.mk
+ ${RM} -r ${STAGEDIR}${WWWDIR}/node_modules/cpu-features/build/deps
+ ${RM} -r ${STAGEDIR}${WWWDIR}/node_modules/ssh2/lib/protocol/crypto/build/Release/.deps
+ ${RM} -r ${STAGEDIR}${WWWDIR}/node_modules/ssh2/lib/protocol/crypto/build/Release/obj.target
+ ${RM} ${STAGEDIR}${WWWDIR}/node_modules/ssh2/lib/protocol/crypto/build/Makefile
+ ${RM} ${STAGEDIR}${WWWDIR}/node_modules/ssh2/lib/protocol/crypto/build/binding.Makefile
+ ${RM} ${STAGEDIR}${WWWDIR}/node_modules/ssh2/lib/protocol/crypto/build/config.gypi
+ ${RM} ${STAGEDIR}${WWWDIR}/node_modules/ssh2/lib/protocol/crypto/build/sshcrypto.target.mk
+ ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}
+ ${MKDIR} ${STAGEDIR}/var/log/${PORTNAME}
+ ${MKDIR} ${STAGEDIR}/var/run/${PORTNAME}
+
+# generate npm cache tarball for offline builds.
+tarball: fetch-src npm-populate npm-cache upload-npm-cache
+
+_NPM_CACHE_SRC_URL= https://github.com/${GH_ACCOUNT}/${PORTNAME}/archive/${DISTVERSION}${EXTRACT_SUFX}
+_NPM_CACHE_TARBALL= ${PORTNAME}-npm-cache-${DISTVERSION}${EXTRACT_SUFX}
+
+fetch-src:
+ @${RM} -rf ${WRKDIR}
+ @${MKDIR} ${WRKDIR}
+ ${FETCH_CMD} -o ${WRKDIR}/src${EXTRACT_SUFX} ${_NPM_CACHE_SRC_URL}
+ ${TAR} xf ${WRKDIR}/src${EXTRACT_SUFX} -C ${WRKDIR}
+
+npm-populate:
+ (cd ${WRKSRC} && \
+ ${SETENV} HOME=${WRKDIR} npm_config_cache=${_NPM_CACHE} \
+ npm ci --legacy-peer-deps --no-audit --no-fund)
+
+npm-cache:
+ (cd ${WRKDIR} && \
+ ${TAR} czf ${_NPM_CACHE_TARBALL} .npm)
+
+upload-npm-cache:
+ rsync -Phrivazcld ${WRKDIR}/${_NPM_CACHE_TARBALL} freefall.freebsd.org:public_distfiles/${PORTNAME}/
+
+.include <bsd.port.mk>
Index: net-mgmt/uptime-kuma/distinfo
===================================================================
--- /dev/null
+++ net-mgmt/uptime-kuma/distinfo
@@ -0,0 +1,7 @@
+TIMESTAMP = 1779833956
+SHA256 (uptime-kuma/uptime-kuma-npm-cache-2.3.2.tar.gz) = 9cf8a14c04a119de24f18f3f0933599fa0a0930c85bfae4d66fbfd8342ffd1c3
+SIZE (uptime-kuma/uptime-kuma-npm-cache-2.3.2.tar.gz) = 88065380
+SHA256 (uptime-kuma/dist.tar.gz) = 999bd26d7623b0a5465fbc14fc33e74a7b15fdb993b13bc8d40f610b7ca50d9f
+SIZE (uptime-kuma/dist.tar.gz) = 6957201
+SHA256 (uptime-kuma/louislam-uptime-kuma-2.3.2_GH0.tar.gz) = d93fc9f268a333bec97dbc50412354d3f82e54c76604bc56f56ee707285249fc
+SIZE (uptime-kuma/louislam-uptime-kuma-2.3.2_GH0.tar.gz) = 2049515
Index: net-mgmt/uptime-kuma/files/patch-server_uptime-kuma-server.js
===================================================================
--- /dev/null
+++ net-mgmt/uptime-kuma/files/patch-server_uptime-kuma-server.js
@@ -0,0 +1,18 @@
+--- server/uptime-kuma-server.js.orig
++++ server/uptime-kuma-server.js
+@@ -342,12 +342,13 @@ class UptimeKumaServer {
+ * @returns {void}
+ */
+ static errorLog(error, outputToConsole = true) {
+- const errorLogStream = fs.createWriteStream(path.join(Database.dataDir, "/error.log"), {
++ const errorLogPath = process.env.UPTIME_KUMA_ERROR_LOG || path.join(Database.dataDir, "error.log");
++ const errorLogStream = fs.createWriteStream(errorLogPath, {
+ flags: "a",
+ });
+
+ errorLogStream.on("error", () => {
+- log.info("", "Cannot write to error.log");
++ log.info("", `Cannot write to error log: ${errorLogPath}`);
+ });
+
+ if (errorLogStream) {
Index: net-mgmt/uptime-kuma/files/uptimekuma.in
===================================================================
--- /dev/null
+++ net-mgmt/uptime-kuma/files/uptimekuma.in
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+# PROVIDE: uptimekuma
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# uptimekuma_enable (bool): Set to NO by default.
+# Set it to YES to enable uptimekuma.
+# uptimekuma_user (string): User account to run as.
+# Default is "%%USERS%%".
+# uptimekuma_group (string): Group to run as.
+# Default is "%%GROUPS%%".
+# uptimekuma_datadir (string): Directory for application data and database.
+# Default is "/var/db/uptime-kuma".
+# uptimekuma_host (string): IP address to listen on.
+# Default is "0.0.0.0".
+# uptimekuma_port (string): TCP port to listen on.
+# Default is "3001".
+# uptimekuma_options (string): Additional command-line arguments appended
+# after --data-dir.
+# Default is "".
+# uptimekuma_errorlog (string): Path for unexpected application errors.
+# Default is
+# "/var/log/uptime-kuma/error.log".
+# uptimekuma_env (string): Additional environment variables.
+# Defaults are typically required, so append.
+
+. /etc/rc.subr
+
+name="uptimekuma"
+rcvar="${name}_enable"
+
+load_rc_config $name
+
+: ${uptimekuma_enable:="NO"}
+: ${uptimekuma_user:="%%USERS%%"}
+: ${uptimekuma_group:="%%GROUPS%%"}
+: ${uptimekuma_datadir:="/var/db/uptime-kuma"}
+: ${uptimekuma_host:="0.0.0.0"}
+: ${uptimekuma_port:="3001"}
+: ${uptimekuma_options:=""}
+: ${uptimekuma_errorlog:="/var/log/uptime-kuma/error.log"}
+: ${uptimekuma_env:="LC_ALL=en_US.UTF-8 PLAYWRIGHT_BROWSERS_PATH=/nonexistent"}
+
+logfile="/var/log/uptime-kuma/uptime-kuma.log"
+pidfile="/var/run/uptime-kuma/${name}.pid"
+
+procname="/usr/sbin/daemon"
+
+uptimekuma_chdir="%%WWWDIR%%"
+
+command="/usr/sbin/daemon"
+command_args="-H -r -f -o ${logfile} -P ${pidfile} -t ${name} \
+ /usr/bin/env ${uptimekuma_env} UPTIME_KUMA_ERROR_LOG=${uptimekuma_errorlog} \
+ /usr/local/bin/node %%WWWDIR%%/server/server.js \
+ --host=${uptimekuma_host} --port=${uptimekuma_port} \
+ --data-dir=${uptimekuma_datadir} ${uptimekuma_options}"
+
+start_precmd="${name}_precmd"
+
+uptimekuma_precmd()
+{
+ install -d -o ${uptimekuma_user} -g ${uptimekuma_group} ${uptimekuma_datadir}
+ install -d -o ${uptimekuma_user} -g ${uptimekuma_group} /var/run/uptime-kuma
+ install -d -o ${uptimekuma_user} -g ${uptimekuma_group} /var/log/uptime-kuma
+ install -d -o ${uptimekuma_user} -g ${uptimekuma_group} "$(dirname "${uptimekuma_errorlog}")"
+ install -o ${uptimekuma_user} -g ${uptimekuma_group} /dev/null ${pidfile}
+ touch ${logfile} ${uptimekuma_errorlog}
+ chown ${uptimekuma_user}:${uptimekuma_group} ${logfile} ${uptimekuma_errorlog}
+}
+
+run_rc_command "$1"
Index: net-mgmt/uptime-kuma/pkg-descr
===================================================================
--- /dev/null
+++ net-mgmt/uptime-kuma/pkg-descr
@@ -0,0 +1,16 @@
+Uptime Kuma is a self-hosted monitoring tool similar to "Uptime Robot".
+
+Features include:
+- Monitoring uptime for HTTP(s), TCP, HTTP(s) keyword, HTTP(s) JSON
+ query, ping, DNS record, push, Steam game server, Docker containers
+- Fancy, reactive, fast UI/UX
+- Notifications via Telegram, Discord, Gotify, Slack, Pushover, email
+ (SMTP), and 90+ notification services
+- 20-second intervals
+- Multi-language support
+- Multiple status pages
+- Map status pages to specific domains
+- Ping chart
+- Certificate info
+- Proxy support
+- 2FA support

File Metadata

Mime Type
text/plain
Expires
Thu, Jun 11, 9:23 AM (20 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33803917
Default Alt Text
D57369.id179009.diff (11 KB)

Event Timeline