├── .gitignore ├── client ├── inc.go ├── generate.go └── cfg.yaml ├── .dockerignore ├── update_openapi.sh ├── release.sh ├── Dockerfile ├── .github └── workflows │ ├── ci.yml │ └── go-release.yml ├── LICENSE ├── main_test.go ├── go.mod ├── README.md ├── main.go └── go.sum /.gitignore: -------------------------------------------------------------------------------- 1 | immich-stacker 2 | .env 3 | -------------------------------------------------------------------------------- /client/inc.go: -------------------------------------------------------------------------------- 1 | // +build client 2 | 3 | package client 4 | 5 | import ( 6 | _ "github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen" 7 | ) 8 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .dockerignore 2 | .env 3 | .git 4 | .github 5 | .gitignore 6 | Dockerfile 7 | LICENSE 8 | README.md 9 | immich-stacker 10 | update_openapi.sh 11 | -------------------------------------------------------------------------------- /client/generate.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | //go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest -config cfg.yaml immich-openapi-specs.json 4 | -------------------------------------------------------------------------------- /client/cfg.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/deepmap/oapi-codegen/HEAD/configuration-schema.json 2 | package: client 3 | output: client.gen.go 4 | generate: 5 | models: true 6 | client: true 7 | -------------------------------------------------------------------------------- /update_openapi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | VERSION=2.3.1 4 | 5 | pushd client 6 | curl https://raw.githubusercontent.com/immich-app/immich/v${VERSION}/open-api/immich-openapi-specs.json -o immich-openapi-specs.json 7 | popd 8 | go generate ./... 9 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | version=$(git describe --tags) 4 | 5 | podman build . -t ghcr.io/mattdavis90/immich-stacker:${version} 6 | podman build . -t ghcr.io/mattdavis90/immich-stacker:latest 7 | podman build . -t mattdavis90/immich-stacker:${version} 8 | podman build . -t mattdavis90/immich-stacker:latest 9 | 10 | podman push ghcr.io/mattdavis90/immich-stacker:${version} 11 | podman push ghcr.io/mattdavis90/immich-stacker:latest 12 | podman push mattdavis90/immich-stacker:${version} 13 | podman push mattdavis90/immich-stacker:latest 14 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:alpine3.22 AS builder 2 | 3 | RUN mkdir /app 4 | WORKDIR /app 5 | 6 | COPY go.mod go.sum /app/ 7 | RUN go mod download 8 | 9 | COPY . /app/ 10 | RUN CGO_ENABLE=0 go build -ldflags '-extldflags "-static"' -tags timetzdata 11 | 12 | FROM scratch 13 | 14 | LABEL org.opencontainers.image.source=https://github.com/mattdavis90/immich-stacker 15 | LABEL org.opencontainers.image.description="A small application to help you stack images in Immich" 16 | LABEL org.opencontainers.image.licenses=MIT 17 | 18 | COPY --from=builder /app/immich-stacker / 19 | COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ 20 | 21 | ENTRYPOINT ["/immich-stacker"] 22 | CMD [""] 23 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | lint: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v4 15 | 16 | - name: Setup Go 17 | uses: actions/setup-go@v4 18 | with: 19 | go-version: '1.24' 20 | 21 | - name: Run golangci-lint 22 | uses: golangci/golangci-lint-action@v3 23 | with: 24 | version: latest 25 | 26 | test: 27 | runs-on: ubuntu-latest 28 | steps: 29 | - name: Checkout code 30 | uses: actions/checkout@v4 31 | 32 | - name: Setup Go 33 | uses: actions/setup-go@v4 34 | with: 35 | go-version: '1.24' 36 | 37 | - name: Run tests 38 | run: go test ./... 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Matt Davis 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /main_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/google/uuid" 7 | openapi_types "github.com/oapi-codegen/runtime/types" 8 | ) 9 | 10 | func TestStack_Stackable(t *testing.T) { 11 | id1 := uuid.New() 12 | id2 := uuid.New() 13 | tests := []struct { 14 | name string 15 | stack Stack 16 | want bool 17 | }{ 18 | { 19 | name: "stackable with parent and IDs", 20 | stack: Stack{ 21 | IDs: []openapi_types.UUID{id1}, 22 | Parent: &id2, 23 | }, 24 | want: true, 25 | }, 26 | { 27 | name: "not stackable without parent", 28 | stack: Stack{ 29 | IDs: []openapi_types.UUID{id1}, 30 | }, 31 | want: false, 32 | }, 33 | { 34 | name: "not stackable without IDs", 35 | stack: Stack{ 36 | Parent: &id1, 37 | }, 38 | want: false, 39 | }, 40 | { 41 | name: "not stackable empty", 42 | stack: Stack{}, 43 | want: false, 44 | }, 45 | } 46 | 47 | for _, tt := range tests { 48 | t.Run(tt.name, func(t *testing.T) { 49 | if got := tt.stack.Stackable(); got != tt.want { 50 | t.Errorf("Stack.Stackable() = %v, want %v", got, tt.want) 51 | } 52 | }) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /.github/workflows/go-release.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | tags: 4 | - 'v*' 5 | 6 | name: Release 7 | 8 | jobs: 9 | release: 10 | runs-on: 'ubuntu-latest' 11 | strategy: 12 | matrix: 13 | # build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64 14 | goos: [linux, windows, darwin] 15 | goarch: ["386", amd64, arm64] 16 | exclude: 17 | - goarch: "386" 18 | goos: darwin 19 | - goarch: arm64 20 | goos: windows 21 | steps: 22 | - name: Checkout code 23 | uses: actions/checkout@v2 24 | 25 | - name: Setup Go 26 | uses: actions/setup-go@v4 27 | with: 28 | go-version: '1.24' 29 | 30 | - name: Build 31 | run: | 32 | GO_ENABLE=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags '-extldflags "-static"' -tags timetzdata -o immich-stacker-${{ matrix.goos }}-${{ matrix.goarch }} 33 | 34 | - name: Run Trivy vulnerability scanner 35 | uses: aquasecurity/trivy-action@master 36 | with: 37 | scan-type: 'binary' 38 | scan-ref: './immich-stacker-${{ matrix.goos }}-${{ matrix.goarch }}' 39 | format: 'sarif' 40 | output: 'trivy-results.sarif' 41 | 42 | - name: Release 43 | uses: softprops/action-gh-release@v1 44 | with: 45 | files: immich-stacker-${{ matrix.goos }}-${{ matrix.goarch }} 46 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mattdavis90/immich-stacker 2 | 3 | go 1.24.0 4 | 5 | toolchain go1.24.5 6 | 7 | require ( 8 | github.com/caarlos0/env/v11 v11.3.1 9 | github.com/google/uuid v1.6.0 10 | github.com/joho/godotenv v1.5.1 11 | github.com/oapi-codegen/oapi-codegen/v2 v2.5.1 12 | github.com/oapi-codegen/runtime v1.1.2 13 | github.com/rs/zerolog v1.34.0 14 | ) 15 | 16 | require ( 17 | github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect 18 | github.com/dprotaso/go-yit v0.0.0-20251117151522-da16f3077589 // indirect 19 | github.com/getkin/kin-openapi v0.133.0 // indirect 20 | github.com/go-openapi/jsonpointer v0.22.3 // indirect 21 | github.com/go-openapi/swag/jsonname v0.25.4 // indirect 22 | github.com/josharian/intern v1.0.0 // indirect 23 | github.com/mailru/easyjson v0.9.1 // indirect 24 | github.com/mattn/go-colorable v0.1.14 // indirect 25 | github.com/mattn/go-isatty v0.0.20 // indirect 26 | github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 27 | github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect 28 | github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 // indirect 29 | github.com/perimeterx/marshmallow v1.1.5 // indirect 30 | github.com/speakeasy-api/jsonpath v0.6.2 // indirect 31 | github.com/speakeasy-api/openapi-overlay v0.10.3 // indirect 32 | github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect 33 | github.com/woodsbury/decimal128 v1.4.0 // indirect 34 | go.yaml.in/yaml/v4 v4.0.0-rc.3 // indirect 35 | golang.org/x/mod v0.30.0 // indirect 36 | golang.org/x/sync v0.18.0 // indirect 37 | golang.org/x/sys v0.38.0 // indirect 38 | golang.org/x/text v0.31.0 // indirect 39 | golang.org/x/tools v0.39.0 // indirect 40 | gopkg.in/yaml.v2 v2.4.0 // indirect 41 | gopkg.in/yaml.v3 v3.0.1 // indirect 42 | ) 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Immich Stacker 2 | 3 | A small application to help you stack images in [Immich](https://immich.app). 4 | 5 | The Immich web app allows you to manually stack your files but doesn't give you any 6 | automation. This app adds a small automation layer that can be run periodically to 7 | stack your photos. 8 | 9 | ## Use Cases 10 | 11 | Below are some sample use cases. 12 | 13 | ### Raw + JPG 14 | 15 | You shoot in Raw+JPG on your DSLR / smart phone and you'd like Immich to dedupe the 16 | photos while preserving the raw files. The below config searches for `RW2` and `JPG` 17 | files with the same filename other than the extension and stacks them, with the `JPG` 18 | becoming the parent image. 19 | 20 | ```bash 21 | IMMICH_MATCH=\.(JPG|RW2)$ 22 | IMMICH_PARENT=\.JPG$ 23 | ``` 24 | 25 | ### Burst Mode 26 | 27 | Modern smart phones provide a burst option. Below is a config for detecting bursts of 28 | photos and stacking them with the cover image becoming the parent. 29 | 30 | ```bash 31 | IMMICH_MATCH=BURST[0-9]{3}(_COVER)?\.jpg$ 32 | IMMICH_PARENT=_COVER\.jpg$ 33 | ``` 34 | 35 | ## Versions 36 | 37 | * 1.0.0 - works up to Immich v1.106.0 38 | * 1.1.1 - works up to Immich v1.112.0 39 | * 1.1.2 - works up to Immich v1.112.0 40 | * 1.2.0 - works up to Immich v1.132.0 41 | * 1.3.0 - works up to Immich v1.132.0 42 | * 1.4.0 - works up to Immich v1.132.0 43 | * 1.5.0 - works up to Immich v1.132.0 44 | * 1.6.0 - works up to Immich v1.135.3 45 | * 1.7.0 - works up to latest 46 | * 1.7.1 - works up to latest 47 | 48 | ## Deployment 49 | 50 | Running the application is straightforward but it only runs once; there is no loop. 51 | Configuration is taken from the environment or a `.env` file. Care should be taken 52 | when using special characters in an environment variable. `.env` files will handle 53 | escaping for you but a docker deployment needs care. 54 | 55 | You will need an API Key for your Immich installation. Since v1.351 it has been 56 | possible to apply fine grain security to this token. The following properties 57 | are required for immich-stacker to work; `asset.read` and `stack.*` 58 | 59 | ### Standalone 60 | 61 | Download the prebuilt binary from Github and run it. The example below uses a `.env` 62 | file for repeatability and to minimise mistakes when escaping regexes. 63 | 64 | ```bash 65 | cat > .env << EOF 66 | IMMICH_API_KEY=abc123 67 | IMMICH_ENDPOINT=https://immich.app/api 68 | IMMICH_MATCH=\.(JPG|RW2)$ 69 | IMMICH_PARENT=\.JPG$ 70 | EOF 71 | 72 | ./immich-stacker 73 | ``` 74 | 75 | ### Docker 76 | 77 | Use the prebuilt docker container. The example below uses a `.env` file for 78 | repeatability and to minimise mistakes when escaping regexes. 79 | 80 | ```bash 81 | cat > .env << EOF 82 | IMMICH_API_KEY=abc123 83 | IMMICH_ENDPOINT=https://immich.app/api 84 | IMMICH_MATCH=\.(JPG|RW2)$ 85 | IMMICH_PARENT=\.JPG$ 86 | EOF 87 | 88 | docker run -ti --rm --env-file=.env mattdavis90/immich-stacker 89 | ``` 90 | 91 | ### Using Swarm Cronjobs 92 | 93 | Since the stacker only runs once then exits. It is recommended to use a cron scheduler 94 | if deploying on Docker Swarm or in a docker-compose file. `crazymax/swarm-cronjob` 95 | works reliably and is easy to configure. 96 | 97 | **Note:** Take care when escaping regex in a docker-compose file. 98 | 99 | ```yaml 100 | services: 101 | stacker: 102 | image: mattdavis90/immich-stacker:latest 103 | deploy: 104 | replicas: 0 105 | labels: 106 | - "swarm.cronjob.enable=true" 107 | - "swarm.cronjob.schedule=0 * * * *" 108 | - "swarm.cronjob.skip-running=false" 109 | restart_policy: 110 | condition: none 111 | environment: 112 | IMMICH_API_KEY: abc123 113 | IMMICH_ENDPOINT: "https://immich.com/api" 114 | IMMICH_MATCH: "\\.(JPG|RW2)$$" 115 | IMMICH_PARENT: "\\.JPG$$" 116 | swarm-cronjob: 117 | image: crazymax/swarm-cronjob 118 | deploy: 119 | placement: 120 | constraints: 121 | - node.role == manager 122 | environment: 123 | - "TZ=Europe/London" 124 | - "LOG_LEVEL=info" 125 | - "LOG_JSON=false" 126 | volumes: 127 | - "/var/run/docker.sock:/var/run/docker.sock" 128 | ``` 129 | 130 | ### Additional Options 131 | 132 | There is an `IMMICH_LOG_LEVEL` environment variable that accepts a standard log level 133 | and will configure the output of the applciation. It defaults to `INFO`. 134 | 135 | The `IMMICH_COMPARE_CREATED` environment variable can be used to only match files with 136 | the same createdAt timestamp. This can be useful when your camera has reset numbering to 137 | 0 and you can no longer rely on the filenames being unique. Thanks to @Pikachews for 138 | the suggestion. 139 | 140 | The `IMMICH_INSECURE_TLS` environment variable can be used to disable the checking of 141 | TLS certificates. This option should be used with caution, for this reason it emit a 142 | warning log on startup. 143 | 144 | The `IMMICH_READ_ONLY` environment variable can be used for testing. It will not make 145 | changes to your Immich installation. 146 | 147 | The `IMMICH_DRY_RUN` environment variable can be used to preview what stacks would be 148 | created without actually making changes to your Immich installation. 149 | 150 | The `IMMICH_NEWER_THAN` environment variable can be used to only target images 151 | newer than the given time duration. Due to a [limitation in GoLang's time 152 | duration paring](https://github.com/golang/go/issues/11473) only seconds, 153 | minutes, and hours can be used. 154 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bytes" 5 | "context" 6 | "crypto/tls" 7 | "io" 8 | "net/http" 9 | "os" 10 | "regexp" 11 | "slices" 12 | "strconv" 13 | "time" 14 | 15 | "github.com/caarlos0/env/v11" 16 | "github.com/google/uuid" 17 | "github.com/joho/godotenv" 18 | "github.com/mattdavis90/immich-stacker/client" 19 | "github.com/oapi-codegen/oapi-codegen/v2/pkg/securityprovider" 20 | openapi_types "github.com/oapi-codegen/runtime/types" 21 | "github.com/rs/zerolog" 22 | "github.com/rs/zerolog/log" 23 | ) 24 | 25 | type Stack struct { 26 | IDs []openapi_types.UUID 27 | Parent *openapi_types.UUID 28 | } 29 | 30 | func (s Stack) Stackable() bool { 31 | return s.Parent != nil && len(s.IDs) > 0 32 | } 33 | 34 | type Stats struct { 35 | Stackable int 36 | AlreadyStacked int 37 | NotStackable int 38 | Success int 39 | Failed int 40 | } 41 | 42 | type Config struct { 43 | APIKey string `env:"API_KEY"` 44 | Endpoint string `env:"ENDPOINT"` 45 | Match string `env:"MATCH"` 46 | Parent string `env:"PARENT"` 47 | LogLevel string `env:"LOG_LEVEL" envDefault:"INFO"` 48 | DebugHTTP bool `env:"DEBUG_HTTP" envDefault:"false"` 49 | CompareCreated bool `env:"COMPARE_CREATED" envDefault:"false"` 50 | NewerThan time.Duration `env:"NEWER_THAN" envDefault:"0h"` 51 | InsecureTLS bool `env:"INSECURE_TLS" envDefault:"false"` 52 | ReadOnly bool `env:"READ_ONLY" envDefault:"false"` 53 | } 54 | 55 | type HTTPLogger struct{} 56 | 57 | const VERSION = "v1.7.1" 58 | 59 | func (hl HTTPLogger) RoundTrip(req *http.Request) (*http.Response, error) { 60 | reqBody := "" 61 | respBody := "" 62 | 63 | if req.Body != nil { 64 | buf, e := io.ReadAll(req.Body) 65 | if e != nil { 66 | log.Fatal().Err(e).Msg("Failed to read HTTP request") 67 | } else { 68 | reqRdr := io.NopCloser(bytes.NewBuffer(buf)) 69 | req.Body = reqRdr 70 | reqBody = string(buf) 71 | } 72 | } 73 | 74 | resp, err := http.DefaultTransport.RoundTrip(req) 75 | if err != nil { 76 | return resp, err 77 | } 78 | 79 | if resp.Body != nil { 80 | buf, e := io.ReadAll(resp.Body) 81 | if e != nil { 82 | log.Fatal().Err(e).Msg("Failed to read HTTP response") 83 | } else { 84 | respRdr := io.NopCloser(bytes.NewBuffer(buf)) 85 | resp.Body = respRdr 86 | respBody = string(buf) 87 | } 88 | } 89 | 90 | log.Debug(). 91 | Str("method", req.Method). 92 | Str("path", req.URL.Path). 93 | Any("req_hdr", req.Header). 94 | Str("req_body", reqBody). 95 | Any("resp_hdr", resp.Header). 96 | Str("resp_body", respBody). 97 | Int("status", resp.StatusCode). 98 | Msg("Request") 99 | 100 | return resp, err 101 | } 102 | 103 | func main() { 104 | godotenv.Load() //nolint:errcheck 105 | 106 | log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.RFC3339}) 107 | zerolog.TimeFieldFormat = zerolog.TimeFormatUnix 108 | 109 | cfg := Config{} 110 | opts := env.Options{RequiredIfNoDef: true, Prefix: "IMMICH_"} 111 | if err := env.ParseWithOptions(&cfg, opts); err != nil { 112 | log.Fatal().Err(err).Msg("Error loading config") 113 | } 114 | 115 | level, err := zerolog.ParseLevel(cfg.LogLevel) 116 | if err != nil { 117 | log.Fatal().Err(err).Msg("Invalid log level") 118 | } 119 | zerolog.SetGlobalLevel(level) 120 | 121 | m, err := regexp.Compile(cfg.Match) 122 | if err != nil { 123 | log.Fatal().Err(err).Msg("Invalid match regex") 124 | } 125 | 126 | p, err := regexp.Compile(cfg.Parent) 127 | if err != nil { 128 | log.Fatal().Err(err).Msg("Invalid parent regex") 129 | } 130 | 131 | sp, err := securityprovider.NewSecurityProviderApiKey("header", "x-api-key", cfg.APIKey) 132 | if err != nil { 133 | log.Fatal().Err(err).Msg("Failed to create API key provider") 134 | } 135 | 136 | log.Info().Str("version", VERSION).Msg("Starting immich-stacker") 137 | log.Info().Str("endpoint", cfg.Endpoint).Msg("Connecting to Immich") 138 | 139 | if cfg.InsecureTLS { 140 | log.Warn().Msg("Insecure TLS connections enabled") 141 | http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} 142 | } 143 | 144 | var hc http.Client 145 | if cfg.DebugHTTP { 146 | hl := HTTPLogger{} 147 | hc = http.Client{Transport: hl} 148 | } else { 149 | hc = http.Client{} 150 | } 151 | 152 | c, err := client.NewClientWithResponses( 153 | cfg.Endpoint, 154 | client.WithHTTPClient(&hc), 155 | client.WithRequestEditorFn(sp.Intercept), 156 | ) 157 | if err != nil { 158 | log.Fatal().Err(err).Msg("Failed to create Immich client") 159 | } 160 | 161 | ctx := context.Background() 162 | 163 | verResp, err := c.GetServerVersionWithResponse(ctx) 164 | if err != nil { 165 | log.Fatal().Err(err).Msg("Failed to get server version") 166 | } 167 | if verResp.StatusCode() != http.StatusOK { 168 | log.Fatal().Int("status", verResp.StatusCode()).Msg("Failed to get server version: expected HTTP 200") 169 | } 170 | if verResp.JSON200 == nil { 171 | log.Fatal().Msg("Server version response is nil") 172 | } 173 | v := verResp.JSON200 174 | log.Info().Int("major", v.Major).Int("minor", v.Minor).Int("patch", v.Patch).Msg("Server version") 175 | 176 | var timeTaken *time.Time = nil 177 | if cfg.NewerThan.Seconds() != 0 { 178 | tt := time.Now().Add(-1 * cfg.NewerThan) 179 | timeTaken = &tt 180 | } 181 | 182 | log.Info().Msg("Requesting all assets") 183 | 184 | total := 0 185 | stacks := make(map[string]*Stack) 186 | var one float32 = 1.0 187 | next := &one 188 | 189 | for next != nil { 190 | resp, err := c.SearchAssetsWithResponse(ctx, client.MetadataSearchDto{TakenAfter: timeTaken, Page: next}) 191 | if err != nil { 192 | log.Fatal().Err(err).Msg("Failed to search assets") 193 | } 194 | if resp.StatusCode() != http.StatusOK { 195 | log.Fatal().Int("status", resp.StatusCode()).Msg("Failed to search assets: expected HTTP 200") 196 | } 197 | if resp.JSON200 == nil { 198 | log.Fatal().Msg("Search assets response is nil") 199 | } 200 | 201 | total += resp.JSON200.Assets.Count 202 | 203 | log.Debug().Float32("page", *next).Int("expected", resp.JSON200.Assets.Count).Int("got", len(resp.JSON200.Assets.Items)).Msg("Retrieved page") 204 | for _, a := range resp.JSON200.Assets.Items { 205 | if m.Match([]byte(a.OriginalFileName)) { 206 | id := openapi_types.UUID(uuid.MustParse(a.Id)) 207 | key := string(m.ReplaceAll([]byte(a.OriginalFileName), []byte(""))) 208 | if cfg.CompareCreated { 209 | key += "_" + a.FileCreatedAt.Local().String() 210 | } 211 | 212 | s, ok := stacks[key] 213 | if !ok { 214 | s = &Stack{ 215 | IDs: make([]uuid.UUID, 0), 216 | } 217 | stacks[key] = s 218 | } 219 | 220 | if p.Match([]byte(a.OriginalFileName)) { 221 | s.Parent = &id 222 | } else { 223 | s.IDs = append(s.IDs, id) 224 | } 225 | } 226 | } 227 | 228 | if resp.JSON200.Assets.NextPage != nil { 229 | a, err := strconv.ParseFloat(*resp.JSON200.Assets.NextPage, 32) 230 | if err != nil { 231 | log.Fatal().Err(err).Msg("Failed to parse next page") 232 | } 233 | b := float32(a) 234 | next = &b 235 | } else { 236 | next = nil 237 | } 238 | } 239 | 240 | log.Info().Int("total", total).Int("matches", len(stacks)).Msg("Retrieved assets") 241 | 242 | stats := Stats{} 243 | 244 | for f, s := range stacks { 245 | if s.Stackable() { 246 | stats.Stackable++ 247 | 248 | log.Debug().Str("filename", f).Msg("Checking stacked") 249 | 250 | resp, err := c.GetAssetInfoWithResponse(ctx, *s.Parent, &client.GetAssetInfoParams{}) 251 | if err != nil { 252 | log.Fatal().Err(err).Msg("Failed to get asset info") 253 | } 254 | if resp.StatusCode() != http.StatusOK { 255 | log.Fatal().Int("status", resp.StatusCode()).Msg("Failed to get asset info: expected HTTP 200") 256 | } 257 | if resp.JSON200 == nil { 258 | log.Fatal().Msg("Asset info response is nil") 259 | } 260 | if resp.JSON200.Stack != nil && resp.JSON200.Stack.AssetCount > 0 { 261 | stats.AlreadyStacked++ 262 | continue 263 | } 264 | 265 | log.Debug().Str("filename", f).Msg("Stacking") 266 | 267 | // Generate a slice of UUIDs with the parent first 268 | assetIDs := []openapi_types.UUID{*s.Parent} 269 | for _, a := range s.IDs { 270 | if !slices.Contains(assetIDs, a) { 271 | assetIDs = append(assetIDs, a) 272 | } 273 | } 274 | 275 | if !cfg.ReadOnly { 276 | resp, err := c.CreateStackWithResponse(ctx, client.StackCreateDto{ 277 | AssetIds: assetIDs, 278 | }) 279 | if err != nil { 280 | log.Error().Err(err).Msg("Failed to create stack") 281 | stats.Failed++ 282 | } else if resp.StatusCode() != http.StatusCreated { 283 | log.Error().Int("status", resp.StatusCode()).Msg("Failed to create stack: expected HTTP 201") 284 | stats.Failed++ 285 | } else { 286 | log.Info().Str("filename", f).Msg("Created stack") 287 | stats.Success++ 288 | } 289 | } 290 | } else { 291 | log.Debug().Str("filename", f).Msg("Skipped") 292 | stats.NotStackable++ 293 | } 294 | } 295 | 296 | log.Info(). 297 | Int("stackable", stats.Stackable). 298 | Int("already_stacked", stats.AlreadyStacked). 299 | Int("success", stats.Success). 300 | Int("failed", stats.Failed). 301 | Int("not_stackable", stats.NotStackable). 302 | Msg("Finished") 303 | } 304 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= 2 | github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= 3 | github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= 4 | github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= 5 | github.com/caarlos0/env/v11 v11.3.1 h1:cArPWC15hWmEt+gWk7YBi7lEXTXCvpaSdCiZE2X5mCA= 6 | github.com/caarlos0/env/v11 v11.3.1/go.mod h1:qupehSf/Y0TUTsxKywqRt/vJjN5nz6vauiYEUUr8P4U= 7 | github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= 8 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 9 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 10 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 11 | github.com/dprotaso/go-yit v0.0.0-20191028211022-135eb7262960/go.mod h1:9HQzr9D/0PGwMEbC3d5AB7oi67+h4TsQqItC1GVYG58= 12 | github.com/dprotaso/go-yit v0.0.0-20251117151522-da16f3077589 h1:VJ/jVUWr+r4MQA7U/cscbbXRuwh1PfPCUUItYAjlKN4= 13 | github.com/dprotaso/go-yit v0.0.0-20251117151522-da16f3077589/go.mod h1:IeI20psFPeg2n1jxwbkYCmkpYsXsJqB7qmoqCIlX80s= 14 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 15 | github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= 16 | github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= 17 | github.com/getkin/kin-openapi v0.133.0 h1:pJdmNohVIJ97r4AUFtEXRXwESr8b0bD721u/Tz6k8PQ= 18 | github.com/getkin/kin-openapi v0.133.0/go.mod h1:boAciF6cXk5FhPqe/NQeBTeenbjqU4LhWBf09ILVvWE= 19 | github.com/go-openapi/jsonpointer v0.22.3 h1:dKMwfV4fmt6Ah90zloTbUKWMD+0he+12XYAsPotrkn8= 20 | github.com/go-openapi/jsonpointer v0.22.3/go.mod h1:0lBbqeRsQ5lIanv3LHZBrmRGHLHcQoOXQnf88fHlGWo= 21 | github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= 22 | github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= 23 | github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= 24 | github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= 25 | github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= 26 | github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= 27 | github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= 28 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 29 | github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= 30 | github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= 31 | github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= 32 | github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 33 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 34 | github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= 35 | github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= 36 | github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= 37 | github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= 38 | github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= 39 | github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= 40 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 41 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 42 | github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= 43 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 44 | github.com/mailru/easyjson v0.9.1 h1:LbtsOm5WAswyWbvTEOqhypdPeZzHavpZx96/n553mR8= 45 | github.com/mailru/easyjson v0.9.1/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= 46 | github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= 47 | github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= 48 | github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= 49 | github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= 50 | github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 51 | github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= 52 | github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 53 | github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= 54 | github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= 55 | github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= 56 | github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= 57 | github.com/oapi-codegen/oapi-codegen/v2 v2.5.1 h1:5vHNY1uuPBRBWqB2Dp0G7YB03phxLQZupZTIZaeorjc= 58 | github.com/oapi-codegen/oapi-codegen/v2 v2.5.1/go.mod h1:ro0npU1BWkcGpCgGD9QwPp44l5OIZ94tB3eabnT7DjQ= 59 | github.com/oapi-codegen/runtime v1.1.2 h1:P2+CubHq8fO4Q6fV1tqDBZHCwpVpvPg7oKiYzQgXIyI= 60 | github.com/oapi-codegen/runtime v1.1.2/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= 61 | github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 h1:G7ERwszslrBzRxj//JalHPu/3yz+De2J+4aLtSRlHiY= 62 | github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037/go.mod h1:2bpvgLBZEtENV5scfDFEtB/5+1M4hkQhDQrccEJ/qGw= 63 | github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 h1:bQx3WeLcUWy+RletIKwUIt4x3t8n2SxavmoclizMb8c= 64 | github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o= 65 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 66 | github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 67 | github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= 68 | github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= 69 | github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 70 | github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= 71 | github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= 72 | github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= 73 | github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= 74 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 75 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 76 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 77 | github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= 78 | github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY= 79 | github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= 80 | github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= 81 | github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= 82 | github.com/speakeasy-api/jsonpath v0.6.2 h1:Mys71yd6u8kuowNCR0gCVPlVAHCmKtoGXYoAtcEbqXQ= 83 | github.com/speakeasy-api/jsonpath v0.6.2/go.mod h1:ymb2iSkyOycmzKwbEAYPJV/yi2rSmvBCLZJcyD+VVWw= 84 | github.com/speakeasy-api/openapi-overlay v0.10.3 h1:70een4vwHyslIp796vM+ox6VISClhtXsCjrQNhxwvWs= 85 | github.com/speakeasy-api/openapi-overlay v0.10.3/go.mod h1:RJjV0jbUHqXLS0/Mxv5XE7LAnJHqHw+01RDdpoGqiyY= 86 | github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= 87 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 88 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 89 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 90 | github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= 91 | github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= 92 | github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= 93 | github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= 94 | github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= 95 | github.com/vmware-labs/yaml-jsonpath v0.3.2 h1:/5QKeCBGdsInyDCyVNLbXyilb61MXGi9NP674f9Hobk= 96 | github.com/vmware-labs/yaml-jsonpath v0.3.2/go.mod h1:U6whw1z03QyqgWdgXxvVnQ90zN1BWz5V+51Ewf8k+rQ= 97 | github.com/woodsbury/decimal128 v1.4.0 h1:xJATj7lLu4f2oObouMt2tgGiElE5gO6mSWUjQsBgUlc= 98 | github.com/woodsbury/decimal128 v1.4.0/go.mod h1:BP46FUrVjVhdTbKT+XuQh2xfQaGki9LMIRJSFuh6THU= 99 | go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= 100 | go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= 101 | go.yaml.in/yaml/v4 v4.0.0-rc.3 h1:3h1fjsh1CTAPjW7q/EMe+C8shx5d8ctzZTrLcs/j8Go= 102 | go.yaml.in/yaml/v4 v4.0.0-rc.3/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= 103 | golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk= 104 | golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc= 105 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 106 | golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= 107 | golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= 108 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 109 | golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= 110 | golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= 111 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 112 | golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 113 | golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 114 | golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 115 | golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= 116 | golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= 117 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 118 | golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= 119 | golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= 120 | golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ= 121 | golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ= 122 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 123 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= 124 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 125 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 126 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= 127 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 128 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 129 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 130 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 131 | gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 132 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 133 | gopkg.in/yaml.v3 v3.0.0-20191026110619-0b21df46bc1d/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 134 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 135 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 136 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 137 | --------------------------------------------------------------------------------