Skip to content

Commit

Permalink
✨ Support workq (#194)
Browse files Browse the repository at this point in the history
* ♻️ Rename ximager to sigma

* ✨ Support init scm branch

* ✨ Add code repository get method

* ✨ Support workq
  • Loading branch information
tosone authored Sep 18, 2023
1 parent afd44ff commit 6d01db9
Show file tree
Hide file tree
Showing 41 changed files with 1,754 additions and 82 deletions.
2 changes: 2 additions & 0 deletions cmd/imports/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ import (
_ "github.com/go-sigma/sigma/pkg/daemon/gc"
_ "github.com/go-sigma/sigma/pkg/daemon/sbom"
_ "github.com/go-sigma/sigma/pkg/daemon/vulnerability"
_ "github.com/go-sigma/sigma/pkg/workq/database"
_ "github.com/go-sigma/sigma/pkg/workq/kafka"
)
2 changes: 1 addition & 1 deletion cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
// serverCmd represents the server command
var serverCmd = &cobra.Command{
Use: "server",
Short: "Start the XImager server",
Short: "Start the sigma server",
PersistentPreRun: func(_ *cobra.Command, _ []string) {
initConfig()
logger.SetLevel(viper.GetString("log.level"))
Expand Down
50 changes: 26 additions & 24 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,32 @@ import (
"github.com/spf13/cobra"
)

// You can copy & paste this ascii graphic and use it e.g. as mail signature
// Font: doh Reflection: no Adjustment: left Stretch: no Width: 280 Text: sigma
const banner = `
XXXXXXX XXXXXXIIIIIIIIII
X:::::X X:::::I::::::::I
X:::::X X:::::I::::::::I
X::::::X X::::::II::::::II
XXX:::::X X:::::XXX I::::I mmmmmmm mmmmmmm aaaaaaaaaaaaa ggggggggg ggggg eeeeeeeeeeee rrrrr rrrrrrrrr
X:::::X X:::::X I::::I mm:::::::m m:::::::mm a::::::::::::a g:::::::::ggg::::g ee::::::::::::ee r::::rrr:::::::::r
X:::::X:::::X I::::I m::::::::::mm::::::::::m aaaaaaaaa:::::ag:::::::::::::::::ge::::::eeeee:::::er:::::::::::::::::r
X:::::::::X I::::I m::::::::::::::::::::::m a::::g::::::ggggg::::::ge::::::e e:::::rr::::::rrrrr::::::r
X:::::::::X I::::I m:::::mmm::::::mmm:::::m aaaaaaa:::::g:::::g g:::::ge:::::::eeeee::::::er:::::r r:::::r
X:::::X:::::X I::::I m::::m m::::m m::::m aa::::::::::::g:::::g g:::::ge:::::::::::::::::e r:::::r rrrrrrr
X:::::X X:::::X I::::I m::::m m::::m m::::ma::::aaaa::::::g:::::g g:::::ge::::::eeeeeeeeeee r:::::r
XXX:::::X X:::::XXX I::::I m::::m m::::m m::::a::::a a:::::g::::::g g:::::ge:::::::e r:::::r
X::::::X X::::::II::::::Im::::m m::::m m::::a::::a a:::::g:::::::ggggg:::::ge::::::::e r:::::r
X:::::X X:::::I::::::::m::::m m::::m m::::a:::::aaaa::::::ag::::::::::::::::g e::::::::eeeeeeee r:::::r
X:::::X X:::::I::::::::m::::m m::::m m::::ma::::::::::aa:::agg::::::::::::::g ee:::::::::::::e r:::::r
XXXXXXX XXXXXXIIIIIIIIImmmmmm mmmmmm mmmmmm aaaaaaaaaa aaaa gggggggg::::::g eeeeeeeeeeeeee rrrrrrr
g:::::g
gggggg g:::::g
g:::::gg gg:::::g
g::::::ggg:::::::g
gg:::::::::::::g
ggg::::::ggg
gggggg`
iiii
i::::i
iiii
ssssssssss iiiiiii ggggggggg ggggg mmmmmmm mmmmmmm aaaaaaaaaaaaa
ss::::::::::s i:::::i g:::::::::ggg::::g mm:::::::m m:::::::mm a::::::::::::a
ss:::::::::::::s i::::i g:::::::::::::::::gm::::::::::mm::::::::::m aaaaaaaaa:::::a
s::::::ssss:::::s i::::i g::::::ggggg::::::ggm::::::::::::::::::::::m a::::a
s:::::s ssssss i::::i g:::::g g:::::g m:::::mmm::::::mmm:::::m aaaaaaa:::::a
s::::::s i::::i g:::::g g:::::g m::::m m::::m m::::m aa::::::::::::a
s::::::s i::::i g:::::g g:::::g m::::m m::::m m::::m a::::aaaa::::::a
ssssss s:::::s i::::i g::::::g g:::::g m::::m m::::m m::::ma::::a a:::::a
s:::::ssss::::::si::::::ig:::::::ggggg:::::g m::::m m::::m m::::ma::::a a:::::a
s::::::::::::::s i::::::i g::::::::::::::::g m::::m m::::m m::::ma:::::aaaa::::::a
s:::::::::::ss i::::::i gg::::::::::::::g m::::m m::::m m::::m a::::::::::aa:::a
sssssssssss iiiiiiii gggggggg::::::g mmmmmm mmmmmm mmmmmm aaaaaaaaaa aaaa
g:::::g
gggggg g:::::g
g:::::gg gg:::::g
g::::::ggg:::::::g
gg:::::::::::::g
ggg::::::ggg
gggggg`

var (
version = ""
Expand All @@ -56,7 +58,7 @@ var (
// versionCmd represents the worker command
var versionCmd = &cobra.Command{
Use: "version",
Short: "Show version of XImager",
Short: "Show version of sigma",
Run: func(_ *cobra.Command, _ []string) {
color.Cyan(banner)
fmt.Printf("Version: %s\n", version)
Expand Down
2 changes: 1 addition & 1 deletion cmd/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
// workerCmd represents the worker command
var workerCmd = &cobra.Command{
Use: "worker",
Short: "Start the XImager worker",
Short: "Start the sigma worker",
PersistentPreRun: func(_ *cobra.Command, _ []string) {
initConfig()
logger.SetLevel(viper.GetString("log.level"))
Expand Down
59 changes: 34 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,26 @@ go 1.20
require (
code.gitea.io/sdk/gitea v0.16.0
github.com/BurntSushi/toml v1.3.2
github.com/IBM/sarama v1.41.2
github.com/Masterminds/sprig/v3 v3.2.3
github.com/alicebob/miniredis/v2 v2.30.5
github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible
github.com/anchore/syft v0.90.0
github.com/aquasecurity/trivy v0.45.0
github.com/aws/aws-sdk-go v1.45.7
github.com/aquasecurity/trivy v0.45.1
github.com/aws/aws-sdk-go v1.45.11
github.com/bytedance/json v0.0.0-20190516032711-0d89175f1949
github.com/caarlos0/env/v9 v9.0.0
github.com/casbin/casbin/v2 v2.77.2
github.com/casbin/gorm-adapter/v3 v3.19.0
github.com/deckarep/golang-set/v2 v2.3.1
github.com/distribution/distribution/v3 v3.0.0-20230908093250-285b601af99a
github.com/distribution/distribution/v3 v3.0.0-20230915083636-612ad42609c3
github.com/distribution/reference v0.5.0
github.com/docker/cli v24.0.6+incompatible
github.com/docker/docker v24.0.6+incompatible
github.com/dustin/go-humanize v1.0.1
github.com/fatih/color v1.15.0
github.com/glebarez/sqlite v1.9.0
github.com/go-git/go-git/v5 v5.8.1
github.com/go-git/go-git/v5 v5.9.0
github.com/go-playground/validator v9.31.0+incompatible
github.com/go-redsync/redsync/v4 v4.9.4
github.com/go-resty/resty/v2 v2.7.0
Expand Down Expand Up @@ -55,7 +56,7 @@ require (
github.com/tidwall/gjson v1.16.0
github.com/wagslane/go-password-validator v0.3.0
github.com/xanzy/go-gitlab v0.91.1
go.uber.org/mock v0.2.0
go.uber.org/mock v0.3.0
golang.org/x/crypto v0.13.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
golang.org/x/oauth2 v0.12.0
Expand All @@ -66,22 +67,8 @@ require (
gorm.io/gorm v1.25.4
gorm.io/plugin/dbresolver v1.4.7
gorm.io/plugin/soft_delete v1.2.1
k8s.io/api v0.28.1
k8s.io/client-go v0.28.1
)

require (
github.com/adrg/xdg v0.4.0 // indirect
github.com/anchore/clio v0.0.0-20230823172630-c42d666061af // indirect
github.com/anchore/fangs v0.0.0-20230818131516-2186b10924fe // indirect
github.com/felixge/fgprof v0.9.3 // indirect
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 // indirect
github.com/gookit/color v1.5.4 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/pborman/indent v1.2.1 // indirect
github.com/pkg/profile v1.7.0 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
k8s.io/api v0.28.2
k8s.io/client-go v0.28.2
)

require (
Expand All @@ -90,10 +77,13 @@ require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/acobaugh/osrelease v0.1.0 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/adrg/xdg v0.4.0 // indirect
github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 // indirect
github.com/anchore/clio v0.0.0-20230823172630-c42d666061af // indirect
github.com/anchore/fangs v0.0.0-20230818131516-2186b10924fe // indirect
github.com/anchore/go-logger v0.0.0-20230725134548-c21dafa1ec5a // indirect
github.com/anchore/go-struct-converter v0.0.0-20230627203149-c72ef8859ca9 // indirect
github.com/anchore/packageurl-go v0.1.1-0.20230104203445-02e0a6721501 // indirect
Expand All @@ -105,8 +95,9 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/clbanning/mxj v1.8.4 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/containerd/containerd v1.7.3 // indirect
github.com/containerd/containerd v1.7.5 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davidmz/go-pageant v1.0.2 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
Expand All @@ -115,16 +106,20 @@ require (
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
github.com/eapache/go-resiliency v1.4.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/emicklei/go-restful/v3 v3.10.2 // indirect
github.com/facebookincubator/nvdtools v0.1.5 // indirect
github.com/felixge/fgprof v0.9.3 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/github/go-spdx/v2 v2.1.2 // indirect
github.com/glebarez/go-sqlite v1.21.2 // indirect
github.com/go-fed/httpsig v1.1.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
Expand All @@ -145,14 +140,18 @@ require (
github.com/google/go-containerregistry v0.16.1 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 // indirect
github.com/gookit/color v1.5.4 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
Expand All @@ -164,6 +163,11 @@ require (
github.com/jackc/pgtype v1.14.0 // indirect
github.com/jackc/pgx/v5 v5.4.3 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.7.6 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
Expand All @@ -181,6 +185,7 @@ require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-sqlite3 v1.14.17 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/mholt/archiver/v3 v3.5.1
github.com/microsoft/go-mssqldb v1.5.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
Expand All @@ -194,13 +199,16 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nwaples/rardecode v1.1.3 // indirect
github.com/opencontainers/image-spec v1.1.0-rc4 // indirect
github.com/pborman/indent v1.2.1 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
github.com/pierrec/lz4/v4 v4.1.18 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/profile v1.7.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/samber/lo v1.38.1 // indirect
github.com/scylladb/go-set v1.0.3-0.20200225121959-cc7b2070d91e // indirect
Expand Down Expand Up @@ -229,6 +237,7 @@ require (
github.com/wagoodman/go-partybus v0.0.0-20230516145632-8ccac152c651 // indirect
github.com/wagoodman/go-progress v0.0.0-20230301185719-21920a456ad5 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
github.com/yuin/gopher-lua v1.1.0 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.uber.org/atomic v1.11.0 // indirect
Expand All @@ -254,7 +263,7 @@ require (
gorm.io/datatypes v1.2.0 // indirect
gorm.io/driver/sqlserver v1.5.1 // indirect
gorm.io/hints v1.1.2 // indirect
k8s.io/apimachinery v0.28.1
k8s.io/apimachinery v0.28.2
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230816210353-14e408962443 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
Expand Down
Loading

0 comments on commit 6d01db9

Please sign in to comment.