-
Notifications
You must be signed in to change notification settings - Fork 6
Sync Release 2.14.x #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from 22 commits
679bbc1
0b69ea7
c0dffba
3ee6a79
861fad9
44a7442
2c62b50
815a1a3
27b26e2
a5d598b
2503b07
e5ae645
6d83b3e
885201a
4c3f875
123538b
f45ac3e
53c7238
9ab1494
65bbe89
3385c1c
f4229d0
f1393ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,21 @@ | |
| * Add date here... Add signature here... | ||
| - Add your reason here... | ||
|
|
||
| * Nov 07 2025 <[email protected]> | ||
| - Refresh base image | ||
|
|
||
| * Oct 27 2025 <[email protected]> | ||
| - Refresh base image | ||
|
|
||
| * Sep 09 2025 <[email protected]> | ||
| - Refresh base image | ||
|
|
||
| * Sep 05 2025 <[email protected]> | ||
| - Refresh base image | ||
|
|
||
| * Aug 29 2025 <[email protected]> | ||
| - Refresh base image | ||
|
|
||
| * Aug 12 2025 <[email protected]> | ||
| - Refresh base image | ||
|
|
||
|
|
@@ -33,4 +48,4 @@ | |
| - Refresh base image | ||
|
|
||
| * Jul 15 2021 <[email protected]> | ||
| - Create this file to trigger build base action in buld-package workflow | ||
| - Create this file to trigger build base action in buld-package workflow | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| v2.14.0 | ||
| v2.14.1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /* | ||
| Initialize skip_audit_log_database configuration based on existing audit log usage - Only insert the configuration if it doesn't already exist | ||
| 1. If tables exist and show evidence of previous usage | ||
| set skip_audit_log_database to false | ||
| 2. If tables exist but show no evidence of usage, don't create the configuration record | ||
| */ | ||
| DO $$ | ||
| BEGIN | ||
| IF EXISTS (SELECT 1 FROM properties WHERE k = 'skip_audit_log_database') THEN | ||
| RETURN; | ||
| END IF; | ||
|
|
||
| IF (SELECT last_value FROM audit_log_id_seq) > 1 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The sequence check misses the case where exactly one audit-log row exists: Prompt for AI agents |
||
| OR (SELECT last_value FROM audit_log_ext_id_seq) > 1 THEN | ||
| INSERT INTO properties (k, v) VALUES ('skip_audit_log_database', 'false'); | ||
| END IF; | ||
| END $$; | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -22,12 +22,14 @@ import ( | |||||
| "net/url" | ||||||
| "os" | ||||||
| "os/signal" | ||||||
| "strconv" | ||||||
| "strings" | ||||||
| "syscall" | ||||||
| "time" | ||||||
|
|
||||||
| "github.com/beego/beego/v2/server/web" | ||||||
|
|
||||||
| "github.com/goharbor/harbor/src/common" | ||||||
| "github.com/goharbor/harbor/src/common/dao" | ||||||
| common_http "github.com/goharbor/harbor/src/common/http" | ||||||
| configCtl "github.com/goharbor/harbor/src/controller/config" | ||||||
|
|
@@ -222,6 +224,10 @@ func main() { | |||||
| log.Error(err) | ||||||
| } | ||||||
|
|
||||||
| // Allow user to disable writing audit log to db by env while initialize | ||||||
| if err := initSkipAuditDBbyEnv(ctx); err != nil { | ||||||
| log.Errorf("Failed to initialize SkipAuditDB by ENV: %v", err) | ||||||
| } | ||||||
| // Init API handler | ||||||
| if err := api.Init(); err != nil { | ||||||
| log.Fatalf("Failed to initialize API handlers with error: %s", err.Error()) | ||||||
|
|
@@ -356,3 +362,34 @@ func getDefaultScannerName() string { | |||||
| } | ||||||
| return "" | ||||||
| } | ||||||
|
|
||||||
| func initSkipAuditDBbyEnv(ctx context.Context) error { | ||||||
| var err error | ||||||
| skipAuditEnv := false | ||||||
| s := os.Getenv("SKIP_LOG_AUDIT_DATABASE") | ||||||
| if s != "" { | ||||||
| skipAuditEnv, err = strconv.ParseBool(s) | ||||||
| if err != nil { | ||||||
| log.Warningf("Failed to parse SKIP_LOG_AUDIT_DATABASE to bool with error: %v, Will use SKIP_LOG_AUDIT_DATABASE env as false", err) | ||||||
| } | ||||||
| } | ||||||
| log.Debugf("get SKIP_LOG_AUDIT_DATABASE from Env is %v", skipAuditEnv) | ||||||
|
|
||||||
| // get from db | ||||||
| mgr := config.GetCfgManager(ctx) | ||||||
| cfg, err := mgr.GetItemFromDriver(ctx, common.SkipAuditLogDatabase) | ||||||
| if err != nil { | ||||||
| return err | ||||||
| } | ||||||
| // if key not exist in the db, set default ENV value | ||||||
| if val, ok := cfg[common.SkipAuditLogDatabase]; !ok { | ||||||
| log.Debugf("key SkipAuditLogDatabase do not exist in the db, will initialize as %v", skipAuditEnv) | ||||||
| cfg[common.SkipAuditLogDatabase] = skipAuditEnv | ||||||
| if err := mgr.UpdateConfig(ctx, cfg); err != nil { | ||||||
| return err | ||||||
| } | ||||||
| } else { | ||||||
| log.Debugf("key SkipAuditLogDatabase aleady exist in the db with value %v", val) | ||||||
|
||||||
| log.Debugf("key SkipAuditLogDatabase aleady exist in the db with value %v", val) | |
| log.Debugf("key SkipAuditLogDatabase already exist in the db with value %v", val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo in the modified line.
The line contains a typo: "buld-package" should be "build-package". Since this line is being modified, please correct the typo.
Apply this diff to fix the typo:
📝 Committable suggestion
🤖 Prompt for AI Agents