diff --git a/Makefile b/Makefile index 3213e780..ccca4fdf 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,7 @@ deps: assets: PATH:=$(PWD)/node_modules/.bin:$(PATH) assets: deps - $(GO) generate ./... - ./web/build.sh - ./xess/build.sh + $(NPM) run assets build: assets $(GO) build -o ./var/anubis ./cmd/anubis diff --git a/go.mod b/go.mod index ac48abd9..bf068299 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/TecharoHQ/anubis -go 1.24.2 +go 1.25.0 require ( github.com/TecharoHQ/thoth-proto v0.5.0 @@ -50,7 +50,7 @@ require ( github.com/Microsoft/go-winio v0.6.2 // indirect github.com/ProtonMail/go-crypto v1.3.0 // indirect github.com/Songmu/gitconfig v0.2.1 // indirect - github.com/TecharoHQ/yeet v0.6.3 // indirect + github.com/TecharoHQ/yeet v0.5.0 // indirect github.com/a-h/parse v0.0.0-20250122154542-74294addb73e // indirect github.com/andybalholm/brotli v1.2.0 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect @@ -188,9 +188,9 @@ require ( golang.org/x/mod v0.31.0 // indirect golang.org/x/oauth2 v0.32.0 // indirect golang.org/x/sync v0.19.0 // indirect - golang.org/x/sys v0.39.0 // indirect + golang.org/x/sys v0.42.0 // indirect golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc // indirect - golang.org/x/term v0.38.0 // indirect + golang.org/x/term v0.40.0 // indirect golang.org/x/tools v0.40.0 // indirect golang.org/x/vuln v1.1.4 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251213004720-97cd9d5aeac2 // indirect @@ -198,7 +198,7 @@ require ( google.golang.org/protobuf v1.36.11 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect honnef.co/go/tools v0.6.1 // indirect - mvdan.cc/sh/v3 v3.12.0 // indirect + mvdan.cc/sh/v3 v3.13.0 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect ) @@ -212,4 +212,5 @@ tool ( golang.org/x/tools/cmd/stringer golang.org/x/vuln/cmd/govulncheck honnef.co/go/tools/cmd/staticcheck + mvdan.cc/sh/v3/cmd/gosh ) diff --git a/go.sum b/go.sum index e8a4615b..2da90150 100644 --- a/go.sum +++ b/go.sum @@ -31,14 +31,12 @@ github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f h1:tCbYj7/299ek github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f/go.mod h1:gcr0kNtGBqin9zDW9GOHcVntrwnjrK+qdJ06mWYBybw= github.com/ProtonMail/gopenpgp/v2 v2.7.1 h1:Awsg7MPc2gD3I7IFac2qE3Gdls0lZW8SzrFZ3k1oz0s= github.com/ProtonMail/gopenpgp/v2 v2.7.1/go.mod h1:/BU5gfAVwqyd8EfC3Eu7zmuhwYQpKs+cGD8M//iiaxs= -github.com/ProtonMail/gopenpgp/v3 v3.3.0 h1:N6rHCH5PWwB6zSRMgRj1EbAMQHUAAHxH3Oo4KibsPwY= -github.com/ProtonMail/gopenpgp/v3 v3.3.0/go.mod h1:J+iNPt0/5EO9wRt7Eit9dRUlzyu3hiGX3zId6iuaKOk= github.com/Songmu/gitconfig v0.2.1 h1:cZsqELfMtxWVI8ovq17gbvsR4qLfoYLAiXy5GwtJWbk= github.com/Songmu/gitconfig v0.2.1/go.mod h1:XM4O3SoXFnli9Ql2G7qXK2Fg7LJwf7Hs8GLFEOJlzmM= github.com/TecharoHQ/thoth-proto v0.5.0 h1:Fa663s4soYiURSU8MfW9tZ2wF+LsCRSaYmjUSyagfBM= github.com/TecharoHQ/thoth-proto v0.5.0/go.mod h1:C/U7FqTxpVn4V/qebC/GcW32I0h9xzsmWehF27KFOJs= -github.com/TecharoHQ/yeet v0.6.3 h1:Iev6TYt/tpFYU73kbkNIYjCObYTvlihtby+htGF4Us8= -github.com/TecharoHQ/yeet v0.6.3/go.mod h1:ltt+PWPjnvmQJxEHsdJ5K9u3GoWK83vSLWCCp8XbxqI= +github.com/TecharoHQ/yeet v0.5.0 h1:6zL/9q0cnAI/79VA7fggcxDowzPA6D76I7+rvDLHNlM= +github.com/TecharoHQ/yeet v0.5.0/go.mod h1:qjWkZGADLgzB+bdm8W1GhdSBbwxVskdrvXssKraTSwQ= github.com/a-h/parse v0.0.0-20250122154542-74294addb73e h1:HjVbSQHy+dnlS6C3XajZ69NYAb5jbGNfHanvm1+iYlo= github.com/a-h/parse v0.0.0-20250122154542-74294addb73e/go.mod h1:3mnrkvGpurZ4ZrTDbYU84xhwXW2TjTKShSwjRi2ihfQ= github.com/a-h/templ v0.3.960 h1:trshEpGa8clF5cdI39iY4ZrZG8Z/QixyzEyUnA7feTM= @@ -495,8 +493,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= -golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= +golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc h1:bH6xUXay0AIFMElXG2rQ4uiE+7ncwtiOdPfYK1NK2XA= golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc/go.mod h1:hKdjCMrbv9skySur+Nek8Hd0uJ0GuxJIoIX2payrIdQ= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -504,8 +502,8 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q= -golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg= +golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= +golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -559,8 +557,8 @@ honnef.co/go/tools v0.6.1 h1:R094WgE8K4JirYjBaOpz/AvTyUu/3wbmAoskKN/pxTI= honnef.co/go/tools v0.6.1/go.mod h1:3puzxxljPCe8RGJX7BIy1plGbxEOZni5mR2aXe3/uk4= k8s.io/apimachinery v0.34.3 h1:/TB+SFEiQvN9HPldtlWOTp0hWbJ+fjU+wkxysf/aQnE= k8s.io/apimachinery v0.34.3/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw= -mvdan.cc/sh/v3 v3.12.0 h1:ejKUR7ONP5bb+UGHGEG/k9V5+pRVIyD+LsZz7o8KHrI= -mvdan.cc/sh/v3 v3.12.0/go.mod h1:Se6Cj17eYSn+sNooLZiEUnNNmNxg0imoYlTu4CyaGyg= +mvdan.cc/sh/v3 v3.13.0 h1:dSfq/MVsY4w0Vsi6Lbs0IcQquMVqLdKLESAOZjuHdLg= +mvdan.cc/sh/v3 v3.13.0/go.mod h1:KV1GByGPc/Ho0X1E6Uz9euhsIQEj4hwyKnodLlFLoDM= pault.ag/go/debian v0.18.0 h1:nr0iiyOU5QlG1VPnhZLNhnCcHx58kukvBJp+dvaM6CQ= pault.ag/go/debian v0.18.0/go.mod h1:JFl0XWRCv9hWBrB5MDDZjA5GSEs1X3zcFK/9kCNIUmE= pault.ag/go/topsort v0.1.1 h1:L0QnhUly6LmTv0e3DEzbN2q6/FGgAcQvaEw65S53Bg4= diff --git a/lib/challenge/preact/build.sh b/lib/challenge/preact/build.sh index ebd6d596..1e9f4853 100755 --- a/lib/challenge/preact/build.sh +++ b/lib/challenge/preact/build.sh @@ -8,7 +8,7 @@ LICENSE='/* @licstart The following is the entire license notice for the JavaScript code in this page. -Copyright (c) 2025 Xe Iaso +Copyright (c) 2026 Xe Iaso Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -41,9 +41,9 @@ for the JavaScript code in this page. mkdir -p static/js for file in js/*.tsx; do - filename="${file##*/}" # Extracts "app.jsx" from "./js/app.jsx" - output="${filename%.tsx}.js" # Changes "app.jsx" to "app.js" - echo $output + filename="${file##*/}" # Extracts "app.jsx" from "./js/app.jsx" + output="${filename%.tsx}.js" # Changes "app.jsx" to "app.js" + echo $output - esbuild "${file}" --minify --bundle --outfile=static/"${output}" --banner:js="${LICENSE}" -done \ No newline at end of file + esbuild "${file}" --minify --bundle --outfile=static/"${output}" --banner:js="${LICENSE}" +done diff --git a/lib/challenge/preact/preact.go b/lib/challenge/preact/preact.go index e39cd4d8..5201d921 100644 --- a/lib/challenge/preact/preact.go +++ b/lib/challenge/preact/preact.go @@ -17,7 +17,7 @@ import ( "github.com/a-h/templ" ) -//go:generate ./build.sh +//go:generate go tool gosh ./build.sh //go:generate go tool github.com/a-h/templ/cmd/templ generate //go:embed static/app.js diff --git a/package.json b/package.json index cdd08d27..ef494de9 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "test:integration": "npm run assets && go test -v ./internal/test", "test:integration:podman": "npm run assets && go test -v ./internal/test --playwright-runner=podman", "test:integration:docker": "npm run assets && go test -v ./internal/test --playwright-runner=docker", - "assets": "go generate ./... && ./web/build.sh && ./xess/build.sh", + "assets": "go generate ./...", "build": "npm run assets && go build -o ./var/anubis ./cmd/anubis", "dev": "npm run assets && go run ./cmd/anubis --use-remote-address --target http://localhost:3000", "container": "npm run assets && go run ./cmd/containerbuild", diff --git a/test/go.mod b/test/go.mod index c7f4db16..52786682 100644 --- a/test/go.mod +++ b/test/go.mod @@ -1,6 +1,6 @@ module github.com/TecharoHQ/anubis/test -go 1.24.5 +go 1.25.0 replace github.com/TecharoHQ/anubis => .. @@ -90,7 +90,7 @@ require ( go.yaml.in/yaml/v2 v2.4.3 // indirect golang.org/x/exp v0.0.0-20251209150349-8475f28825e9 // indirect golang.org/x/net v0.48.0 // indirect - golang.org/x/sys v0.39.0 // indirect + golang.org/x/sys v0.42.0 // indirect golang.org/x/text v0.32.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251213004720-97cd9d5aeac2 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251213004720-97cd9d5aeac2 // indirect diff --git a/test/go.sum b/test/go.sum index bbaf2b80..9777dba6 100644 --- a/test/go.sum +++ b/test/go.sum @@ -261,8 +261,8 @@ golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= -golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= +golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= diff --git a/web/build.sh b/web/build.sh index d0818e0c..85683896 100755 --- a/web/build.sh +++ b/web/build.sh @@ -8,7 +8,7 @@ LICENSE='/* @licstart The following is the entire license notice for the JavaScript code in this page. -Copyright (c) 2025 Xe Iaso +Copyright (c) 2026 Xe Iaso Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -42,15 +42,15 @@ cp ../lib/localization/locales/*.json static/locales/ shopt -s nullglob globstar for file in js/**/*.ts js/**/*.mjs; do - out="static/${file}" - if [[ "$file" == *.ts ]]; then - out="static/${file%.ts}.mjs" - fi + out="static/${file}" + if [[ "$file" == *.ts ]]; then + out="static/${file%.ts}.mjs" + fi - mkdir -p "$(dirname "$out")" + mkdir -p "$(dirname "$out")" - esbuild "$file" --sourcemap --bundle --minify --outfile="$out" --banner:js="$LICENSE" - gzip -f -k -n "$out" - zstd -f -k --ultra -22 "$out" - brotli -fZk "$out" + esbuild "$file" --sourcemap --bundle --minify --outfile="$out" --banner:js="$LICENSE" + gzip -f -k -n "$out" + zstd -f -k --ultra -22 "$out" + brotli -fZk "$out" done diff --git a/web/embed.go b/web/embed.go index e572e350..8502b3f2 100644 --- a/web/embed.go +++ b/web/embed.go @@ -3,6 +3,7 @@ package web import "embed" //go:generate go tool github.com/a-h/templ/cmd/templ generate +//go:generate go tool gosh ./build.sh var ( //go:embed static diff --git a/xess/xess.go b/xess/xess.go index a391c633..585b7f99 100644 --- a/xess/xess.go +++ b/xess/xess.go @@ -12,6 +12,8 @@ import ( "github.com/TecharoHQ/anubis/internal" ) +//go:generate go tool gosh ./build.sh + var ( //go:embed *.css static Static embed.FS