Simplify goatcounter + use js integration
parent
c78f4efc98
commit
a08755200f
|
@ -1,21 +1,17 @@
|
||||||
FROM debian:bookworm-slim
|
FROM alpine:latest
|
||||||
|
|
||||||
WORKDIR /goatcounter
|
WORKDIR /goatcounter
|
||||||
|
|
||||||
ENV GOATCOUNTER_VERSION 'v2.2.3'
|
ENV GOATCOUNTER_VERSION 'v2.2.3'
|
||||||
ENV GOATCOUNTER_TAG 'dev'
|
ENV GOATCOUNTER_TAG 'dev'
|
||||||
ENV GOATCOUNTER_LISTEN '0.0.0.0:8080'
|
|
||||||
ENV GOATCOUNTER_DB 'sqlite+/data/goatcounter.sqlite3'
|
|
||||||
ENV GOATCOUNTER_SMTP ''
|
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apk add --no-cache ca-certificates wget bash \
|
||||||
&& apt-get install -y ca-certificates ncat wget \
|
|
||||||
&& update-ca-certificates --fresh
|
&& update-ca-certificates --fresh
|
||||||
|
|
||||||
RUN wget "https://github.com/zgoat/goatcounter/releases/download/$GOATCOUNTER_VERSION/goatcounter-$GOATCOUNTER_TAG-linux-amd64.gz" \
|
RUN wget "https://github.com/arp242/goatcounter/releases/download/$GOATCOUNTER_VERSION/goatcounter-$GOATCOUNTER_TAG-linux-amd64.gz" \
|
||||||
&& gzip -d "goatcounter-$GOATCOUNTER_TAG-linux-amd64.gz" \
|
&& gzip -d "goatcounter-$GOATCOUNTER_TAG-linux-amd64.gz" \
|
||||||
&& mv "goatcounter-$GOATCOUNTER_TAG-linux-amd64" /usr/bin/goatcounter \
|
&& mv "goatcounter-$GOATCOUNTER_TAG-linux-amd64" /usr/local/bin/goatcounter \
|
||||||
&& chmod +x /usr/bin/goatcounter
|
&& chmod +x /usr/local/bin/goatcounter
|
||||||
|
|
||||||
COPY goatcounter.sh ./
|
COPY goatcounter.sh ./
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
|
|
@ -5,6 +5,7 @@ set -eu
|
||||||
create_site ()
|
create_site ()
|
||||||
{
|
{
|
||||||
goatcounter db create site \
|
goatcounter db create site \
|
||||||
|
-createdb \
|
||||||
-vhost "$GOATCOUNTER_DOMAIN" \
|
-vhost "$GOATCOUNTER_DOMAIN" \
|
||||||
-user.email "$GOATCOUNTER_EMAIL" \
|
-user.email "$GOATCOUNTER_EMAIL" \
|
||||||
-password "$GOATCOUNTER_PASSWORD" \
|
-password "$GOATCOUNTER_PASSWORD" \
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
# fly.toml file generated for goatcounter-mat-services on 2022-08-27T22:27:36-04:00
|
# fly.toml file generated for goatcounter-mat-services on 2022-09-03T21:18:21-04:00
|
||||||
|
|
||||||
app = "goatcounter-mat-services"
|
app = "goatcounter-mat-services"
|
||||||
kill_signal = "SIGINT"
|
kill_signal = "SIGINT"
|
||||||
kill_timeout = 5
|
kill_timeout = 5
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
|
GOATCOUNTER_DB = "sqlite+/data/goatcounter.sqlite3"
|
||||||
|
GOATCOUNTER_DEBUG = ""
|
||||||
GOATCOUNTER_DOMAIN = "stats.mat.services"
|
GOATCOUNTER_DOMAIN = "stats.mat.services"
|
||||||
GOATCOUNTER_EMAIL = "mat@mat.services"
|
GOATCOUNTER_EMAIL = "mat@mat.services"
|
||||||
LOG_SOURCE_HOST = "static-mat-services.internal"
|
GOATCOUNTER_LISTEN = "0.0.0.0:8080"
|
||||||
LOG_SOURCE_PORT = "514"
|
GOATCOUNTER_SMTP = ""
|
||||||
|
|
||||||
[experimental]
|
[experimental]
|
||||||
allowed_public_ports = []
|
allowed_public_ports = []
|
||||||
|
|
|
@ -18,11 +18,4 @@ if [ -n "$GOATCOUNTER_DEBUG" ]; then
|
||||||
OPTS="$OPTS -debug all"
|
OPTS="$OPTS -debug all"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ncat -l 9090 > /data/caddy.log &
|
goatcounter serve $OPTS
|
||||||
goatcounter import \
|
|
||||||
-site=$GOATCOUNTER_DOMAIN \
|
|
||||||
-follow \
|
|
||||||
-format=combined \
|
|
||||||
/data/caddy.log &
|
|
||||||
|
|
||||||
goatcounter serve $OPTS
|
|
||||||
|
|
|
@ -20,10 +20,6 @@ http://static-mat-services.fly.dev {
|
||||||
file_server
|
file_server
|
||||||
}
|
}
|
||||||
|
|
||||||
log {
|
|
||||||
output stdout
|
|
||||||
}
|
|
||||||
|
|
||||||
header {
|
header {
|
||||||
# disable FLoC tracking
|
# disable FLoC tracking
|
||||||
Permissions-Policy interest-cohort=()
|
Permissions-Policy interest-cohort=()
|
||||||
|
@ -40,15 +36,19 @@ http://static-mat-services.fly.dev {
|
||||||
# style-src 'unsafe-inline': syntax highlighting in codefences
|
# style-src 'unsafe-inline': syntax highlighting in codefences
|
||||||
# sandbox allow-popups: enable target="_blank" links to open in new tabs
|
# sandbox allow-popups: enable target="_blank" links to open in new tabs
|
||||||
Content-Security-Policy "default-src 'none';
|
Content-Security-Policy "default-src 'none';
|
||||||
img-src 'self';
|
img-src 'self' https://stats.mat.services;
|
||||||
style-src 'self' 'unsafe-inline';
|
style-src 'self' 'unsafe-inline';
|
||||||
font-src 'self';
|
font-src 'self';
|
||||||
script-src 'self';
|
script-src 'self' https://stats.mat.services;
|
||||||
form-action 'none';
|
form-action 'none';
|
||||||
frame-ancestors 'none';
|
frame-ancestors 'none';
|
||||||
base-uri 'none';
|
base-uri 'none';
|
||||||
upgrade-insecure-requests;
|
upgrade-insecure-requests;
|
||||||
sandbox allow-same-origin allow-popups allow-popups-to-escape-sandbox"
|
sandbox
|
||||||
|
allow-same-origin
|
||||||
|
allow-scripts
|
||||||
|
allow-popups
|
||||||
|
allow-popups-to-escape-sandbox"
|
||||||
}
|
}
|
||||||
|
|
||||||
# caching
|
# caching
|
||||||
|
|
Loading…
Reference in New Issue