mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-18 16:58:27 -04:00
Build goaccess from source
This commit is contained in:
+27
@@ -1,6 +1,33 @@
|
|||||||
|
FROM ghcr.io/linuxserver/baseimage-alpine:3.15 as build-stage
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** install packages ****" && \
|
||||||
|
apk add -U --update --no-cache --virtual=build-dependencies \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
build-base \
|
||||||
|
git \
|
||||||
|
glib-dev \
|
||||||
|
libmaxminddb-dev \
|
||||||
|
ncurses-dev && \
|
||||||
|
mkdir -p /build && \
|
||||||
|
mkdir -p /goaccess && \
|
||||||
|
echo "**** build goaccess ****" && \
|
||||||
|
git clone --shallow-submodules --recurse-submodules https://github.com/allinurl/goaccess.git /goaccess && cd /goaccess && \
|
||||||
|
autoreconf -fiv && \
|
||||||
|
./configure --enable-utf8 --enable-geoip=mmdb && \
|
||||||
|
make DESTDIR="/build" install && \
|
||||||
|
echo "**** cleanup ****" && \
|
||||||
|
apk del --purge \
|
||||||
|
build-dependencies && \
|
||||||
|
rm -rf \
|
||||||
|
/goaccess/* \
|
||||||
|
/tmp/*
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
||||||
LABEL maintainer="quietsy"
|
LABEL maintainer="quietsy"
|
||||||
|
|
||||||
# copy local files
|
# copy local files
|
||||||
COPY root/ /
|
COPY root/ /
|
||||||
|
COPY --from=build-stage /build/ /
|
||||||
|
|||||||
@@ -174,7 +174,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$geodb = file_exists('/config/geoip2db/GeoLite2-City.mmdb') ? '--geoip-database=/config/geoip2db/GeoLite2-City.mmdb' : '';
|
$geodb = file_exists('/config/geoip2db/GeoLite2-City.mmdb') ? '--geoip-database=/config/geoip2db/GeoLite2-City.mmdb' : '';
|
||||||
$goaccess = shell_exec("goaccess -a -o html --config-file=/dashboard/goaccess.conf ".$geodb);
|
$goaccess = shell_exec("/usr/local/bin/goaccess -a -o html --config-file=/dashboard/goaccess.conf ".$geodb);
|
||||||
$status = GetHeader() . GetProxies() . GetF2B() . GetAnnouncements() . GetLinks() . '<div class="wrap-general">';
|
$status = GetHeader() . GetProxies() . GetF2B() . GetAnnouncements() . GetLinks() . '<div class="wrap-general">';
|
||||||
$page = str_replace("<div class='wrap-general'>", $status, $goaccess);
|
$page = str_replace("<div class='wrap-general'>", $status, $goaccess);
|
||||||
$page = str_replace("<title>Server Statistics", "<title>SWAG Dashboard", $page);
|
$page = str_replace("<title>Server Statistics", "<title>SWAG Dashboard", $page);
|
||||||
|
|||||||
@@ -2,12 +2,17 @@
|
|||||||
|
|
||||||
echo "Applying the SWAG dashboard mod..."
|
echo "Applying the SWAG dashboard mod..."
|
||||||
|
|
||||||
apk add --no-cache --upgrade goaccess
|
apk add libmaxminddb
|
||||||
|
cp -f /dashboard/dashboard.subdomain.conf.sample /config/nginx/proxy-confs/dashboard.subdomain.conf.sample
|
||||||
if [ ! -f /config/nginx/proxy-confs/dashboard.subdomain.conf ]; then
|
if [ ! -f /config/nginx/proxy-confs/dashboard.subdomain.conf ]; then
|
||||||
cp /dashboard/dashboard.subdomain.conf.sample /config/nginx/proxy-confs/dashboard.subdomain.conf
|
cp /dashboard/dashboard.subdomain.conf.sample /config/nginx/proxy-confs/dashboard.subdomain.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$(sed -nE 's|## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' /dashboard/dashboard.subdomain.conf.sample)" != "$(sed -nE 's|## Version ([0-9]{4}\/[0-9]{2}\/[0-9]{2}).*|\1|p' /config/nginx/proxy-confs/dashboard.subdomain.conf)" ]; then
|
||||||
|
echo "**** The swag-dashboard conf has been updated ****"
|
||||||
|
echo "**** Compare the changes using the sample file: /config/nginx/proxy-confs/dashboard.subdomain.conf.sample"
|
||||||
|
fi
|
||||||
|
|
||||||
# permissions
|
# permissions
|
||||||
chown -R abc:abc \
|
chown -R abc:abc \
|
||||||
/dashboard \
|
/dashboard \
|
||||||
|
|||||||
Reference in New Issue
Block a user