Skip to content

Commit

Permalink
mostly working
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Dec 11, 2024
1 parent 67e799b commit 3f10591
Show file tree
Hide file tree
Showing 5 changed files with 422 additions and 62 deletions.
44 changes: 13 additions & 31 deletions caddy/Caddyfile.pgs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,23 @@
metrics
trusted_proxies static 0.0.0.0/0
}
cache {
ttl 300s
max_cacheable_body_bytes 1000000
otter
api {
souin
}

# custom domains
:443 {
reverse_proxy web:3000
log {
format append {
server_id {$APP_DOMAIN}
}
}
tls {$APP_EMAIL} {
on_demand
}
encode zstd gzip
}

# subdomains and root pgs domain
*.{$APP_DOMAIN}, {$APP_DOMAIN} {
reverse_proxy web:3000
log {
Expand All @@ -29,18 +36,6 @@
dns cloudflare {$CF_API_TOKEN}
resolvers 1.1.1.1
}
route {
@souinApi path /souin-api/*
basic_auth @souinApi {
cacheuser $2a$14$NuCZqIy/NGKEmK89bNSKseBidpwPK4HiD4rqgnLftUHpWVAfV4xGO
}
cache {
regex {
exclude /check
}
}
reverse_proxy web:3000
}

encode zstd gzip

Expand Down Expand Up @@ -117,16 +112,3 @@ monitoring.{$MONITORING_APP_DOMAIN}, prometheus.{$MONITORING_APP_DOMAIN}, grafan
disable_openmetrics
}
}

:443 {
reverse_proxy web:3000
log {
format append {
server_id {$APP_DOMAIN}
}
}
tls {$APP_EMAIL} {
on_demand
}
encode zstd gzip
}
4 changes: 1 addition & 3 deletions caddy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ ARG TARGETARCH
ENV GOOS=${TARGETOS} GOARCH=${TARGETARCH}

RUN xcaddy build \
--with github.com/caddy-dns/cloudflare \
--with github.com/darkweak/souin/plugins/[email protected] \
--with github.com/darkweak/storages/otter/caddy
--with github.com/caddy-dns/cloudflare

FROM caddy:alpine

Expand Down
62 changes: 58 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ go 1.23.1

// replace github.com/picosh/utils => ../utils

// replace github.com/darkweak/souin => /home/erock/src/souin
replace github.com/darkweak/souin => /home/erock/src/souin

replace github.com/darkweak/souin/plugins/souin/storages => /home/erock/src/souin/plugins/souin/storages

// replace github.com/darkweak/storages/otter => /home/erock/src/storages/otter

Expand All @@ -33,9 +35,7 @@ require (
github.com/charmbracelet/ssh v0.0.0-20240725163421-eb71b85b27aa
github.com/charmbracelet/wish v1.4.3
github.com/darkweak/souin v1.7.6-0.20241208130618-0e1579f1adc7
github.com/darkweak/souin/plugins/souin v1.7.5
github.com/darkweak/storages/core v0.0.11
github.com/darkweak/storages/otter v0.0.11
github.com/darkweak/souin/plugins/souin/storages v1.7.5
github.com/gkampitakis/go-snaps v0.5.7
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
Expand Down Expand Up @@ -66,6 +66,7 @@ require (
)

require (
dario.cat/mergo v1.0.0 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
git.sr.ht/~emersion/go-scfg v0.0.0-20240128091534-2ae16e782082 // indirect
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 // indirect
Expand All @@ -75,9 +76,13 @@ require (
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/PuerkitoBio/goquery v1.10.0 // indirect
github.com/RoaringBitmap/roaring v1.2.3 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
github.com/antlabs/stl v0.0.1 // indirect
github.com/antlabs/timer v0.0.11 // indirect
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/aryann/difflib v0.0.0-20210328193216-ff5ff6dc229b // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aws/aws-sdk-go-v2 v1.32.4 // indirect
Expand All @@ -102,6 +107,10 @@ require (
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.5.0 // indirect
github.com/buraksezer/consistent v0.10.0 // indirect
github.com/buraksezer/olric v0.5.6 // indirect
github.com/bwmarrin/snowflake v0.3.0 // indirect
github.com/caddyserver/caddy/v2 v2.8.4 // indirect
github.com/caddyserver/certmagic v0.21.3 // indirect
github.com/caddyserver/zerossl v0.1.3 // indirect
Expand All @@ -116,15 +125,28 @@ require (
github.com/charmbracelet/x/term v0.2.1 // indirect
github.com/charmbracelet/x/termios v0.1.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/creack/pty v1.1.24 // indirect
github.com/darkweak/go-esi v0.0.5 // indirect
github.com/darkweak/storages/badger v0.0.8 // indirect
github.com/darkweak/storages/core v0.0.11 // indirect
github.com/darkweak/storages/etcd v0.0.8 // indirect
github.com/darkweak/storages/nats v0.0.8 // indirect
github.com/darkweak/storages/nuts v0.0.8 // indirect
github.com/darkweak/storages/olric v0.0.8 // indirect
github.com/darkweak/storages/otter v0.0.11 // indirect
github.com/darkweak/storages/redis v0.0.8 // indirect
github.com/darkweak/storages/simplefs v0.0.11 // indirect
github.com/delthas/go-libnp v0.0.0-20221222161248-0e45ece1f878 // indirect
github.com/delthas/go-localeinfo v0.0.0-20240813094314-e5413e186769 // indirect
github.com/dgraph-io/badger v1.6.2 // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/badger/v3 v3.2103.5 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/dolthub/maphash v0.1.0 // indirect
github.com/dsoprea/go-exif v0.0.0-20230826092837-6579e82b732d // indirect
Expand All @@ -149,20 +171,34 @@ require (
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-redis/redis/v8 v8.11.5 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
github.com/golang/geo v0.0.0-20230421003525-6adc56603217 // indirect
github.com/golang/glog v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/cel-go v0.20.1 // indirect
github.com/google/flatbuffers v23.1.21+incompatible // indirect
github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/gorilla/css v1.0.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-msgpack v0.5.5 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.6.0 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/memberlist v0.5.0 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand All @@ -174,6 +210,7 @@ require (
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgtype v1.14.0 // indirect
github.com/jackc/pgx/v4 v4.18.3 // indirect
github.com/jellydator/ttlcache/v3 v3.3.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
Expand Down Expand Up @@ -204,10 +241,15 @@ require (
github.com/mmcloughlin/md4 v0.1.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nats-io/nats.go v1.36.0 // indirect
github.com/nats-io/nkeys v0.4.7 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/neurosnap/go-jpeg-image-structure v0.0.0-20221010133817-70b1c1ff679e // indirect
github.com/nutsdb/nutsdb v1.0.4 // indirect
github.com/onsi/ginkgo/v2 v2.15.0 // indirect
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect
github.com/picosh/go-rsync-receiver v0.0.0-20240709135253-1daf4b12a9fc // indirect
Expand All @@ -224,11 +266,13 @@ require (
github.com/prometheus/prometheus v0.300.0 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/quic-go v0.44.0 // indirect
github.com/redis/rueidis v1.0.39 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/safchain/ethtool v0.4.1 // indirect
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
github.com/secure-io/sio-go v0.3.1 // indirect
github.com/sendgrid/rest v2.6.9+incompatible // indirect
github.com/shirou/gopsutil/v3 v3.24.5 // indirect
Expand All @@ -246,19 +290,29 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/tailscale/tscert v0.0.0-20240517230440-bbccfbf48933 // indirect
github.com/tidwall/btree v1.6.0 // indirect
github.com/tidwall/gjson v1.17.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/redcon v1.6.2 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
github.com/tinylib/msgp v1.2.4 // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.9.0 // indirect
github.com/urfave/cli v1.22.14 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/xujiajun/mmap-go v1.0.1 // indirect
github.com/xujiajun/utils v0.0.0-20220904132955-5f7c5b914235 // indirect
github.com/yuin/goldmark-emoji v1.0.4 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
github.com/zeebo/blake3 v0.2.3 // indirect
go.etcd.io/bbolt v1.3.9 // indirect
go.etcd.io/etcd/api/v3 v3.5.14 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect
go.etcd.io/etcd/client/v3 v3.5.14 // indirect
go.opencensus.io v0.24.0 // indirect
go.step.sm/cli-utils v0.9.0 // indirect
go.step.sm/crypto v0.45.0 // indirect
go.step.sm/linkedca v0.20.1 // indirect
Expand Down
Loading

0 comments on commit 3f10591

Please sign in to comment.