Skip to content

Commit

Permalink
Merge branch 'main' into satellite-adp
Browse files Browse the repository at this point in the history
  • Loading branch information
bupd authored Feb 19, 2025
2 parents 7f42f91 + 4565907 commit 36ae579
Show file tree
Hide file tree
Showing 34 changed files with 803 additions and 114 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</br> </br>

**Note**: The `main` branch may be in an *unstable or even broken state* during development.
Please use [releases](https://github.com/vmware/harbor/releases) instead of the `main` branch in order to get a stable set of binaries.
Please use [releases](https://github.com/goharbor/harbor/releases) instead of the `main` branch in order to get a stable set of binaries.

<img alt="Harbor" src="https://raw.githubusercontent.com/goharbor/website/master/docs/img/readme/harbor_logo.png">

Expand Down Expand Up @@ -57,7 +57,7 @@ For learning the architecture design of Harbor, check the document [Architecture

**On a Linux host:** docker 20.10.10-ce+ and docker-compose 1.18.0+ .

Download binaries of **[Harbor release ](https://github.com/vmware/harbor/releases)** and follow **[Installation & Configuration Guide](https://goharbor.io/docs/latest/install-config/)** to install Harbor.
Download binaries of **[Harbor release ](https://github.com/goharbor/harbor/releases)** and follow **[Installation & Configuration Guide](https://goharbor.io/docs/latest/install-config/)** to install Harbor.

If you want to deploy Harbor on Kubernetes, please use the **[Harbor chart](https://github.com/goharbor/harbor-helm)**.

Expand Down
12 changes: 10 additions & 2 deletions api/v2.0/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4486,7 +4486,7 @@ paths:
description: |
The purge job's schedule, it is a json object. |
The sample format is |
{"parameters":{"audit_retention_hour":168,"dry_run":true, "include_operations":"create,delete,pull"},"schedule":{"type":"Hourly","cron":"0 0 * * * *"}} |
{"parameters":{"audit_retention_hour":168,"dry_run":true,"include_event_types":"create_artifact,delete_artifact,pull_artifact"},"schedule":{"type":"Hourly","cron":"0 0 * * * *"}} |
the include_operation should be a comma separated string, e.g. create,delete,pull, if it is empty, no operation will be purged.
tags:
- purge
Expand Down Expand Up @@ -4516,7 +4516,7 @@ paths:
description: |
The purge job's schedule, it is a json object. |
The sample format is |
{"parameters":{"audit_retention_hour":168,"dry_run":true, "include_operations":"create,delete,pull"},"schedule":{"type":"Hourly","cron":"0 0 * * * *"}} |
{"parameters":{"audit_retention_hour":168,"dry_run":true,"include_event_types":"create_artifact,delete_artifact,pull_artifact"},"schedule":{"type":"Hourly","cron":"0 0 * * * *"}} |
the include_operation should be a comma separated string, e.g. create,delete,pull, if it is empty, no operation will be purged.
tags:
- purge
Expand Down Expand Up @@ -9101,6 +9101,9 @@ definitions:
banner_message:
$ref: '#/definitions/StringConfigItem'
description: The banner message for the UI.It is the stringified result of the banner message object
disabled_audit_log_event_types:
$ref: '#/definitions/StringConfigItem'
description: The audit log event types to skip to log in database
Configurations:
type: object
properties:
Expand Down Expand Up @@ -9379,6 +9382,11 @@ definitions:
description: The banner message for the UI.It is the stringified result of the banner message object
x-omitempty: true
x-isnullable: true
disabled_audit_log_event_types:
type: string
description: the list to disable log audit event types.
x-omitempty: true
x-isnullable: true
StringConfigItem:
type: object
properties:
Expand Down
6 changes: 3 additions & 3 deletions src/common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ const (
// 24h.
DefaultCacheExpireHours = 24

PurgeAuditIncludeOperations = "include_operations"
PurgeAuditIncludeEventTypes = "include_event_types"
PurgeAuditDryRun = "dry_run"
PurgeAuditRetentionHour = "audit_retention_hour"
// AuditLogForwardEndpoint indicate to forward the audit log to an endpoint
Expand All @@ -220,8 +220,8 @@ const (
// ScannerSkipUpdatePullTime
ScannerSkipUpdatePullTime = "scanner_skip_update_pulltime"

// AuditLogEventsDisabled
AuditLogEventsDisabled = "audit_log_events_disabled"
// AuditLogEventsDisabled ...
AuditLogEventsDisabled = "disabled_audit_log_event_types"

// SessionTimeout defines the web session timeout
SessionTimeout = "session_timeout"
Expand Down
2 changes: 2 additions & 0 deletions src/controller/event/handler/webhook/artifact/replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ func constructReplicationPayload(ctx context.Context, event *event.ReplicationEv
OverrideMode: rpPolicy.Override,
TriggerType: string(execution.Trigger),
ExecutionTimestamp: execution.StartTime.Unix(),
ExecutionID: execution.ID,
TaskID: task.ID,
},
},
}
Expand Down
2 changes: 2 additions & 0 deletions src/controller/event/model/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ type Replication struct {
DestResource *ReplicationResource `json:"dest_resource,omitempty"`
SuccessfulArtifact []*ArtifactInfo `json:"successful_artifact,omitempty"`
FailedArtifact []*ArtifactInfo `json:"failed_artifact,omitempty"`
ExecutionID int64 `json:"execution_id,omitempty"`
TaskID int64 `json:"task_id,omitempty"`
}

// ArtifactInfo describe info of artifact
Expand Down
2 changes: 1 addition & 1 deletion src/controller/purge/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (c *controller) Start(ctx context.Context, policy JobPolicy, trigger string

para[common.PurgeAuditDryRun] = policy.DryRun
para[common.PurgeAuditRetentionHour] = policy.RetentionHour
para[common.PurgeAuditIncludeOperations] = policy.IncludeOperations
para[common.PurgeAuditIncludeEventTypes] = policy.IncludeEventTypes

execID, err := c.exeMgr.Create(ctx, job.PurgeAuditVendorType, -1, trigger, para)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion src/controller/purge/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type JobPolicy struct {
Trigger *Trigger `json:"trigger"`
DryRun bool `json:"dryrun"`
RetentionHour int `json:"retention_hour"`
IncludeOperations string `json:"include_operations"`
IncludeEventTypes string `json:"include_event_types"`
ExtraAttrs map[string]interface{} `json:"extra_attrs"`
}

Expand Down
2 changes: 2 additions & 0 deletions src/core/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ import (
_ "github.com/goharbor/harbor/src/pkg/accessory/model/sbom"
_ "github.com/goharbor/harbor/src/pkg/accessory/model/subject"
"github.com/goharbor/harbor/src/pkg/audit"
_ "github.com/goharbor/harbor/src/pkg/auditext/event/config"
_ "github.com/goharbor/harbor/src/pkg/auditext/event/login"
_ "github.com/goharbor/harbor/src/pkg/auditext/event/user"
dbCfg "github.com/goharbor/harbor/src/pkg/config/db"
_ "github.com/goharbor/harbor/src/pkg/config/inmemory"
"github.com/goharbor/harbor/src/pkg/notification"
Expand Down
38 changes: 19 additions & 19 deletions src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/Masterminds/semver v1.5.0
github.com/aliyun/alibaba-cloud-sdk-go v1.63.84
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
github.com/aws/aws-sdk-go v1.55.5
github.com/aws/aws-sdk-go v1.55.6
github.com/beego/beego/v2 v2.3.4
github.com/beego/i18n v0.0.0-20140604031826-e87155e8f0c0
github.com/bmatcuk/doublestar v1.3.4
Expand All @@ -19,14 +19,14 @@ require (
github.com/docker/distribution v2.8.3+incompatible
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7
github.com/go-asn1-ber/asn1-ber v1.5.7
github.com/go-ldap/ldap/v3 v3.4.6
github.com/go-ldap/ldap/v3 v3.4.10
github.com/go-openapi/errors v0.22.0
github.com/go-openapi/loads v0.22.0
github.com/go-openapi/loads v0.22.0 // indirect
github.com/go-openapi/runtime v0.28.0
github.com/go-openapi/spec v0.21.0
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/strfmt v0.23.0
github.com/go-openapi/swag v0.23.0
github.com/go-openapi/validate v0.24.0
github.com/go-openapi/validate v0.24.0 // indirect
github.com/go-redis/redis/v8 v8.11.4
github.com/gocarina/gocsv v0.0.0-20210516172204-ca9e8a8ddea8
github.com/gocraft/work v0.5.1
Expand Down Expand Up @@ -54,24 +54,24 @@ require (
github.com/stretchr/testify v1.10.0
github.com/tencentcloud/tencentcloud-sdk-go v3.0.233+incompatible
github.com/vmihailenco/msgpack/v5 v5.4.1
github.com/volcengine/volcengine-go-sdk v1.0.177
github.com/volcengine/volcengine-go-sdk v1.0.180
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.59.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0
go.opentelemetry.io/otel v1.34.0
go.opentelemetry.io/otel/exporters/jaeger v1.0.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0
go.opentelemetry.io/otel/sdk v1.34.0
go.opentelemetry.io/otel/trace v1.34.0
go.uber.org/ratelimit v0.3.1
golang.org/x/crypto v0.31.0
golang.org/x/net v0.33.0
golang.org/x/crypto v0.32.0
golang.org/x/net v0.34.0
golang.org/x/oauth2 v0.25.0
golang.org/x/sync v0.10.0
golang.org/x/text v0.21.0
golang.org/x/time v0.9.0
gopkg.in/h2non/gock.v1 v1.1.2
gopkg.in/yaml.v2 v2.4.0
helm.sh/helm/v3 v3.16.2
helm.sh/helm/v3 v3.17.0
k8s.io/api v0.32.1
k8s.io/apimachinery v0.32.1
k8s.io/client-go v0.32.1
Expand All @@ -81,7 +81,7 @@ require (
require github.com/prometheus/client_model v0.6.1

require (
cloud.google.com/go/compute/metadata v0.5.0 // indirect
cloud.google.com/go/compute/metadata v0.5.2 // indirect
github.com/Azure/azure-sdk-for-go v37.2.0+incompatible // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
Expand Down Expand Up @@ -119,7 +119,7 @@ require (
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
Expand Down Expand Up @@ -171,21 +171,21 @@ require (
github.com/x448/float16 v0.8.4 // indirect
go.mongodb.org/mongo-driver v1.14.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
go.opentelemetry.io/otel/metric v1.34.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/term v0.28.0 // indirect
google.golang.org/api v0.171.0 // indirect
google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.35.1 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
google.golang.org/grpc v1.69.4 // indirect
google.golang.org/protobuf v1.36.3 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 36ae579

Please sign in to comment.