diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index ec12ae2d3c08..a59b57b85034 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -1,443 +1,444 @@ COMMENT = Network management tools SUBDIR += 2ping SUBDIR += TkTopNetFlows SUBDIR += adcli SUBDIR += adguard-exporter SUBDIR += aggregate SUBDIR += aircrack-ng SUBDIR += alertmanager SUBDIR += andwatch SUBDIR += ap-utils SUBDIR += argus SUBDIR += argus-clients SUBDIR += arpscan SUBDIR += arpwatch SUBDIR += bandwhich SUBDIR += bandwidthd SUBDIR += bgpq3 SUBDIR += bgpq4 SUBDIR += bgpuma SUBDIR += bind_exporter SUBDIR += blackbox_exporter SUBDIR += bosun SUBDIR += bpft SUBDIR += braa SUBDIR += bsnmp-regex SUBDIR += bsnmp-ucd SUBDIR += bwm-ng SUBDIR += cacti SUBDIR += cacti-spine SUBDIR += cacti88-spine SUBDIR += carbon-relay-ng SUBDIR += carbonzipper SUBDIR += cdpd SUBDIR += cdpr SUBDIR += cdpsnarf SUBDIR += centreon-clib SUBDIR += check_ipmi_sensor SUBDIR += check_logfiles SUBDIR += check_mk_agent SUBDIR += check_multi SUBDIR += check_mysql_health SUBDIR += check_nwc_health SUBDIR += check_ssl_cert SUBDIR += check_syncthing SUBDIR += check_ups_health SUBDIR += check_wg SUBDIR += chillispot SUBDIR += choparp SUBDIR += cidr SUBDIR += ciscoconf SUBDIR += clog SUBDIR += cnagios SUBDIR += collectd5 SUBDIR += confregdecode SUBDIR += coovachilli SUBDIR += cowpatty SUBDIR += cricket SUBDIR += crmsh SUBDIR += darkstat SUBDIR += devmon SUBDIR += devmon-templates SUBDIR += dhcdrop SUBDIR += dhcp_probe SUBDIR += disco SUBDIR += dnsmap SUBDIR += docsis SUBDIR += driftnet SUBDIR += ehnt SUBDIR += etherape SUBDIR += ettercap SUBDIR += fastnetmon SUBDIR += fence-agents SUBDIR += fetchconfig SUBDIR += fli SUBDIR += flow-tools SUBDIR += flowd SUBDIR += flowviewer SUBDIR += fprobe SUBDIR += geom-exporter SUBDIR += gnu-ipcalc SUBDIR += gping SUBDIR += grepcidr SUBDIR += grepip SUBDIR += grok_exporter SUBDIR += gsnmp SUBDIR += guifi-snpservices SUBDIR += icinga-ipl-i18n SUBDIR += icinga-php-library SUBDIR += icinga-php-thirdparty SUBDIR += icinga2 SUBDIR += icingadb SUBDIR += icingaweb2 SUBDIR += icingaweb2-module-businessprocess SUBDIR += icingaweb2-module-cube SUBDIR += icingaweb2-module-director SUBDIR += icingaweb2-module-elasticsearch SUBDIR += icingaweb2-module-fileshipper SUBDIR += icingaweb2-module-generictts SUBDIR += icingaweb2-module-grafana SUBDIR += icingaweb2-module-graphite SUBDIR += icingaweb2-module-icingadb SUBDIR += icingaweb2-module-idoreports SUBDIR += icingaweb2-module-incubator SUBDIR += icingaweb2-module-jira SUBDIR += icingaweb2-module-map SUBDIR += icingaweb2-module-monitoring SUBDIR += icingaweb2-module-pdfexport SUBDIR += icingaweb2-module-reactbundle SUBDIR += icingaweb2-module-reporting SUBDIR += icingaweb2-module-vsphere SUBDIR += icingaweb2-module-vspheredb SUBDIR += icingaweb2-module-x509 SUBDIR += icmpmonitor SUBDIR += icmpquery SUBDIR += iftop SUBDIR += intel-snap SUBDIR += ipacctd SUBDIR += ipaudit SUBDIR += ipcad SUBDIR += ipcalc SUBDIR += ipfixcol2 SUBDIR += ipgen SUBDIR += iprange SUBDIR += ipv6calc SUBDIR += ipv6gen SUBDIR += ipv6mon SUBDIR += irrtoolset SUBDIR += isic SUBDIR += jnettop SUBDIR += junos_exporter SUBDIR += kapacitor SUBDIR += kf6-networkmanager-qt SUBDIR += kismet SUBDIR += klg SUBDIR += lg SUBDIR += libfds SUBDIR += librenms SUBDIR += libsmi SUBDIR += lldpd SUBDIR += mac-telnet SUBDIR += makenl SUBDIR += mbrowse SUBDIR += mdata-client SUBDIR += metronome SUBDIR += midpoint SUBDIR += mk-livestatus SUBDIR += monitoring-plugins SUBDIR += mqtt2prometheus SUBDIR += mrtg SUBDIR += mrtg-ping-probe SUBDIR += mtrace SUBDIR += mysql-snmp SUBDIR += mysqld_exporter SUBDIR += nagios SUBDIR += nagios-certexp-plugin SUBDIR += nagios-check_bacula13 SUBDIR += nagios-check_bacula15 SUBDIR += nagios-check_clamav SUBDIR += nagios-check_cpu_usage SUBDIR += nagios-check_dhcp.pl SUBDIR += nagios-check_email_delivery SUBDIR += nagios-check_hdd_health SUBDIR += nagios-check_hp_bladechassis SUBDIR += nagios-check_mysql_slave SUBDIR += nagios-check_netsnmp SUBDIR += nagios-check_ports SUBDIR += nagios-check_postgres SUBDIR += nagios-check_puppet SUBDIR += nagios-check_relayd_status SUBDIR += nagios-check_smartmon SUBDIR += nagios-check_tftp SUBDIR += nagios-check_zpools SUBDIR += nagios-geom SUBDIR += nagios-openldap-plugins SUBDIR += nagios-pf-plugin SUBDIR += nagios-plugins SUBDIR += nagios-snmp-plugins SUBDIR += nagios-snmp-plugins-extras SUBDIR += nagios4 SUBDIR += nagiosgraph SUBDIR += nagiosql SUBDIR += nagnu SUBDIR += nagstamon SUBDIR += nagtail SUBDIR += nagvis SUBDIR += nbtscan SUBDIR += ndoutils SUBDIR += ndpmon SUBDIR += net-snmp SUBDIR += netbox SUBDIR += netbox-agent SUBDIR += netdata SUBDIR += netdisco-mibs SUBDIR += netleak SUBDIR += netmagis-common SUBDIR += netmagis-database SUBDIR += netmagis-detecteq SUBDIR += netmagis-metro SUBDIR += netmagis-servers SUBDIR += netmagis-topo SUBDIR += netmagis-utils SUBDIR += netmagis-www SUBDIR += netmask SUBDIR += netspoc SUBDIR += networkmanager-shim SUBDIR += networkmgr SUBDIR += netxms SUBDIR += nfdump SUBDIR += nfs-exporter SUBDIR += nfsen SUBDIR += ng_ipacct SUBDIR += nitpicker SUBDIR += nrpe SUBDIR += nsca SUBDIR += nsca-client SUBDIR += nsca-ng SUBDIR += nsca-ng-client SUBDIR += nsca27 SUBDIR += nsca27-client SUBDIR += nsd_exporter SUBDIR += nstat SUBDIR += nvidia_gpu_prometheus_exporter SUBDIR += observium SUBDIR += ocsinventory-agent SUBDIR += ocsinventory-ocsreports SUBDIR += ocsinventory-server SUBDIR += omada5 SUBDIR += omada6 SUBDIR += omping SUBDIR += openbmp SUBDIR += openlldp SUBDIR += openvmps SUBDIR += p0f SUBDIR += p5-AnyEvent-SNMP SUBDIR += p5-BigIP-iControl SUBDIR += p5-Cflow SUBDIR += p5-Cisco-CopyConfig SUBDIR += p5-Cisco-Reconfig SUBDIR += p5-Data-Validate-IP SUBDIR += p5-FusionInventory-Agent SUBDIR += p5-MRTG-Parse SUBDIR += p5-Mon SUBDIR += p5-Monitoring-Livestatus SUBDIR += p5-Monitoring-Plugin SUBDIR += p5-NSNMP SUBDIR += p5-Nagios-Object SUBDIR += p5-Nagios-Plugin SUBDIR += p5-Nagios-Plugin-Beanstalk SUBDIR += p5-Nagios-Plugin-LDAP SUBDIR += p5-Nagios-Plugin_check_raid SUBDIR += p5-Nagios-Plugins-Memcached SUBDIR += p5-Net-ACL SUBDIR += p5-Net-Abuse-Utils SUBDIR += p5-Net-Abuse-Utils-Spamhaus SUBDIR += p5-Net-CIDR SUBDIR += p5-Net-ILO SUBDIR += p5-Net-IP SUBDIR += p5-Net-IP-Match-Regexp SUBDIR += p5-Net-IP-Match-XS SUBDIR += p5-Net-IP-Resolver SUBDIR += p5-Net-IP-XS SUBDIR += p5-Net-IPAddress SUBDIR += p5-Net-IPv4Addr SUBDIR += p5-Net-IPv6Addr SUBDIR += p5-Net-NSCA-Client SUBDIR += p5-Net-Netmask SUBDIR += p5-Net-OpenVPN-Manage SUBDIR += p5-Net-SNMP SUBDIR += p5-Net-SNMP-Util SUBDIR += p5-Net-SNMPTrapd SUBDIR += p5-Net-Telnet-Cisco-IOS SUBDIR += p5-NetAddr-IP SUBDIR += p5-NetAddr-IP-Lite SUBDIR += p5-NetApp SUBDIR += p5-OSLV-Monitor SUBDIR += p5-POE-Component-SNMP SUBDIR += p5-Prometheus-Tiny SUBDIR += p5-Prometheus-Tiny-Shared SUBDIR += p5-RDR-Collector SUBDIR += p5-SNMP-Info SUBDIR += p5-SNMP-MIB-Compiler SUBDIR += p5-SNMP-Simple SUBDIR += p5-SNMP-Trapinfo SUBDIR += p5-SNMP-Util SUBDIR += p5-SNMP_Session SUBDIR += p5-Telnet-Cisco SUBDIR += p5-Tie-NetAddr-IP SUBDIR += p5-Xymon SUBDIR += p5-Xymon-Client SUBDIR += p5-Xymon-Server SUBDIR += p5-Zenoss SUBDIR += p5-jmx4perl SUBDIR += packit SUBDIR += pads SUBDIR += pancho SUBDIR += pandorafms_agent SUBDIR += pandorafms_console SUBDIR += pandorafms_server SUBDIR += peering-manager SUBDIR += pftabled SUBDIR += php-fpm_exporter SUBDIR += php82-snmp SUBDIR += php83-snmp SUBDIR += php84-snmp SUBDIR += php85-snmp SUBDIR += php86-snmp SUBDIR += phpfpm_exporter SUBDIR += phpipam SUBDIR += ping_exporter SUBDIR += pktstat SUBDIR += pmacct SUBDIR += pnp SUBDIR += pnp-icinga2 SUBDIR += portmon SUBDIR += prometheus-bird-exporter SUBDIR += prometheus-collectd-exporter SUBDIR += prometheus1 SUBDIR += prometheus2 SUBDIR += prometheus3 SUBDIR += promscale SUBDIR += promxy SUBDIR += pushgateway SUBDIR += py-adal SUBDIR += py-aggregate6 SUBDIR += py-arouteserver SUBDIR += py-ciscoconfparse SUBDIR += py-dnsdiag SUBDIR += py-gstat_exporter SUBDIR += py-ipcalc SUBDIR += py-ipy SUBDIR += py-junos-eznc SUBDIR += py-msrest SUBDIR += py-msrestazure SUBDIR += py-napalm SUBDIR += py-napalm-logs SUBDIR += py-ncclient SUBDIR += py-netutils SUBDIR += py-nxapi-plumbing SUBDIR += py-opn-cli SUBDIR += py-pdagent SUBDIR += py-pdagent-integrations SUBDIR += py-phonebox-plugin SUBDIR += py-prometheus-client SUBDIR += py-pyIOSXR SUBDIR += py-pyang SUBDIR += py-pyeapi SUBDIR += py-pyixapi SUBDIR += py-pynetbox SUBDIR += py-pynxos SUBDIR += py-pypowerwall SUBDIR += py-pysmi SUBDIR += py-pysnmp SUBDIR += py-pysnmp-mibs SUBDIR += py-pyzabbix SUBDIR += py-snmp_passpersist SUBDIR += py-snmpclitools SUBDIR += rackmonkey SUBDIR += rancid3 SUBDIR += rate SUBDIR += rcpd SUBDIR += realmd SUBDIR += remarp SUBDIR += resource-agents SUBDIR += riemann SUBDIR += riemann-c-client SUBDIR += rotorouter SUBDIR += routers2 SUBDIR += routers2-extensions SUBDIR += routers2-extras SUBDIR += rrdbot SUBDIR += rs-aggregate SUBDIR += rtrlib SUBDIR += rubygem-blimpy SUBDIR += rubygem-checkson SUBDIR += rubygem-oxidized SUBDIR += rubygem-oxidized-script SUBDIR += rubygem-oxidized-web SUBDIR += rubygem-riemann-client SUBDIR += rubygem-riemann-dash SUBDIR += rubygem-riemann-rabbitmq SUBDIR += rubygem-riemann-tail SUBDIR += rubygem-riemann-tools SUBDIR += rubygem-snmp SUBDIR += rubygem-visage-app SUBDIR += sblim-wbemcli SUBDIR += sdig SUBDIR += seafile-client SUBDIR += seafile-gui SUBDIR += seafile-server SUBDIR += semaphore SUBDIR += sendip SUBDIR += simplomon SUBDIR += sipcalc SUBDIR += sjitter SUBDIR += smartctl_exporter SUBDIR += smokeping SUBDIR += snmp4nagios SUBDIR += snmptt SUBDIR += softflowd SUBDIR += spectools SUBDIR += ssgless SUBDIR += statsite SUBDIR += subcalc SUBDIR += super_mediator SUBDIR += sysmon SUBDIR += tcpreplay SUBDIR += tcptrack SUBDIR += telegraf SUBDIR += thanos SUBDIR += torrus SUBDIR += triton-guesttools SUBDIR += unbound_exporter SUBDIR += unifi10 SUBDIR += unifi9 + SUBDIR += uptime-kuma SUBDIR += victoria-logs SUBDIR += victoria-metrics SUBDIR += virt-viewer SUBDIR += vmutils SUBDIR += wdiag SUBDIR += whatmask SUBDIR += wifimgr SUBDIR += wmi-client SUBDIR += xymon-client SUBDIR += xymon-server SUBDIR += yaf SUBDIR += zabbix6-agent SUBDIR += zabbix6-frontend SUBDIR += zabbix6-java SUBDIR += zabbix6-proxy SUBDIR += zabbix6-server SUBDIR += zabbix7-agent SUBDIR += zabbix7-frontend SUBDIR += zabbix7-java SUBDIR += zabbix7-proxy SUBDIR += zabbix7-server SUBDIR += zabbix74-agent SUBDIR += zabbix74-frontend SUBDIR += zabbix74-java SUBDIR += zabbix74-proxy SUBDIR += zabbix74-server .include diff --git a/net-mgmt/uptime-kuma/Makefile b/net-mgmt/uptime-kuma/Makefile new file mode 100644 index 000000000000..63075b99dfb6 --- /dev/null +++ b/net-mgmt/uptime-kuma/Makefile @@ -0,0 +1,248 @@ +PORTNAME= uptime-kuma +DISTVERSION= 2.4.0 +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 \ + ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} \ + 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_FILES= "@dir(${USERS},${GROUPS},750) /var/db/${PORTNAME}" \ + "@dir(${USERS},${GROUPS},750) /var/log/${PORTNAME}" \ + "@dir(${USERS},${GROUPS},750) /var/run/${PORTNAME}" + +_NODE_ARCH= ${ARCH:S/aarch64/arm64/:S/amd64/x64/} +_NPM_CACHE= ${WRKDIR}/.npm +_PRUNE_EXTRA_DIRS= beta kuma-pr release uptime-kuma-push \ + push-examples/typescript-fetch +_PRUNE_NODE_FILES= -name '*.map' -o -name '*.d.ts' -o -name '*.ts' -o \ + -name '*.cts' -o -name '*.mts' -o -name '*.tsbuildinfo' +_PRUNE_NODE_EXPR= -name .github -o -name .circleci -o -name __pycache__ \ + -o -name benchmark -o -name benchmarks -o -name \ + coverage -o -name docs -o -name example -o -name \ + examples -o -name test -o -name tests +_PRUNE_NODE_MODULES= @azure @azure-rest @mapbox/node-pre-gyp @typespec \ + are-we-there-yet cacache gauge make-fetch-happen \ + node-gyp nopt npmlog playwright-core tar + +post-extract: + @${MKDIR} ${_NPM_CACHE} + ${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/dist.tar.gz -C ${WRKSRC} + +post-patch: + ${REINPLACE_CMD} -e '/monitorTypeList\["real-browser"\]/d' \ + -e '/RealBrowserMonitorType/d' \ + ${WRKSRC}/server/uptime-kuma-server.js + ${REINPLACE_CMD} -e '/remoteBrowserSocketHandler/d' \ + -e '/resetChrome/d' \ + -e '/Chrome executable is changed/d' \ + ${WRKSRC}/server/server.js + ${REINPLACE_CMD} \ + -e 's#const { testChrome } = require("../monitor-types/real-browser-monitor-type");#const testChrome = async () => { throw new Error("Real browser monitor is not supported on FreeBSD."); };#' \ + ${WRKSRC}/server/socket-handlers/general-socket-handler.js + ${REINPLACE_CMD} \ + -e 's#const { testRemoteBrowser } = require("../monitor-types/real-browser-monitor-type");#const testRemoteBrowser = async () => { throw new Error("Real browser monitor is not supported on FreeBSD."); };#' \ + ${WRKSRC}/server/socket-handlers/remote-browser-socket-handler.js + +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 + cd ${WRKSRC} && \ + ${SETENV} ${MAKE_ENV} HOME=${WRKDIR} npm_config_cache=${_NPM_CACHE} \ + npm_config_offline=true npm prune --omit=dev --ignore-scripts \ + --legacy-peer-deps --no-audit --no-fund --no-progress + +post-build: + ${ECHO_CMD} "module.exports = require('./binding/napi-v6-freebsd-${_NODE_ARCH}/node_sqlite3.node');" \ + > ${WRKSRC}/node_modules/@louislam/sqlite3/lib/sqlite3-binding.js + ${REINPLACE_CMD} -e '/"test-e2e":/d' \ + -e '/"test-e2e-ui":/d' \ + -e '/"playwright-codegen":/d' \ + -e '/"playwright-show-report":/d' \ + -e '/"playwright-core":/d' \ + -e '/"@playwright\/test":/d' \ + ${WRKSRC}/package.json + ${REINPLACE_CMD} \ + -e 's#var _identity = require("@azure/identity");#var _identity = {};#' \ + -e 's#var _coreAuth = require("@azure/core-auth");#var _coreAuth = { isTokenCredential: function() { return false; } };#' \ + -e '/@azure\/identity/d' \ + -e "/type !== 'default'.*azure-active-directory-default/s#^.*# if (type !== 'default' \&\& type !== 'ntlm') {#" \ + -e "/must one of/s#^.*# throw new TypeError('Only default and ntlm SQL Server authentication are supported in the FreeBSD port.');#" \ + ${WRKSRC}/node_modules/tedious/lib/connection.js + ${REINPLACE_CMD} -e '/"@azure\//d' \ + ${WRKSRC}/node_modules/tedious/package.json + ${REINPLACE_CMD} -e '/"azure",/d' \ + ${WRKSRC}/node_modules/mssql/package.json + +do-install: + ${MKDIR} ${STAGEDIR}${WWWDIR} +.for d in server db extra dist dist-frontend + if [ -d ${WRKSRC}/${d} ]; then \ + (cd ${WRKSRC} && \ + ${COPYTREE_SHARE} ${d} ${STAGEDIR}${WWWDIR}); \ + fi +.endfor + ${MKDIR} ${STAGEDIR}${WWWDIR}/src + ${INSTALL_DATA} ${WRKSRC}/src/util.js \ + ${STAGEDIR}${WWWDIR}/src + ${INSTALL_DATA} ${WRKSRC}/package.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} + +# The plist is generated from the staged tree below, so pruning has to +# happen before TMPPLIST is appended. Native artefacts are treated +# differently from JS helpers: keep and strip FreeBSD ELF modules, but +# delete Linux, Mach-O, PE, and other non-FreeBSD binaries. Do not +# blindly remove JS platform dispatchers; some packages, e.g. +# @louislam/ping, statically require Linux/macOS/Windows helpers even +# when running on FreeBSD. Yes. +# +# Pruning: +# +# Files/modules Saving Functionality lost +# ------------------------------------ -------------- ----------------------- +# package-lock/.package-lock files 1.2MB/3 files None at runtime +# node_modules/*.map 42MB/6.7k Source-level debugging +# node_modules TS decl/source files 27MB/7.9k None if JS dist exists +# README*/CHANGELOG* 4.9MB/700 Bundled package docs +# extra dev/release/test helper scripts <100KB Only those helpers +# node-gyp/npm fetch/build stack 2.9MB/375 Patched sqlite loader +# Playwright 6.9MB/291 Real browser monitor +# Azure auth/key-vault deps 10MB/1.8k AAD auth/AKV encryption +# +# Possible further pruning savings, if people don't use these: +# SQL Server 4MB/500 SQL Server monitor +# MongoDB 2.7MB/315 MongoDB monitor +# Redis 3.4MB/2.3k Redis monitor +# Oracle 1.2MB/113 Oracle DB monitor +# Nostr 7.6MB/827 Nostr notifications +post-install: +.for d in ${_PRUNE_EXTRA_DIRS} + ${RM} -r ${STAGEDIR}${WWWDIR}/extra/${d} +.endfor + ${RM} ${STAGEDIR}${WWWDIR}/extra/remove-playwright-test-data.js +.for d in ${_PRUNE_NODE_MODULES} + ${RM} -r ${STAGEDIR}${WWWDIR}/node_modules/${d} +.endfor + ${RM} ${STAGEDIR}${WWWDIR}/node_modules/tedious/lib/always-encrypted/keystore-provider-azure-key-vault.js + ${FIND} -s ${STAGEDIR}${WWWDIR}/node_modules -type d \( ${_PRUNE_NODE_EXPR} \ + \) -prune -exec ${RM} -r {} + + ${FIND} -s ${STAGEDIR}${WWWDIR} -type f \( ${_PRUNE_NODE_FILES} \) \ + -delete + ${FIND} -s -L ${STAGEDIR}${WWWDIR}/node_modules/.bin -type l -exec \ + ${RM} {} + + ${FIND} -s ${STAGEDIR}${WWWDIR} -type f \( -name '*.orig' -o -name '*.bak' \ + -o -name '.gitignore' -o -name 'package-lock.json' -o -name \ + '.package-lock.json' \) -delete + ${RM} ${STAGEDIR}${WWWDIR}/server/monitor-types/real-browser-monitor-type.js + ${RM} -r ${STAGEDIR}${WWWDIR}/node_modules/oracledb/build + ${FIND} -s ${STAGEDIR}${WWWDIR} -type f \ + \( -name '*.node' -o -name '*.bare' -o -name '*.so' \ + -o -name '*.dylib' -o -name '*.dll' -o -name '*.exe' \) -exec \ + ${SH} -c 'for f do \ + case "$$(${FILE} -b "$$f")" in \ + *ELF*FreeBSD*) ${STRIP_CMD} "$$f";; \ + *ELF*|*Mach-O*|*PE32*) ${RM} "$$f";; \ + esac; \ + done' sh {} + + ${FIND} -s ${STAGEDIR}${WWWDIR} -depth -type d -empty -delete + ${FIND} -s \ + ${STAGEDIR}${WWWDIR} \ + -not \ + -type \ + d | \ + ${SORT} | \ + ${SED} -e 's#^${STAGEDIR}${PREFIX}/##' \ + >> \ + ${TMPPLIST} + +# 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 -Phv --chmod=F0644 ${WRKDIR}/${_NPM_CACHE_TARBALL} freefall.freebsd.org:public_distfiles/${PORTNAME}/ + +.include diff --git a/net-mgmt/uptime-kuma/distinfo b/net-mgmt/uptime-kuma/distinfo new file mode 100644 index 000000000000..84e4f4784616 --- /dev/null +++ b/net-mgmt/uptime-kuma/distinfo @@ -0,0 +1,7 @@ +TIMESTAMP = 1783331489 +SHA256 (uptime-kuma/uptime-kuma-npm-cache-2.4.0.tar.gz) = dab69365670e8bbd9968983f43bf6f0cb0af171a1c62c437cbfb8a7f15b55c85 +SIZE (uptime-kuma/uptime-kuma-npm-cache-2.4.0.tar.gz) = 88195474 +SHA256 (uptime-kuma/dist.tar.gz) = 015ebb4df74b72bd8c303bdc41b71e2de8bdc72862ddc2d65db69a92316df835 +SIZE (uptime-kuma/dist.tar.gz) = 7059039 +SHA256 (uptime-kuma/louislam-uptime-kuma-2.4.0_GH0.tar.gz) = 0ad39c4cbe2de5a2dd4869d02a8a4f0398b7b16217b0aeaff98d78cf37500c42 +SIZE (uptime-kuma/louislam-uptime-kuma-2.4.0_GH0.tar.gz) = 2076193 diff --git a/net-mgmt/uptime-kuma/files/patch-server_uptime-kuma-server.js b/net-mgmt/uptime-kuma/files/patch-server_uptime-kuma-server.js new file mode 100644 index 000000000000..f7bb610b4e98 --- /dev/null +++ b/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) { diff --git a/net-mgmt/uptime-kuma/files/uptimekuma.in b/net-mgmt/uptime-kuma/files/uptimekuma.in new file mode 100644 index 000000000000..975932354d6b --- /dev/null +++ b/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" diff --git a/net-mgmt/uptime-kuma/pkg-descr b/net-mgmt/uptime-kuma/pkg-descr new file mode 100644 index 000000000000..28412c242890 --- /dev/null +++ b/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 diff --git a/net-mgmt/uptime-kuma/pkg-message b/net-mgmt/uptime-kuma/pkg-message new file mode 100644 index 000000000000..893651ad12ea --- /dev/null +++ b/net-mgmt/uptime-kuma/pkg-message @@ -0,0 +1,18 @@ +[ +{ type: install + message: <