diff options
Diffstat (limited to 'awstats/build.sh')
-rwxr-xr-x | awstats/build.sh | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/awstats/build.sh b/awstats/build.sh deleted file mode 100755 index 816ae3b..0000000 --- a/awstats/build.sh +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -euo pipefail | ||
4 | |||
5 | # Validate environment variables | ||
6 | [ -z "$SITE_DOMAIN" ] && { echo "SITE_DOMAIN env variable required"; exit 1; } | ||
7 | [ -z "$SITE_ALIASES" ] && { echo "SITE_DOMAIN env variable required"; exit 1; } | ||
8 | [ -z "$GEOIP_LICENSE_KEY" ] && { echo "GEOIP_LICENSE_KEY env variable required"; exit 1; } | ||
9 | |||
10 | # Create the config template | ||
11 | cat > /etc/awstats/awstats.${SITE_DOMAIN}.conf <<EOF | ||
12 | LogFile="/input/${SITE_DOMAIN}.log" | ||
13 | DirData="/output" | ||
14 | LogFormat = "%virtualname %host - %other %time1 %methodurl %code %bytesd %refererquot %uaquot" | ||
15 | SiteDomain="${SITE_DOMAIN}" | ||
16 | HostAliases="${SITE_DOMAIN} ${SITE_ALIASES}" | ||
17 | #ShowScreenSizeStats=1 | ||
18 | DefaultFile="index.html default.html" | ||
19 | AllowFullYearView=3 | ||
20 | |||
21 | LoadPlugin="ipv6" | ||
22 | # Should be enabled for build only | ||
23 | LoadPlugin="geoip2 /geoip/GeoLite2-Country.mmdb" | ||
24 | LoadPlugin="geoip2_city /geoip/GeoLite2-City.mmdb" | ||
25 | |||
26 | #ExtraSectionName1="Redirected Hit" | ||
27 | #ExtraSectionCodeFilter1="302" | ||
28 | #ExtraSectionCondition1="URL,\/offsite" | ||
29 | #ExtraSectionFirstColumnTitle1="Url" | ||
30 | #ExtraSectionFirstColumnValues1="QUERY_STRING,url=([^&]+)" | ||
31 | #ExtraSectionStatTypes1=HL | ||
32 | #MaxNbOfExtra1=500 | ||
33 | #MinHitExtra1=1 | ||
34 | #ExtraSectionAddSumRow1=1 | ||
35 | EOF | ||
36 | |||
37 | # Download and setup GeoIP Databases | ||
38 | curl -s "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN&suffix=tar.gz&license_key=${GEOIP_LICENSE_KEY}" | tar -xz -C /tmp | ||
39 | curl -s "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&suffix=tar.gz&license_key=${GEOIP_LICENSE_KEY}" | tar -xz -C /tmp | ||
40 | curl -s "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&suffix=tar.gz&license_key=${GEOIP_LICENSE_KEY}" | tar -xz -C /tmp | ||
41 | |||
42 | find /tmp -name '*.mmdb' -exec cp '{}' /geoip/ \; | ||
43 | rm -rf /tmp/GeoLite2* | ||
44 | |||
45 | /opt/awstats/wwwroot/cgi-bin/awstats.pl -config=${SITE_DOMAIN} -update -dir=/output | ||