diff --git a/models/auth/secret.go b/models/auth/secret.go
index 32b1c48e9c..fea4e4b3b5 100644
--- a/models/auth/secret.go
+++ b/models/auth/secret.go
@@ -36,7 +36,7 @@ type Secret struct {
Name string
Data string
PullRequest bool
- CreatedUnix timeutil.TimeStamp
+ CreatedUnix timeutil.TimeStamp `xorm:"created"`
}
// Validate validates the required fields and formats.
diff --git a/models/migrations/v226.go b/models/migrations/v226.go
new file mode 100644
index 0000000000..af9d2cd32f
--- /dev/null
+++ b/models/migrations/v226.go
@@ -0,0 +1,25 @@
+// Copyright 2022 The Gitea Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package migrations
+
+import (
+ "code.gitea.io/gitea/modules/timeutil"
+
+ "xorm.io/xorm"
+)
+
+func createSecretsTable(x *xorm.Engine) error {
+ type Secret struct {
+ ID int64
+ UserID int64 `xorm:"index"`
+ RepoID int64 `xorm:"index"`
+ Name string
+ Data string
+ PullRequest bool
+ CreatedUnix timeutil.TimeStamp `xorm:"created"`
+ }
+
+ return x.Sync(new(Secret))
+}
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index 2ef8b181d0..c7fc61be96 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -2072,6 +2072,15 @@ settings.deploy_key_desc = Deploy keys have read-only pull access to the reposit
settings.is_writable = Enable Write Access
settings.is_writable_info = Allow this deploy key to push to the repository.
settings.no_deploy_keys = There are no deploy keys yet.
+settings.secrets = Secrets
+settings.pull_request_read = Pull Request Read
+settings.pull_request_read_info = "If allow pull request read the secret, it's security related."
+settings.add_secret = Add Secret
+settings.secret_value_content_placeholder = Input any content
+settings.secret_desc = Secrets could be visited by repository events
+settings.secret_content = Value
+settings.secret_key = Key
+settings.no_secret = There are no secrets yet.
settings.title = Title
settings.deploy_key_content = Content
settings.key_been_used = A deploy key with identical content is already in use.
diff --git a/templates/repo/settings/deploy_keys.tmpl b/templates/repo/settings/deploy_keys.tmpl
index f656640cad..31d1c1f7ab 100644
--- a/templates/repo/settings/deploy_keys.tmpl
+++ b/templates/repo/settings/deploy_keys.tmpl
@@ -75,8 +75,8 @@
{{end}}
-
- {{template "settings/tokens" .}}
+
+ {{template "repo/settings/secrets" .}}