diff options
| author | Xe Iaso <me@xeiaso.net> | 2025-03-29 15:00:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-29 15:00:22 -0400 |
| commit | 52ca5390c2b54374e62cbcd2efaf78edaa4e7249 (patch) | |
| tree | e40c639e99e501bdb91acdc1750d7d16e36cc655 /cmd | |
| parent | 6b2ae30baef6cdc1796a5ec5495c11686aaca50e (diff) | |
| download | anubis-52ca5390c2b54374e62cbcd2efaf78edaa4e7249.tar.xz anubis-52ca5390c2b54374e62cbcd2efaf78edaa4e7249.zip | |
Add staticheck to CI (#152)
* Add staticheck to CI
Signed-off-by: Xe Iaso <me@xeiaso.net>
* fix staticcheck warnings
Signed-off-by: Xe Iaso <me@xeiaso.net>
* oh, right, playwright is broken
Signed-off-by: Xe Iaso <me@xeiaso.net>
---------
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/anubis/main.go | 23 | ||||
| -rw-r--r-- | cmd/containerbuild/main.go | 6 |
2 files changed, 0 insertions, 29 deletions
diff --git a/cmd/anubis/main.go b/cmd/anubis/main.go index b634676..a7e7350 100644 --- a/cmd/anubis/main.go +++ b/cmd/anubis/main.go @@ -16,7 +16,6 @@ import ( "os" "os/signal" "strconv" - "strings" "sync" "syscall" "time" @@ -25,7 +24,6 @@ import ( "github.com/TecharoHQ/anubis/internal" libanubis "github.com/TecharoHQ/anubis/lib" "github.com/TecharoHQ/anubis/lib/policy/config" - "github.com/TecharoHQ/anubis/web" "github.com/facebookgo/flagenv" "github.com/prometheus/client_golang/prometheus/promhttp" ) @@ -267,24 +265,3 @@ func metricsServer(ctx context.Context, done func()) { log.Fatal(err) } } - -func serveMainJSWithBestEncoding(w http.ResponseWriter, r *http.Request) { - priorityList := []string{"zstd", "br", "gzip"} - enc2ext := map[string]string{ - "zstd": "zst", - "br": "br", - "gzip": "gz", - } - - for _, enc := range priorityList { - if strings.Contains(r.Header.Get("Accept-Encoding"), enc) { - w.Header().Set("Content-Type", "text/javascript") - w.Header().Set("Content-Encoding", enc) - http.ServeFileFS(w, r, web.Static, "static/js/main.mjs."+enc2ext[enc]) - return - } - } - - w.Header().Set("Content-Type", "text/javascript") - http.ServeFileFS(w, r, web.Static, "static/js/main.mjs") -} diff --git a/cmd/containerbuild/main.go b/cmd/containerbuild/main.go index 95194c6..18e879c 100644 --- a/cmd/containerbuild/main.go +++ b/cmd/containerbuild/main.go @@ -19,7 +19,6 @@ var ( dockerLabels = flag.String("docker-labels", os.Getenv("DOCKER_METADATA_OUTPUT_LABELS"), "Docker image labels") dockerRepo = flag.String("docker-repo", "registry.int.xeserv.us/techaro/anubis", "Docker image repository for Anubis") dockerTags = flag.String("docker-tags", os.Getenv("DOCKER_METADATA_OUTPUT_TAGS"), "newline separated docker tags including the registry name") - githubActor = flag.String("github-actor", "", "GitHub actor") githubEventName = flag.String("github-event-name", "", "GitHub event name") pullRequestID = flag.Int("pull-request-id", -1, "GitHub pull request ID") slogLevel = flag.String("slog-level", "INFO", "logging level (see https://pkg.go.dev/log/slog#hdr-Levels)") @@ -113,11 +112,6 @@ type image struct { tag string } -func newlineSep2Comma(inp string) string { - lines := strings.Split(inp, "\n") - return strings.Join(lines, ",") -} - func parseImageList(imageList string) ([]image, error) { images := strings.Split(imageList, "\n") var result []image |
